|
-
May 3rd, 2004, 05:07 PM
#1
Thread Starter
Hyperactive Member
Port Monitor
Can anyone tell me how to build a VB program that would monitor ports I specify (preferably 25 & 110) and log the requests to a text file?
-
May 3rd, 2004, 07:31 PM
#2
So Unbanned
Make two winsock controls, set the local ports to 25/110 respectively.
In the connection request... close it, accept requestID, they've now established a connection. You can use the remoteip to get their IP.
-
May 3rd, 2004, 08:00 PM
#3
Addicted Member
Server End:
VB Code:
Dim strData as string
Form_Load()
sckWinsock.LocalPort = 25
sckWinsock.Listen
'Listen for connection requests
End Sub
sckWinsock_ConnectionRequest()
'Accept connection
sckWinsock.Close
sckWinsock.Accept RequestID
End Sub
sckWinsock_DataArrival
'Gets data
sckWinsock.GetData strData
'Writes to file
Open App.Path & "\log.txt" for Append as #1
Write #1, strdata
Close #1
End Sub
sckWinsock_Close
MsgBox ("User has closed connection!")
Client End:
VB Code:
Form_Load
sckWinsock.RemoteHostIP = 000.000.000.000
sckWinsock.RemotePort = 25
End Sub
cmdConnect_Click()
sckWinsock.Connect
End Sub
'If you want to send data, send it using sckWinsock.SendData (Variable)
Simple, as long as you don't mess it up, which I probably did.
-
May 3rd, 2004, 09:27 PM
#4
Thread Starter
Hyperactive Member
Thanks guys, that's exactly what I needed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|