乐府诗个人博客 >> ASP >> asp小偷post抓取与发送Cookies

asp小偷post抓取与发送Cookies

<%
Function GetSourceInfo(byval url,pages,Cookies)
    dim xmlhttp,xmlget,bgpos,endpos
    Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP") 
    With xmlhttp
    .Open "POST", url, False
    .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
    '.setRequestHeader("Referer","来路的绝对地址")
    .setRequestHeader "Cookie",Cookies'Cookie
    .Send "page="&pages'post的参数
    xmlget = bin2str(.responseBody)
    End With 
    set xmlhttp = nothing
    GetSourceInfo=xmlget
End Function
Function bin2str(binstr)
    Const adTypeBinary = 1
    Const adTypeText = 2
    Dim BytesStream,StringReturn
    Set BytesStream = Server.CreateObject("ADODB.Stream") '建立一个流对象
    With BytesStream
    .Type = adTypeText
    .Open
    .WriteText binstr
    .Position = 0
    .Charset = "GB2312"
    .Position = 2
    StringReturn = .ReadText
    .close
    End With
    Set BytesStream = Nothing
    bin2str = StringReturn
End Function
'--------------------------------------------------------------------------------------

Cookies = ""

pages = ""


'GetSourceInfo(网址,提交的表单,Cookies)

response.write(GetSourceInfo("http://www.Laidu.net",pages,Cookies))

%> 

下列内容与有着内在的联系,建议您一并阅读。

公益广告