Inside an Oracle Database SQL Injection Attack | Huntress
Huntress details a July 2026 incident where attackers exploited a classic SQL injection flaw in a public-facing Java/Tomcat application to reach an Oracle database over JDBC, then used Oracle's CREATE JAVA SOURCE statement to compile a custom post-exploitation toolkit called khunt directly as database objects. Khunt modules (KhuntCmd, KhuntHash, KhuntFS/FS2, KhuntT, KhuntUnzip) let the attacker run OS commands, dump Oracle credentials, browse the filesystem, and ultimately pivot to SYSTEM-level RCE on the underlying Windows host, where they exfiltrated SAM/SECURITY/SYSTEM registry hives. It's notable because storing malicious code as PL/SQL/Java database objects rather than OS files/processes evades traditional EDR and AV visibility.
What it is
Huntress's incident writeup of a real-world SQL injection against a public-facing Java/Tomcat app with an Oracle backend, escalating to SYSTEM-level RCE and registry-hive theft via the database-resident khunt toolkit. The summary already covers the toolkit and the oraexec/CREATE JAVA SOURCE technique; what follows are the concrete detection and hunting artifacts the summary omits.
How it works
The injectable endpoint was an autocomplete search feature in the app — no novel vuln was needed. Tomcat passed the SQL over its JDBC connection to Oracle, where CREATE JAVA SOURCE compiled attacker Java into stored schema objects, wrapped by khunt_* PL/SQL. KhuntCmd then bridged from the database layer to the OS by loading cmd.exe.
Detection signals
- Process ancestry:
reg.exe(and other OS tooling) spawned from anoracle.exeparent process. This is the pivot from DB to OS and the strongest single signal. - On-disk artifacts written to
F:\Oracle\: khuntSECURITY.hiv,khuntSYSTEM.hiv(viareg.exethrough PowerShell)khunt_SECURITY.hiv,khuntSAM.hiv(viaesentutl.exe)khunttasks.txt(output oftasklist /svc)- Attacker infrastructure: source IP
178.162.151[.]229, traced via the volume of requests to the injectable endpoint in Apacheaccess.log. - Observed commands:
cmd.exe /c whoami(used to confirm SYSTEM),tasklist /svc, plusreg.exeandesentutl.exehive copies.
Note the attacker copied SECURITY twice using two different tools (reg.exe and esentutl.exe) — worth accounting for when scoping.
flowchart TD A[Autocomplete search field, no input validation] --> B[Tomcat -> JDBC -> Oracle] B --> C[CREATE JAVA SOURCE: khunt compiled as DB object] C -->|trust boundary: DB -> OS| D[KhuntCmd loads cmd.exe as SYSTEM] D --> E[reg.exe / esentutl.exe dump SAM/SECURITY/SYSTEM hives] A -. input validation cuts here .-> X[blocked]
What to do
The page's stated mitigation is fixing the root cause: validate/parameterize inputs so form fields cannot reach PL/SQL. It also flags the core defensive gap — because the toolkit lives as a database schema object rather than a file or memory-resident payload, traditional EDR can miss it, so hunt in Oracle for anomalous JAVA SOURCE objects and khunt_* PL/SQL wrappers in addition to the OS-level signals above.
Caveats
The writeup is a single incident narrative; it gives no CVE, no patch, and no exhaustive IOC list beyond the artifacts above. The oraexec technique itself is described as long-known but rarely seen in the wild — treat the specific file names and paths as this actor's convention, not a fixed signature.
Organisations named here
- 178.162.151.229
- oraexec
Technologies named here
- Oracle Database
- khunt toolkit
- Apache Tomcat
- KhuntCmd
- KhuntHash
- Windows Server
- KhuntFS
- KhuntFS2
- KhuntT
- KhuntUnzip
- khunt_* PL/SQL wrappers
- reg.exe
- esentutl.exe
- tasklist
- Java
- Windows
- PowerShell
Techniques named here
- SQL injection
- OS command execution from database layer
- Credential/registry hive theft
- Service enumeration
Threat actors named here
- khunt
Related in AppSec
Flowise MCP Security Bypass Enables RCE
OASIS
