vb6 wont connect remotely



Hello All,

I'm writing an application for remote administration; during the
beta
testing of my application i have noticed that i can successfully
connect to
my own computer (localhost) and to another system on my same network
address
(for example 192.168.1.100 Server, 192.168.1.102 Client).

I have a few users helping me beta test the application, and i
cannot
connect to their systems, nor can they connect to mine. Winsock always
fails
on connection to the system. I have turned all fire walls off,
configured the
firewalls for the communication ports, and it fails. I have even tested
the
connection event, and i have changed the port configuration. From
localport /
remoteport, port number, and even tested older applications i have
written of
this matter. Which, all fail.

I have even tested similar code to mine (like netbus, and BO) and
they
too fail. Before anyone judges, please note i'm a CEH and i'm
developing
application to help penetration testers. Below is a sample code from
the
application (Server and Client)

(On the connection form)
On Error GoTo Error_Trap_Event
If Len(Combo1) > 0 And Len(Combo2) > 0 Then
With TokenRingG.Winsock1
'//DO THE CONNECTION REQUEST
.Connect Combo1, Combo2
DataDlg.RichTextBox1.Text = DataDlg.RichTextBox1.Text & "-
Attempting to connect to: " & Combo1 & " On: " & Combo2 & " [
ATTEMPTING ]" &
vbNewLine
DataDlg.RichTextBox1.Text = DataDlg.RichTextBox1.Text & "-
Connection Request made on: " & Format(Date, "DDDD MMMM DD YYYY") & _
" At: " & Format(Time, "HH:MM") & Right(Time, 2) & " [
ATTEMPTING ]"
& vbNewLine
SPause (0.9)
If TokenRingG.StatusBar1.Panels(1).Text = "Connection State:"
Then
DataDlg.RichTextBox1.Text = DataDlg.RichTextBox1.Text & "!
No
connection established to: " & Combo1 & " On Port: " & Combo2 & " [
FAILED ]"
& vbNewLine & _
"! Possible Causes for a failed connection include: " &
vbNewLine & _
"(1) User is currently behind a firewall application." &
vbNewLine & _
"(2) The entity in which you are trying to connect to has
signed
off." & vbNewLine & _
"(3) The entity in which you are trying to connect to has
removed TokenRing." & vbNewLine & _
"(4) The IP address or Port Number you have entered are
incorrect or invalid." & vbCrLf & _
"(5) If you are using the port binding service You may be
entering the wrong port number." & vbCrLf
TokenRingG.Winsock1.Close
DataDlg.RichTextBox1.Text = DataDlg.RichTextBox1.Text & "!
TokenRing has now reset the connection. Please Try again. [ FAILED ] "
&
vbNewLine
Else
MsgBox "The input fields contain invalid data.", vbExclamation
End If
End With
End If
Exit Sub
Error_Trap_Event:
MsgBox Err.Number & vbCrLf & Err.Description
TokenRingG.Enabled = False
ErrorHandlerhWnd.Show
With ErrorHandlerhWnd.Text1
.Text = .Text & "Error Source: " & Err.Source & vbNewLine
.Text = .Text & "Error Number: " & Err.Number & vbNewLine
.Text = .Text & "Error Description: " & Err.Description &
vbNewLine
.Text = .Text &
"---------------------------------------------------" & vbNewLine
.Text = .Text & "Technical Details:" & vbNewLine
.Text = .Text & "Windows Version: " & Environ("OS") & vbNewLine
.Text = .Text & "Error Date & Time: " & Format(Date, "DDDD MMMM
DD
YYYY") & " " & Time & vbNewLine
If Len(TokenRingG.Winsock1.RemoteHostIP) > 0 Then
.Text = .Text & "Connection Status: Error Experienced
During
Connection" & vbNewLine
Else
.Text = .Text & "Connection Status: Error Was Encountered
Off
Line" & vbNewLine
End If
.Text = .Text &
"---------------------------------------------------" & vbNewLine
.Text = .Text & "End Technical Detail View(s)."
End With

REM //ON THE CONNECTION REQUEST FROM WINSOCK

MsgBox "connected"
With DataDlg.RichTextBox1
.Text = .Text & "- TokenRing has Successfully Connected to:
" &
Combo1 & " On Port: " & Combo2 & " [ OK ]" & vbNewLine
.Text = .Text & "- TokenRing is now waking up the
connection
checker. [ OK ]" & vbCrLf
TokenRingG.StatusBar1.Panels(1).Text = "Connection State:
Connected!"
TokenRingG.ConnectRemote.Enabled = False
TokenRingG.Disconnectremote.Enabled = True
TokenRingG.LineChecker.Enabled = True
TokenRingG.Toolbar1.Enabled = True
TokenRingG.OptionsMenu.Enabled = True
TokenRingG.UninstallTRG.Enabled = True
TokenRingG.Upgrade.Enabled = True
If DirectoryExists(Environ("HomeDrive") & "Program
FilesTRECE") = True Then
Open Environ("HomeDrive") & "Program
FilesTRECEETH0.log" For Append As #1
Print #1, "-a" & Combo1
Print #1, "-p" & Combo2
Close #1
.SelText = "- Dumping Connection Data to ETH0. [ OK
]" &
vbCrLf
Else
MkDir (Environ("HomeDrive") & "Program FilesTRECE")
.SelText = "# Error Discovered | Directory properly
created. [ CORRECTED ]" & vbCrLf
.SelText = "- Dumping Connection Data to ETH0. [ OK
]" &
vbCrLf
Open Environ("HomeDrive") & "Program
FilesTRECEETH0.log" For Append As #1
Print #1, "-a" & Combo1
Print #1, "-p" & Combo2
Close #1
End If
Unload ConnectionDlg
End With
End Sub


'//ON THE LISTENING END OF THE APPLICATION
Winsock1.localport = 4607
winsock1.listen

'//CONNECTION REQUEST
If winsock1.State <> sckClosed Then winsock1.Close
winsock1.accept requestID

'//CHECKER TO SEE IF LINE IS ACTIVE
timer1.enabled = true

'//INSIDE THE TIMER
On Error GoTo ErrorHandler
Winsock1.SendData ""
Exit Sub
ErrorHandler:
On Error Resume Next
With winsock1
.Close
.LocalPort = 4607
.Listen
End If
Timer1.Enabled = False

.



Relevant Pages

  • Re: Correction
    ... Normally to physically disconnect is just a matter of reaching for the ... >> I have an ADSL connection which polls my computer from time to time, ... > disallow each and every port with Windows Firewall? ...
    (microsoft.public.windowsxp.messenger)
  • Re: Using Remote Desktop From an SBS Domain
    ... when you tried to RDP while attached directly to a port on your router? ... Internet to initiate an IP conversation with your computer. ... This situation is different than if you ran your own NAT connection sharing ...
    (microsoft.public.windows.server.sbs)
  • Re: Still cant connect to RWW or OWA remotely
    ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
    (microsoft.public.windows.server.sbs)
  • Re: Still cant connect to RWW or OWA remotely
    ... it certainly appears to be something about the SBS configuration. ... Meridian.local Ethernet adapter Local Area Connection: ... Windows SMALL BUSINESS SERVER 2003 Windows IP Configuration ... 192.168.254.254) directly to a port on the router and then ...
    (microsoft.public.windows.server.sbs)
  • Re: Random unprivileged TCP ports below 5000 kind-of open for a fraction of a second
    ... When Nmap (or many ... > other applications, such as Telnet) does a connectcall, the OS is ... > supposed to choose a good souce port to bind to for the connection. ... I saw a familiar "Connection reset by peer" every time the random port ...
    (Incidents)