Jump to content

Busis Remote Control! Early Beta :d


Busti
 Share

Recommended Posts

This is the server, its only the server from helpfile and lil changed :think:

;SERVER!! Start Me First !!!!!!!!!!!!!!!
#include <GUIConstants.au3>
#include <INet.au3>
#include <String.au3>
$g_IP = @IPAddress1;_GetIP()
$Port = 6114;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CHANGE YOUR OPEN PORT HERE !
; Start The TCP Services
;==============================================
TCPStartup()
; Create a Listening "SOCKET"
;==============================================
$MainSocket = TCPListen($g_IP, $Port, 100)
If $MainSocket = -1 Then Exit
$RogueSocket = -1
; Create a GUI for chatting
;==============================================
$GOOEY = GUICreate("REMOTE SERVER - NOT CONNECTET", 385, 340, -1, -1);, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
$input = GUICtrlCreateInput("", 0, 316, 272, 24)
$butt = GUICtrlCreateButton("senD", 272, 318, 112, 22, $BS_DEFPUSHBUTTON)
$edit = GUICtrlCreateEdit("", 0, 0, 269, 316)
$iplist = GUICtrlCreateList("", 270, 0, 114, 318)
#cs
    $GOOEY = GUICreate("REMOTE SERVER - IDLEING",300,200)
    $edit = GUICtrlCreateEdit("",10,40,280,150);,$WS_DISABLED)
    $input = GUICtrlCreateInput("",10,10,200,20)
    $butt = GUICtrlCreateButton("Send",210,10,80,20,$BS_DEFPUSHBUTTON)
#ce
GUISetState();@SW_SHOW)
; Initialize a variable to represent a connection
;==============================================
Dim $ConnectedSocket = -1
; GUI Message Loop
;==============================================
While 1
    $msg = GUIGetMsg()
; GUI Closed
;--------------------
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
; User Pressed SEND
;--------------------
    If $msg = $butt Then
        If $ConnectedSocket > - 1 Then
            If StringInStr( GUICtrlRead($input), "~execfile", 1) = 1 Then
                $NewString = ConvertFunction(GUICtrlRead($input))
                $StringCount = ConvertName($NewString)
                $TextName = StringRight($NewString, $StringCount)
                $Commands = ReadTXTForCommands($TextName)
                $TimerStart = TimerInit()
                For $I_Run = 0 To $Commands[0]
                    $ret = TCPSend($ConnectedSocket, $Commands[$I_Run] )
                    
                ;While TCPRecv($ConnectedSocket,2024) = ""
                ;   Sleep(1)
                ;WEnd
                Next
                $Time = TimerDiff($TimerStart)
                TCPSend($ConnectedSocket, @CRLF & "Runned every Command in : " & $Time)
                $NewString = ""
                $StringCount = ""
                $ProcessName = ""
                $Commands = ""
            Else
                $ret = TCPSend($ConnectedSocket, GUICtrlRead($input)) 
            EndIf

            If @error Or $ret < 0 Then
            ; ERROR OCCURRED, CLOSE SOCKET AND RESET ConnectedSocket to -1
            ;----------------------------------------------------------------
                TCPCloseSocket($ConnectedSocket)
                WinSetTitle($GOOEY, "", "REMOTE SERVER - NOT CONNECTET")
                $ConnectedSocket = -1
            ElseIf $ret > 0 Then
            ; UPDATE EDIT CONTROL WITH DATA WE SENT
            ;----------------------------------------------------------------
                GUICtrlSetData($edit, GUICtrlRead($edit) & GUICtrlRead($input) & @CRLF)
            EndIf
        EndIf
        GUICtrlSetData($input, "")
    EndIf
    If $RogueSocket > 0 Then
        $recv = TCPRecv($RogueSocket, 512)
        If Not @error Then
            TCPCloseSocket($RogueSocket)
            $RogueSocket = -1
        EndIf
    EndIf
; If no connection look for one
;--------------------
    If $ConnectedSocket = -1 Then
        $ConnectedSocket = TCPAccept($MainSocket)
        If $ConnectedSocket < 0 Then
            $ConnectedSocket = -1
        Else
            WinSetTitle($GOOEY, "", "REMOTE SERVER - " & SocketToIP($ConnectedSocket))
            If Not StringInStr( GUICtrlRead($iplist), SocketToIP($ConnectedSocket)) Then
                GUICtrlSetData($iplist, SocketToIP($ConnectedSocket) & "|")
            Else
                ContinueLoop
            EndIf
        EndIf
    ; If connected try to read some data
    ;--------------------
    Else
    ; EXECUTE AN UNCONDITIONAL ACCEPT IN CASE ANOTHER CLIENT TRIES TO CONNECT
    ;----------------------------------------------------------------
        $RogueSocket = TCPAccept($MainSocket)
        If $RogueSocket > 0 Then
            TCPSend($RogueSocket, "~~rejected")
        EndIf
        $recv = TCPRecv($ConnectedSocket, 512)
        If $recv <> "" And $recv <> "~~bye" Then
        ; UPDATE EDIT CONTROL WITH DATA WE RECEIVED
        ;----------------------------------------------------------------
            If $recv <> "ESISTWASANGEKOMMEN!" Then
            GUICtrlSetData($edit, GUICtrlRead($edit) & SocketToIP($ConnectedSocket) & ">" & @CRLF & $recv & @CRLF)
            $lastsocket = SocketToIP($ConnectedSocket)
            Else
            EndIf
        ElseIf @error Or $recv = "~~bye" Then
        ; ERROR OCCURRED, CLOSE SOCKET AND RESET ConnectedSocket to -1
        ;----------------------------------------------------------------
            WinSetTitle($GOOEY, "", "REMOTE SERVER - NOT CONNECTET")
            If StringInStr( GUICtrlRead($iplist), $lastsocket) Then
                GUICtrlSetData($iplist, StringRegExpReplace( SocketToIP($ConnectedSocket), GUICtrlRead($iplist), ""))
            EndIf
            TCPCloseSocket($ConnectedSocket)
            $ConnectedSocket = -1
        EndIf
    EndIf
WEnd
GUIDelete($GOOEY)
Func ReadTXTForCommands($File)
    SetError(0)
    Local $ArrayCount = 0
    While @error <> - 1
        $ArrayCount += 1
        FileReadLine($File, $ArrayCount)
    WEnd
    SetError(0)
    Dim $Functions[$ArrayCount + 1]
    Local $i = 0
    While @error <> - 1
        $Functions[$i] = FileReadLine($File, $i)
        If @error = -1 Then ExitLoop
        $i += 1
    WEnd
    $Functions[0] = $i - 1
    Return $Functions
EndFunc  ;==>ReadTXTForCommands
Func ConvertFunction($String)
    Return StringRight($String, StringLen($String) - 1)
EndFunc  ;==>ConvertFunction
Func ConvertName($String)
    For $i = 0 To StringLen($String)
        $nString = _StringRight ($String, $i)
        If $nString = "~" Then ExitLoop
    Next
    Return $i - 1
EndFunc  ;==>ConvertName
Func OnAutoItExit()
;ON SCRIPT EXIT close opened sockets and shutdown TCP service
;----------------------------------------------------------------------
    If $ConnectedSocket > - 1 Then
        TCPSend($ConnectedSocket, "~~bye")
        Sleep(2000)
        TCPRecv($ConnectedSocket, 512)
        TCPCloseSocket($ConnectedSocket)
    EndIf
    TCPCloseSocket($MainSocket)
    TCPShutdown()
EndFunc  ;==>OnAutoItExit
Func SocketToIP($SHOCKET)
    Local $sockaddr = DllStructCreate("short;ushort;uint;char[8]")
    Local $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _
            "ptr", DllStructGetPtr($sockaddr), "int_ptr", DllStructGetSize($sockaddr))
    If Not @error And $aRet[0] = 0 Then
        $aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3))
        If Not @error Then $aRet = $aRet[0]
    Else
        $aRet = 0
    EndIf
    $sockaddr = 0
    Return $aRet
EndFunc  ;==>SocketToIP
Func _StringRight($String, $Count)
    $Split = _StringReverse($String)
    $Split = StringSplit($Split, "")
    Return $Split[$Count]
EndFunc  ;==>_StringRight

NOTE SERVER :

the command : ~execfile~filename.txt

does not work properly !

client, startet with the client from helpfile , but i changed about 90% of it :(

;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!!
#include <GUIConstants.au3>
#include <String.au3>
#include <INet.au3>
Opt( "RunErrorsFatal", 0)
Dim $ClientVersion = "v 0.567 Beta"
TCPStartup()
Dim $szServerPC = @ComputerName
Dim $ip = "84.151.222.159" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CHANGE YOUR IP IN HERE !!!!!!!!!!
Dim $szIPADDRESS = $i
Dim $nPORT = 6114
Dim $MyIp = _GetIP()
Dim $ConnectedSocket = -1
$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
Dim $szData
Dim $MouseSpeed = 2
TCPSend($ConnectedSocket, "Client is Running Version : " & $ClientVersion)
If @error Then
    MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error)
Else
    While 1
        $incoming = TCPRecv($ConnectedSocket, 5000)
        If @error Then ExitLoop
        Sleep(1)
        Functions($incoming)
        #cs;= Commands Yet :
            ===;= ~getprocesslist
            ===;= ~DLHTTP:~             [0 = failure 1= succes]
            ===;= ~shutdown[1/6]        [1= ShutDown 6= Restart]
            ===;= ~close~lol.exe
            ===;= ~msgbox~HI ! :D
            ===;= ~open~C:\Programme
            ===;= ~fileexist~C:\Programme
            ===;= ~opentxt~C:\test.txt
            ===;= ~setmousespeed~1
            ===;= ~getactivewindow
            ===;= ~closeactivewindow
            ===;= ~msc~10~10
            ===;= ~msdb~10~10
            ===;= ~msm~10~10
            ===;= ~execfile~test.txt
            ===;= ~exit
        #ce;=
        ToolTip("")
    WEnd
EndIf

Func Functions($recv)
        #cs;==============| FileCreate Function :
        #ce;==============| Example : ~FileCreate~Filename.txt
        If StringInStr($recv, "~exit", 1) = 1 Then
            Exit
        EndIf
        #cs;==============| FileCreate Function :
        #ce;==============| Example : ~FileCreate~Filename.txt
        If StringInStr($recv, "~filecreate", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $ProcessName = StringRight($NewString, $StringCount)
            $retval = Close($ProcessName)
            TCPSend($ConnectedSocket, $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| mouseclickdob Function :
        #ce;==============| Example : ~mouseclickdob~10~10
        If StringInStr($recv, "~msdb", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCountOne = ConvertName($NewString)
            $ConvTwo = ConvertToNextName($StringCountOne, $NewString)
            $y = StringRight($NewString, $StringCountOne)
            $x = StringRight( StringTrimRight($NewString, $StringCountOne + 1), $ConvTwo)
            MouseClick( "left", $x, $y, 2, $MouseSpeed)
            TCPSend($ConnectedSocket, "Mouse Moved To : X : " & $x & " <> Y : " & $y)
            $NewString = ""
            $StringCountOne = ""
            $StringCountTwo = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| mouseclick Function :
        #ce;==============| Example : ~mouseclick~10~10
        If StringInStr($recv, "~msc", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCountOne = ConvertName($NewString)
            $ConvTwo = ConvertToNextName($StringCountOne, $NewString)
            $y = StringRight($NewString, $StringCountOne)
            $x = StringRight( StringTrimRight($NewString, $StringCountOne + 1), $ConvTwo)
            MouseClick( "left", $x, $y, 1, $MouseSpeed)
            TCPSend($ConnectedSocket, "Mouse Moved To : X : " & $x & " <> Y : " & $y)
            $NewString = ""
            $StringCountOne = ""
            $StringCountTwo = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| Close Active Window Function :
        #ce;==============| Example : ~closeactivewindow
        If StringInStr($recv, "~closeactivewindow", 1) = 1 Then
            TCPSend($ConnectedSocket, "Active Window : " & WinGetTitle(""))
            TCPSend($ConnectedSocket, "Forcing to Close...")
            $retval = WinClose( WinGetTitle(""))
            If $retval <> 0 Then
                TCPSend($ConnectedSocket, "Closed!")
            Else
                TCPSend($ConnectedSocket, "Not Closed!")
            EndIf
            $retval = ""
        EndIf
        #cs;==============| Get Active Window Function :
        #ce;==============| Example : ~getactivewindow
        If StringInStr($recv, "~getactivewindow", 1) = 1 Then
            TCPSend($ConnectedSocket, "Active Window : " & WinGetTitle(""))
        EndIf
        #cs;==============| setmousespeed Function :
        #ce;==============| Example : ~setmousespeed~
        If StringInStr($recv, "~setmousespeed", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Speed = StringRight($NewString, $StringCount)
            $MouseSpeed = $Speed
            TCPSend($ConnectedSocket, "MouseSpeed Changed to : " & $MouseSpeed)
            $NewString = ""
            $StringCount = ""
            $retval = ""
        EndIf
        #cs;==============| FileExists Function :
        #ce;==============| Example : ~fileexists~C:\Programme
        If StringInStr($recv, "~msm", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCountOne = ConvertName($NewString)
            $ConvTwo = ConvertToNextName($StringCountOne, $NewString)
            $y = StringRight($NewString, $StringCountOne)
            $x = StringRight( StringTrimRight($NewString, $StringCountOne + 1), $ConvTwo)
            MouseMove($x, $y, $MouseSpeed)
            TCPSend($ConnectedSocket, "Mouse Moved To : X : " & $x & " <> Y : " & $y)
            $NewString = ""
            $StringCountOne = ""
            $StringCountTwo = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| FileExists Function :
        #ce;==============| Example : ~fileexists~C:\Programme
        If StringInStr($recv, "~opentxt", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Pfad = StringRight($NewString, $StringCount)
            $retval = opentxt($Pfad)
            TCPSend($ConnectedSocket, $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| FileExists Function :
        #ce;==============| Example : ~fileexists~C:\Programme
        If StringInStr($recv, "~fileexist", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Pfad = StringRight($NewString, $StringCount)
            $retval = FileExist($Pfad)
            TCPSend($ConnectedSocket, $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| Open a Folder Function :
        #ce;==============| Example : ~open~C:\Programme
        If StringInStr($recv, "~open", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Pfad = StringRight($NewString, $StringCount)
            $retval = open($Pfad)
            TCPSend($ConnectedSocket, $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| Display a Message Box Function :
        #ce;==============| Example : ~msgbox~deine sätze hier xD
        If StringInStr($recv, "~msgbox", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Message = StringRight($NewString, $StringCount)
            MsgBox(0, "", $Message)
            TCPSend($ConnectedSocket, "Message Box wurde geöffnet mit Titel : " & $Message)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| Download From HTTP Function :
        #ce;==============| Example : ~DLHTTP: [0 = failure;1= succes]
        If StringInStr($recv, "~DLHTTP:", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $Url = StringRight($NewString, $StringCount)
            $i = 0
            Do
                $i += 1
                $String = _StringRight($Url, $i)
            Until $String = "."
            $retval = InetGet($Url, @UserName & "-Downloaded." & StringRight($Url, $i))
            TCPSend($ConnectedSocket, "Completet : " & $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
        #cs;==============| ShutDown Function :
        #ce;==============| Example : ~ShutDown[1,6]; 1= ShutDown 2= Restart
        If StringInStr($recv, "~shutdown", 1) = 1 Then
            $retval = CheckIfClientIsNested()
        ;If $RetVal = 1 Then
            TCPSend($ConnectedSocket, "Client is Shuttdown Down!")
            Shutdown( StringRight($recv, 1))
        ;Else
        ;EndIf
        EndIf
        #cs;==============| Get ProcessList Function :
        #ce;==============| Example : ~GetProcessList
        If StringInStr($recv, "~getprocesslist", 1) = 1 Then
            $List = ProcessList()
            TCPSend($ConnectedSocket, "ProcessList of the Other Computer :" & @CRLF)
            For $i = 1 To $List[0][0]
                TCPSend($ConnectedSocket, " " & $List[$i][0] & @CRLF)
            Next
            TCPSend($ConnectedSocket, ">Waiting for Input ..." & @CRLF)
            $i = ""
            $List = ""
        EndIf
        #cs;==============| Process Close Function :
        #ce;==============| Example : ~close~lol.exe
        If StringInStr($recv, "~close", 1) = 1 Then
            $NewString = ConvertFunction($recv)
            $StringCount = ConvertName($NewString)
            $ProcessName = StringRight($NewString, $StringCount)
            $retval = Close($ProcessName)
            TCPSend($ConnectedSocket, $retval)
            $NewString = ""
            $StringCount = ""
            $ProcessName = ""
            $retval = ""
        EndIf
EndFunc

Func ReadTXTForCommands($File)
    $ArrayCount = 0
    Do
        $ArrayCount += 1
        FileReadLine($File, $ArrayCount)
    Until @error = 1 Or @error = -1
    Dim $Functions[$ArrayCount+1]
    SetError(0)
    $i = 0
    Do
        $i += 1
        $Functions[$i] = FileReadLine($File, $i)
    Until @error = 1 Or @error = -1
    $Functions[0] = $i
    Return $Functions
EndFunc  ;==>ReadTXTForCommands
Func opentxt($Pfad)
    $PID = Run( "notepad.exe " & '"' & $Pfad & '"', $Pfad)
    If $PID <> 0 Then
        Return $Pfad & " Opened."
    Else
        Return "Has not been openedt;("
    EndIf
EndFunc  ;==>opentxt
Func FileExist($Pfad)
    If FileExists($Pfad) = 1 Then
        Return "Exist!"
    Else
        Return "Does NOT Exist!"
    EndIf
EndFunc  ;==>FileExist
Func open($Pfad)
    $PID = Run( "explorer.exe " & '"' & $Pfad & '"', $Pfad)
    If $PID <> 0 Then
        Return $Pfad & " Has been Opened."
    Else
        Return "Has not Been Opened!;("
    EndIf
EndFunc  ;==>open
Func CheckIfClientIsNested()
EndFunc  ;==>CheckIfClientIsNested
Func ConvertFunction($String)
    Return StringRight($String, StringLen($String) - 1)
EndFunc  ;==>ConvertFunction
Func ConvertName($String)
    For $i = 0 To StringLen($String)
        $nString = _StringRight($String, $i)
        If $nString = "~" Then ExitLoop
    Next
    Return $i - 1
EndFunc  ;==>ConvertName
Func ConvertToNextName($oldConvert, $String)
    For $i = $oldConvert To StringLen($String)
        $nString = _StringRight($String, $i)
        If $nString = "~" Then ExitLoop
    Next
    Return $i - 1
EndFunc  ;==>ConvertToNextName
Func Close($exename)
;$exename = '"'&$exename&'"'
    If ProcessExists($exename) <> 0 Then
        $Timer = TimerInit()
        While ProcessExists($exename) <> 0 And TimerDiff($Timer) < 1500
            ProcessClose($exename)
        WEnd
    Else
        Return "Exe NOT Found !z !"
    EndIf
    If ProcessExists($exename) <> 0 Then
        Return "Exe Could NOT be closed !"
    Else
        Return "Closed :)"
    EndIf
EndFunc  ;==>Close
Func _StringRight($String, $Count)
    $Split = _StringReverse($String)
    $Split = StringSplit($Split, "")
    Return $Split[$Count]
EndFunc  ;==>_StringRight

This are the commands yet :

===;= ~getprocesslist
; Return's Full process list of the Client.
            ===;= ~DLHTTP:~             [0 = failure 1= succes]
; Downloads a File from the NET to the client XD
            ===;= ~shutdown[1/6]        [1= ShutDown 6= Restart]
; Shutdown1 Shuts the Computer down, Shutdown6 Restarts it !
            ===;= ~close~lol.exe
; Closes an Process
            ===;= ~msgbox~HI ! :D
; Displays a MessageBox with "HI ! :D"
            ===;= ~open~C:\Programme
; Opens a folder on the Client ( Funny;D )
            ===;= ~fileexist~C:\Programme
; Checks if a File exists
            ===;= ~opentxt~C:\test.txt
; Opens a TXT File (or something else with notepad^^)
            ===;= ~setmousespeed~1
; Setsmousespeed to move the mouse
            ===;= ~getactivewindow
; Returns Active Window on Enemy PC
            ===;= ~destroyactivewindow
; Closes the Active Window!
            ===;= ~msc~10~10
; Mouseclickes on 10,10 (x,y)
            ===;= ~msdb~10~10
; Makes an MouseDoubleClick on 10,10 (x,y)
            ===;= ~msm~10~10
; Makes an MouseMove on 10,10 (x,y)
            ===;= ~execfile~test.txt
; Runes The File on YOUR Pc and sends every command to the Client
; Example down^^
            ===;= ~exit
; Closes the Client ( if an error occurs or smt. like that )

an example how a file that wants to be exectet with "~execfile~filename.txt" must be look like this :

~getprocesslist
~setmousespeed~10
~msm~10~10
~msm~100~100
~msm~50~50
~msm~90~90
~msm~555~555
~msgbox~Hello :D

hf XD

if someone wants to see that it works, add me in icq i send you the client with my ip :)

ICQ : 269-424-176

please say me some commands to add ;)

My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity
Link to comment
Share on other sites

i dont understand why nobody can open a port o_O

People probably would if they just knew how. Most people dont even really know what a port does in relation to software.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...