Shellnoob
Shellnoob is a shellcode writing toolkit that converts shellcode between various formats including asm, bin, hex, obj, exe, C, Python, ruby, and more. It offers interactive mode for asm-to-opcode conversion, supports 32/64-bit architectures, and includes utilities for syscall resolution and binary patching.
Description
Shellnoob is designed for security researchers and exploit developers working with shellcode. It facilitates the conversion of shellcode across multiple formats such as asm, bin, hex, obj, exe, C, Python, ruby, pretty, safeasm, completec, and shellstorm. This is particularly useful when generating payloads for different architectures or embedding shellcode into various programming languages and executable formats.
Key use cases include crafting shellcode for Linux/x86, Linux/x86_64, Linux/ARM, FreeBSD/x86, and FreeBSD/x86_64 targets. The interactive asm-to-opcode mode helps identify problematic bytes by testing assembly instructions in real-time. Additional features like resolving syscall numbers, constants, error numbers, and options for prepending breakpoints or cheap debugging with strace/gdb make it invaluable during exploit development.
The tool is portable, relying only on gcc/as/objdump and Python, and supports in-place development on the target architecture. It can be used as a Python module and includes plugins for binary patching, VM patching, and nopping fork calls, streamlining post-exploitation workflows.
How It Works
Shellnoob operates as a self-contained Python script that leverages gcc, as, and objdump for compilation, disassembly, and format conversions. It supports both ATT and Intel syntax, 32/64-bit modes, and handles stdin/stdout for piping. In interactive mode, it provides real-time asm-to-opcode or opcode-to-asm translation. Conversions involve parsing input formats, resolving syscalls/constants via built-in lookups, applying architecture-specific transformations, and generating output in the specified format. Plugins like --file-patch use hex data to modify binaries at offsets or VM addresses, while verbose mode exposes low-level conversion steps.
Installation
sudo apt install shellnoobFlags
Examples
shellnoob -i --to-opcodeshellnoob -hshellnoob.py [--from-INPUT] (input_file_path | - ) [--to-OUTPUT] [output_file_path | - ]shellnoob.py -i [--to-asm | --to-opcode ]shellnoob.py --get-const <const>shellnoob.py --get-sysnum <sysnum>shellnoob.py --get-strerror <errno>shellnoob.py --file-patch <exe_fp> <file_offset> <data>