Cyber News

Cryptomining Payloads Deployed via Java Debug Wire Protocol Server Exploits by Hackers

In a recent security incident, the Wiz Research Team uncovered a sophisticated cyberattack targeting TeamCity, a popular continuous integration and delivery (CI/CD) platform, by abusing an exposed Java Debug Wire Protocol (JDWP) interface.

This attack highlights the risks of misconfigured debugging utilities and the rapid exploitation capabilities of modern threat actors.

Fast, Stealthy Attacks – How JDWP Became a Target

JDWP is a built-in Java protocol designed for remote debugging of applications. While invaluable during development, JDWP lacks default authentication or access control mechanisms.

JDWP Targeting

If left exposed to the internet, often due to misconfiguration or careless deployment, it enables attackers to inspect and control live Java applications remotely.

JDWP is not enabled by default but is frequently activated in debug environments for widely used platforms, such as TeamCity, Jenkins, Selenium Grid, and Apache Tomcat.

In this incident, attackers rapidly identified and compromised a honeypot CI server with an open JDWP port (5005). Wiz observed that malware was deployed within hours of exposure, reflecting JDWP’s popularity among cybercriminals.

Further analysis, including GreyNoise data, revealed over 6,000 unique IPs scanning for JDWP instances in just 90 days.

From Exploit to Persistence – The Attack Chain Unveiled

After confirming the open JDWP port via handshake, the attackers leveraged protocol features to enumerate loaded Java classes and methods.

By interacting directly with the JVM through JDWP, they invoked java.lang.Runtime.getRuntime(). exec () to execute custom shell commands. These commands fetched and executed a dropper script (logservice.sh) from attacker-controlled domains.

The dropper script implemented several malicious actions:

  • Termination of Competing Processes: Any process consuming more than 60% of the CPU (except those on a limited allowlist) was targeted and terminated to maximize mining efficiency.
  • Cryptominer Deployment: A renamed, customized XMRig miner binary was downloaded and placed in a concealed directory, with its configuration hardcoded to avoid detection by traditional security tools.
  • Multi-layered Persistence: The miner setup registered itself in system startup files (.bashrc, .zshrc, rc.local), created cron jobs, and established a persistent systemd service—each camouflaged as legitimate utilities.

To further evade detection, the miner communicated via mining pool proxies, which obscured the wallet address and made forensic attribution challenging.

Detection and Mitigation

Wiz’s agentless malware detection and runtime sensors proved effective in flagging each phase of the attack, from the initial JDWP exploitation to cryptomining activity.

The company’s catalog of YARA rules and behavioral analytics can recognize not only the malicious scripts (logservice.sh, modified XMRig binaries) but also system modifications such as unauthorized cron job insertions and new systemd service files.

This incident highlights the importance of securing debug interfaces, particularly JDWP, by restricting network exposure, enforcing robust access controls, and monitoring for suspicious configuration changes.

As cryptomining attacks evolve, layered detection and rapid remediation remain essential for protecting CI/CD infrastructure.

Priya

Recent Posts

Burp Suite Supercharges Its Scanning Capabilities With React2Shell Vulnerability Detection

PortSwigger has leveled up Burp Suite's scanning arsenal with the latest Active Scan++ extension, version…

4 months ago

Malicious MCP Servers Enable New Prompt Injection Attack To Drain Resources

Unit 42 researchers at Palo Alto Networks exposed serious flaws in the Model Context Protocol…

4 months ago

Law Enforcement Detains Hackers Equipped With Specialized Flipper Hacking Tools

Polish police have arrested three Ukrainian men traveling through Europe and seized a cache of…

4 months ago

Google Unveils 10 New Gemini-Powered AI Features For Chrome

Google has launched its most significant Chrome update ever, embedding Gemini AI across the browser…

4 months ago

CISA Alerts On Actively Exploited Buffer Overflow Flaw In D-Link Routers

Attackers exploit this vulnerability through the router's web interface components, specifically "cgibin" and "hnap_main," by…

4 months ago

Over 500 Apache Tika Toolkit Instances Exposed To Critical XXE Vulnerability

Security researchers have uncovered a severe flaw in Apache Tika, a popular open-source toolkit for…

4 months ago