680 words
3 minutes
Link Vortex

LinkVortex#

  • Linux machine

Hack The Box

Ping command

  • The machine is up and i can communicate with them.

image.png

Nmap

Done Nmap to find the open ports

image.png

Result:

There are two open ports:

  • 22 ssh
  • 80 htttp

After viewing the website I got some error. I was directed to the linkvortex.htb. There is a problem in a DNS system. Let’s fix this

image.png

image.png

image.png

After solving the DNS Issue I was able to view the website.

image.png

Web Technology

image.png

I have also used wappalyzer extension and got the technologies used. But i was not able to screenshot this because in this VM I have to click ctrl+win to search for screenshot option and after clicking this the extension automatically closes.

Technologies used are:

  • CMS - Ghost 5.58

  • Web server

    • Apache HTTP server
    • Express
  • The latest version of ghost is 5.114.1.

image.png

Seems like the ghost version 5.58 is outdated. let’s check.

image.png

Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028/CVE-2023-40028 at master · 0xDTC/Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028

The ghost version 5.58 is vulnerable.

Let’s perform a directory search on linkvotex.htb using ffuf.

image.png

Found:

  • robots.txt
  • sitemap.xml

In robots.txt I found this site

image.png

navigated to the site map URL and found this page. there is nothing special, It contains the blogs posts.

image.png

I have tried all the endpoints but only the ghost has worked.

got this signin page in ghost endpoint.

image.png

now from here I don’t have any credentials to login into the website, there is nothing i can do.

What did I miss?

  • Going back I have missed the subdomain enumeration.

So let’s run for subdomain enumeration.

image.png

result:

  • found dev subdomain

added the IP address to the /etc/hosts file.

image.png

image.png

Now the web is working.

image.png

I didn’t anything interesting.

now let’s try directory search on this subdomain

image.png

Result:

Found:

  • .git
  • index.html

Let’s check.

image.png

image.png

Found:

let’s try if this users exist.

image.png

Both the users doesn’t exist.

  • Since I found the .git directory I can download the source code from a website using a tool called git-Dumper.
  • I have used the tool git-Dump when I was doing the dog room. Since I know how to used git-Dumper too, let’s try new things this time.
  • In the write up and upon researching, I have learned a new tool about GitHack.

Learnings.#

  • GitHack

image.png

  • GitHack is the same as the git-Dumper that extract source code from a website that has .git directory.

Git-Dumper vs GitHack

image.png

  • If we want to be quick and fast GitHack is recommended, but it might miss some files, but for the Git-Dumper, it grabs all the Git files.

This time I used GitHack to download the source code form the .git directory.

image.png

After the download was completed, I studied the folder structure.

image.png

  • Inside the admin directory
    • Found a JavaScript file called authentication.js.

Let’s study authentication.js

image.png

image.png

image.png

Found:

  • Password: OctopiFociPilfer45

Earlier in .git/logs/HEAD endpoint, I have found one email:

Since the file is for the admin. Let’s use admin as the username and try the password that I have found in the admin directory.

image.png

Yes!! It worked.

image.png

Now, going back to the enumeration phase, using Wappalyzer I have found that the CMS used is Ghost version 5.58.0 and is outdated.

  • the latest version of Ghost is 5.114.1.

And the Ghost version 5.58.0 has vulnerabilities.

Found the exploit in this link

https://github.com/0xDTC/Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028

image.png

  • A symlink attack works by tricking a system into reading or modifying a file that it shouldn’t have access to.

image.png

image.png

I then ran the exploit, but I got an error.

image.png

Used AI to solve this error. copied the code and the error and told to solve the error.

image.png

There was an error in line 25, and I replaced it with the correct code.

After correcting the code, I rerun the exploit. This time it’s working.

image.png

image.png

Found:

image.png

This directory contains sensitive information. Like the database credentials, logs file and etc…

Now I have got the user and password. I will be able to login in on port 22; let’s try these credentials in ssh.

I was able to login to the SSH using the credentials I found.

image.png

Found the user.txt file!!!

Let’s check Bob’s permission.

image.png

Bob doesn’t have much privilege. He can run this command

  • /opt/ghost/clean_symlink.sh *.png

image.png

Now, let’s study this script.

  • Got help from AI to analyze the script and how it works.

image.png

  • Got the point that it used a symlink attack. The symlink points to the important file like /etc/passwd, and creates a shortcut file. But the scripts deletes the symlink to protect them.
  • However, by creating another shortcut file pointing to the symlink, the script is moved to the quarantine folder instead of being deleted.

image.png

What is quarantine folder?

image.png

Okay now I understand how the script works.

Note:

  • The script checks for symbolic links (symlinks) that end with .png.

image.png

image.png

image.png

image.png

image.png

Reference#

https://medium.com/@anandhusuresh990/linkvortex-writeup-htb-5082f90b9507

Link Vortex
https://fuwari.vercel.app/posts/link_vortex/
Author
Ranjung Yeshi Norbu
Published at
2025-02-22