[Penetration Testing Learning] Devvortex - HackTheBox


information collection

Scan port

nmap -sV -sC -p- -v --min-rate 1000 10.10.11.242

Insert image description hereIt was found that there is an http service on port 80, and it is an nginx service
I tried to access the web interface and found that it jumped to http://devvortex.htb/ and was inaccessible< a i=3> We can use vim to add the domain name

sudo vim /etc/hosts

Insert image description here
We visited and found that it was a corporate website. We scanned it to see if there is a subdomain name.

gobuster vhost -u http://devvortex.htb/ -w /usr/share/wordlists/dirb/big.txt --append-domain

Get the subdomain name
Insert image description hereAdd it to/etc/hosts as before, then scan the directory
Insert image description here

Problem solving steps

can be scanned out/adminisrator, we log in to the web interface to access robots.txt
Insert image description here
We know it is Joomla CMS
we use Kali's own tool to scan out Joomla version information

joomscan -u http://dev.devvortex.htb/

Insert image description hereThen use the tool searchsploit to find vulnerabilities

searchsploit joomla 4.2

Insert image description here
Then remember the script serial number and use the -m parameter to copy it
Insert image description here
This script is written in ruby, so the execution command is as follows

./51334.py http://dev.devvortex.htb > joomla_exp.out

Note: the url is nothttp://dev.devvortex.htb/

Insert image description hereCheck to get the password and database name

Since the ssh connection cannot be reached, we use a rebound shell
Log in with the account and password you just entered
Insert image description here and then go to the site template of the System Click on the first one
and then modify error.php, add the rebound shell command
Insert image description hereenable monitoring and access the given path/templates/cassiopeia/error.php
and successfully rebound. shell
Insert image description here
But we found that the current user’s permissions are not enough
Insert image description here

Then we try to log in to other users
First increase the shell permissions

python3 -c 'import pty; pty.spawn("/bin/bash")'

Connect to the database again

mysql -u lewis -p joomla

Insert image description hereThen get the password of logan
Insert image description hereUse the tool john to blast and get the password
Insert image description hereThen connect via ssh

ssh [email protected]

Get the user's flag
Insert image description here
Let's sudo to see the available commands
Insert image description here
We found a script, let's try to search it on Google< a i=3> Directly search for ready-made POCapport-cli exploit

Insert image description here

There is a crash file in the target machine
ls couldn’t find it at first, so I added the parameter -al and found out that there was one

Insert image description hereExcuting an order

sudo /usr/bin/apport-cli -c /var/crash/_usr_bin_sleep.1000.crash

Select v mode
Insert image description here
Enter the file and enter!id to successfully escalate the privileges
Insert image description here

After querying, press Enter and enter again!cat /root/root.txt
to get the root flag
Insert image description here

The target machine has no crash file
Our purpose is to enable V mode, then we can use the -f and –pid parameters
Insert image description here
We enable the pid process
Insert image description hereThen execute

sudo /usr/bin/apport-cli -f --pid=4365

You can also enter V mode
Insert image description hereThe following steps are the same and will not be described

Submit flag

user: dc5d3636a25c08eab2b633c3af454cc2
root: 72254d1c628607e1670942d1ba21b4de

おすすめ

転載: blog.csdn.net/m0_73512445/article/details/134882601