Black Box 2
Write up for the Black-Box PenTesting 2 by the end of the PTS from IN
Target:
172.16.64.0/24Goals
Discover and exploit all the machines on the network.
Read all flag files (one per machine)
Obtain a reverse shell at least on 172.16.64.92
What you will learn:
Taking advantage of DNS and virtual hosts.
Bypassing client-side access controls.
Abusing unrestricted file upload to achieve remote code execution
Recommended tools
Dirb.
Metasploit framework (recommended version: 5).
Nmap.
SQLmap.
BurpSuite.
My Solution:
Network+Info:
routing:
recon:
OS FingerPrinting:
First Target (Apache httpd Ubuntu):
target:
dir busting:
/webapp is interesting let's busted we get the following:
From the Fourth target:
we can add to /etc/hosts the .bak content so we can resolve it and chek the websites:
static.foocorp.io
cms.foocorp.io
in static.foocorp.io using BurpSuite (or dir busting ) we will arrive to /img/custom/thumbs/users.bak :
it redirects to /home then /500 not config maybe but /home in burpsuite shows DB info in the header et's use mysql:

really helpful: https://www.mariadbtutorial.com/mariadb-basics/mariadb-select-database/
we can get all the users:
Second Target (Apache httpd Ubuntu):
target:
dir busting:
from the third target we discovered the new dns entery let's gobust it:
Third Target (Apache DNS-cache + Photon HTML5 Ubuntu):
target:
dir busting:
dir bust:
SQLi:
login.php interesting we will try the cracked dump pass and will crack more as it but in the source code there's sql conn:
Update user to admin:
log out and agian in and type phpinfo(); it shows that we can excute php code.
as this is a DNS host recommended to visit the /etc/hosts:
FourthTarget (Apache httpd Ubuntu):
target:
dir busting:
checking the source code of the website shows us interesting names written as a comment using them in ssh as username will grant us access:
Fifth Target (Unknown):
Last updated
Was this helpful?