-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample DOS.au3
47 lines (37 loc) · 1.1 KB
/
example DOS.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#cs
Download netcat at https://eternallybored.org/misc/netcat/
Execute this script
Run in CMD:
nc -vv 127.0.0.1 8081
#ce
#include "TCPServer.au3"
Global $sPassword = "12345" ; input server password here
_TCPServer_OnConnect("connected")
_TCPServer_OnDisconnect("disconnect")
_TCPServer_OnReceive("received")
_TCPServer_DebugMode(True)
_TCPServer_SetMaxClients(10)
_TCPServer_Start(8081)
Func connected($iSocket, $sIP)
_TCPServer_Send($iSocket, "Welcome! Please input password: ")
_TCPServer_SetParam($iSocket, 'login')
EndFunc ;==>connected
Func disconnect($iSocket, $sIP)
MsgBox(0, "Client disconnected", "Client " & $sIP & " disconnected from socket " & $iSocket)
EndFunc ;==>disconnect
Func received($iSocket, $sIP, $sData, $sParam)
If $sParam = "login" Then
If $sData <> $sPassword Then
_TCPServer_Send($iSocket, "Wrong password. Try again: ")
Return
Else
_TCPServer_SetParam($iSocket, 'command')
_TCPServer_BindAppToSocket($iSocket, 'cmd.exe')
EndIf
ElseIf $sParam = "command" Then
_TCPServer_SendToBound($iSocket, $sData)
EndIf
EndFunc ;==>received
While 1
Sleep(100)
WEnd