By:nowake
中国菜刀的两个小插件(asp),扫描常用端口,读取终端端口(3389、Mstsc)。
扫描常用端口:
ip="127.0.0.1"
port="21,23,80,3306,1433,3389,43958"
arrport=Split(port,",")
For i=0 To Ubound(arrport)
If Isnumeric(arrport(i)) Then
Call Scan(ip, arrport(i))
end if
next
Sub Scan(scanip,theport)
on error resume next
set conn=server.createobject("Adodb.connection")
connstr="Provider=SQLOLEDB.1;Data Source=" & scanip & "," & theport & ";User ID=yezi;Password=;"
conn.ConnectionTimeout=1
conn.open connstr
If Err Then
If Err.number=-2147217843 or Err.number=-2147467259 Then
If InStr(Err.description, "(Connect()).") > 0 Then
response.write scanip & ":" & theport & ":close" & chr(13) & chr(10)
Else
response.write scanip & ":" & theport & ":open." & chr(13) & chr(10)
End If
End If
End If
end sub |
读取终端端口:
set ws=createobject("wscript.shell")
port=ws.regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber")
response.write "Terminal port is "& port |
文章作者
Nuclear'Atk
上次更新
2011-04-20
许可协议
Nuclear'Atk(核攻击)网络安全实验室版权所有,转载请注明出处。