
पोस्ट-एक्सप्लॉइटेशन क्रेडेंशियल हार्वेस्टिंग टूलकिट जो पासवर्ड मैनेजरों और विंडोज उपयोगिताओं में इंजेक्ट करता है, DLL प्रॉक्सीइंग, COM हाइजैकिंग और AppDomainManager इंजेक्शन के माध्यम से क्रेडेंशियल्स कैप्चर करने के लिए।
ThievingFox विभिन्न पासवर्ड मैनेजरों और विंडोज़ उपयोगिताओं से क्रेडेंशियल्स एकत्र करने के लिए पोस्ट-एक्सप्लॉइटेशन टूल्स का एक संग्रह है। प्रत्येक मॉड्यूल लक्ष्य प्रक्रिया में इंजेक्ट करने के लिए एक विशिष्ट विधि का उपयोग करता है, और फिर क्रेडेंशियल्स एकत्र करने के लिए आंतरिक फ़ंक्शन को हुक करता है।
संबंधित ब्लॉग पोस्ट यहाँ पाई जा सकती है।
Rustup स्थापित होना चाहिए, यहाँ उपलब्ध निर्देशों का पालन करें : https://rustup.rs/
mingw-w64 पैकेज स्थापित होना चाहिए। Debian पर, यह इस प्रकार किया जा सकता है :
apt install mingw-w64
Rust के लिए x86 और x86_64 दोनों विंडोज़ लक्ष्य स्थापित होने चाहिए:
rustup target add x86_64-pc-windows-gnu
rustup target add i686-pc-windows-gnu
Mono और Nuget भी स्थापित होने चाहिए, निर्देश यहाँ उपलब्ध हैं : https://www.mono-project.com/download/stable/#download-lin
Mono रिपॉजिटरी जोड़ने के बाद, Nuget को apt का उपयोग करके स्थापित किया जा सकता है :
apt install nuget
अंत में, python निर्भरताएँ स्थापित की जानी चाहिए :
pip install -r client/requirements.txt
ThievingFox python >= 3.11 के साथ काम करता है।
Rustup स्थापित होना चाहिए, यहाँ उपलब्ध निर्देशों का पालन करें : https://rustup.rs/
Rust के लिए x86 और x86_64 दोनों विंडोज़ लक्ष्य स्थापित होने चाहिए:
rustup target add x86_64-pc-windows-msvc
rustup target add i686-pc-windows-msvc
.NET विकास वातावरण भी स्थापित होना चाहिए। Visual Studio से, Tools > Get Tools And Features > Install ".NET desktop development" पर जाएँ।
अंत में, python निर्भरताएँ स्थापित की जानी चाहिए :
pip install -r client/requirements.txt
ThievingFox python >= 3.11 के साथ काम करता है
नोट : विंडोज़ होस्ट पर, KeePass मॉड्यूल का उपयोग करने के लिए, msbuild PATH में उपलब्ध होना चाहिए। यह Visual Studio Developer PowerShell के अंदर से क्लाइंट चलाकर प्राप्त किया जा सकता है (Tools > Command Line > Developer PowerShell)
सभी मॉड्यूल का परीक्षण निम्नलिखित विंडोज़ संस्करणों पर किया गया है :
| Windows Version |
|---|
| Windows Server 2022 |
| Windows Server 2019 |
| Windows Server 2016 |
| Windows Server 2012R2 |
| Windows 10 |
| Windows 11 |
[!CAUTION] मॉड्यूल का अन्य संस्करणों पर परीक्षण नहीं किया गया है, और उनके काम नहीं करने की उम्मीद है।
[!CAUTION] हालाँकि मैंने यह सुनिश्चित करने का प्रयास किया कि ये उपकरण लक्षित अनुप्रयोगों की स्थिरता को प्रभावित न करें, इनलाइन हुकिंग और लाइब्रेरी इंजेक्शन असुरक्षित हैं और इसके परिणामस्वरूप क्रैश या एप्लिकेशन अस्थिर हो सकता है। यदि ऐसा होता है, तो लक्ष्य पर
cleanupमॉड्यूल का उपयोग करना यह सुनिश्चित करने के लिए पर्याप्त होना चाहिए कि अगली बार जब एप्लिकेशन लॉन्च किया जाए, तो कोई इंजेक्शन/हुकिंग न हो।
ThievingFox में 3 मुख्य मॉड्यूल हैं : poison, cleanup और collect।
कमांड लाइन पैरामीटर में निर्दिष्ट प्रत्येक एप्लिकेशन के लिए, poison मॉड्यूल उस मूल लाइब्रेरी को प्राप्त करता है जिसे हाईजैक किया जाना है (COM हाईजैकिंग और DLL प्रॉक्सीइंग के लिए), एक लाइब्रेरी संकलित करता है जो मूल DLL के गुणों से मेल खाती है, इसे सर्वर पर अपलोड करता है, और यदि आवश्यक हो तो COM हाईजैकिंग करने के लिए रजिस्ट्री को संशोधित करता है।
सभी लाइब्रेरी के संकलन की प्रक्रिया को गति देने के लिए, client/cache/ में एक कैश बनाए रखा जाता है।
--mstsc, --rdcman, और --mobaxterm में एक विशिष्ट विकल्प है, क्रमशः --mstsc-poison-hkcr, --rdcman-poison-hkcr, और --mobaxterm-poison-hkcr। यदि इनमें से कोई विकल्प निर्दिष्ट किया जाता है, तो COM हाईजैकिंग HKCR हाइव में रजिस्ट्री कुंजी को बदल देगा, जिसका अर्थ है कि सभी उपयोगकर्ता प्रभावित होंगे। डिफ़ॉल्ट रूप से, केवल वर्तमान में लॉग इन सभी उपयोगकर्ता प्रभावित होते हैं (सभी उपयोगकर्ता जिनके पास HKCU हाइव है)।
--keepass और --keepassxc में विशिष्ट विकल्प हैं, --keepass-path, --keepass-share, और --keepassxc-path, --keepassxc-share, यह निर्दिष्ट करने के लिए कि ये एप्लिकेशन कहाँ स्थापित हैं, यदि यह डिफ़ॉल्ट स्थापना पथ नहीं है। यह अन्य एप्लिकेशन के लिए आवश्यक नहीं है, क्योंकि COM हाईजैकिंग का उपयोग किया जाता है।
KeePass मॉड्यूल को लक्ष्य पर Visual C++ Redistributable स्थापित होने की आवश्यकता है।
एक साथ कई एप्लिकेशन निर्दिष्ट किए जा सकते हैं, या सभी एप्लिकेशन को लक्षित करने के लिए --all फ्लैग का उपयोग किया जा सकता है।
[!IMPORTANT] यदि आप कभी
--tempdirपैरामीटर बदलते हैं तो कैश को साफ करना याद रखें, क्योंकि निर्देशिका का नाम नेटिव DLL में एम्बेडेड होता है।
$ python3 client/ThievingFox.py poison -h
usage: ThievingFox.py poison [-h] [-hashes HASHES] [-aesKey AESKEY] [-k] [-dc-ip DC_IP] [-no-pass] [--tempdir TEMPDIR] [--keepass] [--keepass-path KEEPASS_PATH]
[--keepass-share KEEPASS_SHARE] [--keepassxc] [--keepassxc-path KEEPASSXC_PATH] [--keepassxc-share KEEPASSXC_SHARE] [--mstsc] [--mstsc-poison-hkcr]
[--consent] [--logonui] [--rdcman] [--rdcman-poison-hkcr] [--mobaxterm] [--mobaxterm-poison-hkcr] [--all]
target
positional arguments:
target Target machine or range [domain/]username[:password]@<IP or FQDN>[/CIDR]
options:
-h, --help show this help message and exit
-hashes HASHES, --hashes HASHES
LM:NT hash
-aesKey AESKEY, --aesKey AESKEY
AES key to use for Kerberos Authentication
-k Use kerberos authentication. For LogonUI, mstsc and consent modules, an anonymous NTLM authentication is performed, to retrieve the OS version.
-dc-ip DC_IP, --dc-ip DC_IP
IP Address of the domain controller
-no-pass, --no-pass Do not prompt for password
--tempdir TEMPDIR The name of the temporary directory to use for DLLs and output (Default: ThievingFox)
--keepass Try to poison KeePass.exe
--keepass-path KEEPASS_PATH
The path where KeePass is installed, without the share name (Default: /Program Files/KeePass Password Safe 2/)
--keepass-share KEEPASS_SHARE
The share on which KeePass is installed (Default: c$)
--keepassxc Try to poison KeePassXC.exe
--keepassxc-path KEEPASSXC_PATH
The path where KeePassXC is installed, without the share name (Default: /Program Files/KeePassXC/)
--keepassxc-share KEEPASSXC_SHARE
The share on which KeePassXC is installed (Default: c$)
--mstsc Try to poison mstsc.exe
--mstsc-poison-hkcr Instead of poisonning all currently logged in users' HKCU hives, poison the HKCR hive for mstsc, which will also work for user that are currently not
logged in (Default: False)
--consent Try to poison Consent.exe
--logonui Try to poison LogonUI.exe
--rdcman Try to poison RDCMan.exe
--rdcman-poison-hkcr Instead of poisonning all currently logged in users' HKCU hives, poison the HKCR hive for RDCMan, which will also work for user that are currently not
logged in (Default: False)
--mobaxterm Try to poison MobaXTerm.exe
--mobaxterm-poison-hkcr
Instead of poisonning all currently logged in users' HKCU hives, poison the HKCR hive for MobaXTerm, which will also work for user that are currently not
logged in (Default: False)
--all Try to poison all applications
कमांड लाइन पैरामीटर में निर्दिष्ट प्रत्येक एप्लिकेशन के लिए, cleanup पहले पॉइज़निंग आर्टिफैक्ट्स को हटाता है जो लक्ष्य एप्लिकेशन को हुकिंग लाइब्रेरी लोड करने के लिए बाध्य करते हैं। फिर, यह रिमोट होस्ट पर अपलोड की गई लाइब्रेरी को हटाने का प्रयास करता है।
जो एप्लिकेशन HKCU और HKCR दोनों हाइव के पॉइज़निंग का समर्थन करते हैं, दोनों को बिना शर्त साफ किया जाता है।
एक साथ कई एप्लिकेशन निर्दिष्ट किए जा सकते हैं, या सभी एप्लिकेशन को साफ करने के लिए --all फ्लैग का उपयोग किया जा सकता है।
यह रिमोट होस्ट पर निकाले गए क्रेडेंशियल्स को साफ नहीं करता है।
[!IMPORTANT] यदि
cleanupमॉड्यूल चलाते समय लक्षित एप्लिकेशन उपयोग में है, तो लक्ष्य पर छोड़े गए DLL को हटाया नहीं जा सकता। फिर भी,cleanupमॉड्यूल उस कॉन्फ़िगरेशन को वापस कर देगा जो इंजेक्शन को सक्षम करता है, जो यह सुनिश्चित करना चाहिए कि अगली बार जब एप्लिकेशन लॉन्च किया जाए, तो कोई इंजेक्शन नहीं किया जाता है। ThievingFox द्वारा हटाई न जा सकने वाली फ़ाइलों को लॉग किया जाता है।
$ python3 client/ThievingFox.py cleanup -h
usage: ThievingFox.py cleanup [-h] [-hashes HASHES] [-aesKey AESKEY] [-k] [-dc-ip DC_IP] [-no-pass] [--tempdir TEMPDIR] [--keepass] [--keepass-share KEEPASS_SHARE]
[--keepass-path KEEPASS_PATH] [--keepassxc] [--keepassxc-path KEEPASSXC_PATH] [--keepassxc-share KEEPASSXC_SHARE] [--mstsc] [--consent] [--logonui]
[--rdcman] [--mobaxterm] [--all]
target
positional arguments:
target Target machine or range [domain/]username[:password]@<IP or FQDN>[/CIDR]
options:
-h, --help show this help message and exit
-hashes HASHES, --hashes HASHES
LM:NT hash
-aesKey AESKEY, --aesKey AESKEY
AES key to use for Kerberos Authentication
-k Use kerberos authentication. For LogonUI, mstsc and consent modules, an anonymous NTLM authentication is performed, to retrieve the OS version.
-dc-ip DC_IP, --dc-ip DC_IP
IP Address of the domain controller
-no-pass, --no-pass Do not prompt for password
--tempdir TEMPDIR The name of the temporary directory to use for DLLs and output (Default: ThievingFox)
--keepass Try to cleanup all poisonning artifacts related to KeePass.exe
--keepass-share KEEPASS_SHARE
The share on which KeePass is installed (Default: c$)
--keepass-path KEEPASS_PATH
The path where KeePass is installed, without the share name (Default: /Program Files/KeePass Password Safe 2/)
--keepassxc Try to cleanup all poisonning artifacts related to KeePassXC.exe
--keepassxc-path KEEPASSXC_PATH
The path where KeePassXC is installed, without the share name (Default: /Program Files/KeePassXC/)
--keepassxc-share KEEPASSXC_SHARE
The share on which KeePassXC is installed (Default: c$)
--mstsc Try to cleanup all poisonning artifacts related to mstsc.exe
--consent Try to cleanup all poisonning artifacts related to Consent.exe
--logonui Try to cleanup all poisonning artifacts related to LogonUI.exe
--rdcman Try to cleanup all poisonning artifacts related to RDCMan.exe
--mobaxterm Try to cleanup all poisonning artifacts related to MobaXTerm.exe
--all Try to cleanup all poisonning artifacts related to all applications
कमांड लाइन पैरामीटर पर निर्दिष्ट प्रत्येक एप्लिकेशन के लिए, collect मॉड्यूल रिमोट होस्ट पर C:\Windows\Temp\<tempdir> के अंदर संग्रहीत एप्लिकेशन के अनुरूप आउटपुट फ़ाइलों को पुनर्प्राप्त करता है, और उन्हें डिक्रिप्ट करता है। फ़ाइलें रिमोट होस्ट से हटा दी जाती हैं, और प्राप्त डेटा client/ouput/ में संग्रहीत किया जाता है।
एक साथ कई एप्लिकेशन निर्दिष्ट किए जा सकते हैं, या सभी एप्लिकेशन से लॉग एकत्र करने के लिए --all फ्लैग का उपयोग किया जा सकता है।
$ python3 client/ThievingFox.py collect -h
usage: ThievingFox.py collect [-h] [-hashes HASHES] [-aesKey AESKEY] [-k] [-dc-ip DC_IP] [-no-pass] [--tempdir TEMPDIR] [--keepass] [--keepassxc] [--mstsc] [--consent]
[--logonui] [--rdcman] [--mobaxterm] [--all]
target
positional arguments:
target Target machine or range [domain/]username[:password]@<IP or FQDN>[/CIDR]
options:
-h, --help show this help message and exit
-hashes HASHES, --hashes HASHES
LM:NT hash
-aesKey AESKEY, --aesKey AESKEY
AES key to use for Kerberos Authentication
-k Use kerberos authentication. For LogonUI, mstsc and consent modules, an anonymous NTLM authentication is performed, to retrieve the OS version.
-dc-ip DC_IP, --dc-ip DC_IP
IP Address of the domain controller
-no-pass, --no-pass Do not prompt for password
--tempdir TEMPDIR The name of the temporary directory to use for DLLs and output (Default: ThievingFox)
--keepass Collect KeePass.exe logs
--keepassxc Collect KeePassXC.exe logs
--mstsc Collect mstsc.exe logs
--consent Collect Consent.exe logs
--logonui Collect LogonUI.exe logs
--rdcman Collect RDCMan.exe logs
--mobaxterm Collect MobaXTerm.exe logs
--all Collect logs from all applications
| Application | Injection Method |
|---|
| KeePass.exe | AppDomainManager Injection |
| KeePassXC.exe | DLL Proxying |
| LogonUI.exe (Windows Login Screen) | COM Hijacking |
| consent.exe (Windows UAC Popup) | COM Hijacking |
| mstsc.exe (Windows default RDP client) | COM Hijacking |
| RDCMan.exe (Sysinternals' RDP client) | COM Hijacking |
| MobaXTerm.exe (3rd party RDP client) | COM Hijacking |