Skip to content
RCE Write-up Intermediate

Kids, this is story of How I Met... my VPS hacked

The author's VPS was compromised via an exposed JBoss HTTP Invoker, allowing remote code execution and deployment of a web shell. The attacker used this to mine bitcoins and install a backdoor war file for persistence.

corrspt.com

Published on corrspt.com

Just recently I published my technical goals for 2014 and one of them was to learn more about security. Well it couldn’t have been more appropriate, my Virtual Private Server (VPS) just got hacked, for the second time (I use the VPS to host a Java web application).

The author, on corrspt.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The JBoss HTTP Invoker and Web Console were deployed and accessible to anyone, allowing remote code execution.

Impact

The attacker could execute arbitrary commands, install a web shell, and use the server for bitcoin mining; the author is not fully certain the threat is removed.

What the attacker needed

JBoss HTTP Invoker exposed; No authentication on management interfaces

The fix

The HTTP Invoker and Web Console were removed, and malicious files were deleted.

How it was found

  1. Attacker sent requests to /a/pwn.jsp with commands like cat /proc/cpuinfo and ls to explore the system.
  2. Attacker downloaded a backdoor script using wget and executed it with perl.
  3. Attacker used the JBoss HTTP Invoker vulnerability to deploy a .war file containing a web shell.
  4. Attacker placed a hidden .war file in the deploy/management directory to re-deploy the web shell if removed.
  5. Attacker launched a bitcoin mining process named logrotate to consume CPU.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A web server running JBoss had a feature called HTTP Invoker left open, which let attackers run commands on the server. They uploaded a malicious program (web shell) to control the server and used it to mine cryptocurrency.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.