Hello, aspiring ethical hackers. In our previous blogpost, you learnt what SQL injection is and different types of SQL injection attacks. In this blogpost, you will learn about Havij, an automated SQL injection tool. Havij is a SQL Injection tool that helps penetration testers to find and exploit SQL Injection vulnerabilities on a web page. It can be used to perform back-end database fingerprinting, retrieve DBMS login names and password hashes, dump tables and columns, fetch data from the database, execute SQL statements against the server, and even access the underlying file system and execute operating system shell commands.
Let me give you a complete guide on Havij in this article. First download Havij and install it.
1. Specifying the target:
Then open it and enter the vulnerable URL in the target field (for this tutorial I am using my own vulnerable webpage).
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij1.jpg)
2. List the current database:
Set the database option to ‘auto detect‘ and hit analyze. This should show you the current database name as shown below.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij2.jpg)
3. Get Host information:
Click on the “info” tab. This will show you information about the victim’s system. We can see information like Host IP address, web server version etc.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij3.jpg)
4. List all tables of the current database:
Click on the “Tables” tab.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij4.jpg)
5. List all databases from the target:
Click on “Get DBs” option. This will list all the databases as shown below.
![sql injection with havij](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij5.jpg)
7. List tables in a certain database:
To get tables in a specific database, select the database and click on “Get Tables”. This will list all the tables present in the selected database. I selected database “shunya”here.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij6.jpg)
8. List all columns from a particular table:
We can see that there is on table ‘users’ in our database ‘shunya’ .To get columns , select the table ‘ users’ and click on “Get Columns”.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij7.jpg)
This will list all the columns in the table. We can see that we have five columns in the table ‘users’. It’s time to dump the values of columns.
9. Dump data from the columns:
Select the columns whose data we want to dump and click on “Get data”. Here I selected all the columns.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij8.jpg)
10. Crack password hashes:
We got all the data including usernames and passwords. But passwords seem to be encrypted. No problem. Click on the password hashes and copy them. Then click on “MD5″ tab and paste the password. Click on “Start”. Havij automatically decrypts the password for us. Decrypt all passwords in the similar manner.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij9.jpg)
11. Find admin page:
Having passwords is not enough. You also need to know where to login with these passwords. Havij can do that too. Click on “Find admin”. This option finds the admin page of the website automatically. When it finds the admin page, you can try the username and passwords to get access to the website. Hope this was helpful.
![](https://www.hackercoolmagazine.com/wp-content/uploads/2013/08/havij10.jpg)
Nice Effort
But I would say it is better to do it manually
so that you know what is happening behind
I totally agree with your opinion, my friend.
please i need a real site to download the HAVIJ SQL INJECTOR that is password free
@kayle, a link is provided in the forums for this.
the site here is not working with my windows10 and others i got via google research all are encrypted and with passwords and without loader in the software……
@kayle kayler, the alternative download link for the tool is provided in the forums section of this website.
the address i saw there was not helpful, pls i need an address that will help me get the file downloaded pls
@Mahesh, this tool doesn’t depend on the language used by the website. Maybe the site isn’t vulnerable.
thnx for the step by step guide and havij
searched everywhere for it finally got it
@Charles, Happy it helped you
hello Charles
i also have problems finding the setup. can u please upload and share the link.
my email is [email protected].
thanks
i found database as well as tables but as i try to get columns nothing happens.Help
rRohit, Did you try a different table?
I found a few vulnerble sites.. ik can see the database.. when i click get tables i can see the tables, but when i select a few boxes and click “get colums” not hing is happening. On al sites i try i have this problem.. whats the reisonderdelen bevind this?
@Rgccevo, I hope you have prior permission to test these sites. Coming to your problem, first make sure that table has some columns. If that tsble has columns, what actually is the program saying.
Will i be arrested if I hack website using havij
Dear Viruz, not only Havij, if you use any hacking tool on a website or network without their prior permission, its called malicious hacking and is a punishable offence. Laws vary for nation to nation but I think imprisonment is common in all nations. My sincere suggestion to you will be not to try out any hacking on sites which you have no permission.
how to this ( /about.php?id=1 )
of other sites.
This is only possible if the site is vulnerable to sql injection. First make sure if the site is vulnerable
what is the login password of havij zip