Page cover

LinkVortex

Synopsis

LinkVortex is a linux easy machine created by 0xyassinearrow-up-right. The Ghost CMS is used in linkvortex.htb domain. The dev subdomain is found during fuzzing and .git directory is present. The content of .git directory is dumped and password for Ghost CMS login is retrieved. The version of Ghost CMS used is 5.58.0 which is vulnerable to CVE-2023-40028 arbitrary file read vulnerability, with which the foothold is gained. The user has a privilege to run clean_symbolic.sh script file as sudo which creates the TOCTOU vulnerability and exploiting it gives us the id_rsa of root.

OS
Difficulty
Points
Release Date
Retired Date

Linux

Easy

20

07-12-2024

12-04-2025


Enumeration

Nmap

Starting the nmap scan and found ssh and http services running.

nmap -Pn -sC -sV --min-rate=1000 10.10.11.47
Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-20 21:03 EDT
Nmap scan report for 10.10.11.47
Host is up (8.0s latency).
Not shown: 749 filtered tcp ports (no-response), 249 closed tcp ports (reset)
PORT   STATE SERVICE    VERSION
22/tcp open  tcpwrapped
|_ssh-hostkey: ERROR: Script execution failed (use -d to debug)
80/tcp open  tcpwrapped
|_http-server-header: Apache
|_http-title: Did not follow redirect to http://linkvortex.htb/

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

Add linkvortex.htb in /etc/hosts file.

Web - linkvortex.htb

The linkvortex is the blogging site where computer parts information is given in details.

The footer reveals that the site is using Ghost CMS and going to ghost directory gives us the ghost login page.

Fuzzing

Subdomain fuzzing found the dev.linkvortex.htb subdomain.

Add dev.linkvortex.htb in /etc/hosts file.

Web - dev.linkvortex.htb

The dev subdomain gives us launching soon and under construction message.

Fuzzing

Directory fuzzing found the .git directory.

Dumping the content of .git using git-dumper.

Git

The ghost/core/test/regression/api/admin/authentication.test.js has been changed and not committed yet.

Only the password has been changed. The admin@linkvortex.htb email and the above password gives us access to the ghost dashboard.


Foothold

Shell - bob [ CVE-2023 -40028 exploit ]

Going to settings and clicking on About Ghost button shows the details and versions of ghost.

Ghost version < 5.59.1 is vulnerable to CVE-2023-40028 arbitrary file read vulnerability. The PoC with bash script is created in this github repositoryarrow-up-right.

CVE-2023-40028

Affected versions of this package are vulnerable to Arbitrary File Read which allows authenticated users to upload files that are symlinks. This can be exploited to perform an arbitrary file read of any file on the host operating system. More details can be found herearrow-up-right.

Exploit

1

Git clone the repository

2

Executing script

Change the GHOST_URL variable to http://linkvortex.htb and execute the script.

3

Getting bob credentials

Fetching the ghost config file and found the password for bob.

4

SSH login

circle-info

The user.txt file contains the user flag 👏


Privilege Escalation

Pillaging - bob [ user ]

The sudo -l command reveals that the user bob has a sudo privilege to run the /usr/bin/bash /opt/ghost/clean_symlink.sh *.png command.

We don't have write permission over clean_symlink.sh file.

File - clean_symlink.sh

  • The script takes the .png file as a argument and checks whether it is symbolic link or not.

  • It also inspects the link target whether it points to /etc or /root directories.

  • If it points to those directories it unlink the file otherwise it moves to a quarantine folder /var/quarantined and if the $CHECK_CONTENT variable is set to TRUE, it prints the contents of the linked file.

Shell - root [ TOCTOU ]

Methodology

The time-of-check-time-of-use vulnerability occurs after the symbolic link is created. We can quickly swap the link target to other sensitive files and directories like /etc and /root. If the $CHECK_CONTENT variable is set to TRUE, we can also print the content of the files.

Exploit

1

Running while loop to force the symbolic link if the file already exists.

2

Getting id_rsa

Creating another symbolic link in another folder with the same png file name and executing the clean_symlink.sh moves the file into quarantined folder and SSH private key is printed.

3

Getting shell

Copy the private key and save into the file. Change the permission and ssh as a root.

If libcrypto error occurs remove the unwanted space from the id_rsa file.

circle-info

The root.txt file contains the root flag 🎉


Proof of Concept

The below video provides the PoC of LinkVortex machine.

Last updated