top of page
perceptive_background_267k.jpg

Attackers Compile khunt Inside Oracle to Turn SQL Injection Into Windows SYSTEM Access

Published:

6 August 2026 at 09:19:23

Alert date:

6 August 2026 at 10:01:02

Source:

thehackernews.com

Click to open the original link from this advisory

Database & Storage, Web Technologies, Ransomware & Malware, Data Breach & Exfiltration, Identity & Access

Attackers exploited a SQL injection vulnerability in a public-facing web application to gain access to an organization's Oracle database. Rather than dropping executable files to disk, they used a fileless technique by feeding Java source code directly to the Oracle database engine, which compiled it into stored schema objects. This allowed them to execute system commands from within the database engine itself. The post-exploitation toolkit, tracked by Huntress as 'khunt', enabled privilege escalation to Windows SYSTEM-level access. The attack chain demonstrates a sophisticated living-off-the-land approach leveraging Oracle's built-in Java compilation capabilities. The technique avoids traditional file-based detection mechanisms, making it harder for endpoint security tools to detect. Huntress identified and named the toolkit based on their investigation of the intrusion.

Technical details

Attackers exploited a SQL injection vulnerability in an unvalidated autocomplete search field of a public-facing web application that communicated with an Oracle database over a JDBC connection. The compromised database account had sufficient privileges (at minimum CREATE PROCEDURE) to create Java schema objects. Attackers submitted Java source code via the CREATE JAVA SOURCE Oracle SQL statement, which Oracle's embedded JVM compiled and stored as schema objects — never writing a binary or executable to disk, evading most EDR products. The toolkit, tracked as 'khunt', consisted of six Java objects and several PL/SQL wrappers: KhuntCmd (executes OS commands via cmd.exe), KhuntHash (extracts Oracle user password hashes to a file), KhuntFS and KhuntFS2 (filesystem enumeration, read, search, size), KhuntT (connectivity check), and KhuntUnzip (archive extraction). Running KhuntCmd with 'cmd.exe /c whoami' returned SYSTEM-level access on the underlying Windows server. Post-exploitation activity included using PowerShell and reg.exe to copy SECURITY and SYSTEM registry hives to F:\Oracle, running tasklist /svc into khunttasks.txt, and copying SAM and SECURITY hives with esentutl.exe for credential harvesting. The technique is architecturally similar to Marco Ivaldi's raptor_oraexec.sql from 2006. The malicious requests originated from IP 178.162.151[.]229. Detection firing occurred on July 27, 2026 via credential-theft alerts.

Mitigation steps:

1. Search the Oracle installation for schema object names beginning with 'Khunt' to detect toolkit presence. 2. Search Oracle SQL logs for entries matching 'KHUNT%' to identify malicious activity. 3. Implement parameterized queries and rigorous input validation in all public-facing web applications that interact with Oracle databases to prevent SQL injection. 4. Apply the principle of least privilege: accounts serving public-facing applications should not have CREATE PROCEDURE, CREATE JAVA SOURCE, or Runtime.exec permissions. 5. Audit and revoke unnecessary Java object creation and stored procedure execution privileges from database accounts. 6. Monitor for suspicious use of Oracle's CREATE JAVA SOURCE statement and Runtime.exec calls within the database. 7. Block or alert on traffic to/from IP 178.162.151[.]229. 8. Monitor for unexpected registry hive exports (SECURITY, SYSTEM, SAM) and use of esentutl.exe for credential staging. 9. Review Oracle database accounts for overly permissive privilege grants and remediate. 10. Implement database activity monitoring to inspect Oracle internals that EDR products typically do not cover.

Affected products:

Oracle Database (with embedded Java Virtual Machine
versions unspecified)
Microsoft Windows (SYSTEM-level access achieved on underlying Windows server)

Related links:

Related CVE's:

Related threat actors:

IOC's:

178.162.151[.]229, Oracle schema object names beginning with 'Khunt', SQL log entries matching pattern 'KHUNT%', KhuntCmd, KhuntHash, KhuntFS, KhuntFS2, KhuntT, KhuntUnzip, khunttasks.txt, Registry hives copied to F:\Oracle (SECURITY, SYSTEM, SAM)

This article was created with the assistance of AI technology by Perceptive.

© 2025 by Perceptive Security. All rights reserved.

email: info@perceptivesecurity.com

Disclaimer: Deze website toont informatie afkomstig van externe bronnen. Perceptive aanvaardt geen verantwoordelijkheid voor de inhoud, juistheid of volledigheid van deze informatie.

bottom of page