Pelican
Pg Practice Pelican writeup
Last updated
Pg Practice Pelican writeup
Last updated
We start this box on SMB and perform a quick null authentication check using smbmap
against the target.
We have no luck here. I then run enum4linux against the target to look for users, groups and to perform RID cycling.
As Enum4linux
output is quite messy I have opted to not post the gathered information but essentially from this we have found the user 'charles' on the target machine. We can store this information for later.
I ran feroxbuster
against port 8080 and 8081 and did not find any valid results. Nikto
did not find any significant finds either.
When browsing to port 8080 we come to an application called 'Exhibitor'.
When searching on Google for known exploits we are directed to a RCE vulnerability that exists in versions of Exhibitor where 'Java.env script' configuration parameter exists under the 'Config' tab.
The relevant part of the exploit code is the following:
I then made the changes as recommended in the PoC.
Start up a netcat
listener on the attacking machine.
Then commit the changes in Exhibitor. You will be warned about the Exhibitor server restarting and when it comes up you should land a shell.
We can then upgrade our shell a little bit:
As per usual I then started a python server on my attacking machine with python2 -m SimpleHTTPServer
and then downloaded linpeas.sh
with wget
.
After linpeas.sh
was downloaded I then executed the batch file. linpeas soon identifies that we have access to the following sudo command:
Looking up gcore
on Google we see it is an application for dumping information out of memory for running processes. Considering we can run this as any account defined by (ALL) with no password 'NOPASSWD' we can run it as root.
Looking further down linpeas we can see the following SUID permission files one of which has an interesting name of '/usr/bin/password-store'.
We can check if this is a running process which can be dumped with gcore
.
We can attempt to dump this with gcore
. The syntax for our command is as follows:
or in my case:
Once the command completed I moved to the destination directory and run the strings command on the file to make it more human readable.
In the output of the text you will see a field with a value under it called '001 Password: root:' grab the value under this and attempt to login to root with the su
command.