Codo

Nmap Scan

$ nmap -sC -sV -p- --min-rate 10000 -Pn -oN nmap 192.168.155.23 
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-06-07 10:12 +08
Nmap scan report for 192.168.155.23
Host is up (0.0091s latency).
Not shown: 65533 filtered tcp ports (no-response)
Bug in http-generator: no string output.
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 62:36:1a:5c:d3:e3:7b:e1:70:f8:a3:b3:1c:4c:24:38 (RSA)
|   256 ee:25:fc:23:66:05:c0:c1:ec:47:c6:bb:00:c7:4f:53 (ECDSA)
|_  256 83:5c:51:ac:32:e5:3a:21:7c:f6:c2:cd:93:68:58:d8 (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: All topics | CODOLOGIC
|_http-server-header: Apache/2.4.41 (Ubuntu)
| http-cookie-flags: 
|   /: 
|     PHPSESSID: 
|_      httponly flag not set
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.16 seconds

Initial Access

Port 80

There is a Codologic website running on port 80.

After searching online, there is an RCE exploit that we can use. However, it requires an admin username and password.

So we will go to the login page next.

We tried the usual username and password combination. Sure enough, admin:admin is enough for us to login as the admin.

CVE-2022-31854

Since now we got the admin username and password, we can use the exploit.

However, the exploit does not work as intended.

So, we will upload the webshell manually.

Firstly, we need to go to the configuration page (the URL can be found in the exploit).

After logging in, paste the URL for the configuration page and go there.

When we scroll to the bottom, we should be able to see the Upload logo for your forum.

This is our payload for the webshell that is to be uploaded:

After uploading and saving, we can see now the value has been change to our webshell filename.

So, now we just need to visit that page to trigger the webshell to get a reverse shell back.

Privilege Escalation

From the linpeas scan, we can see there is an offsec user and this password is in one of the files.

So I tried on both the user and root. We manage to successfully get root user.

Last updated