liranzoz/Malware-Analysis-Lab
GitHub: liranzoz/Malware-Analysis-Lab
Stars: 0 | Forks: 0
# 🧪 NotPetya Malware Analysis Lab
### Static & dynamic analysis of the 2017 NotPetya wiper in a fully isolated VM environment
[](#)
[](#)
[](#)
[](#)
## 🔍 The Sample
NotPetya (June 2017) caused **~$10B** in global damage. It was initially seeded through a backdoored update to **M.E.Doc**, a Ukrainian accounting application, and spread laterally using **EternalBlue / EternalRomance** (the leaked NSA SMB exploits) plus **Mimikatz**-style credential theft. It looked like ransomware. It was actually a **wiper** — files could never be decrypted, the "ransom" was a smokescreen.
| Property | Value |
|:---|:---|
| **File** | `nopetya.dll` — 32-bit DLL, console subsystem |
| **SHA-256** | `027CC450EF5F8C5F653329641EC1FED91F694E0D229928963B30F6B0D7D3A745` |
| **Language** | C / C++ |
| **Compiler** | Microsoft Visual C++ — Visual Studio 2010 (Rich header) |
| **Packer** | Generic — `.rsrc` section compressed (DIE heuristic, not UPX) |
| **Size / Sections** | ~362 KB · 6 sections, all with valid entropy |
| **Execution** | `rundll32.exe nopetya.dll,#1` (entry exported by ordinal) |
| **Signature** | Invalid — flagged by PEStudio |
## 🏗️ Lab Architecture
┌───────────────────────────────┐ ┌───────────────────────────────┐
│ Windows 10 Victim VM │ │ REMnux (Analysis VM) │
│ ────────────────────────── │ │ ────────────────────────── │
│ • PEStudio, Process Explorer │ ◄─────► │ • INetSim (fake internet) │
│ • Procmon, Regshot │ host- │ • Wireshark capture │
│ • Detonation target │ only │ • DNS / HTTP / SMTP sim │
└───────────────────────────────┘ └───────────────────────────────┘
▲ ▲
└────────── isolated from host ──────────────┘
## 🛠️ Lab Setup
### REMnux — Analysis Box
The de-facto Linux distribution for reverse engineers. Here it acts as the **fake internet** — INetSim responds to every DNS, HTTP, HTTPS, SMTP, FTP and POP3 request the victim makes, so the malware *thinks* it's online without ever touching a real network.
| Hardware | Options |
|:---:|:---:|
|
|
|
**INetSim running — DNS, HTTP, SMTP, POP3, FTP, HTTPS all simulated**
### Windows 10 — Victim Box
The detonation target. Monitoring tools were installed *before* a clean snapshot was taken, so the malware can be triggered, observed, and the VM reverted to a clean state in seconds.
|
|
**INetSim running — DNS, HTTP, SMTP, POP3, FTP, HTTPS all simulated**
| Hardware | Options |
|:---:|:---:|
|
|
|
## 🧬 Static Analysis — *the imports tell the story*
Static analysis means examining the binary **without executing it**. PEStudio surfaced **38 indicators** before a single line of code ran. The import table alone exposes the entire playbook:
| Library | Notable APIs | What it reveals |
|:---|:---|:---|
| **DHCPSAPI** | `DhcpEnumSubnetClients`, `DhcpEnumSubnets` | Pull the DHCP client list → find every host on the LAN |
| **NETAPI32 / MPR** | `NetServerEnum`, `WNetAddConnection2W` | Enumerate machines, mount admin shares |
| **WS2_32** | `socket`, `connect`, `send`, `recv` | Raw sockets for network propagation |
| **ADVAPI32** | `AdjustTokenPrivileges`, `CreateProcessAsUserW` | Privilege escalation |
| **CRYPT32** | `CryptEncrypt`, `CryptGenKey` | The "ransomware" payload |
**Verdict:** a network worm carrying an encryption payload — not a simple file locker.
|
|










**Lab engineering** · **PE static analysis** · **Disassembly / reversing (Ghidra)** · **Packer & compiler ID (DIE)** · **Behavioral / dynamic analysis** · **Network forensics** · **IOC extraction & ATT&CK mapping** · **Threat-intel writeup**
**Liran Zozulya** · [LinkedIn](LINKEDIN_URL_HERE) · [GitHub](GITHUB_URL_HERE)