32-bit exec () 64-bit program

On my Debian amd64 system, I am trying to run tests with 32-bit payloads on sample programs. I know this payload works as I tested it on a 32-bit virtual machine.

All required libraries are installed to run a 32-bit or 64-bit program.

However, when the shellcode executes int 80h

for the call exec("/bin/sh", ...)

, the system call fails, returning an error code of -2 (ENOENT).

Modifying the shellcode to run another 32-bit program causes the shellcode to work as expected.

So, is there a way to exec()

64-bit program from 32-bit program?

+3


source to share


1 answer


It works when using a library function execl

.



It can be difficult to call a library function from shell code, but you can try to trace its execution in a regular program and see how to write shell code that does the same.

0


source







All Articles