Release v1.0.0 : OpenPetya
Initial public release of OpenPetya, a Proof-of-Concept implementation inspired by the original Petya bootkit ransomware.
Educational and research purposes only.
Features
- Custom MBR bootloader
- Multi-stage boot process
- Real Mode → Protected Mode transition
- NTFS MFT encryption via Salsa20
- Password-based key derivation and validation
- Custom bootloader UI
- Automatic recovery and restoration
- Original MBR backup/restoration
- Hidden backup storage
- BSOD-trigger reboot using undocumented Windows APIs
Components
| File | Description |
|---|---|
OpenPetya.exe |
Installer and controller application |
mbr.bin |
Custom MBR loader |
stage2.bin |
Stage-2 protected mode bootloader |
Workflow Overview
- Install custom MBR and Stage-2 payload
- Reboot system
- Encrypt NTFS MFT using Salsa20
- Lock system and display login screen
- Validate password
- Restore MFT and original bootloader
- Boot Windows normally
Technical Highlights
- Written in Assembly, C, and C++
- BIOS-based boot process
- ATA sector-level disk access
- Protected Mode bootloader environment
- Salsa20 stream cipher implementation
- Sector-based metadata management
- Validation tag mechanism to prevent corruption
- Use of undocumented Windows APIs:
NtRaiseHardErrorRtlAdjustPrivilege
Important Notes
- This project does NOT include Command-and-Control (C2) functionality.
- Network communication was intentionally excluded because it is outside the scope of this educational project.
- OpenPetya stores backup data in hidden sectors for recovery purposes.
Disclaimer
This project was created for:
- malware analysis research
- bootloader research
- low-level systems learning
- cybersecurity education
Do NOT use this software for illegal activities.
The author is not responsible for any misuse.
Related Articles
- Analyzing Petya
- Analyzing NotPetya
- Simple MBR And Bootloader
- OpenBootloader
- Rootkits and Bootkits Notes
- PC Assembly Language Notes
- Serious Cryptography Notes
Demonstration
Future Plans
- Improved recovery workflow
- Better NTFS parsing
- More accurate Petya behavior simulation
- UEFI experiments
- Additional bootkit research
Thanks
Thanks for checking out this project. Feedback and suggestions are welcome.
