Instead of deploying traditional malware files on the compromised server, the attackers used Oracle's built-in Java Virtual Machine (JVM) and the CREATE JAVA SOURCE statement to compile and store the entire post-exploitation toolkit as Java schema objects inside the Oracle database . This approach made the toolkit invisible to standard OS-level defenses because EDR and antivirus tools focus on processes, binaries, and files on the operating system—they do not generally inspect Java classes and PL/SQL wrappers stored inside Oracle .
The khunt toolkit included these components, each stored as a database object:
| Component | Function |
|---|---|
| KhuntCmd | Loads cmd.exe and executes arbitrary OS commands by embedding them in SQL statements sent to the database |
| KhuntHash | Extracts usernames and password hashes from Oracle's internal user tables and saves them to a file |
| KhuntFS / KhuntFS2 | File explorers for listing, reading, searching, and checking file sizes on the compromised system |
| KhuntT | A simple "ping" tool to confirm the toolkit is installed and reachable before proceeding |
| KhuntUnzip | Utility for unzipping files |
| khunt_ PL/SQL wrappers* | PL/SQL wrapper procedures used to call the underlying Java methods |
The attackers did not stop at database-level access. They used the khunt toolkit to pivot from the database layer to the underlying Windows operating system in a multi-step process:
cmd.exe /c whoami, which confirmed they were running with SYSTEM-level privileges on the Windows server, establishing remote code execution (RCE) from the database to the OS .reg.exe and copy the SECURITY and SYSTEM registry hives, saving them as khuntSECURITY.hiv and khuntSYSTEM.hiv in F:\Oracle\ .tasklist /svc and saved the output as khunttasks.txt .esentutl.exe to copy the SAM and a second copy of the SECURITY hives, saving them as khuntSAM.hiv and khunt_SECURITY.hiv .The exfiltrated registry hives could be used offline to extract and decode password hashes for all local accounts on the system .
Huntress's investigation revealed several critical blind spots that allowed this attack to succeed and evade detection:
Based on this attack, Huntress recommended several mitigations :
This attack serves as a stark reminder that database engines with built-in programming environments (like Oracle's JVM) can become stealthy attack platforms when combined with even a single unvalidated input field. Security teams must extend their monitoring beyond the operating system to include the database object layer.