Click to See Complete Forum and Search --> : For advanced programers only
hurgh
Aug 29th, 2000, 12:14 AM
Does anyone know where I can find code for a multiple IP port scanner? I've found a hundred that will scan multiple ports but none that scan multiple IP's.
I've tried to write one but I keep getting a buffer overflow from all of the winsock stuff it runs. Any ideas?
Thanks.
Mage33
Aug 30th, 2000, 06:46 PM
Well, a cheap way around that (and not too effective) is to use multiple controls... like 5 for 5 different IPs. The problem with that is that you can only get up to about ten IPs with Winsock, and only a few more with TCP/IP before getting a buffer overflow. Maybe you've already tried this... dunno, hope it helps.
hurgh
Aug 30th, 2000, 06:49 PM
I have tried it with just one winsock control and am able to get upto 100 Ip addresses then it says there is no buffer space left,
do you know of any way around this, or it there another control that I should use instead of winsock.
Thanks
Hurgh
Mage33
Aug 30th, 2000, 06:52 PM
Well... I have a few ideas. How many winsock controls do you need to use? I'm not too used to using winsock, just a little. Is buffer overflow a matter of time? If so, maybe use a timer to space out multiple winsock control's scanning. IE: Have 1 winsock control do 100... wait a second, have the same one or a new one do another 100... wait a second, etc.
hurgh
Aug 30th, 2000, 06:58 PM
I will try and have a fiddle round with it,
If you have any code on how to do the timer thing that would be much appreciated, I am not too use to the use fo timers.
Hurgh
Mage33
Aug 30th, 2000, 07:09 PM
Timers are really easy to use, once you know how. Simply enter how long you want it to wait inbetween whatever it's doing in the .interval prop... 800 is around 1 second I believe, not sure though. Double click on the timer to get its main function and enter the code for whatever you want it to do every 800 or whatever.
hurgh
Aug 30th, 2000, 07:12 PM
Ok will try and work it out
Hurgh
The_Fog
Aug 31st, 2000, 07:03 AM
Have you tried using the MSWinsock Component?
sample:
Public function Scan_IP()
dim myPort as integer
dim myHost as string
myPort = 1002
set myWinsock = creatobject("MSWinsock.Winsock")
for a = 0 to 255
myHost = "10.0.0." & a
myWinsock.RemoteHost = myHost
myWinsock.RemotePort = myPort
myWinsock.Connect
s = DoEvents
Do While myWinsock.State = 4
s = DoEvents()
Loop
Do While myWinsock.State = 6
s = DoEvents()
Loop
If myWinsock.State <> 7 Then GoTo nosend 'If we couldn't connect the we won't send anything, just move on to the next IP.
lstAvaliableIP.additem myHost
GoTo ending
nosend:
ending:
s = DoEvents
myWinsock.Close
next a
End Function
I think that should take care of your Buffer problem.
hurgh
Aug 31st, 2000, 08:23 PM
It would not let me use the CreatObject thing,
is there a component that I need to add or something??
Hurgh
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.