home.social

#malchela — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #malchela, aggregated by home.social.

  1. Unmasking the Moon: Comparing LunaStealer Samples with MalChela and Claude

    As one tends to do on Saturday mornings with coffee in hand, I was reviewing two samples that were attributed to the LunaStealer / LunaGrabber family. Originally I was validating that tiquery was working with the MCP configuration, however what started as a quick TI check turned into a full static analysis session — and it gave me a good opportunity to put the MalChela MCP integration through its paces in a real workflow. This post walks through how that investigation unfolded, what the pivot points were, and what we found at the bottom of the rabbit hole.

    The Setup

    If you haven’t seen the MalChela MCP plugin before, the short version is this: MalChela is a Rust-based malware analysis toolkit I’ve been building for a while — tools like tiqueryfileanalyzermstrings, and others. The MCP server exposes all of those tools to Claude Desktop natively, so instead of dropping to the terminal for every command, I can run analysis steps conversationally and let Claude help interpret the results and suggest next moves.

    This is not replacing the terminal — it’s augmenting it. The pivot decisions still come from the analyst. But having a reasoning layer that can look at mstrings output and say “that SetDllDirectoryW + GetTempPathW combination is staging behavior, and here’s the ATT&CK mapping” is genuinely useful when you’re moving fast.

    Both samples were sitting in a folder on my Desktop. I had SHA-256 hashes. Let’s go.

    Phase 1: Threat Intelligence Query

    First move is always TI. The MalChela tiquery tool hits MalwareBazaar, VirusTotal, Hybrid Analysis, MetaDefender, and Triage simultaneously and returns a combined results matrix. Two calls, two answers.

    Sample 1 (4f3b8971...) came back confirmed LunaStealer across all five sources. First seen 2025-12-01. Original filename sdas.exe. VT tagged it trojan.generickdq/python — already telling us something about the build.

    Sample 2 (d4f57b42...) was more interesting. MalwareBazaar returned both LunaGrabber and LunaStealer tags. Triage clustered it with BlankGrabber, GlassWorm, IcedID, and Luca-Stealer. The original filename was loader.exe. That’s a different kind of name than sdas.exe. One sounds like a throwaway test artifact. The other sounds deliberate.

    The TI results alone suggested these weren’t just two copies of the same thing. They were potentially different components of the same campaign.

    Phase 2: Static PE Analysis

    fileanalyzer and mstrings on both samples.

    The first thing that jumped out was the imphash — f3c0dbc597607baa2ea891bc3a114b19 — identical on both. Same section layout, same section sizes, same import count (146), same 7 PE sections including the .fptable section that PyInstaller uses for its frozen module table. These two samples were compiled from the same PyInstaller loader template with different payloads bundled inside.

    But the entropy diverged sharply. Sample 1 (sdas.exe) came in at 3.9 — low, even for a PyInstaller bundle. Sample 2 (loader.exe) was 6.9 — high, indicating the embedded payload is compressed or encrypted more aggressively. Combined with the file size difference (47 MB vs 22 MB), this was the first signal that what was inside each bundle was meaningfully different.

    mstrings gave us 22–23 ATT&CK-mapped detections across both samples — largely the same set: IsDebuggerPresentQueryPerformanceCounterSetDllDirectoryWGetTempPathWExpandEnvironmentStringsWOpenProcessToken. Standard infostealer staging behavior. Tcl_CreateThread showed up in both, which is a PyInstaller artifact from bundling Python with Tkinter. The VT python family tag made more sense in context.

    Phase 3: PyInstaller Extraction

    Both samples were extracted with pyinstxtractor-ng. This is where the two samples started to diverge clearly.

    Sample 1 entry point: sdas.pyc — Python 3.13, 112 files in the CArchive, 752 modules in the PYZ archive.

    Sample 2 entry point: cleaner.pyc — Python 3.11, 113 files, 760 modules.

    The name cleaner.pyc inside a file called loader.exe is a tell. That’s not a stealer payload name. That’s something that runs after.

    The bundled library sets were nearly identical between both — requestsrequests_toolbeltCryptodomecryptographypsutilPILsqlite3win32 — same stealer framework. But Sample 2 had a unique addition: a l.js reference (mapped to T1059 — Command and Scripting Interpreter). A JavaScript component not present in the December build. The OpenSSL versions also differed: Sample 1 bundled libcrypto-3.dll (OpenSSL 3.x), Sample 2 had libcrypto-1_1.dll (OpenSSL 1.1). Different build environments, roughly one month apart.

    At this point the working theory was solid: Sample 1 is a standalone stealer. Sample 2 is a later-generation dropper/installer with an updated payload and additional capability.

    Phase 4: Bytecode Decompilation

    decompile3 couldn’t handle Python 3.11 or 3.13 bytecode. That’s a known limitation. pycdc (Decompyle++) handles both.

    sdas.pyc decompiled cleanly — the import stack made the capability set immediately obvious:

     from win32crypt import CryptUnprotectData  from Cryptodome.Cipher import AES  from PIL import Image, ImageGrab  from requests_toolbelt.multipart.encoder import MultipartEncoder  import sqlite3  

    CryptUnprotectData for browser master key decryption. AES for the decryption itself. ImageGrab for screenshots. MultipartEncoder for structured exfiltration. Classic infostealer, nothing surprising.

    cleaner.pyc was a different story. The decompiler output opened with this:

     __________ = eval(getattr(__import__(bytes([98,97,115,101,54,52]).decode()), ...  

    Heavy obfuscation — byte arrays used to reconstruct evalgetattr, and __import__ at runtime so none of those strings appear in plain text. The approach is designed to evade static string detection. Decode the byte arrays and you get:

     bytes([98,97,115,101,54,52])        → "base64"  bytes([90,88,90,104,98,65,61,61])   → b64decode("ZXZhbA==") → "eval"  bytes([90,50,86,48,...])            → "getattr"  bytes([88,49,57,112,...])           → "__import__"  

    Standard Python malware obfuscation. But buried further down in the decompile output was a large binary blob — a bytes literal starting with \xfd7zXZ. That’s the LZMA magic header.

    Phase 5: LZMA Stage 2 Extraction

    The blob was located at offset 0x17d4 in the pyc file. Extract and decompress it:

     import lzma  blob = open('cleaner.pyc', 'rb').read()  idx = blob.find(b'\xfd7zXZ')  decompressed = lzma.decompress(blob[idx:])  # → 102,923 bytes  

    One important detail: the decompression is wrapped in a try/except LZMAError block with os._exit(0) on failure. If the decompression fails — as it would in some emulated sandbox environments — the process exits silently with no error. That’s the anti-sandbox mechanism.

    The decompressed payload was another obfuscated Python source using a custom alphabet substitution encoding. The final execution chain was compile() + exec(). Decoding the full stage 2 revealed everything:

    The injection URL:

     https://raw.githubusercontent.com/Smug246/luna-injection/main/obfuscated-injection.js  

    This is the live Discord injection payload. The stage 2 pulls this JavaScript file from GitHub and injects it into the Discord desktop client’s core module, persisting across restarts.

    The capability set from stage 2:

    • Anti-analysis checks on startup: process blacklist (~30 entries including wiresharkprocesshackervboxserviceollydbgx96dbgpestudio), MAC address blacklist (80+ VM prefixes), HWID blacklist, IP blacklist, username/PC name blacklists
    • Discord token theft from all three release channels (stable, canary, PTB)
    • Browser credential theft across 20+ Chromium and non-Chromium browsers
    • Roblox session cookie harvesting (.ROBLOSECURITY= targeting with API validation)
    • Desktop screenshot capture
    • Self-destruct: ping localhost -n 3 > NUL && del /F "{path}"

    The ping delay is a simple trick — the 3-second wait lets the process fully exit before the delete fires, so the file removes itself cleanly after execution.

    What MalChela + MCP Added to This Workflow

    The honest answer is: speed and synthesis.

    tiquery hitting five TI sources in one call versus five separate browser tabs or CLI invocations is a meaningful time saving, but that’s the surface benefit. The deeper value showed up in the mstrings step — getting ATT&CK-mapped output with technique IDs alongside the raw strings meant the behavioral picture came together faster than manually correlating imports against the ATT&CK matrix.

    The MCP integration meant each of those steps — TI query, PE analysis, string extraction — could happen within the same conversation context. Claude could see the fileanalyzer output and the mstrings output together and note that the entropy difference between the two samples was significant, that the identical imphash meant shared loader infrastructure, that the staging imports in mstrings were consistent with the exfil approach suggested by the TI tags. That cross-tool synthesis is where the integration earns its keep.

    The parts that still required manual work: pyinstxtractor-ngpycdc, the LZMA extraction, and decoding the stage 2. Those are terminal steps on the Mac.

    IOCs at a Glance

    Samples:

    SHA-256FilenameFamily4f3b8971...d0sdas.exeLunaStealerd4f57b42...24loader.exeLunaGrabber

    Injection URL:

     https://raw.githubusercontent.com/Smug246/luna-injection/main/obfuscated-injection.js  

    Self-destruct pattern:

     ping localhost -n 3 > NUL && del /F "{executable}"  

    Imphash (shared loader stub):

     f3c0dbc597607baa2ea891bc3a114b19  

    A full IOC list including ~60 C2 IPs, MAC address blacklists, and HWID blacklists is in the analysis report linked below.

    Downloads

    • 📄 [Full Analysis Report] — Complete investigation narrative, sample properties, capability breakdown, IOC documentation, campaign timeline, and recommendations. (LunaStealer_Analysis_Report.pdf)
    • 🛡️ [YARA Rules — PE] — Four rules targeting the PE samples: exact hash match, shared PyInstaller stub (imphash-based), infostealer payload strings, generic PyInstaller infostealer. (lunastealer_pe.yar)
    LunaStealer_Analysis_ReportDownload lunastealer_pe.yarDownload

    If you’re running MalChela in your environment and want to reproduce the TI query steps, the MalChela MCP plugin source is on GitHub at github.com/dwmetz/MalChela. Questions or additions to the IOC list — find me on the usual channels.

    #DFIR #Forensics #Github #lumastealer #MalChela #Malware #Python #yara
  2. MalChela 3.2: More Cowbell? More Intel!

    One of the things I value most about the open-source community is that the best improvements to a tool often don’t come from inside it — they come from outside conversations.  A short while back, the author of mlget, xorhex,  reached out and suggested I add more malware retrieval sources to FOSSOR, one of my earlier tools for pulling down samples from threat intel repositories.  It was a generous nudge, and it landed at exactly the right moment.

    FOSSOR started as a simple script.  It did one job — grab malware samples from a handful of sources — and it did it well enough.  When I wrote it, I already knew it was a candidate for eventual MalChela integration, but “eventually” had stayed firmly in the future tense.  The message from xorhex gave me the push to actually sit down and do it properly.

    The result is tiquery — and it’s become a new centerpiece to MalChela 3.2.

    The Pattern I Keep Repeating (Deliberately)

    If you’ve followed this blog or the MalChela project for a while, you might notice a recurring arc in how my tools tend to develop.  It goes something like this:

    • Step one:  write a focused script that solves a specific problem.
    • Step two:  that script evolves into a standalone tool as the scope grows.
    • Step three:  the tool finds its permanent home inside MalChela, where it benefits from the broader ecosystem — case management, the GUI, the MCP server integration, the portable workspace.
    • Step four:  When there’s overlap between tools, follow the KISS principle.

    FOSSOR was in step one.  The conversation with xorhex accelerated the jump to step three.  What emerged was something more ambitious than just a source expansion — it’s a unified threat intelligence query engine, built from the ground up.

    If you’re new to MalChela, it’s a Rust-based malware analysis toolkit built for DFIR practitioners — static analysis, string extraction, YARA rule generation, threat intel lookups, network analysis, and now a unified case management layer tying it all together.  Free, open-source, and built to run anywhere.

    Introducing tiquery

    tiquery is now the single threat intel tool in MalChela, replacing the retired malhash.  The core idea is straightforward: submit a hash, query multiple sources in parallel, get a clean color-coded summary back.  No waiting for one source to finish before the next one starts.  No manually juggling browser tabs or API wrappers.

    Out of the box, tiquery works with eight confirmed sources:

    • VirusTotal
    • MalwareBazaar
    • AlienVault OTX
    • MetaDefender Cloud
    • Hybrid Analysis
    • FileScan.IO
    • Malshare
    • ObjectiveSee (no API key required — queries a locally-cached macOS malware catalogue)

    Sources are tiered — free sources and registration-required sources are distinguished in the interface.  If you haven’t configured an API key for a given source, tiquery skips it gracefully rather than throwing an error. This means you can run it easily with whatever keys you have available.

    The ObjectiveSee integration deserves a special mention.  It queries the objective-see.org/malware.html catalogue for macOS-specific threats using a locally-cached copy that refreshes every 24 hours, with a stale-cache fallback for offline use.  For anyone doing Mac forensics, this is a meaningful addition — a free, no-key-required check specifically against known macOS malware families.

    Tiquery, like FOSSOR, supports batch lookups as well — point it to a .csv or .txt file of hashes and they’ll all be checked in parallel. You can also download samples directly, with MalwareBazaar supported in this release and additional sources on the way – (your vote matters).

    What It Looks Like in Practice

    The screenshots below show tiquery running in both the CLI and GUI.  In both cases, for any of the matching sources you get a basic classification (malware family, tags, detections,) and direct links to threat intelligence documents about the samples. It’s the perfect jumping off point when you want to leverage community research.

    The CLI output is clean and tabular — source abbreviation, status (color-coded FOUND/NOT FOUND), family and tag information, detection count, and a direct reference URL.  Everything you need to make a quick triage decision, no scrolling through API response JSON required. You can run tiquery CLI as a stand-alone, or from within the MalChela CLI menu.

    In the GUI, the experience is layered a bit more richly.  You can toggle individual sources on or off, switch between single-hash and bulk lookup modes, download the sample directly from MalwareBazaar, and export results to CSV — all from one interface.  The macOS ObjectiveSee source displays its cache age inline so you always know how fresh the data is.

    Both outputs feed into MalChela’s case management system.  Check “Save to Case” in the GUI, and tiquery creates a valid case.json automatically — no separate case creation step needed.

    Extended Case Management Across the Toolkit

    Speaking of case management — 3.2 extends “Save to Case” support across the full GUI.  File Analyzer, File Miner, and mStrings, all now include the checkbox.  This closes out the last gaps in the case workflow.  Whatever tool you’re using for a given task, if you want to preserve the output in a named case, it’s one click. You no longer have to start with the New Case workflow, however it is recommended if that’s the direction you’re going from the start.

    The Strings to YARA tool also gains a companion “Save to YARA Library” checkbox.  Check it, and the generated rule gets copied directly into the project’s yara_rules/ directory alongside being saved to the case. This will automatically make the rule available when you run fileanalyzer on subsequent files.  It’s a small workflow improvement, but one that eliminates a manual copy step I was taking every time anyway. I also added a quick formatter so the special character most often in need of escaping “\” gets handled automatically when the rule is generated.

    A Note on malhash

    malhash is retired in 3.2.  If you’ve been using it in scripts or workflows, tiquery is its direct replacement — it does everything malhash did and then some.  This is a breaking change in the sense that the binary is gone, but functionally tiquery is a superset, not a lateral move.

    malhash served its purpose well.  RIP. tiquery is where that purpose lives now.

    Get It

    MalChela 3.2 is available now on GitHub.  The full release notes are in the repo. 

    Thanks to xorhex for the nudge.  Sometimes the best features start with someone saying “have you thought about…”

    #API #DFIR #Forensics #Github #MalChela #Malware #ThreatIntelligence #yara
  3. MalChela 2.2 “REMnux” Release

    MalChela’s 2.2 update is packed with practical and platform-friendly improvements. It includes native support for REMnux, better tool settings, and deeper integrations with analysis tools like YARA-X, Tshark, Volatility3, and the newly improved fileanalyzer module.

    🦀 REMnux Edition: Built-In Support, Zero Tweaks

    When the GUI loads a REMnux-specific tools.yaml profile, it enters REMnux mode.

    Screenshot of yaml configuration applying REMnux mode

    Native binaries and Python scripts like capa, oledump.py, olevba, and FLOSS are loaded into the MalChela tools menu, allowing you to mix and match operations with the embedded MalChela utilities and the full REMnux tool stack. No manual configuration needed—just launch and go. MalChela currently supports the following REMnux programs right out of the box:

    Tool NameDescriptionbinwalkFirmware analysis and extraction toolcapaIdentifies capabilities in executable filesradare2Advanced reverse engineering frameworkVolatility 3Memory forensics framework for RAM analysisexiftoolExtracts metadata from images, documents, and moreTSharkTerminal-based network packet analyzer (Wireshark CLI)mraptorDetects malicious macros in Office documentsoledumpParses OLE files and embedded streamsoleidIdentifies features in OLE files that may indicate threatsolevbaExtracts and analyzes VBA macros from Office filesrtfobjExtracts embedded objects from RTF documentszipdumpInspects contents of ZIP files, including suspicious payloadspdf-parserAnalyzes structure and contents of suspicious PDFsFLOSSReveals obfuscated and decoded strings in binariesclamscanOn-demand virus scanner using ClamAV enginestringsExtracts printable strings from binary filesYARA-XNext-generation high-performance YARA rule scanner

    If you only need a subset of tools you can easily save and restore that a custom profile.

    TShark Panel with Built-In Reference

    Tshark and the integrated field reference

    A new TShark integration exposes features including:

    • A filter builder panel
    • Commonly used fields reference
    • Tooltip hints for each example (e.g., `ip.addr == 192.168.1.1` shows “Any traffic to or from 192.168.1.1”)
    • One-click copy support

    This helps analysts build and understand filters quickly—even if TShark isn’t something they use every day. Using the syntax builder in MalChela you can use the exact commands directly in Tshark or Wireshark.

    YARA-X Support (Install Guide Included)

    YARA-X module in MalChela

    Support for YARA-X (via the `yr` binary) is now built in. YARA-X is not bundled with REMnux by default, but install instructions are included in the User Guide for both macOS and Linux users.

    Once installed, MalChela allows for rule-based scanning from the GUI,and with YARA-X, it’s faster than ever.

    fileanalyzer: Fuzzy Hashing, PE Metadata, and More

    Updated FileAnalyzer Module

    MalChela’s fileanalyzer tool has also been updated to include:

    • Fuzzy hashing support via `ssdeep`
    • BLAKE3 hashing for fast, secure fingerprints
    • Expanded PE analysis, including:
    • Import and Export Table parsing (list of imported and exported functions)
    • Compilation Timestamp (for detection of suspicious or forged build times)
    • Section Characteristics (flags like IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_CNT_CODE, etc., for detecting anomalous sections)

    These improvements provide deeper insight into executable structure, helping analysts detect anomalies such as packers, suspicious timestamps, or unexpected imports/exports. Useful for everything from sample triage to correlation, fileanalyzer now digs deeper—without slowing down.

    Memory Forensics Gets a Boost: Volatility 3 Now Supported

    With the 2.2 release, MalChela introduces support for Volatility 3, the modern Python-based memory forensics framework. Whether you’re running MalChela in REMnux or on a customized macOS or Linux setup, you can now access the full power of Volatility directly from the MalChela GUI.

    Volatility 3 in MalChela

    There’s an intuitive plugin selector that dynamically adjusts available arguments based on your chosen plugin,. You can search, sort, and browse available plugins, and even toggle output options like –dump-dir with ease.

    Like Tshark, there is an added plugin reference panel with searchable descriptions and argument overviews — a real time-saver when navigating Volatility’s deep and often complex toolset.

    Volatility Plugin Reference

    Smarter Tool Configuration via YAML

    The tool configuration system continues to evolve:

    • Tools now declare their input type (file, folder, or hash)
    • The GUI dynamically adjusts the interface to match
    • Alternate profiles (like REMnux setups) can be managed simply by swapping `tools.yaml` files via the GUI
    • Easily backup or restore your custom setups
    • Restore the default toolset to get back to basics

    This structure helps keep things clean—whether you’re testing, teaching, or deploying in a lab environment.

    Embedded Documentation Access

    The GUI now includes a link to the full MalChela User Guide in PDF. You can also access the documentation online.

    From tool usage and CLI flags to configuration tips and install steps, it’s all just a click away—especially useful in offline environments or when onboarding new analysts. I’ll be honest, this is likely the most comprehensive user guide I’ve ever written.

    Whether you’re reviewing binaries, building hash sets, or exploring network captures—MalChela 2.2 is designed bring together the tools you need, and make it easier to interoperate between them.

    The new REMnux mode makes it even easier to get up and running with dozens of third party integrations.

    Have an idea for a feature or application you’d like to see supported — reach out to me.

    GitHub: REMnux Release

    MalChela User Guide: Online, PDF, Web

    Shop: T-shirts, hats, stickers, and more

    #DFIR #Github #MalChela #Malware #MalwareAnalysis #Memory #Network #NSRL #PCAP #Python #REMnux #Rust #Tshark #VirusTotal #Volatility #yara