Results 1 to 5 of 5

Thread: Calling all Winsock Gurus !

  1. #1

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245
    How would one go about coding a small app that will try every port/ip out of a proxy to find a path that goes successfully through the proxy.

    I am not trying to hack into a proxy.
    At my work, we have our systems all on a proxy, and I need to be able to get all systems here to reach my static IP at home where I have a Chat server setup.

    Naturally, this is a no-no with my IT team.

    Are there any Winsock/Proxy Gurus out there that can enlighten me?


    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    You wouldn't want to do it from home (or at all). This is an action called "port scanning", which most ISPs consider illegal.
    Most ISPs can also detect when you perform a port scan, and even send you an E-mail saying "one more time and you get no service" or something like that.

    For educational purposes ONLY:
    Code:
    Option Explicit
    
    Dim nPort As Long
    
    Sub PortScan(ByVal sIPAddress As String, Optional ByVal nStartPort As Long = 1, Optional ByVal nEndPort As Long = 65535)
        Dim I As Long
        
        Call wskPortScan.Close
        
        For I = nStartPort To nEndPort
            wskPortScan.LocalPort = 0
            Call wskPortScan.Connect(sIPAddress, I)
            
            Do
                DoEvents
            Loop Until wskPortScan.State = sckClosed
        Next
    End Sub
    
    Private Sub wskPortScan_Close()
        Call wskPortScan.Close
    End Sub
    
    Private Sub wskPortScan_Connect()
        Debug.Print "Found open port: " & nPort
        Call wskPortScan.Close
    End Sub
    
    Private Sub wskPortScan_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
        Call wskPortScan.Close
    End Sub

  3. #3

    Thread Starter
    Addicted Member Daniel_Christie's Avatar
    Join Date
    Jan 2000
    Location
    USA
    Posts
    245

    How do I make this code work?

    I copied to source, but it seems to be unfinished. I can not seem to start it.

    I tried:

    Code:
    Private Sub Command1_Click()
        Call PortScan("127.0.0.1", 1, 65535)
    End Sub
    But this did nothing for me...

    any ideas?

    I appreciate all of your time and effort,
    Daniel Christie
    VB 5 and 6 Enterprise Editions,
    Html, Java scipt, Vb script,
    & etc...
    http://www.qwcd.com

  4. #4
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    • It takes time.
    • You need the Debug (Immediate) Window open.
    • Maybe you have no ports open.

  5. #5
    Frenzied Member
    Join Date
    Jun 2000
    Location
    England, Buckingham
    Posts
    1,341
    I can send you the project files of mine that allow you to port scan. It then lists all of the open ports in a listbox.

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