|
|||||||||||
|
exploiting a binary if %edi can be overwritten?
From: <avel(at)gmx.ch>
Date: Mon Jun 23 2003 - 04:06:05 EDT
i have a buffer overflow question. If i have a binary (no src available)
that
If i put in a malformed addr (like above) the proc segfaults, if i put in a valid (like addr of my shellcode) it gets executed normally (thats why i think i have to restore/push/pop %edi to another register somehow... but how?) I theory i'd like to do something like restoring the addr i have written to the place were %edi is to some other register, which would jmp to the addr given by me. I just dunno, _where_ to write _what_ to accomplish that. Maybe push %edi and ret in opcodes (but where? infront of my shellcode won't make much sense, since the prog won't jmp there...)? ...is this exploitable at all? # ./mybinary `perl -e 'print "A" x 5000'` Segmentation fault (core dumped)
# gdb -core mybinary.core
#0 0x2813ecfa in ?? () #1 0x2813dae9 in ?? () #2 0x2813de32 in ?? () #3 0x2813da25 in ?? () #4 0x8049123 in ?? () #5 0x8049831 in ?? () #6 0x804cd19 in ?? () #7 0x804906a in ?? () (gdb) x/10i $eax 0x0: Cannot access memory at address 0x0. (gdb) x/10i $ecx 0xffffffff: Cannot access memory at address 0xffffffff. (gdb) x/10i $ebx 0x2815000c: push %esp 0x2815000d: das 0x2815000e: or %al,(%eax) 0x28150010: add %al,0x34502806(%ebx) 0x28150016: add $0xdcfba28,%eax 0x2815001b: sub %cl,%dl 0x2815001d: iret 0x2815001e: or $0xdcfda28,%eax 0x28150023: sub %ch,%dl 0x28150025: iret (gdb) x/10i $esi 0x8: Cannot access memory at address 0x8. (gdb) x/10i $edi 0x41414141: Cannot access memory at address 0x41414141. (gdb) x/10i $eip 0x2813ecfa: Cannot access memory at address 0x2813ecfa. (gdb) Thanks for any help with that topic! avel -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!Received on Mon Jun 23 14:02:43 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:40 EDT |
||||||||||
|
|||||||||||