Havij is an automated SQL Injection tool that helps penetration testers to find and exploit SQL Injection vulnerabilities on a web page. But now it is most commonly used by hackers community as said in an interesting article Cybercrime’s Love Affair With Havij Spells SQL Injection Trouble in dark reading by Ericka
“So when I sat and read chat logs from Anonymous IRC rooms where they do hacker training, the only thing I ever see mentioned is Havij,” Shaul says. “The reason for that is Havij is awesome. And it’s as powerful and easy to use as could be.”
The amazing thing with this tool is that you just need to click buttons to let the tool work for you and no other programming stuff is required. Cool one…right!
Note: I have executed Havij in my own lab of vulnerable website. I take no responsibility for whatever you do using this tutorial
- Download Free edition from Havij (In the same page, you can see the difference between free and professional edition). It is matter of what your target is.
- Now you google with below options to find websites vulnerable for targetting SQL Injection with Havij
Once you choose a website, type ‘ at the end like shown below and press enter. If you get an error, then the website is vulnerable to SQL Injection.
1. Retrieve DB Information:
Copy and paste the target url in ‘Target’ column and click ‘Analyze’
Once Havij is successful in retrieving DB name, it will stop and you can see the database details either at the log window or ‘Info’ option. Havij will retrieve Web Server Type (Apache, IIS or other), DB Type (My SQL, MS SQL or other) and DB Name
Once this is successful, you can make sure that you are in right path i.e; your target is vulnerable to SQL Injection Attack.
2. Retrieve Tables:
Now you need to retrieve all table that contains user name and password to login to the website. Choose the db and Click ‘Get Tables’ option.
Here you go, now all the tables are retrieved from DB. You can either wait till it retrieves all the tables or you can just stop the top when you see any suspected table like one below. I stopped the processing when Havij found a table that I suspected to be containing user names and passwords for the website.
3. Retrieve Table Columns:
Before you start retrieving data of a specific table, you need to get the columns. So mark the suspected password table and click ‘Get Columns’
I am really sorry for marking all website specific details with red mark, I must do that to safeguard.
4. Retrieve User name and Password:
You are at final stage of hacking . Mark the database, table and columns to be retrieved and you have option of retrieving only one row. Choose ‘Get Data’ to let Havij give you member access to the site.
I am done now, luckily my target website didn’t store passwords encrypted and I have their website’s admin password. That’s it!
If the password is encrypted, Havij has inbuilt MD5 option where you can specify the MD5 hash to be cracked. Havij will look for hash in several sites in mul thread mode and displays the result.
If you need additional information, download PDF Manual from ITSecTeam