
SysWhispers2 का C# पोर्टिंग। यह सिस्टम कॉल स्टब को निष्पादित करने के लिए कोड गुफाओं (code caves) को खोजने हेतु SharpASM का उपयोग करता है।

C# में SysWhispers2 का पोर्टिंग।
यह सिस्टम कॉल स्टब को निष्पादित करने के लिए कोड केव्स खोजने हेतु SharpASM का उपयोग करता है।
तकनीकी विवरण के लिए ब्लॉग पोस्ट पढ़ें: https://www.secforce.com/blog/sharpasm-sharpwhispers/
______ _ ____ _
/ __/ / ___ ________| | /| / / / (_)__ ___ ___ _______
_\ \/ _ \/ _ `/ __/ _ \ |/ |/ / _ \/ (_-</ _ \/ -_) __(_-<
/___/_//_/\_,_/_/ / .__/__/|__/_//_/_/___/ .__/\__/_/ /___/
/_/ /_/
@d_glenx
@SECFORCE_LTD
=============================================================
usage: SharpWhispers.py [-h] [-p PRESET] [-f FUNCTIONS] -o OUT_FILE
optional arguments:
-h, --help show this help message and exit
-p PRESET, --preset PRESET
Preset ("all", "common", "dinvoke")
-f FUNCTIONS, --functions FUNCTIONS
Comma-separated functions
-o OUT_FILE, --out-file OUT_FILE
Output basename (w/o extension)
Visual Studio प्रोजेक्ट बनाने के निर्देश यहाँ दिए गए हैं।
एक बुनियादी प्रोसेस इंजेक्शन उदाहरण यहाँ दिया गया है।
इस समय json फ़ाइलों में 33 सिस्टम कॉल उत्पन्न करने का डेटा होता है।
नोट: All प्रीसेट में सभी सिस्टम कॉल्स का एक उपसमुच्चय होता है।
==== System Calls Imported ====
==[DInvoke]==
[i] Number of Delegates: 13
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtOpenProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtQueryVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtReadVirtualMemory
NtOpenFile
==[Additional]==
[i] Number of Delegates: 20
NtOpenThread
NtQueueApcThread
NtOpenSection
NtSuspendThread
NtQueryInformationFile
NtSetContextThread
NtResumeProcess
NtOpenProcessToken
NtWaitForMultipleObjects
NtQueryDirectoryFile
NtAdjustPrivilegesToken
NtQuerySystemInformation
NtDeviceIoControlFile
NtResumeThread
NtCreateProcess
NtSuspendProcess
NtGetContextThread
NtClose
NtQueryInformationThread
NtTestAlert
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtOpenFile
NtReadVirtualMemory
NtQueryVirtualMemory
NtOpenProcess
NtCreateThreadEx
NtCreateSection
NtUnmapViewOfSection
NtMapViewOfSection
NtQueryInformationProcess
NtOpenProcess
NtAllocateVirtualMemory
NtFreeVirtualMemory
NtQueryVirtualMemory
NtProtectVirtualMemory
NtWriteVirtualMemory
NtReadVirtualMemory
NtOpenFile
गतिशील रूप से उत्पन्न
उत्पन्न किए जाने वाले सिस्टम कॉल्स के डेलीगेट्स शामिल हैं।
SharpASM पर निर्भर करता है
ASM का उपयोग करके PEB का पता प्राप्त करने में सहायक।
इसमें c# में ASM को गतिशील रूप से कॉल करने का कोड होता है।
फ़ंक्शन public static IntPtr callASM(byte[] stub) का उपयोग बाइट ऐरे पास करके शेलकोड को कॉल करने के लिए किया जा सकता है।
गतिशील रूप से उत्पन्न - स्क्रिप्ट सिस्टम कॉल नामों को हैश करने के लिए एक यादृच्छिक सीड उत्पन्न करती है
इसमें ElephantSe4l की तकनीक का उपयोग करके सिस्टम कॉल नंबर प्राप्त करने का कोड शामिल है (SysWhispers2 से पोर्ट किया गया कोड)।
SharpASM पर निर्भर करता है
इसमें ASM का उपयोग करके सिस्टम कॉल्स को गतिशील रूप से निष्पादित करने का कोड होता है।
इसमें सिस्टम कॉल्स के लिए रैपर भी शामिल हैं (जैसे Syscall.NtAllocateVirtualMemory) (गतिशील रूप से उत्पन्न)
गतिशील रूप से उत्पन्न
SharpWhispers आउटपुट फ़ाइलों का उपयोग सीधे C# प्रोजेक्ट में किया जा सकता है। आवश्यक डेटा प्रकार, DInvoke प्रोजेक्ट में परिभाषित डेटा प्रकारों का एक उपसमुच्चय हैं (कुछ डेटा प्रकार वास्तव में Rastamouse के न्यूनतम प्रोजेक्ट से लिए गए हैं) ताकि डिटेक्शन सतह को कम किया जा सके। डेटा प्रकार SharpWhisper.Data नेमस्पेस में परिभाषित किए गए हैं ताकि DInvoke की परिभाषाओं के साथ ओवरलैपिंग से बचा जा सके।
नोट: डेटा प्रकार केवल आवश्यक होने पर ही उत्पन्न किए जाते हैं (अर्थात यदि किसी सिस्टम कॉल को डेटा प्रकार की आवश्यकता हो) ताकि डिटेक्शन सतह कम हो।
आवश्यक डेटा प्रकार उत्पन्न करने के लिए निम्नलिखित टेम्पलेट्स का उपयोग किया जाता है: