
MSI Dump - एक उपकरण जो दुर्भावनापूर्ण MSI इंस्टॉलेशन पैकेजों का विश्लेषण करता है, फ़ाइलों, स्ट्रीम, बाइनरी डेटा निकालता है और YARA स्कैनर को शामिल करता है।
msidumpMSI Dump - एक उपकरण जो दुर्भावनापूर्ण MSI इंस्टॉलेशन पैकेजों का विश्लेषण करता है, फ़ाइलें, स्ट्रीम, बाइनरी डेटा निकालता है और इसमें YARA स्कैनर शामिल है।
मैक्रो-सक्षम Office दस्तावेज़ों पर हम तुरंत oletools mraptor का उपयोग करके यह निर्धारित कर सकते हैं कि दस्तावेज़ दुर्भावनापूर्ण है या नहीं। यदि हम इसका और विस्तार से विश्लेषण करना चाहते हैं, तो हम oletools olevba या oledump का उपयोग कर सकते हैं।
दुर्भावनापूर्ण MSI फ़ाइलों का विश्लेषण करने के लिए, अब तक हमारे पास केवल एक ही था, लेकिन विश्वसनीय और भरोसेमंद lessmsi।
हालाँकि, lessmsi उन सुविधाओं को लागू नहीं करता है जिनकी मुझे तलाश थी:
इसलिए यहाँ msidump काम आता है।
यह उपकरण त्वरित ट्राइएज के साथ-साथ दुर्भावनापूर्ण MSI कॉर्पोरा की विस्तृत जाँच में मदद करता है। यह हमें इसकी अनुमति देता है:
file/MIME प्रकार अनुमान का उपयोग करता हैइसे एक ब्लॉग पोस्ट के सहयोगी उपकरण के रूप में बनाया गया था जिसे मैंने यहाँ जारी किया:
WindowsInstaller.Installer इंटरफेस पर इस उपकरण की भारी निर्भरता के कारण, वर्तमान में नेटिव Linux प्लेटफ़ॉर्म का समर्थन करना संभव नहीं है। हो सकता है wine python msidump.py मदद कर सके, लेकिन अभी तक इसका प्रयास नहीं किया गया है।cmd> python msidump.py evil.msi -y rules.yara

यहाँ हम देख सकते हैं कि इनपुट MSI में संदिग्ध VBScript इंजेक्ट किया गया है और इसमें कई निष्पादन योग्य फ़ाइलें मौजूद हैं।
हम ट्राइएज तालिका से देखते हैं कि यह Binary तालिका में मौजूद था। आइए इसे प्राप्त करें:
python msidump.py putty-backdoored.msi -l binary -i UBXtHArj
हम निर्दिष्ट कर सकते हैं कि किस रिकॉर्ड को डंप करना है, या तो उसके नाम/ID से या उसके इंडेक्स नंबर से (यहाँ वह 7 होगा)।

आइए एक और उदाहरण देखें। इस बार Binary तालिका में एक निष्पादन योग्य फ़ाइल संग्रहीत है जो इंस्टॉलेशन के दौरान निष्पादित की जाएगी:

उस फ़ाइल को निकालने के लिए हम इसका उपयोग करेंगे:
python msidump.py evil2.msi -x binary -i lmskBju -O extracted
जहाँ:
-x binary Binary तालिका की सामग्री निकालने के लिए कहता है-i lmskBju निर्दिष्ट करता है कि कौन सा रिकॉर्ड निकालना है-O extracted आउटपुट निर्देशिका सेट करता है
सर्वोत्तम आउटपुट अनुभव के लिए, अधिकतम कंसोल विंडो पर टूल चलाएँ या आउटपुट को फ़ाइल में रीडायरेक्ट करें:
python msidump.py [...] -o analysis.log
PS D:\> python .\msidump.py --help
options:
-h, --help show this help message and exit
Required arguments:
infile Input MSI file (or directory) for analysis.
Options:
-q, --quiet Surpress banner and unnecessary information. In triage mode, will display only verdict.
-v, --verbose Verbose mode.
-d, --debug Debug mode.
-N, --nocolor Dont use colors in text output.
-n PRINT_LEN, --print-len PRINT_LEN
When previewing data - how many bytes to include in preview/hexdump. Default: 128
-f {text,json,csv}, --format {text,json,csv}
Output format: text, json, csv. Default: text
-o path, --outfile path
Redirect program output to this file.
-m, --mime When sniffing inner data type, report MIME types
Analysis Modes:
-l what, --list what List specific table contents. See help message to learn what can be listed.
-x what, --extract what
Extract data from MSI. For what can be extracted, refer to help message.
Analysis Specific options:
-i number|name, --record number|name
Can be a number or name. In --list mode, specifies which record to dump/display entirely. In --extract mode dumps only this particular record to --outdir
-O path, --outdir path
When --extract mode is used, specifies output location where to extract data.
-y path, --yara path Path to YARA rule/directory with rules. YARA will be matched against Binary data, streams and inner files
------------------------------------------------------
- What can be listed:
--list CustomAction - Specific table
--list Registry,File - List multiple tables
--list stats - Print MSI database statistics
--list all - All tables and their contents
--list olestream - Prints all OLE streams & storages.
To display CABs embedded in MSI try: --list _Streams
--list cabs - Lists embedded CAB files
--list binary - Lists binary data embedded in MSI for its own purposes.
That typically includes EXEs, DLLs, VBS/JS scripts, etc
- What can be extracted:
--extract all - Extracts Binary data, all files from CABs, scripts from CustomActions
--extract binary - Extracts Binary data
--extract files - Extracts files
--extract cabs - Extracts cabinets
--extract scripts - Extracts scripts
------------------------------------------------------
CustomAction Type का मिलान करता है, जिससे बचा जा सकता है।
जाहिर है, जब मैं अपने उपकरण का नाम रख रहा था, तो मैंने यह जाँचने के बारे में नहीं सोचा कि क्या यह पहले से लिया गया है।
एक और उपकरण है जिसका नाम msidump है जो msitools GNU पैकेज का हिस्सा है:
यह और अन्य प्रोजेक्ट नींद हराम रातों और बहुत सारी मेहनत का परिणाम हैं। यदि आपको मेरा काम पसंद है और आप सराहना करते हैं कि मैं हमेशा समुदाय को कुछ न कुछ वापस देता हूँ, मेरे लिए एक कॉफी खरीदने पर विचार करें (या बेहतर एक बियर) बस धन्यवाद कहने के लिए! 💪
Mariusz Banach / mgeeky, (@mariuszbit)
<mb [at] binary-offensive.com>