offensive-shellcode

offensive-shellcode is a skill for Claude Code, Codex from Miosa-osa/OSA. It costs 85 tokens per session (5,760 once invoked), scanned A, a copy of offensive-shellcode, Apache-2.0.

A reference for developing shellcode, small machine-code programs used after exploiting a system. It focuses on x86 and x64 code, position-independent code, loaders, and ways attackers try to avoid detection.

In plain words
What is it for?
It is for researching custom shellcode, position-independent code, loaders, null-byte avoidance, API hashing, encoders, and converting portable executable files to shellcode.
Why use it?
It brings together common implementation concerns when studying or testing payload execution and security-tool detection. Use it only in authorized security research.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for researching custom shellcode, position-independent code, loaders, null-byte avoidance, API hashing, encoders, and converting portable executable files to shellcode.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miosa-osa/osa/offensive-shellcode
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.

Any agent
npx skills add Miosa-osa/OSA --skill offensive-shellcode
Clone the repo
git clone --depth 1 https://github.com/Miosa-osa/OSA

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for offensive-shellcode

README.md
[![agentmods](https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-shellcode/github.svg)](https://agentmods.dev/skills/miosa-osa/osa/offensive-shellcode)
Your own site
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-shellcode"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-shellcode/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for offensive-shellcode

Your own site · 80×15
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-shellcode"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-shellcode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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,760 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod 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.1 $0.00085 $0.05760
Opus 5.5 $0.00034 $0.02304
Sonnet 5.5 $0.00017 $0.01152
Haiku 4.5 $0.00009 $0.00576

Measured 1mo ago against content hash d41fd761f24c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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.

Origin

This is a copy

89% identical to offensive-shellcode — 40 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

priv/skills/offensive-shellcode/SKILL.md · 516 lines

How it starts

The opening of the file, as written. The whole thing — 516 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 · 516 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. 1mo ago First seen · 516 lines · 85 tokens per session scan A d41fd761f24c

Subscribe to this mod's changes

offensive-shellcode is a skill published in the GitHub repository Miosa-osa/OSA (78 stars, last pushed 9d ago), licensed Apache-2.0. It adds 85 tokens to every session and 5,760 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 89% identical to offensive-shellcode, differing in 40 lines, and is treated as a copy.