HackTheBox - Kotarak
Last updated
Was this helpful?
Last updated
Was this helpful?
I will be scanning all the ports, it might take some time.
SSH (OpenSSH 7.2p2)
Apache Jserv (Protocol v1.3)
Apache Tomcat 8.5.5
Apache httpd 2.4.18 ((Ubuntu))
Basic nmap scan would have not disclosed the Apache server, so that's the reason we did a all port scan.
We can probably upload a .war file via the tomcat server to get command execution. But for that to happen, we need manager credentials.
Default/Common Credentials used
admin:admin
admin:tomcat
tomcat:s3cr3t
admin: <nothing>
Let's run a gobuster scan in the background.
url.php
contains a parameter named path
and we can add our webserver address to check if it is working or not.
It is indeed working, but we cannot exploit it for Remote File Inclusion (RFI) because of the following.
allow_url_include
is set to Off, so we can't include any remote PHP files.
Let's try to access localhost. We can FUZZ for local ports using ffuf or wfuzz.
Got the credentials for tomcat manager stored in a backup file. Let's login into the manager and get a reverse shell by uploading a war file.
Deploy the shell.war payload and trigger the payload at /shell
We can retrieve credentials from ntds.dit file using the MS Windows registry file.
Using impacket-secretsdump to get all the hashes.
The root directory is readable and writable and it contains a file named app.log
Version of wget running: Wget/1.16
For this exploit to run, we need a FTP Server and a HTTP server. If you can host a FTP Server using python, try using authbind
before it to work
Create .wgetrc file into any writable folder having the following contents.
Now run the FTP server using the following command.
Copy the exploit.py file and edit it according to our needs.
Set the HTTP_LISTEN_IP to all the interfaces and FTP_HOST to target's IP. We also need to change the root cron payload to ours.
Now are good to go, so let's run the script.
Running linux exploit suggester to get a list of possible kernel exploits.
We can also try SSRF attack to discover sensitive files. Read more about .
Something interesting is running at