Black Box 1

Write up for the Black-Box PenTesting 1 by the end of the PTS from IN

Target:

172.16.64.0/24

Goals

  • Discover and exploit all the machines on the network.

  • Read all flag files (one per machine)

What you will learn:

  • How to exploit Apache Tomcat.

  • How to exploit SQL Server.

  • Post-exploitation discovery.

  • Arbitrary file upload exploitation

  • Dirb.

  • Metasploit framework (recommended version: 5).

  • Nmap.

  • Netcat.

My Solution:

Network+Info:

routing:

recon:

OS FingerPrinting:

First target (Apache Tomcat):

helpful: https://book.hacktricks.xyz/pentesting/pentesting-web/tomcatls

dir busting:

/manager is default tomcat for admin server creds it asks for user/pass popout let's test using the default creds:

https://github.com/netbiosX/Default-Credentials/blob/master/Apache-Tomcat-Default-Passwords.mdown

let's use the list and save it inside creds.txt with a python script to bruteforce:

from it we got the following:

after log-in we notice that we can deploy fils, time to exploit by deploying a webshell, as it's a tomcat we will use a .war formate build one by:

start the webshell then visit it : http://172.16.64.101:8080/revshell/ listen to it:

another way is to use metasploite:

then upload the appropriate mfvenome:

Second Target (Apache httpd):

dir busting:

/project: apparently the only accessible one (with the prompt hint let's try admin:admin) .

more dir busting but now we know the creds:

/backups: looks interesting doing same against it we will discover /test: inside it there are intersting info regarding the SQL server we will use it to attack our fourth target now.

Third Target (Ubuntu Host):

apparently it got hacked by hacking 4'th target we found the ssh cred.

Fourth Target (Win10 SQL Server):

really healpfull:

from target 2 we got Username/pass let's try to log-in with them in metasploit console:

output runing the scanner

enumerate with:

allow us to find more admin creds time to exploit:

now we have a meterpreter session we can pop a shell:

even thou it's compromised idrsa.pub looks interesting (looks like SSH rsa keys) type id_rsa.pub shows its not a real key but have ssh creds :

thus also the 3'rd target is hacked .

Last updated

Was this helpful?