SHELLCRAFT
This pwntool module helps exploit developers to quickly generate assembly code (shellcode) for common tasks, without having to write raw assembly by hand. It provides ready-made snippets for things like executing syscalls, spawning a shell, reading/writing files, or setting registers. The code can be output in multiple formats (assembly, raw bytes, or Python strings). It is architecture-aware and supports x86, x86-64, ARM, MIPS, and others. For example, shellcraft.sh() produces assembly for a simple execve("/bin/sh") shell, while shellcraft.cat("flag.txt") generates code to open, read, and print a file. Because it integrates tightly with Pwntools’ assembler (asm), you can seamlessly generate shellcode, assemble it, and inject it into an exploit. In short, shellcraft acts like a library of building blocks for custom payloads, making shellcode creation both faster and less error-prone.
COMPLETE X86_64 SYSCALL LIST
LISTING SYSCALLS
METHOD 1:
METHOD 2:
SHELLCODE GENERATION: BASIC
SHELLCODE GENERATION: ADVANCED (VIA PYTHON)
This method uses the Python3 interpreter to fully unlock shellcraft's capabilities and use its advanced syscalls with arguments.
RUNNING SHELLCODE (TESTING)
METHOD 1
METHOD 2
Last updated