root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat shocker.md
// writeups

Shocker

30 Sep 2017 · 9 min read · root access
Shocker - maquina de Hack The Box

Executive summary — Shocker is the textbook Easy Linux box about Shellshock: an Apache 2.4.18 with a Bash CGI script (/cgi-bin/user.sh, physically at /usr/lib/cgi-bin) lets us inject commands through the User-Agent header (CVE-2014-6271) for RCE as shelly. Escalation is direct: sudo allows running Perl as root without a password. A CGI/Shellshock → shelly → sudo perl → root path.

PlatformHack The Box
Operating systemUbuntu Linux
DifficultyEasy
StatusRetired
Target IP10.129.3.102

Attack map

[80] Apache 2.4.18 (Ubuntu) + CGI
   │  gobuster -x sh,cgi,txt → /cgi-bin/ → /cgi-bin/user.sh (Bash script)
   │  CVE-2014-6271 (Shellshock) via User-Agent header → RCE
   ▼
[SHELL]  shelly  (/usr/lib/cgi-bin) → user.txt
   │  sudo -l → (root) NOPASSWD: /usr/bin/perl
   ▼
[ROOT]  sudo perl -e 'exec "/bin/bash"'  → root.txt

1. Reconnaissance

We start with a standard service scan: basic NSE scripts (-sC) plus version detection (-sV) against the target.

nmap -sC -sV 10.129.3.102
80/tcp   open  http    Apache 2.4.18 (Ubuntu)
2222/tcp open  ssh     OpenSSH 7.2p2 Ubuntu

Port 80 (Apache): the interesting one. Apache can run CGI scripts, and Shellshock specifically affects Bash — if those CGI scripts invoke Bash, the box is a direct candidate for the vulnerability. The homepage shows no title or relevant content, suggesting the real functionality lives on paths not linked from the index.

Port 2222 (SSH), why we don't attack it first: it's on a non-standard port but gives us nothing without credentials — there's no obvious vulnerability in OpenSSH 7.2p2. On Easy boxes, SSH is usually the later access point once credentials or a key are obtained, not the initial vector.

🔒 Clearance required

This content is Root Access only. Everything else on the site — the free tier, the whole public library — stays open.

See Root Access plans

No account? Create one free then upgrade from your console.