r/MalwareAnalysis • • 18h ago

Built a static analysis tool for PE/ELF triage: CFG view, pseudo-C and Unicorn emulation of decode stubs. What would you want from it?

2 Upvotes

I'm a pentester getting into malware RE and I've been writing a static analysis desktop app called Malhound (GPL-2.0, Windows app, analyses PE and ELF).

What it does now: Capstone disassembly with recursive descent and jump-table resolution, a control-flow graph view, an early pseudo-C lifter, Unicorn emulation to decode simple string/config decode stubs, IOC extraction, simple YARA-style and capa-style rules, and a report that states which analysis stages actually ran and which were skipped.

Tested on: WannaCry, a kernel driver, a Go binary and a 32-bit ARM Linux bot sample. Static only, no dynamic analysis has been run on a real VM yet.

Known gaps: pseudo-C still has raw asm lines, no for-loop or real switch recovery, ARM Thumb and MIPS delay slots are not handled.

Questions for people who do this daily: what do you check first when triaging an unknown PE, and what do the existing graph views get wrong that you'd fix?

Source and releases: https://github.com/LIME1Star/Malhound


r/MalwareAnalysis • • 10h ago

Reversed a Recovered WannaCry Worm Payload With the Kill Switch Patched Out

1 Upvotes

Hi all, I reversed a WannaCry sample that turned out to be the payload one infected machine sends to the next, and wrote up the analysis.

Quick summary:

- The file is a 64-bit launcher.dll (single export, PlayGame) with a full copy of mssecsvc.exe appended to it. I found the function in the worm that builds exactly this packet for DoublePulsar, and the first 0xC8A4 bytes of the sample match its embedded x64 launcher byte for byte

- The kill switch is patched out: the worm still requests the domain, but the JNZ after InternetOpenUrlA is replaced by two NOPs, so the result is ignored

- The sample is damaged. Half of the embedded worm is overwritten with NT paths from the victim's disk (AVG temp files, ru-RU language files), probably from an imperfect disk or memory recovery. The ZIP at the end of the chain is cut short, and t.wnry, u.wnry and the helper tools are missing

- The worm scans its own subnets, plus the /24 of every gateway and DNS server, and also 128 threads of random internet IPs. On each host it runs the MS17-010 check (status 0xC0000205), EternalBlue, then the DoublePulsar ping (Multiplex ID 0x51) and upload

- tasksche.exe extracts the XIA resource with the password WNcry@2ol7. I recovered c.wnry with the 5 Tor C2 onions and the 3 Bitcoin addresses, plus the wallpaper, the FAQ and the ransom text in 28 languages

- The RSA private key embedded in tasksche only decrypts t.wnry (header WANACRY!). It's there to keep the encryption module encrypted on disk, not to protect the victims' files

- On chain, the 3 addresses show about 51.9 BTC cashed out in August 2017

Full writeup with IOCs and YARA rules: https://inkman97.github.io/wannacry-analysis/