nitesh@gupta
Proving Grounds Linux

Extplorer

Full walkthrough — enumeration, foothold and privilege escalation.

Nmap output

Nmap scan report for 192.168.123.16
Host is up (0.057s latency).
Not shown: 65533 filtered tcp ports (no-response)
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 98:4e:5d:e1:e6:97:29:6f:d9:e0:d4:82:a8:f6:4f:3f (RSA)
|   256 57:23:57:1f:fd:77:06:be:25:66:61:14:6d:ae:5e:98 (ECDSA)
|_  256 c7:9b:aa:d5:a6:33:35:91:34:1e:ef:cf:61:a8:30:1c (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
| http-methods: 
|_  Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

We see a wordpress installation page when I visit port 80

Extplorer walkthrough, Got root, screenshot 1
Extplorer, step 1

After directory bruteforcing we found a /filemanager directory

Extplorer walkthrough, Got root, screenshot 2
Extplorer, step 2

There’s a login page on the filemanager directory

Extplorer walkthrough, Got root, screenshot 3
Extplorer, step 3

Tried admin : admin as creds and it worked

Extplorer walkthrough, Got root, screenshot 4
Extplorer, step 4

As this is a file manage I tried to upload php shell

Extplorer walkthrough, Got root, screenshot 5
Extplorer, step 5

And it uploaded successfully

Extplorer walkthrough, Got root, screenshot 6
Extplorer, step 6

Visited shell.php and we got command execution

Extplorer walkthrough, Got root, screenshot 7
Extplorer, step 7

Taking reverse shell

Extplorer walkthrough, Got root, screenshot 8
Extplorer, step 8

Got reverse shell

Extplorer walkthrough, Got root, screenshot 9
Extplorer, step 9

We got hash value for dora user in .htusers.php

Extplorer walkthrough, Got root, screenshot 10
Extplorer, step 10

Got password for dora user

Extplorer walkthrough, Got root, screenshot 11
Extplorer, step 11

Using password to switch user to dora

Extplorer walkthrough, Got root, screenshot 12
Extplorer, step 12

Got local.txt (d76555be6f8692c623048f1367f8f1ca)

Extplorer walkthrough, Got root, screenshot 13
Extplorer, step 13

Dora user is in disk group

Extplorer walkthrough, Got root, screenshot 14
Extplorer, step 14

Using https://book.hacktricks.wiki/en/linux-hardening/privilege-escalation/interesting-groups-linux-pe/index.html for exploitation

Extplorer walkthrough, Got root, screenshot 15
Extplorer, step 15

We can access /root

Extplorer walkthrough, Got root, screenshot 16
Extplorer, step 16

And see file in it with ls

Extplorer walkthrough, Got root, screenshot 17
Extplorer, step 17

We read the hash of root user from /etc/shadow

Extplorer walkthrough, Got root, screenshot 18
Extplorer, step 18

Cracked it and got root user password

Extplorer walkthrough, Got root, screenshot 19
Extplorer, step 19

Got root

Extplorer walkthrough, Got root, screenshot 20
Extplorer, step 20

Got proof.txt (05ad63bb0ab7f4d8ef64bda86a152758)

Extplorer walkthrough, Got root, screenshot 21
Extplorer, step 21

More walkthroughs