Skip to content
RCE Write-up Intermediate

Escaping from Restricted Shell and Gaining Root Access

The SolarWinds Log & Event Manager appliance shipped with a default SSH password for the 'cmc' user, and the restricted shell menu allowed command injection via the 'restrictssh' feature, enabling escape to a full shell. From there, a local kernel privilege escalation exploit (perf_swevent) was used to gain root access.

pentest.blog

Published on pentest.blog

By time goes, I’ve found myself more focusing on SIEM product during penetration test. This is the fourth article of my article series called as “Unexpected Journey” which all of them focused on different SIEM products.

The author, on pentest.blog

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

Likely the combination of a default SSH password that was not forced to be changed and a restricted shell menu that passed user input directly to a shell command without sanitisation, plus an outdated kernel vulnerable to a known local privilege escalation.

Impact

An attacker with network access could log in with default credentials, escape the restricted shell, and gain root access to the appliance, leading to full compromise.

What the attacker needed

Network access to SSH port 32022; default credentials for 'cmc' user

How it was found

  1. Connect to SSH on port 32022 using the default credentials for the 'cmc' user.
  2. Enter the 'service' menu and then the 'restrictssh' submenu.
  3. Provide a crafted input containing a shell command to break out of the restricted shell.
  4. Compile and upload a local privilege escalation exploit for the old kernel.
  5. Run the exploit to obtain a root shell.

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.

The product had a built-in user account with a password that was the same for every installation, and nobody was forced to change it. The limited menu that user could access had a feature that let you type in an IP address, but it didn't check the input properly, so you could sneak in a command to get a normal shell. Once on the system, an old Linux kernel bug allowed the attacker to become the all-powerful root user.

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.