1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

一个ASP程序~百度网页搜索小偷

本帖由 net0082006-03-08 发布。版面名称:网站运营

  1. net008

    net008 New Member

    注册:
    2005-10-19
    帖子:
    3
    赞:
    0
    刚开始学ASP,昨天突然对小偷感兴趣~网上查了一些资料,又有几个问题请教了下阿江后,终于做出个百度搜索小偷来。原来小偷程序不怎么复杂呀~`以前以为挺神奇的``~~`

    就不打包下载了~~我直接把发代码吧~~~望大家多多指点~`

    1.文件Function.asp
    <%
    Function GetHttpPage(HttpUrl)
    If IsNull(HttpUrl)=True Or HttpUrl="$False$" Then
    GetHttpPage="$False$"
    Exit Function
    End If
    Dim Http
    Set Http=server.createobject("MSXML2.XMLHTTP")
    Http.open "GET",HttpUrl,False
    Http.Send()
    If Http.Readystate<>4 then
    Set Http=Nothing
    GetHttpPage="$False$"
    Exit function
    End if
    GetHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
    Set Http=Nothing
    If Err.number<>0 then
    Err.Clear
    End If
    End Function

    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

    Function GetBody(ConStr,StartStr,OverStr,IncluL,IncluR)
    If ConStr="$False$" or ConStr="" or IsNull(ConStr)=True Or StartStr="" or IsNull(StartStr)=True Or OverStr="" or IsNull(OverStr)=True Then
    GetBody="$False$"
    Exit Function
    End If
    Dim ConStrTemp
    Dim Start,Over
    ConStrTemp=Lcase(ConStr)
    StartStr=Lcase(StartStr)
    OverStr=Lcase(OverStr)
    Start = InStrB(1, ConStrTemp, StartStr, vbBinaryCompare)
    If Start<=0 then
    GetBody="$False$"
    Exit Function
    Else
    If IncluL=False Then
    Start=Start+LenB(StartStr)
    End If
    End If
    Over=InStrB(Start,ConStrTemp,OverStr,vbBinaryCompare)
    If Over<=0 Or Over<=Start then
    GetBody="$False$"
    Exit Function
    Else
    If IncluR=True Then
    Over=Over+LenB(OverStr)
    End If
    End If
    GetBody=MidB(ConStr,Start,Over-Start)
    End Function
    %>

    2.文件index.asp
    <!--#include file=Function.asp-->
    <!--#include file=top.asp-->
    <%
    dim url,Wstr,we,wf,lm,si,rn,ie,ct,pn,cl
    we=Request.QueryString("wd")
    If we="" Then
    Response.Write("<table width=760 border=0 cellpadding=0 align=center cellspacing=0 height=202><tr height=25><td align=center><img src=http://www.baidu.com/img/logo.gif width=174 alt=""Powered By BaiDu"" height=59 border=0><br>在全球10亿中文网页中搜索:</td></tr><tr valign=center height=40><td align=center><form name=f action=index.asp><input type=text name=wd class=ff size=35 maxlength=100 value=""请在这里输入关键字"" onMouseOver=""this.focus()"" onblur=""if (this.value =='') this.value='请在这里输入关键字'"" onFocus=""this.select()"" onClick=""if (this.value=='请在这里输入关键字') this.value=''""><input type=hidden name=cl value=3> <input type=submit value=给我搜!><br><br><script src='img/remen.js'></script><br><br></form></td></tr></table>")
    Else
    wf=we
    lm=Request.QueryString("lm")
    si=Request.QueryString("si")
    rn=Request.QueryString("rn")
    ie=Request.QueryString("ie")
    ct=Request.QueryString("ct")
    pn=Request.QueryString("pn")
    cl=Request.QueryString("cl")
    url="http://www.baidu.com/s?tn=lzc444&wd="&wf&"&lm="&lm&"&si="&si&"&rn="&rn&"&ie="&ie&"&ct="&ct&"&pn="&pn&"&cl="&cl&""
    Wstr=Gethttppage(Url)
    body=GetBody(Wstr,"<table border=""0"" cellpadding=""0"" cellspacing=""0""><tr><td class=f>","<div style=""text-align:center;background-color:#e6e6e6; height:20px;padding-top:2px;font-size:12px;"">",true,false)
    body=replace(body,"<td nowrap><a href=""http://utility.baidu.com/quality/quality_form.php","<!--")
    body=replace(body,"与百度对话</a></td>","</a></td-->")
    body=replace(body,"s?","index.asp?")
    body=replace(body,"""/s""","index.asp")
    body=replace(body,"value=百度搜索","value=给我搜!")
    body=replace(body,"百度快照","网页快照")
    body=replace(body,"<td nowrap>","<td width=20></td><td nowrap>")
    body=replace(body,"margin-left:18px","margin-left:0px")
    body=replace(body,"<tr><td> </td></tr>","")
    body=replace(body,"<input type=button value=在结果中找 onclick=""return my_submit(f2);"">","")
    Response.Write ("<table border=""0"" cellpadding=""0"" cellspacing=""0"" style=""margin-left:18px;height:60px;""><form name=f2 action=""index.asp""><tr valign=""middle""><td nowrap><input type=hidden name=tn value=""lzc444""><input type=hidden name=ct value=""0""><input type=hidden name=ie value=""gb2312""><input type=hidden name=bs value=""bs""><input type=hidden name=sr><input type=hidden name=z value=""""><input type=hidden name=cl value=3><input type=hidden name=f value=8><input name=wd size=""35"" class=i value="""" maxlength=100><input type=submit value=给我搜!> </td><!--?word=22""></a></td--></tr></form></table><hr>")
    Response.Write Body
    End if
    %>
    <!--#include file=bottom.asp-->

    3.至于其他3个文件(top.asp,bottom.asp还有remen.js)这个都和程序没多大关系了~~大家根据自己的爱好自己搞定吧~~`如果需要我的可以加我QQ363341134。

    程序演示:http://www.1-100.org/so/
     
  2. comic

    comic New Member

    注册:
    2006-03-05
    帖子:
    302
    赞:
    2
    个人觉得这个没多大的意义``只是手法值得学习