Results 1 to 9 of 9

Thread: For advanced programers only

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    149
    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.

  2. #2
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Hmm...

    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.
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net- ^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    149
    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

  4. #4
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Ooh

    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.
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net- ^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    149
    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

  6. #6
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Timer

    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.
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net- ^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    149
    Ok will try and work it out

    Hurgh


  8. #8
    Lively Member The_Fog's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Posts
    65

    Lightbulb Look at me.. I know something... ;)

    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.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    149
    It would not let me use the CreatObject thing,
    is there a component that I need to add or something??

    Hurgh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width