Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: exploiting a binary if %edi can be overwritten?

From: <andrewg(at)d2.net.au>
Date: Tue Jun 24 2003 - 20:02:16 EDT

>> Possibly, but doubtful given what i shown. Depending on the assembly

The above command iirc at&t syntax correctly, will destroy %edi.

> 0x2813ed03 <vfprintf+3999>: jmp 0x2813f0e6 <vfprintf+4994>

How about info registers edi and eax?

[ snip ]

> open("/dev/mem", O_RDWR) = 4

[ snip ]

Do you need help?X

>
> and finally ltrace:
OFEOFEOFEOFEOFEOFEOFEOF".
> .. <unfinished ...>

Hmm, since edi is killed above, it doesn't look that exploitable. Since you can modify edi though, it kindof suggests you have overwritten other information. What does a backtrace (bt) under gdb look like?

Possibly though given the ltrace, you may need to match the sscanf() call, so that the 4rd arg is written to. (That could be the reason for the EOF's). A x/s 0x0804f928 should suffice.

I also notice that libvga is used, and that /dev/mem is open; this itself leads to an exploitable condition, because you can now modify kernel memory with what you want. libvga will also attempt to drop privs for you, iirc.

(From memory, under linux for the kernel, you get the virtual address of the kernel (maybe via /proc/ksyms), and 0x00ffffff the address to get the physical address.)

Some distros don't set CLOSE ON EXEC when they open /dev/mem, which makes it easier to exploit b/c you can start programs targetting that open fd, rather than shellcoding it.

>
> still thanks a lot to anyone helping me with that topic!

No problems.

Do you need more help?X

> regards
> avel
>
> --
> +++ GMX - Mail, Messaging & more http://www.gmx.net +++

Hope this helps,
Andrew Griffiths Received on Wed Jun 25 12:37:21 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:40 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library