欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

vbs 搜索代理地址实现代码[小偷程序]

程序员文章站 2022-07-04 20:27:25
复制代码 代码如下:'1、输入url目标网页地址,返回值gethttppage是目标网页的html代码 function gethttppage(url) dim http...

复制代码 代码如下:

'1、输入url目标网页地址,返回值gethttppage是目标网页的html代码
function gethttppage(url)
dim http
set http=createobject("msxml2.xmlhttp")
http.open "get",url,false
http.send()
if http.readystate<>4 then
exit function
end if
gethttppage=bytestobstr(http.responsebody,"gb2312")
set http=nothing
if err.number<>0 then err.clear
end function

'2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
function bytestobstr(body,cset)
dim objstream
set objstream =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

'下面试着调用http://www.proxycn.com/html_proxy/30fastproxy-1.html的html内容
dim url,html,temp
url="http://www.proxycn.com/html_proxy/30fastproxy-1.html"
html = gethttppage(url)
call getinfo(html)

sub getinfo(s)
dim pl(),m,st
st="</td><td class=" & """list""" & ">"
do
m = m + 1
n = p + len(st)
p = instr(n,s,st)
redim preserve pl(m-1)
pl(m-1) = p
loop while p <> 0

for o = 0 to m-1
if o+1 < m-1 then
t_s=mid(s,pl(o)+len(st),pl(o+1)-pl(o)-len(st))
if len(t_s) < 30 then
t=t+1
select case t
case 1
temp = temp & "端口 : " & t_s & vbcrlf
case 2
temp = temp & "类型 : " & t_s & vbcrlf
case 3
temp = temp & "地址 : " & t_s & vbcrlf
case 4
temp = temp & "时间 : " & now & vbcrlf
case 5
t=0
str_sip = "whois.php?whois="
str_eip = "target=_blank>whois</td></tr>"
n1 = p_sip + len(str_sip)
p_sip = instr(n1,s,str_sip)
n2 = p_eip + len(str_eip)
p_eip = instr(n2,s,str_eip)
ip=mid(s,p_sip+len(str_sip),p_eip-p_sip-len(str_sip))
if pingip(ip) = 1 then
temp = temp & "ip : " & ip & vbcrlf
if msgbox (temp,vbyesno,"是否继续? " )=vbno then
wscript.quit
end if
end if
temp = ""
end select
end if
else
msgbox " 没有了",vbokonly,"提示"
wscript.quit
end if
next
end sub

function pingip(host)
on error resume next
strcomputer = "."
strtarget = host
set objwmiservice = getobject("winmgmts:" _
& "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2")
set colpings = objwmiservice.execquery _
("select * from win32_pingstatus where address = '" & strtarget & "'")
if err = 0 then
err.clear
for each objping in colpings
if err = 0 then
err.clear
if objping.statuscode = 0 then
pingip = 1
temp = temp & "速度 : " & objping.responsetime & " 毫秒" & vbcrlf
'msgbox strtarget & " responded to ping." & vbcrlf &_
'"responding address: " & objping.protocoladdress & vbcrlf &_
'"responding name: " & objping.protocoladdressresolved & vbcrlf &_
'"bytes sent: " & objping.buffersize & vbcrlf &_
'"time: " & objping.responsetime & " ms" & vbcrlf &_
'"ttl: " & objping.responsetimetolive & " seconds"
else
pingip = 0
'msgbox strtarget & " did not respond to ping." &_
'"status code: " & objping.statuscode
end if
else
err.clear
pingip = 0
'msgbox "unable to call win32_pingstatus on " & strcomputer & "."
end if
next
else
err.clear
pingip = 0
'msgbox "unable to call win32_pingstatus on " & strcomputer & "."
end if
end function