Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Dead Simple SQL Injection Tutorial (With Havij)

This is my short SQLi tutorial.

Please comment if you found it helpful!!!

  1. Download Havij. (There's both a free and paid version, but unless you're bound and determined to hack every site you find, go with the free version. It'll get the job done)

  2. Find an injectible site. (Here's my method. Go to Google and type in inurl:".php?id=". This is what's known as a "dork". You can find/craft your own. :) )

  3. Test its injectability. (A lot of sites aren't injectible. Here's a quick trick for a preliminary check. Throw in a single quote. ' If it returns an error, it might be injectible.)

  4. Throw the link into Havij. There's a box at the top (v1.15) for the URL.

  5. Click analyze. (Simple enough)

  6. Wait to see what it throws back. If it says the site isn't injectible, move on. Or if you know how, go for tactics like Blind SQL injection. (Not my style, too much hassle)

  7. If it returns a DB name, click on the tab called "Tables".

  8. Next, you can either look for more DBs (Click on Get DBs), or you can go straight to the tables of the current DB (Click on Get Tables).

  9. Once you get down to tables for a specific DB, choose one and click on Get Columns.

  10. Once you get down to columns, select the ones you want, and click Get Data.

  11. You now have successfully SQLi'd a site (the n00b way, but it works)



Errata
  • If you're retrieving passwords, they may be MD5'd. Luckily, Havij comes with a tool to try and crack them (It's a one way encryption standard with no known exploitable weaknesses). Copy down (Ctrl + C) the md5 of the password, then open the tab labeled "MD5". Paste it into the box and hit start. If it returns nothing, you have three options. One, give up. Two, Google it (recommended course of action). Three, spend hours/days/months/years obsessing over it attempting to find a way to crack it, including generating your own rainbow tables.

  • The URL you are attacking must already have a variable specified in it. E.g. http://www.site.com/something.php?id=1 This red part is the variable specification.

  • Not all variables make SQL requests, therefore, not all variables will work.



Links

Notes:
  • For the sake of legality, I'll say I don't support any hacking except for educational purposes on systems you own. Yada yada yada FBI yada blah yada hacking yada yada yada big white van.

  • I'll add pictures to this eventually.



Get a signed message before dealing: Keybase
Still here sometimes.
Thanks for the info. I injected into the database of a local university.
Great TUT for...
[img]http://t1.gstatic.com/images?q=tbn:ANd9GcSMId6-GxgTxAACoY-FiEzS9FQzTIH1PqpKi-tUtrV0Z7FbL3Lx[/img]
Good tutorial for those who are 2 lazy to do sqli by hand.
I would highly suggest that you learn sqli by hand first so you get a good understanding of what havij is doing.
if you will just go and use havij from the start you're NOT a hacker, you are a skid.
Also remember that havij leaves alot more logs than you would do by doing the injection urself.
really need to learn this sql malarky!
If you want to learn how to do it the hard way, check out this guy's tuts.

https://hackforums.net/showthread.php?tid=93224

Get a signed message before dealing: Keybase
Still here sometimes.
Nice tut but as many people say learn how to do it manually its much better
Unus pro omnibus omnes pro uno, Iunctus stamus divisum declinemus

One for all, all for one, United we stand, divided we fall
This program is great, i have used it for a while, i dont really understand why people think its nooby, why make it hard when its easy :)
I am having a bit of trouble doing this becuase i am using a mac. Could you please help me figure out how to use havij on a mac.
Thanks
Only skids like you use tools to hack, stop it.
(Nov 25, 2012 11:55 AM)jaycity23 Wrote:  I am having a bit of trouble doing this becuase i am using a mac. Could you please help me figure out how to use havij on a mac.
Thanks

Learn to SQL Inject manually. You'd be doing yourself a favor.
very very old 1337 Skill Tutorial ;)
(Nov 25, 2012 12:04 PM)phlow Wrote:  Learn to SQL Inject manually. You'd be doing yourself a favor.

How would i go about learning how to do it manually? i would love to learn it and yes i am a noob
good tut...nice but can u upload videoo
Nice tut. Not much use to me or anyone else that's not a script kiddie. :P


Possibly Related Threads...
Thread / Author Replies Views Last Post
by CreepyPastaAug 12, 2025 04:40 AM 25 3,763 Aug 12, 2025 04:40 AM
Last Post: uluc06
by OrochimaruMar 5, 2024 11:47 AM 56 6,383 Mar 5, 2024 11:47 AM
Last Post: Any1One
by Decryption/CriticalFeb 14, 2024 05:57 AM 1 161 Feb 14, 2024 05:57 AM
Last Post: I ɴ ᴄ ʀ ᴇ ᴅ ɪ ʙ ʟ E