当--level
的参数设定为2或者2以上的时候,sqlmap会尝试注入Cookie参数。当--level
参数设定为3或者3以上的时候,会尝试对User-Angent和referer进行注入。
1、sqlmap设置User-Agent头
--user-agent=AGENT
指定HTTP User - Agent头
默认情况下sqlmap的HTTP请求头中User-Agent值是:sqlmap/1.0-dev-xxxxxxx (http://sqlmap.org)
可以使用--user-agent
来伪造
使用Firefox浏览器访问页面时的User-Agent
使用python sqlmap.py -u "http://172.17.0.1/Less-1/index.php/?id=1" --banner
并用wireshark抓取http包,查看User-Agent
为了避免触发安全机制,使用参数设置User-Agent
python sqlmap.py -u "http://172.17.0.1/Less-1/index.php/?id=1" --user-agent="Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" --banner
此时可以看到User-Agent头改变
也可以使用--random-agent
使用随机选定的HTTP User - Agent头
python sqlmap.py -u "http://172.17.0.1/Less-1/index.php/?id=1" --random-agent