Gallopsled / pwntools

CTF framework and exploit development library
http://pwntools.com
Other
12.05k stars 1.71k forks source link

Shellcraft Templates #888

Closed zachriggle closed 4 years ago

zachriggle commented 7 years ago

For each architecture, all of the following non-syscall shellcodes should be defined:

For each operating system, for each architecture, the following set should be defined:

With these building blocks, it should be trivial to build entirely architecture-agnostic versions (i.e. living in shellcraft/templates/common/linux) of the following:

Things which are excluded because they are syscalls:

Are there any others that are missing that we expect to work?

zachriggle commented 7 years ago

We are currently missing the following architecture-specific shellcodes:

[!] aarch64/breakpoint.asm
[!] aarch64/crash.asm
[!] aarch64/nop.asm
[!] aarch64/push.asm
[!] aarch64/pushstr_array.asm
[!] aarch64/trap.asm
[!] amd64/breakpoint.asm
[!] arm/breakpoint.asm
[!] mips/breakpoint.asm
[!] mips/crash.asm
[!] mips/infloop.asm
[!] powerpc/breakpoint.asm
[!] powerpc/crash.asm
[!] powerpc/infloop.asm
[!] powerpc/mov.asm
[!] powerpc/nop.asm
[!] powerpc/push.asm
[!] powerpc/pushstr.asm
[!] powerpc/pushstr_array.asm
[!] powerpc/setregs.asm
[!] powerpc/trap.asm
[!] thumb/breakpoint.asm
zachriggle commented 7 years ago

One caveat that's important to note is that aarch64 cannot have a push which is similar to the other architectures, since the stack must be 16-byte aligned.

See: https://community.arm.com/processors/b/blog/posts/using-the-stack-in-aarch64-implementing-push-and-pop

heapcrash commented 4 years ago

Most of these are done, and they can be added ad-hoc where needed