Skip to content

About

Bare-metal x86 shellcode execution & analysis environment in pure 16-bit Assembly. LBA 2-stage bootloader, modular TUI shell, 8 injectable payloads, sandbox layer with 4 enforcement policies, opcode scanning, IVT diffing & register integrity checks, 5 themes, 6 log filters, serial debug - all at ring 0, before any OS.

Topics

Resources

Stars

8 stars

Watchers

1 watching

Forks

Latest commit

 

History

121 Commits

Folders and files

Repository files navigation

Logo

ironshell-x86 – Bare-Metal Shellcode Sandbox

ironshell-x86 is a bare-metal x86 shellcode execution and analysis environment written entirely in 16-bit Assembly. It runs directly from a bootable disk image — no OS, no runtime, no libc. Just raw silicon.

Architecture Language Mode Sandbox Payloads Boot


[>>] Features

  • [+] 2-Stage Bootloader — Stage 1 MBR loads the loader via LBA Extended Read (AH=42h) with a 3-attempt retry mechanism. Stage 2 loads the core engine, sandbox, theme, and filter modules from disk.
  • [+] Modular Directory Structure — Code is strictly separated into boot/, config/, core/, lib/, and ui/ for maintainability and isolated testing.
  • [+] TUI Shell — Full interactive terminal UI with a dual-panel VGA layout, command history (↑↓), page scroll (PgUp/PgDn), and a live execution log.
  • [+] 8 Injectable Payloads — MSGBOX, MEMWALK, PORTPROBE, STACKSMASH, NXPROBE, CPUINFO, IVTDUMP, MEMMAP.
  • [+] Sandbox v2.1.7 — 4 enforcement policies, dynamic opcode scanning up to 512 bytes, CLI/STI protected IVT snapshot & auto-restore, and register integrity checks (SS, DS, ES, SP).
  • [+] Theme Engine — 5 color themes (COLOR, MONO, HACKER, RETRO, STEALTH) loaded as a standalone module at 0xB000, accessed via a stable API jump table.
  • [+] Log Filter System — 6 filter modes (ALL, INFO, WARN, ERROR, SUCCESS, ACCENT) loaded as a standalone module at 0xC000.
  • [+] Hardware Analysis — CPUID vendor/brand/feature detection, A20 gate test, E820 memory map, conventional memory sizing.
  • [+] Serial Debugging — Integrated COM1 output for printf-style debugging via QEMU's -serial stdio flag.
  • [+] Error Tracking — Typed error codes with descriptions, accessible via the errors command.
  • [+] Clean Build System — NASM + QEMU Makefile with GDB debug stub, ndisasm disassembly, and hard binary size validation for all 6 modules.

Schematic of the Working and Execution Logic

Scheme


[CD] Installation

1. Clone the repository

git clone https://github.com/tc4dy/ironshell-x86.git
cd ironshell-x86

2. Install dependencies

sudo apt install nasm qemu-system-x86

3. Build and run

make
make run

Usage

make              # Build all binaries and assemble disk image
make run          # Launch in QEMU (terminal/curses mode)
make run-sdl      # Launch in QEMU (SDL window)
make debug        # Launch with GDB stub on port :1234
make disasm       # Disassemble all binaries via ndisasm
make clean        # Remove all build artifacts
make check        # Verify required tools are installed

[-<] Shell Commands

Once booted in QEMU, the interactive shell accepts:

Command Description
list List all available payloads with index and risk flag
sel <n> [arg] Select a payload by index; optional runtime argument
run Execute the currently selected payload through the sandbox
sandbox Re-run all sandbox environment checks
dump <hex> Hexdump 32 bytes at a given memory address
info Display system memory layout and load addresses
clear Clear the execution log panel
theme <1-5> Apply a color theme
themes List all available color themes
filter <0-5> Set log output filter by color category
filters List all available filter modes
errors Display last error code and description
help Show full command reference

Tip: Use ↑ / ↓ arrow keys to navigate command history. Use PgUp / PgDn to scroll the execution log panel.


[-/] Payload Reference

# Name Description Risk
0 MSGBOX Writes a small MOV/RET stub at 0xA000 and executes it [+] Safe
1 MEMWALK Walks and dumps the BIOS Data Area (0x0400+) [+] Safe
2 PORTPROBE Samples 8 I/O ports starting at the given hex port (default 0x03F8) via IN [+] Safe
3 STACKSMASH Writes canary pattern to stack and verifies integrity [!] Caution
4 NXPROBE Tests NX/DEP enforcement by executing a RET stub at 0xA000 [+] Safe
5 CPUINFO Full CPUID enumeration — vendor, brand, stepping, SSE/AVX [+] Safe
6 IVTDUMP Dumps N Interrupt Vector Table entries; default 16 (INT 0–15) [+] Safe
7 MEMMAP Queries E820 system memory map via INT 15h; falls back to INT 12h [+] Safe

Payload arguments — use sel <n> <arg> before run:

Payload Argument Example
PORTPROBE Starting I/O port (hex) sel 2 03F8
STACKSMASH Canary depth (decimal, 1–16) sel 3 8
IVTDUMP Entry count (decimal, 1–256) sel 6 32

Theme System