मुख्य सामग्री पर जाएँ
Skillpedia
सिक्योरिटी10k · #11960

offensive-shellcode

यह क्या करती है

यह स्किल x86 और x64 सिस्टम के लिए निम्न-स्तरीय shellcode लिखने का संदर्भ है, जिसमें position-independent कोड और loaders शामिल हैं। यह अधिकृत परियोजनाओं पर काम करने वाले सुरक्षा शोधकर्ताओं और exploit डेवलपरों के लिए है।

कब इस्तेमाल करें

  • ✓जब आप x86 या x64 सिस्टम पर अधिकृत exploit विकास शोध कर रहे हों।
  • ✓जब आपको सुरक्षा शोध परियोजना के लिए position-independent कोड समझना हो।
  • ✓जब आप रक्षात्मक विश्लेषण के लिए loaders और staged payloads की कार्यप्रणाली पढ़ रहे हों।

Skill का लिंक

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/infrastructure/offensive-shellcode/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/infrastructure/offensive-shellcode/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“हमारी अधिकृत सुरक्षा शोध लैब के लिए बताइए कि x64 Windows पर position-independent कोड कैसे काम करता है।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल लक्ष्य प्लेटफ़ॉर्म तय करने से लेकर नियंत्रित वातावरण में position-independent assembly लिखने और परखने तक का वर्कफ़्लो बताती है। वह Windows पर memory संभालने की बुनियादी अवधारणाएँ भी कवर करती है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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

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 sc
अक्सर पूछे जाने वाले सवाल

यह कौन से प्लेटफ़ॉर्म कवर करती है?

यह x86 और x64 पर Windows, Linux और macOS कवर करती है।

क्या यह लैब में उपयोग के लिए है?

स्किल नियंत्रित वातावरण में अधिकृत परीक्षण मानकर चलती है।

क्या यह फ़ाइलों को बदलने के बारे में बताती है?

हाँ। यह शोध के लिए PE फ़ाइलों को 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.

repo: SnailSploit/Claude-Red

लोकप्रियता

GitHub स्टार
10k
रैंकिंग में स्थान
#11960
लाइसेंस
MIT
अपडेट की गई
12/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

offensive-active-directory

10k

आपके एजेंट को अधिकृत Active Directory सुरक्षा परीक्षण की योजना बनाने में मदद करती है, नेटवर्क मैपिंग से लेकर Domain Admin तक के हमला रास्ते खोजने तक।

कोडिंगसिक्योरिटी

offensive-netexec

10k

आपके एजेंट को अधिकृत नेटवर्क परीक्षण के लिए NetExec (nxc) टूल इस्तेमाल करने में मदद करती है, जिसमें प्रोटोकॉल, प्रमाणीकरण और credential जाँच शामिल हैं।

कोडिंगसिक्योरिटी

offensive-api-abuse

10k

आपके एजेंट को अधिकृत API सुरक्षा परीक्षण की योजना बनाने में मदद करती है, जो business logic के दुरुपयोग, GraphQL जोखिम और race conditions खोजते हैं।

कोडिंगसिक्योरिटी

offensive-api-security

10k

आपके एजेंट को OWASP API Top 10 के आधार पर REST, gRPC और WebSocket API पर अधिकृत सुरक्षा परीक्षण चलाने में मदद करती है।

कोडिंगसिक्योरिटी

मिलती-जुलती skills