This box was downloaded from VulnHub and is also on the TJnull list of practice boxes for OSCP preparation. The box involved the following steps:

  • Enumerating port 80
  • Exploiting Tiki WIKI CMS
  • Simple Sudo permission for Priv Exploit

I always start my exploitation from the autorecon scan. Initial Nmap scan results are as below:

Scanned at 2022-04-07 05:17:31 EDT for 23s
Not shown: 996 closed tcp ports (reset)
PORT    STATE SERVICE     REASON         VERSION
22/tcp  open  ssh         syn-ack ttl 64 OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 a3:d8:4a:89:a9:25:6d:07:c5:3d:76:28:06:ed:d1:c0 (RSA)
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0QOr55x/Sj6hKeR3ArLyVAPS5kzyAx8e3V2S9W44G2+SxkJ3lNn4WKgUwER8Rv3Dt1dmXfuQHXpRb7Fb9S4DoOh5kpY1PJLnvSyoe/w22YZthgar6Jf6q3XwoPFiaF9JBEJqsG0pFGFRccccasTgtCsT/2wE15L2To+WU6wPyZt2F6vOSC+yhVGOX9P0lnSbO6+1ZFIMKLDtAQU/o++PBap87c12voIkQjzC6Nyk0EVp36NKc6AIlRhAU/RIMic8ETT+f4AAiHOxoBdATL/gJcJXXyBdlWQcZe8kw26zG2kjFrcRQBM+Zj/z91H22dCQjJXmUIRIAhiVdZvL4UG4GPLigGGqAvs7ggnIw1FrQ92diFGz0ksrQfzGvXRwZqLngjdJJMuC+8lps5GZVOevYd5bQR44BLZlZXx69kagOydRMfSKw1RuZViBIDft7KZg2f9ZLlATAIYLx6+xDexE8zKvP/eyNZWELnTbQH2StPXP12tJnSNb9Jea3dXYB4Ds=
|   256 e7:b2:89:05:54:57:dc:02:f4:8c:3a:7c:55:8b:51:aa (ECDSA)
| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCxghOMMgnGuE/gI+7mtcnam8ybjFNjkCsoFqkD/CRe2wWtddrl6EWKDAit3QQ9GbY8WJ4EGrJiJQogW5b7c7is=
|   256 fd:77:07:2b:4a:16:3a:01:6b:e0:00:0c:0a:36:d8:2f (ED25519)
|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILaaZ/QfOgCnog0JIRtlGUoXO3Ph+bxbcGBMBXo8w4Bz
80/tcp  open  http        syn-ack ttl 64 Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
| http-methods: 
|_  Supported Methods: HEAD GET POST OPTIONS
| http-robots.txt: 1 disallowed entry 
|_/tiki/
139/tcp open  netbios-ssn syn-ack ttl 64 Samba smbd 4.6.2
445/tcp open  netbios-ssn syn-ack ttl 64 Samba smbd 4.6.2
MAC Address: 08:00:27:37:18:05 (Oracle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.6

Uptime guess: 22.551 days (since Tue Mar 15 16:05:05 2022)
Network Distance: 1 hop
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: All zeros
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.44 ms 10.0.0.21

Read data files from: /usr/bin/../share/nmap
OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Thu Apr  7 05:17:54 2022 -- 1 IP address (1 host up) scanned in 23.63 seconds

There is port 80 open. It is just the default apache webpage.

Gobuster scan came up with a new directory /tiki . It turns out to be a tiki wiki cms server.

I tried enumerating further but could not find a credible lead. From the nmap scan, there was a samba port open too. And the smbclient scan showed that we have read access to one of the shares name Notes.

Logging into the share I downloaded the Mail.txt file. It consists of the username:password for CMS portal.

Now I logged into the CMS portal. I have never used/seen this content management system before. So I was just playing around. I found Last Changes options on the menu. It sounded interesting. The List Changes were as below.

I started playing around looking for clues. I clicked on one of the changes.

So I clicked on edit. It shows me one more option.

When I checked the autosave drafts of the recent edits, I found this.

There is a CVE number for the vulnerability. Quick search on google, led me to this github page.

So there is an admin authentication bypass vulnerability in Tiki Wiki CMS. The POC video can be found on the same GitHub page above. I followed the steps and was able to gain admin access to the CMS server.

Similar to the user silky I straight went into the last changes section. I found a page with credentials.

Inside it, there was a login credential for silky. silky:Agy8Y7SPJNXQzqA

As there was port 22 open, I tried the credentials for ssh login and succeded.

Now the first command I tried sudo -l had interesting results.

Although it is a different language I can pretty much guess that silky user can use all sudo commands. But I translated it anyway.

Simply running the bash command with sudo gave us root access.