Threat · curated 24 Jul 2026

Hacker Runs Hermes AI Agent Unattended for Post-Exploitation at Thai Finance Ministry

Dossier

Coverage timeline

discovered hunt.io primary 24 Jul 2026thehackernews.com

Single-source incident — first reported, latest, and curated coincide.

Why it matters

The Hermes case shows a legitimate open-source AI assistant being weaponized as an unattended autonomous post-exploitation operator against a national finance ministry, marking a shift from AI-assisted to AI-executed intrusions that defenders must anticipate.

A threat actor installed the open-source Hermes AI agent from Nous Research on a rented server, disabled its permission-prompt safeguard by running in 'YOLO' mode, and pointed it at Thailand's Ministry of Finance, where the agent autonomously scanned hosts for root-access paths, searched file systems, and crawled staff personnel records dating to 2012. The operator exposed the agent's own logs on a web server with directory listing enabled, allowing Hunt.io and researcher Bob Diachenko to recover 585 files and 470 MB of attack tooling; the abuse relied on a documented feature of Hermes rather than any flaw in the tool.

exploited-vuln

Summary

An unidentified operator ran the open-source Hermes AI agent (from Nous Research) unattended, in its documented permission-bypassing YOLO mode, to conduct autonomous post-exploitation against Thailand's Ministry of Finance, which runs the country's treasury and tax collection. The agent iteratively scanned hosts for privilege-escalation paths, hunted file systems, and crawled a folder of staff personnel records dating to 2012.[0]

The intrusion was human-initiated: the operator was already inside before the agent started, having planted a hidden web shell and written custom scripts against named internal Hadoop systems. The agent automated the repetitive scan-read-decide loop, but nothing recovered shows it selecting the target or discovering a new vulnerability. No safety control exposed the operation; a web server left with directory listing enabled did, allowing Hunt.io and Bob Diachenko to recover 585 files and about 470 MB of tooling.[0]

The exploitation hinges on well-understood defaults and known flaws: Apache HiveServer2's default authentication mode of NONE (accepting any password), a malicious Java user-defined function (HiveCmd.jar) for command execution, and staged exploits for four 2026 Linux kernel LPE flaws plus older polkit, sudo, and IIS 6.0 issues. Nothing recovered demonstrates data leaving the network, and the initial access vector remains unknown.[0][18]

Attack chain

  1. Initial access (unknown): The operator was already inside the ministry network before the agent was launched; how initial access was obtained is unknown. A hidden web shell was planted on a ministry web server at /storage/Counter/nine/.journald-cache.php, disguised as a system cache file that does not appear in normal directory listings.[0]
  2. Tooling and agent staging: On a rented staging server (accessed via SSH from 103.97.0.57 in Hong Kong) the operator installed Hermes and enabled YOLO mode to remove the human approval step, then staged a customized linpeas.sh, LinPEAS, kernel-exploit checks, a Hades Go implant in 62 copies, and Hadoop attack scripts.[0]
  3. Autonomous reconnaissance and privilege-escalation hunting: Five call_00_*.txt log files show the agent running kernel vulnerability scans against a ministry host, two LinPEAS runs, a sweep for elevated-permission (SUID/capability) binaries, a filesystem listing, and a recursive crawl of the web root of the Office of the Permanent Secretary.[0]
  4. Hadoop compromise and command execution: The hive_rce_py2.py script connected to HiveServer2 on internal port 10000, exploited the default NONE authentication mode, and installed the HiveCmd.jar user-defined function to run operating-system commands as the Hive service account and read results through database queries.[0][18]
  5. Data access (no confirmed exfiltration): The agent read a directory containing Office documents, performance evaluations, and personnel records dating to 2012, but none of the recovered logs show the files leaving the network.[0]

Disclosure timeline

DateEvent
2025-11-13Anthropic discloses a Chinese state-sponsored group's AI-orchestrated espionage campaign abusing Claude Code, providing the contrast case cited by researchers.[10]
2026-07-15Thailand's national CERT and cybersecurity agency were notified of the findings.[0]
2026-07-23Hunt.io's report notes roughly 5,900 HermesWebUI scan events over a month and 575 hits for the /hermes-results/ folder in its exposed-directory index.[0]
2026-07-24The Hacker News publishes the story; neither Thai CERT nor the cybersecurity agency had published anything as of that check.[0]

How it works

Apache HiveServer2's default authentication mode is NONE, which accepts whatever password it is given without validating it. The hive_rce_py2.py script connects to HiveServer2 on internal port 10000, authenticates with any password, and installs a malicious Java user-defined function (HiveCmd.jar). Cloudera warns that anyone able to install such a UDF can run arbitrary code as the Hive service account and reach sensitive data, effectively turning ordinary database queries into OS command execution.[0][18][19]

The staged custom linpeas.sh checked four 2026 Linux kernel local-privilege-escalation flaws across three families: Copy Fail (CVE-2026-31431), Dirty Frag (CVE-2026-43284 and CVE-2026-43500) and DirtyClone (CVE-2026-43503). Each grants a local user root where its prerequisites hold; for Dirty Frag and DirtyClone that prerequisite is the CAP_NET_ADMIN capability. Nothing recovered names a ministry kernel version or shows any of the four actually ran.[0][17]

Hermes's YOLO mode is a documented feature, not a flaw, that removes the per-command human approval prompt via a --yolo launch flag, a /yolo mid-session command, or the HERMES_YOLO_MODE=1 environment variable. A hardline blocklist still refuses commands that would wipe the agent's own host, so the operator disabled the human check rather than every safeguard.[0]

Affected versions and patch status

ProductAffectedPatch status
Apache HiveServer2Deployments running with authentication mode set to NONE (the default), which accepts any passwordConfiguration hardening required: change authentication from NONE and restrict who can install user-defined functions[0][18]
Linux kernelVersions vulnerable to Copy Fail (CVE-2026-31431), Dirty Frag (CVE-2026-43284, CVE-2026-43500) and DirtyClone (CVE-2026-43503)Patch kernels against all four 2026 flaws[0]
sudoVersions before 1.9.5p2Update to sudo 1.9.5p2 or later[0]
polkitVersions vulnerable to CVE-2021-4034 (PwnKit)Patch polkit for CVE-2021-4034[0][36]
Microsoft IIS 6.0Installations with WebDAV enabledRemediate any remaining IIS 6.0 WebDAV exposure[0]

Indicators of Compromise

TypeIndicatorContext
ip103.97.0.57Hong Kong host from which the operator's SSH session into the staging server originated; the same server previously hosted a ShadowPad controller and now runs a VShell C2 listener.[0]
file-path/storage/Counter/nine/.journald-cache.phpHidden PHP web shell planted on a ministry web server, disguised with a leading-dot name imitating a system cache so it does not appear in normal directory listings.[0]
file-path/hermes-results/Consistent folder where the Hermes agent writes its results with predictable filenames; Hunt.io found 575 exposed hits for this path, making it a strong hunting hook for exposed operator infrastructure.[0]
otherHermesWebUI (HTTP server header)Server header returned by the Hermes web panel; a search on this string returned roughly 5,900 scan events over a month, useful for identifying Hermes web interfaces.[0]
file-hashHiveCmd.jarMalicious Java user-defined function installed via HiveServer2 to execute OS commands as the Hive service account (filename indicator; no hash provided).[0]
otherhive_rce_py2.pyPython script that connects to HiveServer2 on port 10000, sends any password to abuse the default NONE authentication, and installs the HiveCmd.jar UDF.[0]
otherHadesPreviously undocumented Go implant staged in 62 Windows and Linux copies; hardcoded addresses tie the staging server to a second Hong Kong host.[0]
cveCVE-2026-31431Copy Fail Linux kernel LPE flaw checked by the operator's customized linpeas.sh.[0][32]
cveCVE-2026-43284Dirty Frag Linux kernel LPE flaw (requires CAP_NET_ADMIN) checked by the staged scanner.[0][33]
cveCVE-2026-43500Second Dirty Frag Linux kernel LPE flaw checked by the staged scanner.[0][34]
cveCVE-2026-43503DirtyClone Linux kernel LPE flaw (requires CAP_NET_ADMIN) checked by the staged scanner.[0][35]
cveCVE-2021-4034Legacy polkit (PwnKit) flaw for which exploit code was staged on the server.[0][36]

Key takeaways

  • Unlike vendor-hosted AI abuse (e.g. the Chinese group manipulating Claude Code that Anthropic detected and banned), Hermes runs on the operator's own machine, so no vendor is watching and there is no account to ban; the safeguard that failed the operator was an exposed directory listing, not any AI safety control.[0][10]
  • The AI agent automated only the repetitive reconnaissance loop; the human still performed the target-specific work, including a password list built from the ministry's own department abbreviations and shellcode with hardcoded ministry intranet paths.[0]
  • The exploitation relied on ordinary weaknesses—Apache Hive's default NONE authentication, a malicious Hive UDF, and known kernel/polkit/sudo/IIS flaws—so endpoint defenders see the same commands and tools whether or not a human is at the keyboard.[0]

Defensive actions

  • Check whether HiveServer2 is running with authentication set to NONE and restrict who can install user-defined functions.: That default is exactly what the operator's hive_rce_py2.py script was written to rely on to gain code execution via HiveCmd.jar.[0][18][19]
  • Alert when a web server process opens a connection to internal Hadoop ports such as 10000 or 50070.: A web server reaching a Hadoop node is anomalous and matches the observed pivot from the compromised web server into the Hive cluster.[0]
  • Recursively search web roots for PHP files with leading-dot names that imitate system caches.: The recovered web shell sat at /storage/Counter/nine/.journald-cache.php and does not appear in normal directory listings.[0]
  • Patch kernels against the four 2026 LPE flaws, update sudo to 1.9.5p2 or later, patch polkit for CVE-2021-4034, and remediate any remaining IIS 6.0 WebDAV.: Exploit code and a customized scanner for all of these were staged for privilege escalation during the intrusion.[0]
  • Hunt for the HermesWebUI server header and the /hermes-results/ folder with predictable filenames.: The agent leaves its own trail regardless of safety settings; these artifacts identify exposed Hermes-based operator infrastructure.[0]