VB编写入侵监听程序_VB.net_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

VB编写入侵监听程序

作者:黑客防线网安VB教程基地 来源:黑客防线网安VB教程基地 浏览次数:0

本篇关键词:程序入侵编写Winsock1
黑客防线网安网讯:以下是代码片段: ‘本程序在VB6.0+Windows2000下测试通过! Dim tmpstr As String Dim NOW_OUT As Integer ’’总共出去连接的有几个Winsock Private Sub Command1_Click() ListPorts.Add...

以下是代码片段:

‘本程序在VB6.0+Windows2000下测试通过!
Dim tmpstr As String
Dim NOW_OUT As Integer ’’总共出去连接的有几个Winsock
Private Sub Command1_Click()
ListPorts.AddItem txtADDPORT.Text
End Sub

Private Sub Command2_Click()
On Error Resume Next
If Command2.Caption = "监听" Then
For i = 0 To ListPorts.ListCount - 1
Load Winsock1(i + 1) ’’加载监听端口的winsock1数组控件
Winsock1(i + 1).LocalPort = ListPorts.List(i) ’’设定端口
Winsock1(i + 1).Listen ’’监听
Next i
Command2.Caption = "停止"
Else
For i = 1 To Winsock1.Count - 1
Unload Winsock1(i)
Next i
For i2 = 1 To Winsock2.Count - 1
Unload Winsock2(i2)
Next i2
Command2.Caption = "监听"
End If
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
txtLOG.Text = "日志:" & vbCrLf
NOW_OUT = 1
End Sub

Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
Load Winsock2(NOW_OUT) ’’加载建立连接的Winsock2数组控件
Winsock2(NOW_OUT).Accept requestID ’’建立连接
Winsock1(Index).Close
Winsock1(Index).Listen ’’Winsock1继续监听
NOW_OUT = NOW_OUT + 1 ’’连接的控件累加
myAddLog "来自" & Winsock1(Index).RemoteHostIP & "连接到本地端口:" & Winsock1(Index).LocalPort
’’显示捕获的连接
End Sub

Private Sub Winsock2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Winsock2(Index).GetData tmpstr ’’通过Getdata捕获数据
myAddLog "来自" & Winsock2(Index).RemoteHostIP & "的数据:" & tmpstr ’’显示捕获的数据
End Sub

Sub myAddLog(tmptext As String) ’’加入日志
tmptext = tmptext & vbCrLf
txtLOG.SelStart = Len(txtLOG.Text)
txtLOG.SelText = tmptext
End Sub

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-14666-1.html
网站维护教程更新时间:2012-04-03 01:12:04  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer