Win32 · WannaCry
The infamous 2017 WannaCry ransomware worm. It encrypts victim files, changes the wallpaper, and drops the WannaDecryptor UI. It contains a kill switch — if a hardcoded URL is reachable it exits without encrypting — and spreads over SMB (EternalBlue) via IPC$ shares.
Identification
Capabilities
- Kill switch — exits if a hardcoded URL resolves/connects
- File encryption using the Windows CryptoAPI
- Requires administrator privileges to fully detonate
- Drops and runs a persistent service (tasksche.exe / mssecsvc2.0)
- Bundles Tor (taskhsvc.exe) for anonymised C2
- Spreads over SMB to other hosts (IPC$ shares)
- Changes desktop wallpaper to a ransom note; launches WannaDecryptor
Indicators of Compromise
Network indicators
| Type | Value | Note |
|---|---|---|
| url | http://www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com | Kill switch URL — if reachable, the payload does NOT execute |
| ip | 192.168.56.20 | SMB target (\\192.168.56.20\IPC$) for lateral movement |
| ip | 172.16.99.5 | SMB target (\\172.16.99.5\IPC$) for lateral movement |
Host indicators
| Type | Value | Note |
|---|---|---|
| service | mssecsvc2.0 ("Microsoft Security Center (2.0) Service") | Persistence service that launches tasksche.exe |
| file | tasksche.exe | Persistent executable started by the new service |
| file | taskhsvc.exe | Bundled Tor client unpacked at runtime |
| path | C:\ProgramData\<random>\ (hidden) | Hidden directory of unpacked artifacts (includes a "Tor" directory) |
| file | C:\%s\qeriuwjhrf | Artifact path referenced in strings |
| mutex | WanaCrypt0r | Family marker string |
MITRE ATT&CK
| Technique | ID | Note |
|---|---|---|
| Data Encrypted for Impact | T1486 | Encrypts victim files using the CryptoAPI. |
| Exploitation of Remote Services | T1210 | Spreads over SMB (EternalBlue) to IPC$ shares. |
| Create or Modify System Process: Windows Service | T1543.003 | Installs the mssecsvc2.0 service for persistence. |
| Inhibit System Recovery | T1490 | Classic WannaCry recovery-inhibition behaviour (diskpart present). |
| Virtualization/Sandbox Evasion | T1497 | Kill-switch URL check acts as an environment/analysis check. |
Execution flow
Kill switch (checked first):
- The kill-switch URL string is moved into ECX.
- Arguments for
InternetOpenAare pushed; its result goes into EAX. - Arguments for
InternetOpenUrlA(including the kill-switch URL) are pushed;
its result goes into EAX and then EDI.
- The handle is closed and EDI is evaluated:
- If EDI is
0x0(NULL / unreachable) → WannaCry calls the first payload
function and detonates.
- Else (URL reachable) → WannaCry exits without triggering the payload.
In a lab this means INetSim must be OFF for the sample to detonate, and it must be run as administrator.
Static analysis
Hashes match the well-known WannaCry sample and VirusTotal identifies it directly. Interesting imports point to the CryptoAPI and networking:
InternetOpenUrlA InternetOpenA
CryptAcquireContextA CryptGenRandom CryptGenKey
CryptEncrypt CryptDecrypt CryptImportKey CryptDestroyKey
Interesting strings include the kill-switch URL, SMB IPC$ targets, the mssecsvc2.0 service name, WanaCrypt0r, diskpart.exe, and the classic PADDINGXXPADDING... filler.
Dynamic analysis
Observed symptoms: all files encrypted, the desktop wallpaper is changed to a ransom background, and a WannaDecryptor app appears on the desktop.
Host indicators: a hidden directory with a random name is created under C:\ProgramData, containing many unpacked artifacts — including taskhsvc.exe and a Tor directory that unpacks a Tor client. A new service is created to run tasksche.exe persistently.
Detonation requirements: must run as administrator, and the kill-switch URL must be unreachable (INetSim off) or it exits immediately.
Screenshots










