How perikiyoxd/grindoreiro works
Project type and purpose
• This is an open‑source collection of Python CLI utilities for unpacking and analyzing “Grandoreiro” malware samples (ZIPs containing .MSI, .GIF, .DLLs, ISOs).
• Key features:
• grindoreiro.py: orchestrates ZIP extraction & MSI decompilation via WiX Toolset
• isoabduct.py: locates and decodes embedded ISO footprints
• stringripper.py: extracts UTF‑8/UTF‑16 strings from binaries
File structure
• Top‑level scripts (grindoreiro.py, isoabduct.py, stringripper.py) each implement a standalone CLI utility.
• requirements.txt declares Python deps (e.g., pefile, zipfile, click)
• README.md outlines workflow, prerequisites (WiX dark.exe under tools/wix/) and sample layout (samples/<sha256>/…)
• No formal src/ or tests/ directories—this is a small toolset rather than a layered application
README insights
• Workflow:
a) User runs grindoreiro.py on .ZIP → extracts MSI & ICO
b) grindoreiro.py invokes dark.exe (WiX Toolset) to decompile MSI → generates XML & payload folders
c) isoabduct.py scans decompiled artifacts for ISO references → optionally decodes ISOs
d) stringripper.py pulls out DLL string sections to reveal C&C URLs
• External dependency: WiX Toolset CLI (dark.exe) must be installed under tools/wix
a. Main components:
• User CLI Interface
• grindoreiro.py utility
• isoabduct.py utility
• stringripper.py utility
• External Service: WiX Toolset (dark.exe)
• File System:
– Input folder: samples/<sha256>/
– Output folder(s): extracted/, decompiled/, iso_output/, string_output/
b. Relationships & interactions:
• User invokes grindoreiro.py → reads ZIP from samples/ → writes extracted MSI, ICO → calls dark.exe → writes decompiled files
• User may invoke isoabduct.py on decompiled output → generates ISO images in iso_output/
• User may invoke stringripper.py on any binary (DLL, EXE) → writes strings to string_output/
c. Architectural patterns/principles:
• Single Responsibility per script (each tool does one phase)
• Modular chaining: output of one phase serves as input to next
• External tool integration via subprocess calls
d. Key technologies/frameworks:
• Python standard library (zipfile, subprocess)
• pefile or similar for binary parsing
• WiX Toolset (dark.exe) for MSI decompilation
Detailed capture of essential elements
• Don’t just show scripts: break down grindoreiro.py into sub‑activities (ZIP unpack, MSI extract, call to dark.exe)
• Optional flows (user may skip MSI decomp and run stringripper.py directly on DLLs)
• Folder conventions (samples/<sha256>/, tools/wix/dark.exe path)