Specify parameters with SQLMAP
Asked Answered
B

5

9

I'm a student learning php & mysql development. i have setup a private lab ( VM ) inside my computer to test & learn how sql injection works. When things get harder i use sqlmap to exploit and later on study the requests it made to my test app using verbose mode & by capturing packets via wireshark. I came across a small problem and that's to specify the parameter in a URL to sqlmap to test.

http://localhost/vuln/test.php?feature=music&song=1

i want sqlmap to scan the parameter song so i tried these solutions

-u http://localhost/vuln/test.php?feature=music&song=1 --skip feature
-u http://localhost/vuln/test.php? --data="feature=music&song=1" -p song

Tried different variations by adding and removing quotes and equal signs , non worked. I even tried setting the --risk to --level to its maximum but it still fails to pick up the last parameter.

I will be very thankful if an expert can help me out with this. Thank you.

Braunstein answered 27/3, 2013 at 8:23 Comment(0)
E
24

the p option can be used in the following way

-u "http://localhost/vuln/test.php?feature=music&song=1" -p song

Excerpta answered 28/4, 2013 at 19:56 Comment(1)
Also be careful that without quotes the command is not working properly.Felly
C
6

I noticed also that you can scan multiple parameters using this :

-u "http://localhost/vuln/test.php?feature=music&song=1" -p 'song,feature'

This will scan the song parameter, then the feature parameter. If sqlmap find a vulnerable parameter, it will ask you if you want to continue with the others.

Corder answered 27/7, 2017 at 11:28 Comment(0)
D
4

You can simply add * to your value of parameter which you want to scan. Did you try that one?

Disproportionation answered 17/11, 2013 at 13:45 Comment(3)
Can you give an example?Seddon
-u localhost/vuln/test.php?feature=music&song=1* if it is kind of POST request -u localhost/vuln/test.php --data="feature=music&song=1*"Disproportionation
btw you dont need to use question-mark on sqlmapping POST requests. test.php is enough.Disproportionation
A
3

I have this problem too. I think sqlmap inject the first parameter. If you type :

-u http://localhost/vuln/test.php?feature=music&song=1

sqlmap will inject 'feature' parameter. To make it inject 'song' parameter you need to reorder the parameter as follows :

-u http://localhost/vuln/test.php?song=1&feature=music

Dont forget to add '&' between each parameter. It worked for me.

Aliunde answered 26/4, 2013 at 9:48 Comment(0)
G
1

I have already triggered this type of problem. You can simply skip the 'feature' parameter. E.g -u http:// localhost/vuln/test.php?feature=music&song=1 --skip=feature and then certainly it will start testing the 'song' parameter.

Gamb answered 7/2, 2014 at 4:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.