Cronos
Last updated
Was this helpful?
Last updated
Was this helpful?
Initial Foothold : SQL Injection along with Command injection
Privilege Escalation : Schedule Tasks
Starting with port scanning
Interesting Port 53 was open which tells that dns server is running
Lets start with dns enumeration
First of all add the hostname of the machine which is cronos.htb in /etc/hosts file
Now lets perform zone transfer
With the help of zone transfer we can obtain potential subdomains of the site running
If you want to learn why and what is zone transfer refer to
Zone transfer using dig command
Got some subdomains fo the hostname cronos.htb
lets add them in our /etc/hosts file
That's all for dns enumeration we got the information we needed
Lets visit the webpage
Simple Webpage was running
Used directory bruteforce but got nothing
but from our previous dns enumeration we had got some subdomain
Lets use them
at admin.cronos we got login page
We dont have creds lets try sql injection on this login page
and we successfully logged in using
Username : admin'or'1'='1; #
password : password
The above sql injection got us logged in as admin user
After logging we got webpage which do traceroute
There may be possibilty of command injection in this because this was executing on server side
lets do command injection
Using query 8.8.8.8;ls we got the above result
hence it is confirmed that there is command injection vulnerabilty in the above webpage
Lets use this to get reverse shell
Now use reverse shell from pentestmonkey site
Try python reverse shell command
Enter the above command in the textbox of the webpage and setup listener on port 1234
And got the reverse shell
Grab the user.txt file
After some enumeration got that there was schedule task running with root permission which the user can overwrite
Lets overwrite the file
with our reverse shellcode and setup listener
After some time the task was executed and we got the root shell on port 4444
That's all for this box
Good Bye :)