
Kratos is a high-performance Windows File System Minifilter driver designed to detect, block, and permanently immunize
Defensive Security Research Project — Windows minifilter driver developed in C++ for the real-time detection and neutralization of ransomware at the kernel level (Ring 0).
Kratos (Kratos.sys) is a Windows minifilter driver operating at altitude 425342 (Anti-Virus tier) via the Filter Manager (fltmgr.sys). Unlike static signature-based antivirus solutions, Kratos adopts a purely behavioral approach:
| Objective | Result |
|----------|---------|
| Affected Files (First Run) | < 5 |
| Affected Files (Reruns) | 0 |
| False Positive Rate | 0% (After Tuning) |
| Compatibility | NTFS / ReFS |
User-Mode
│
▼
Filter Manager (fltmgr.sys) ← Altitude 425342
│
▼
┌─────────────────────────────────────────────────────┐
│ KRATOS.SYS │
│ │
│ IRP_MJ_CREATE → Initializing contexts │
│ IRP_MJ_WRITE → Entropic analysis │
│ IRP_MJ_READ → R/W ratio counting │
│ IRP_MJ_SET_INFORMATION → Delete/Rename Detection │
│ │
│ RTL_AVL_TABLE → KS_PROCESS_CONTEXT per PID │
│ FLT_FILE_CONTEXT → Entropy + state per file │
└─────────────────────────────────────────────────────┘
│
▼
NTFS / ReFS
Kratos distinguishes between deletions of valuable files (.docx, .pdf, .jpg...) and deletions of system/cache files using KS_IsValuableFile():
Calculation via a pre-calculated LUT (KratosEntropyLUT512) — avoids the use of log2(), which is unavailable in kernel mode. 512-byte sample per write operation.
.tmp file with entropy ≥ 7.5/8 bitsMain innovation: instead of a blacklist of malicious extensions, Kratos uses a whitelist of legitimate extensions.
Original extension is valuable? YES
New extension is recognized? NO
→ SUSPECT — regardless of the extension chosen
This approach can detect LockBit 3.0 (.xmjzh8q), BlackCat/ALPHV (random) and any future ransomware using an unknown extension.
ValuableDeleteCount > 10 → +10 pts
RenameToSuspicious > 2 → +40 pts
HighEntropyWrites > 3 → +40 pts
RansomNoteCreated → +60 pts
ShadowCopyDeleted → +75 pts
Score ≥ 60 → WARNING
Score ≥ 80 → CRITICAL + Kill + Blacklist
Once ransomware is detected, Kratos calculates its 64-bit FNV-1a hash on the first 4096 bytes of the executable (PE Header + beginning of code) and persists it in the registry:
\Registry\Machine\SOFTWARE\Kratos\Blacklist
└── 1F81F13004B5B920 = "C:\Users\...\Hercule.exe"
Each time a process is created, ProcessNotifyCallback checks the blacklist before any execution. The process is blocked via CreationStatus = STATUS_ACCESS_DENIED.
Renaming resistance: the FNV-1a hash is identical regardless of the file name (Hercule-AES.exe, HERCUL~1.EXE, chrome.exe...).
Protection against spoofing: Whitelisted processes are validated by Expected Name + Path:
chrome.exe + \Program Files\Google\Chrome\Application\ → Legitimate
chrome.exe + C:\Users\...\Desktop\ → IMPOSTOR
# Open KratosMinifilter.sln in Visual Studio
# Configuration: Debug or Release / x64
# Build → Build Solution
# On the target VM — enable test mode
bcdedit /set testsigning on
# Copy Kratos.sys and Kratos.inf
# Install via Device Manager or sc.exe
sc create Kratos type= kernel start= boot binPath= "C:\Kratos\Kratos.sys"
sc start Kratos
Modify g_LegitExtensions[] in KratosDetection.cpp to adjust the extensions considered legitimate after a renaming.
Modify g_TrustedProcesses[] to add legitimate processes with their expected path:
{ "myapp.exe", L"\\Program Files\\MyApp\\" },
Modify KS_EvaluateThreatScore() in KratosDetection.cpp to adjust the WARNING/CRITICAL thresholds according to your environment.
⚠️ This driver is developed within a defensive security research framework.
- Use is strictly reserved for isolated test environments (VMs without network access)
- Any deployment on a production system is carried out under the user's sole responsibility
- The author disclaims all liability for any damage resulting from improper use
- Modifying this driver to bypass security systems without authorization is illegal