Reverse Engineeringshellcodeassemblyexploitationconversionlinux

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

bash
sudo apt install shellnoob

Flags

-iStart interactive mode
--to-opcodeAsm to opcode mode in interactive mode
--to-asmOpcode to asm mode in interactive mode
-cPrepend a breakpoint (only few platforms/OS supported)
--6464 bits mode, default is 32 bits
--intelIntel syntax mode, default is ATT
-qQuiet mode
-vVerbose mode (or -vv, -vvv)
--to-straceCompiles it and runs strace
--to-gdbCompiles it and runs gdb with breakpoint on entrypoint
--get-constGet constant value
--get-sysnumGet syscall number
--get-strerrorGet error string for errno
--file-patchPatch binary file at file offset with hex data (x86/x86_64)
--vm-patchPatch binary at VM address with hex data (x86/x86_64)
--fork-nopperNOP out calls to fork() (x86/x86_64)
--installInstall the script to a convenient position
--uninstallUninstall the script

Examples

Start in interactive mode in asm to opcode mode
shellnoob -i --to-opcode
Show help and usage information
shellnoob -h
Convert shellcode from INPUT format to OUTPUT format, supports stdin/stdout with -
shellnoob.py [--from-INPUT] (input_file_path | - ) [--to-OUTPUT] [output_file_path | - ]
Standalone interactive mode for asm/opcode conversion
shellnoob.py -i [--to-asm | --to-opcode ]
Resolve a constant value
shellnoob.py --get-const <const>
Resolve a syscall number
shellnoob.py --get-sysnum <sysnum>
Get error string for an errno
shellnoob.py --get-strerror <errno>
Patch executable file at offset with hex data
shellnoob.py --file-patch <exe_fp> <file_offset> <data>
Updated 2026-04-16kali.org ↗