Dissecting a ransomware-infected MBR
summary
Walkthrough of Petya’s MBR attack shows the ransomware opens \\.\PhysicalDrive0 via CreateFile and DeviceIoControl, reads sector 0, XORs the data with 0x37 and writes a new MBR plus a tiny kernel starting at sector 0x22 that spans 16 sectors, then forces a reboot and encrypts the NTFS MFT rather than individual files. Analysis uses Process Monitor, WinObj, HDHacker and Bochs for BIOS-level debugging (no Win API available), and demonstrates the overwrite, kernel execution and Bitcoin ransom screen working end-to-end.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:08About me
- 1:50Smallpox
- 4:00MBR vs GPT
- 6:37GPT
- 7:58Pecha
- 8:15Execution flow
- 8:53Resolving normal malware
- 10:05Resolving xx section
- 11:56Device IO Control API
- 13:00Physical Drive Zero
- 14:14Winobj
- 15:40Process Monitor
- 16:31MBR
- 17:48Boot Sector Marker
- 18:31Overwrite MBR
- 21:51New MBR
- 25:10Debugging the MBR
