offensive-shellcode

A reference for creating shellcode, which is small machine-code programs designed to run directly in memory during authorized security testing.

In plain words
What is it for?
Use it to write x86 or x64 shellcode, create position-independent code, build loaders, resolve Windows APIs, convert PE files to shellcode, and study ways to evade security scanners.
Why use it?
It organizes techniques for making code work across systems, avoid unwanted bytes, and be loaded or tested in controlled environments.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/snailsploit/claude-red/offensive-shellcode
Any agent
npx skills add SnailSploit/Claude-Red --skill offensive-shellcode
Clone the repo
git clone --depth 1 https://github.com/SnailSploit/Claude-Red

Made for: Claude Code, Codex.

Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,461 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00085 $0.05461
Opus 5 $0.00043 $0.02730
Sonnet 5 $0.00017 $0.01092
Haiku 4.5 $0.00009 $0.00546

Measured yesterday against content hash 3f6399baf95a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

offensive-shellcode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Skills/infrastructure/offensive-shellcode/SKILL.md · 476 lines

How it starts

The opening of the file, as written. The whole thing — 476 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Shellcode Development Workflow

  1. Define concept and target platform (x86/x64, Windows/Linux/macOS)
  2. Write assembly using position-independent techniques
  3. Extract binary and test in controlled environment
  4. Apply null byte avoidance and optimizations
  5. Encode/encrypt to evade static detection
  6. Package with loader and choose delivery method

Basic Concepts

Execution Pattern (Allocate-Write-Execute)

Avoid direct PAGE_EXECUTE_READWRITE — prefer:

  1. Allocate with PAGE_READWRITE
  2. Write shellcode to allocated region
  3. Call VirtualProtect to switch to PAGE_EXECUTE_READ
char *dest = VirtualAlloc(NULL, 0x1234, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
memcpy(dest, shellcode, 0x1234);
VirtualProtect(dest, 0x1234, PAGE_EXECUTE_READ, &old);
((void(*)())dest)();

Position-Independent Code (PIC) Techniques

Method Platform Notes
Call/Pop Windows Push next addr, pop into register
FPU state Windows fstenv saves instruction pointer
SEH Windows Exception handler stores EIP
GOT Linux Global Offset Table
VDSO Linux Kernel-provided shared object

Windows API Resolution (PEB Walk)

Identifying kernel32.dll without imports:

  1. Get PEB via gs:[0x60] (x64) or fs:[0x30] (x86)
  2. Walk PEB->Ldr.InMemoryOrderModuleList — order: exe → ntdll → kernel32
  3. Hash-compare module names to locate kernel32
  4. Parse the Export Address Table (EAT)
  5. Find GetProcAddress by name hash, then resolve LoadLibraryA
  6. Use LoadLibraryA to load WS2_32.dll, resolve Winsock functions

WinDbg helpers for debugging PEB walk:

dt nt!_TEB -y ProcessEnvironmentBlock @$teb
dt nt!_PEB -y Ldr <peb_addr>
dt -r _PEB_LDR_DATA <ldr_addr>
dt _LDR_DATA_TABLE_ENTRY (<init_flink_addr> - 0x10)
lm m kernel32   # verify base address
r @r8           # check register

Shellcode Loaders

Loader Responsibilities

  • Environment verification / keying (sandbox detection)
  • Shellcode decryption
  • Safe memory allocation and injection
  • Ends its duties after injecting

Read the full file on GitHub · 476 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 476 lines · 85 tokens per session scan A 3f6399baf95a

Subscribe to this mod's changes

offensive-shellcode is a skill published in the GitHub repository SnailSploit/Claude-Red (3,000 stars, last pushed 2d ago), licensed MIT. It adds 85 tokens to every session and 5,461 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

app-store-opportunity-research

Full-pipeline iOS App Store opportunity research. Discovers underserved niches, analyzes competitor gaps, estimates revenue, produces scored top-3 opportunity reports, and writes MVP PRDs — all through browser and web research. Use when the user wants to find profitable iOS app ideas, research App Store charts…

robertguss/claude-code-toolkit · 130 tokens

code-documenter

Expert documentation generator for coding projects. Analyzes codebases to create thorough, comprehensive documentation for developers and users. Supports incremental updates, multi-audience documentation, architecture decision records, and documentation health tracking. Works with any project type (APIs, CLIs, web…

robertguss/claude-code-toolkit · 87 tokens

ghost-writer

Produce first drafts that match a writer's authentic voice using their Voice DNA Document. Consumes DNA documents from writing-dna-discovery skill. Generates 2 meaningfully different drafts with headlines, confidence assessment, decision notes, and DNA refinement suggestions. Collaborative partner that evaluates…

robertguss/claude-code-toolkit · 77 tokens

app-store-listing-optimizer

Optimize iOS App Store and Google Play Store listings for maximum discoverability and conversion. Perform competitive keyword research, craft keyword-optimized titles/subtitles/descriptions, design screenshot sequences, and generate A/B test variants. Use when the user has a built app and needs to write or improve…

robertguss/claude-code-toolkit · 137 tokens

paywall-pricing-optimizer

Design effective paywalls, structure subscription tiers, and optimize pricing for mobile apps. Covers monetization model selection, paywall screen design, pricing psychology, A/B testing strategy, and RevenueCat/StoreKit/Google Billing integration. Use when the user wants to monetize an app, design a paywall, choose…

robertguss/claude-code-toolkit · 143 tokens

writing-orchestration

This skill should be used when orchestrating complex writing workflows with multiple phases. It provides two-agent orchestration patterns, the two-gate content readiness assessment, 10 baseline writing strategies, 20+ situational strategies, and quality checkpoints. Inspired by the Spiral Writing System.

robertguss/claude-code-toolkit · 60 tokens