Threat reportVulnerabilityTL-2026-2067
khunt Toolkit: SQL Injection Against Oracle/Tomcat Enables In-Database Post-Exploitation
Threat actors exploited an unauthenticated SQL injection flaw in a public-facing Java/Tomcat application's autocomplete search feature to reach an over-permissioned Oracle JDBC account, then used Oracle's CREATE JAVA SOURCE statement to compile the 'khunt' post-exploitation toolkit as database schema objects. First disclosed .
Key facts
| Identifiers | TL-2026-2067 |
|---|---|
| Also known as | khunt, KHunt Toolkit |
| Severity | HIGH |
| First disclosed | |
| Affected products | Unspecified Public-facing Java/Apache Tomcat web application (autocomplete search feature) with Oracle JDBC backend; Oracle Oracle Database (embedded Java Virtual Machine / CREATE JAVA SOURCE capability) |
| Weaknesses (CWE) | CWE-89 |
| Malware | khunt |
| Tools | Reg - S0075, cmd - S0106, esentutl - S0404 |
| MITRE ATT&CK techniques | T1003 OS Credential Dumping, T1003.002 Security Account Manager, T1005 Data from Local System, T1007 System Service Discovery, T1033 System Owner/User Discovery, T1059.001 PowerShell, T1059.003 Windows Command Shell, T1074.001 Local Data Staging, T1190 Exploit Public-Facing Application, T1505.001 SQL Stored Procedures |
| Motivation | UNKNOWN |
| Detection rules | 9 (1 shown free) |
| Sources | 7 cited sources |
Detection coverage
As of 2026-08-18, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-2067 across Splunk SPL, Microsoft KQL and Sigma, covering 8 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: In-Database Command Execution via KhuntCmd — Oracle Process Spawning cmd.exe/PowerShell for Privilege and Service Discovery
Detects OS command execution reachable through the Oracle database's embedded JVM (the KhuntCmd Java object) — identified by the Oracle service process (oracle.exe / TNS listener) spawning cmd.exe or powershell.exe as a child process, and the specific discovery commands observed in the khunt incident (`whoami` to confirm SYSTEM privilege inheritance, `tasklist /svc` to enumerate services) and general file-system enumeration consistent with the KhuntFS/KhuntFS2 objects.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1059.003, T1059.001, T1033, T1007, T1083
- Data sources: sysmon, windows_security, microsoft_defender_for_endpoint
- Severity: critical
- Confidence: high
Splunk SPL
index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(ParentImage="*\\oracle.exe" OR ParentImage="*\\tnslsnr.exe" OR ParentImage="*oracle*")
(Image="*\\cmd.exe" OR Image="*\\powershell.exe" OR Image="*\\tasklist.exe")
| eval hit_type=case(
like(CommandLine,"%whoami%"),"privilege_confirmation",
like(CommandLine,"%tasklist%/svc%"),"service_discovery",
1=1,"generic_oracle_child_process")
| table _time, host, ParentImage, Image, CommandLine, User, hit_type
| sort -_timeMicrosoft KQL
DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("oracle.exe", "tnslsnr.exe", "oracleservice.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "tasklist.exe")
| extend HitType = case(
ProcessCommandLine has "whoami", "privilege_confirmation",
ProcessCommandLine has_all ("tasklist", "/svc"), "service_discovery",
"generic_oracle_child_process")
| project Timestamp, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine, AccountName, HitType
| order by Timestamp descSigma
title: Oracle Service Process Spawning Command Interpreter (khunt KhuntCmd In-Database RCE)
id: 9d2f6b3e-4c1a-4a7f-8e2d-3b5f9a0c6d22
status: experimental
description: Detects cmd.exe, powershell.exe, or tasklist.exe spawned as a child of the Oracle database service process, consistent with OS command execution issued through the khunt toolkit's KhuntCmd Java object, including the whoami privilege-confirmation and tasklist /svc service-enumeration commands observed in the Huntress-documented incident.
references:
- https://www.huntress.com/blog/khunt-malware-sql-injection-oracle
- https://attack.mitre.org/techniques/T1059/003/
- https://attack.mitre.org/techniques/T1033/
- https://attack.mitre.org/techniques/T1007/
author: Threadlinqs Team
date: 2026-08-18
tags:
- attack.execution
- attack.t1059.003
- attack.t1059.001
- attack.discovery
- attack.t1033
- attack.t1007
- attack.t1083
- attack.tool.khunt
logsource:
category: process_creation
product: windows
detection:
sel_parent:
ParentImage|endswith:
- '\oracle.exe'
- '\tnslsnr.exe'
- '\oracleservice.exe'
sel_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\tasklist.exe'
condition: sel_parent and sel_child
falsepositives:
- Authorized DBA maintenance scripts that legitimately shell out from the Oracle service account (should be rare and change-controlled)
- Third-party Oracle management tooling that spawns command-line utilities for backup/health checks
level: criticalKnown false positives:
- Legitimate DBA or backup-agent scripts that spawn cmd.exe/powershell.exe from the Oracle service account for scheduled maintenance
Tuning notes: Build an allowlist of known, change-controlled Oracle maintenance scripts (by full command line and parent image path) to suppress expected DBA automation; treat any first-time-seen child process of the Oracle service account as high priority regardless of the specific command.
- Oracle SQL Injection via Autocomplete Endpoint Reaching CREATE JAVA SOURCE · unlock with TL Creds
- In-Database Command Execution via KhuntCmd — Oracle Process Spawning cmd.exe/PowerShell for Privilege and Service Discovery · unlock with TL Creds
- Registry Hive Export and Staging via reg.exe/esentutl.exe Following Oracle-Layer Compromise (khunt Credential Theft) · unlock with TL Creds
- Oracle SQL Injection via Autocomplete Endpoint Reaching CREATE JAVA SOURCE · unlock with TL Creds
- Oracle Service Process Spawning Command Interpreter (KhuntCmd In-Database RCE) · unlock with TL Creds
- SAM/SECURITY/SYSTEM Registry Hive Export via reg.exe or esentutl.exe (khunt Credential Staging) · unlock with TL Creds
- Oracle SQL Injection via Autocomplete Endpoint Reaching CREATE JAVA SOURCE · unlock with TL Creds
- Registry Hive Export and Staging via reg.exe/esentutl.exe Following Oracle-Layer Compromise (khunt Credential Theft) · unlock with TL Creds
Indicators of compromise
As of 2026-08-18, Threadlinqs Intelligence tracks 8 indicators of compromise for TL-2026-2067.
Sample indicators (1 of 8)
- IP address:
178.162.151[.]229
Defanged, TLP:CLEAR. Full set of 8 indicators: unlock with TL Creds.
Technical analysis
Khunt gave the attackers SYSTEM-level OS command execution, Oracle credential-table dumping, file-system enumeration, and archive handling, which they used to confirm SYSTEM privileges, enumerate services, and stage copies of the SAM, SECURITY, and SYSTEM registry hives for exfiltration.
On 27 July 2026, Huntress investigated credential-theft detections on a customer's Windows server hosting Oracle Database and traced the activity back to an unauthenticated SQL injection vulnerability in the autocomplete search feature of a public-facing Java/Apache Tomcat web application. The application passed unvalidated user input directly into SQL statements executed over a JDBC connection using a database account that was permissioned to create Java objects — no novel or exotic vulnerability was required, since the autocomplete field alone was sufficient to reach PL/SQL and, from there, the underlying operating system.
Rather than dropping a conventional OS-level binary, the attackers abused Oracle's embedded Java Virtual Machine and its CREATE JAVA SOURCE statement to compile malicious Java code directly into the database as compiled schema objects, paired with khunt_-prefixed PL/SQL wrapper procedures that exposed the underlying Java methods to ordinary SQL calls. Because the payload lives as Java classes and PL/SQL wrappers inside the database rather than as files or processes on disk, it falls outside the visibility of most endpoint security tooling, which is built to inspect processes, binaries, and the filesystem rather than database schema objects.
The resulting toolkit, dubbed 'khunt', consists of six named Java objects: KhuntCmd (loads cmd.exe to run arbitrary OS commands issued as SQL), KhuntHash (extracts usernames and password data from Oracle's internal user tables to a file), KhuntFS and KhuntFS2 (file-system explorers for listing, reading, searching, and sizing files), KhuntT (a toolkit-reachability/connectivity check), and KhuntUnzip (archive decompression). Huntress noted the architecture closely mirrors Marco Ivaldi's 2006 raptor_oraexec.sql exploitation suite — a Java-source-object-plus-PL/SQL-wrapper technique for Oracle RCE that has long been publicly documented but, per Huntress, rarely observed exploited in the wild until this incident.
Using khunt, the attackers ran `cmd.exe /c whoami` via KhuntCmd to confirm that commands executed through the Oracle database inherited SYSTEM-level privileges on the underlying Windows host — a consequence of the Oracle service account itself running as SYSTEM. They then ran `tasklist /svc` to enumerate running services (saved as khunttasks.txt) and used `reg.exe` save operations together with `esentutl.exe` (the Extensible Storage Engine utility, used to copy files normally locked by the OS) to copy the SAM, SECURITY, and SYSTEM registry hives, staging the resulting .hiv files under an `F:\Oracle\` directory ahead of likely exfiltration. Huntress's investigation did not confirm that exfiltration of the staged hives actually completed. No CVE was assigned, since the root cause is an application-specific input-validation failure combined with database-account overprovisioning rather than a product vulnerability; no CVSS score was published by the source. Huntress publicly disclosed the technique, IOCs, and hunting guidance on 5 August 2026, and it was subsequently covered by BleepingComputer, The Hacker News, CSO Online, GBHackers, and Infosecurity Magazine, among others.
MITRE ATT&CK techniques by tactic:
Credential Access
T1003 OS Credential Dumping; T1003.002 Security Account Manager
Collection
T1005 Data from Local System; T1074.001 Local Data Staging
Discovery
T1007 System Service Discovery; T1033 System Owner/User Discovery
Execution
T1059.001 PowerShell; T1059.003 Windows Command Shell
Initial Access
T1190 Exploit Public-Facing Application
Persistence
Remediation
Immediate actions
- Search Oracle schema objects and stored-procedure catalogs for names matching 'Khunt%' or unexpected CREATE JAVA SOURCE objects
- Review SQL/audit logs for 'KHUNT%' patterns and for unexpected CREATE JAVA SOURCE / CREATE PROCEDURE statements originating from application service accounts
- Check for staged registry hive exports (SAM/SECURITY/SYSTEM .hiv files) in unusual locations such as application data directories
- Rotate credentials for any Oracle JDBC service account used by the affected public-facing application
Workarounds
- Disable or restrict the JVM/CREATE JAVA SOURCE capability on Oracle instances that do not require it
- Ensure the autocomplete/search input in the affected application is fully parameterized and does not concatenate user input into SQL
Longer-term hardening
- Enforce least-privilege on database accounts used by public-facing applications: remove CREATE JAVA SOURCE, CREATE PROCEDURE, and other administrative privileges that are unnecessary for normal application function
- Deploy database-activity monitoring capable of alerting on Java class compilation and PL/SQL wrapper creation, since endpoint/EDR tooling does not inspect in-database schema objects
- Run the Oracle listener and RDBMS service account with the minimum OS privileges required, rather than as SYSTEM/root, to limit blast radius of any in-database code execution
Affected and fixed versions
- Unspecified — Public-facing Java/Apache Tomcat web application (autocomplete search feature) with Oracle JDBC backend
Vulnerable versions: Application-specific SQL injection flaw; no product version disclosed - Oracle — Oracle Database (embedded Java Virtual Machine / CREATE JAVA SOURCE capability)
Vulnerable versions: Any Oracle Database instance with JVM enabled and a JDBC application account permissioned to CREATE JAVA SOURCE
Timeline
- Attacker uses reg.exe and esentutl.exe to copy the SAM, SECURITY, and SYSTEM registry hives, staging them as locked-ioc-6, locked-ioc-2, locked-ioc-1, and locked-ioc-4 under locked-ioc-7 ahead of likely exfiltration
- Attacker runs `tasklist /svc` to enumerate running Windows services, saving output to locked-ioc-5
- Attacker runs `cmd.exe /c whoami` via KhuntCmd, confirming OS commands issued through Oracle execute with SYSTEM-level privileges on the Windows host
- Attacker uses CREATE JAVA SOURCE statements to compile the khunt Java objects (KhuntCmd, KhuntHash, KhuntFS, KhuntFS2, KhuntT, KhuntUnzip) and PL/SQL wrappers into the database schema
- Attacker exploits the unauthenticated SQL injection flaw in the application's autocomplete search feature, reaching the Oracle JDBC backend from source IP locked-ioc-3
- Huntress investigates credential-theft detections on a customer's Oracle Database server, initiating the incident response that uncovers the khunt toolkit
- BleepingComputer, The Hacker News, CSO Online, GBHackers, and Infosecurity Magazine republish and analyze the Huntress findings
- Huntress publishes 'Inside an Oracle Database SQL Injection Attack', detailing the khunt toolkit, attack chain, IOCs, and hunting guidance
Sources cited
- raptor_oraexec.sql — Oracle Java-source-object RCE exploitation suite (2006) GitHub · Proof of concept · 2006-01-01
- Inside an Oracle Database SQL Injection Attack Huntress · Blog · 2026-08-05
- Hackers run khunt post-exploitation toolkit from Oracle database BleepingComputer · News · 2026-08-05
- Attackers Compile khunt Inside Oracle to Turn SQL Injection Into Windows SYSTEM Access The Hacker News · News · 2026-08-05
- Attackers hid malware inside Oracle Database after SQL injection breach csoonline.com · News · 2026-08-05
- KHunt Toolkit Turns Oracle SQL Injection Into SYSTEM-Level RCE and Credential Theft gbhackers.com · News · 2026-08-05
- Toolkit Hidden Inside Oracle Database Evades Endpoint Tools infosecurity-magazine.com · News · 2026-08-05
Previous and next in vulnerability
- Oracle August 2026 CSPU: Nine Vulnerabilities in Agile Engineering Data Management 6.2.1, Including Unauthenticated Web Services Security Flaws (CVE-2026-71052, CVE-2026-71053) Previous report
- Critical Microsoft Copilot CoSnitch Vulnerability (CVE-2026-24301) Enabled One-Click Data Theft From Connected Accounts Next report
Drafted by the Threadlinqs research pipeline from 7 sources; published ; last updated —.