Checking networkports
- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
Checking networkports
Hello everybody,
Do anyone knows, how to check all networkports at the same time
for activity ?
Is there an API-Hook ?
			
			
									
									
						Do anyone knows, how to check all networkports at the same time
for activity ?
Is there an API-Hook ?
- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
- NoahPhense
 - Addict

 - Posts: 1999
 - Joined: Thu Oct 16, 2003 8:30 pm
 - Location: North Florida
 
- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
Maybe this can help:
http://www.thecodeproject.com/csharp/iphlpapi.asp
			
			
									
									http://www.thecodeproject.com/csharp/iphlpapi.asp
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{History Viewer Online}.:|:.{Send a Beer}
						- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
- NoahPhense
 - Addict

 - Posts: 1999
 - Joined: Thu Oct 16, 2003 8:30 pm
 - Location: North Florida
 
That example uses netstat, if you pipe out the result of that, its exactly what you need.....but this must work without any extern resources libs and DLLs...
On the other hand, if you want to do it to a remote machine (port scanning) then something like...
Code: Select all
Procedure OpenSocket(portnum)
OpenNetworkConnection("127.0.0.1", portnum)
EndProcedure
For t=1 to 65000
CreateThread(@OpenSocket(), t)
Next t
- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
- Hroudtwolf
 - Addict

 - Posts: 803
 - Joined: Sat Feb 12, 2005 3:35 am
 - Location: Germany(Hessen)
 - Contact:
 
Yes...
Simple port scanner:
Again, please be carefull with this, even to localhost, if you have no delays, it will kill your net connection, it did to me on 1mb after 2 seconds 
			
			
									
									
						Simple port scanner:
Code: Select all
InitNetwork()
Procedure OpenSocket(portnum)
If OpenNetworkConnection("127.0.0.1", portnum)
Debug "OPEN! [port:"+Str(portnum)
EndIf
EndProcedure
For t=1 To 65000
CreateThread(@OpenSocket(), t)
Next t
- NoahPhense
 - Addict

 - Posts: 1999
 - Joined: Thu Oct 16, 2003 8:30 pm
 - Location: North Florida
 


