
Sickle - Payload Development Kit

Sickle एक उपकरण है जिसे मैंने मूल रूप से शेलकोड को विकसित करने और समझने में अधिक प्रभावी होने में मदद करने के लिए विकसित किया था। हालांकि, इसके विकास और उपयोग के दौरान यह एक पेलोड विकास किट में विकसित हो गया है। हालांकि वर्तमान मॉड्यूल अधिकतर असेंबली की ओर लक्षित हैं, यह उपकरण शेलकोड तक सीमित नहीं है।
वर्तमान में Sickle निम्नलिखित में सहायता कर सकता है।
Sickle Keystone Engine के माध्यम से शेलकोड जनरेशन का समर्थन करता है। यह एक नई जोड़ी गई सुविधा होने के कारण, पेलोड समर्थन सीमित है। हालांकि, लक्ष्य प्रत्येक आर्किटेक्चर और प्लेटफॉर्म के लिए एक बुनियादी रिवर्स शेल जोड़ना है।

Sickle में एक "डिफिंग" मॉड्यूल शामिल है जो शुरू में शेलकोड स्टब्स के विश्लेषण के लिए डिज़ाइन किया गया था। मूल "asm" मोड असेंबली भाषा और ऑपकोड स्तरों पर अलग-अलग रैखिक डिसअसेंबली अंतर करता है।

इसके अलावा, Sickle डिफ (अंतर) करने के लिए विभिन्न मोड प्रदान करता है, जो इसे शेलकोड विकास से परे भी उपयोगी बनाता है।

एक सामान्य कार्य जो आप अक्सर कर सकते हैं, वह है अपने शेलकोड का परीक्षण करना। इस प्रक्रिया में आमतौर पर निम्नलिखित चरण शामिल होते हैं:
हालांकि ये चरण मामूली लग सकते हैं, लेकिन जब बार-बार किए जाते हैं तो ये समय लेने वाले हो सकते हैं। Sickle शेलकोड को त्वरित परीक्षण के लिए स्वचालित रूप से लपेटकर प्रक्रिया को सरल बनाता है, और "run" मॉड्यूल वर्तमान में विंडोज और यूनिक्स दोनों प्रणालियों का समर्थन करता है।

Sickle एक बाइनरी फ़ाइल को निकाले गए ऑपकोड (शेलकोड) में भी परिवर्तित कर सकता है और फिर उन्हें मशीन निर्देशों (असेंबली) में अनुवादित कर सकता है। ध्यान दें कि यह प्रक्रिया केवल कच्ची बाइनरी फ़ाइलों के साथ काम करती है और वर्तमान में Capstone के माध्यम से रैखिक तरीके से डिसअसेंबली करती है।

ऊपर दिखाए गए उदाहरण में, "disassemble" मॉड्यूल स्टीफन फ्यूअर द्वारा डिज़ाइन किए गए एक रिवर्स शेल को असेंबली में डिसअसेंबल करता है।
शेलकोड निष्कर्षण Sickle के लिए पहला मॉड्यूल, या यूँ कहें कि मूल कार्यक्षमता थी, क्योंकि उपयोग किए गए रैपर के आधार पर ऑपकोड की व्याख्या अलग-अलग होती है। उदाहरण के लिए, जावास्क्रिप्ट, शेलकोड को उसी तरह से संग्रहीत और व्याख्या नहीं करता जैसे C प्रोग्राम करेगा।

शायद इसके लिए सबसे बड़ी प्रेरणा msfvenom थी।
हालांकि 64-बिट एक्सप्लॉइट्स में कम आम, ऐसे उदाहरण हो सकते हैं जहां एक एक्सप्लॉइट कुछ वर्णों के उपयोग को प्रतिबंधित करता है। यह वह जगह है जहां "pinpoint" मॉड्यूल उत्कृष्ट है, क्योंकि यह सीधे उन असेंबली निर्देशों की पहचान करता है और उन्हें हाइलाइट करता है जो पहचाने गए खराब वर्ण (वर्णों) के लिए जिम्मेदार हैं।

मूल रूप से, यह उपकरण एक एकल बड़ी स्क्रिप्ट के रूप में शुरू हुआ था। हालांकि, जैसे-जैसे यह विकसित हुआ, मुझे प्रत्येक अद्यतन के साथ कोड को फिर से सीखने की आवश्यकता महसूस हुई। इस समस्या का समाधान करने के लिए, Sickle अब एक मॉड्यूलर दृष्टिकोण का पालन करता है, जिससे उपकरण के डिज़ाइन को फिर से सीखने में न्यूनतम समय बिताकर नई कार्यक्षमता जोड़ी जा सके।
$ sickle-pdk -l
Shellcode Ring Description
--------- ---- -----------
windows/x64/virtualalloc_exec_tcp 3 A lightweight stager that connects to a handler via TCP over IPv4 to receive and execute shellcode
windows/x64/egghunter 3 Egghunter based on Hell's Gate and NtProtectVirtualMemory
windows/x64/virtualalloc_exec_https 3 A lightweight stager that connects to a handler over HTTPS to receive and execute shellcode
windows/x64/exec 3 Executes a command on the target host
windows/x64/reflective_pe_loader 3 Stageless Reflective PE Loader that takes an x64 binary and executes it in memory
windows/x64/shell_reverse_tcp 3 Reverse Shell via TCP over IPv4 that provides an interactive cmd.exe session
windows/aarch64/shell_reverse_tcp 3 Reverse Shell via TCP over IPv4 that provides an interactive cmd.exe session
windows/x86/shell_reverse_tcp 3 Reverse shell via TCP over IPv4 that provides an interactive cmd.exe session
windows/x64/kernel_token_stealer 0 Token stealing shellcode for privilege escalation
windows/x64/kernel_sysret 0 Generic method of returning from kernel space to user space
windows/x64/kernel_ace_edit 0 SID entry modifier for process injection
windows/x86/kernel_token_stealer 0 Token stealing shellcode for privilege escalation
linux/x64/memfd_reflective_elf_tcp 3 Staged Reflective ELF Loader via TCP over IPV4 which executes an ELF from a remote server
linux/aarch64/memfd_reflective_elf_tcp 3 Staged Reflective ELF Loader via TCP over IPv4 which executes an ELF from a remote server handler
linux/aarch64/shell_reverse_tcp 3 Reverse Shell via TCP over IPv4 that provides an interactive /bin/sh session
linux/x86/execve 3 Executes a shell session such as /bin/sh
linux/x86/shell_reverse_tcp 3 Reverse shell via TCP over IPV4 that provides an interactive /bin/sh session
Architectures
-------------
aarch64
x64
x86
Modules Description
------- -----------
disassemble Simple linear disassembler for multiple architectures
handler Module for handling payload distribution and session management
asm_shell Interactive assembler and disassembler
diff Bytecode diffing module for comparing two binaries (or shellcode)
pinpoint Highlights opcodes within a disassembly to identify instructions responsible for bad characters
run Wrapper used for executing bytecode (shellcode)
format Converts bytecode into a respective format (activated anytime '-f' is used)
badchar Produces a set of all potential invalid characters for validation purposes
Format Description
------ -----------
perl Format bytecode for Perl
python Format bytecode for Python
hex_space Format bytecode in hex, seperated by a space
nasm Format bytecode for NASM
java Format bytecode for Java
javascript Format bytecode for Javascript (Blob to send via XHR)
escaped Format bytecode for one-liner hex escape paste
rust Format bytecode for a Rust application
uint8array Format bytecode for Javascript as a Uint8Array directly
bash Format bytecode for bash script (UNIX)
powershell Format bytecode for Powershell
cs Format bytecode for C#
dword Format bytecode in dword
c Format bytecode for a C application
raw Format bytecode to be written to stdout in raw form
ruby Format bytecode for Ruby
num Format bytecode in num format
hex Format bytecode in hex
python3 Format bytecode for Python3
यह दृष्टिकोण प्रत्येक मॉड्यूल को अपनी कार्यक्षमता के लिए विस्तृत दस्तावेज़ीकरण उत्पन्न करने की क्षमता प्रदान करता है।
$ sickle-pdk -m run -i
Usage information for run
Name: Shellcode Runner
Module: run
Architecture: Multi
Platform: Multi
Ring: 3
Author(s):
wetw0rk
Tested against:
Linux
Windows
Module Description:
Executes bytecode from a binary file (-r) or a payload module (-p) under the context
of the currently running operating system and architecture. Meaning if you are
running on AARCH64 bytecode will be interpreted as such and if you're on x64 it will
interpret it as x64 respectively.
Example:
/usr/local/bin/sickle-pdk -m run -r shellcode
इस दृष्टिकोण में शेलकोड स्टब्स के लिए दस्तावेज़ीकरण भी शामिल है।
$ sickle-pdk -p windows/x64/egghunter -i
Usage information for windows/x64/egghunter
Name: Windows (x64) Hell's Gate based Egghunter
Module: windows/x64/egghunter
Architecture: x64
Platform: windows
Ring: 3
Author(s):
hvictor
Tested against:
Windows 11 (10.0.26100 N/A Build 26100)
Argument Information:
Name Description Optional
---- ----------- --------
TAG Egg (provide 4 bytes) yes
Module Description:
This egghunter iterates virtual memory addresses and before searching for the egg, it
performs a NtProtectVirtualMemory system call. This system call is similar to
VirtualProtect, and is parameterized to set the memory to be scanned to READ, WRITE,
EXECUTE. This way, when the egg is found, the shellcode after it is guaranteed to be
executable.
Example:
/usr/local/bin/sickle-pdk -p windows/x64/egghunter TAG=w00t