shellcode-dev

Solid

Use when writing position-independent shellcode or a loader — PEB walking, API hashing, null-byte avoidance, encoders, loaders, PE-to-shellcode conversion, cross-platform shellcode

API & Backend 428 stars 77 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 92/100

Stars 20%
88
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Shellcode Development ## When to Activate - Writing custom x86/x64 shellcode - Implementing position-independent code (PIC) - Building shellcode loaders for implant delivery - Evading AV/EDR static detection - Converting PE files to shellcode - Cross-platform shellcode development ## Execution Pattern (Allocate-Write-Execute) Avoid direct `PAGE_EXECUTE_READWRITE` — prefer two-step: ```c // 1. Allocate with RW char *dest = VirtualAlloc(NULL, size, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); // 2. Write shellcode memcpy(dest, shellcode, size); // 3. Switch to RX (no write permission) VirtualProtect(dest, size, PAGE_EXECUTE_READ, &old); // 4. Execute ((void(*)())dest)(); ``` ## Position-Independent Code (PIC) | Method | Platform | Notes | |--------|----------|-------| | Call/Pop | Windows | Push next addr, pop into register | | FPU state (fstenv) | Windows | Saves instruction pointer | | SEH | Windows | Exception handler stores EIP | | RIP-relative | x64 | `lea rax, [rip+offset]` | | GOT | Linux | Global Offset Table | | VDSO | Linux | Kernel-provided shared object | ## Windows API Resolution (PEB Walk) ```nasm ; x64 PEB walk to find kernel32.dll base find_kernel32: xor rcx, rcx mov rax, gs:[rcx + 0x60] ; RAX = PEB mov rax, [rax + 0x18] ; RAX = PEB->Ldr mov rsi, [rax + 0x20] ; RSI = InMemoryOrderModuleList lodsq ; skip first entry (exe) xchg rax, rsi lodsq ; skip ntdll...

Details

Author
hypnguyen1209
Repository
hypnguyen1209/offensive-claude
Created
6 months ago
Last Updated
1 months ago
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Featured

offensive-shellcode

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.

11,367 Updated 5 days ago
SnailSploit
Data & Documents Listed

offensive-shellcode

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.

719 Updated 3 months ago
0xwilliamortiz
DevOps & Infrastructure Listed

detect-shellcode-injection

Detection and hunting methodology for shellcode injection and in-memory execution: CreateRemoteThread injection, PE and DLL injection, process hollowing, thread execution hijacking, APC injection, and reflective code loading (MITRE ATT&CK T1055 with .001 .002 .003 .004 .012 .008 .009, T1620, T1106). Keys off Windows endpoint telemetry: Sysmon EID 8, 10, 25, 7, and 1 / Security 4688, the Microsoft-Windows-Threat-Intelligence ETW provider, Microsoft Defender for Endpoint DeviceEvents, plus Linux ptrace and memfd signals. Gives the allocate-write-execute footprint, unbacked-memory signals, a memory-forensics hunt, and exploit-protection, application-control, and EDR hardening. Use when triaging a suspected process-injection or in-memory implant, hunting for CreateRemoteThread into unbacked memory or process hollowing, investigating RWX private memory, reviewing EDR injection alerts, or hardening a fleet against fileless execution.

0 Updated 1 weeks ago
umbrasec-labs