<?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 Nishith P on Medium]]></title>
        <description><![CDATA[Stories by Nishith P on Medium]]></description>
        <link>https://medium.com/@nishithp?source=rss-7425ab5725e3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vSEtLyYVi5rDBThsr3YOCQ.jpeg</url>
            <title>Stories by Nishith P on Medium</title>
            <link>https://medium.com/@nishithp?source=rss-7425ab5725e3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 07 Apr 2026 12:14:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nishithp/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[Cracking the Code: A Walkthrough of the Fam Product Security Challenge]]></title>
            <link>https://infosecwriteups.com/cracking-the-code-a-walkthrough-of-the-fam-product-security-challenge-21c296bd219d?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/21c296bd219d</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[mobile-security]]></category>
            <category><![CDATA[famapp]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 11:17:47 GMT</pubDate>
            <atom:updated>2025-12-25T14:25:45.244Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As part of the Product Security Intern assignment for Fam (Trio), I was tasked with a Capture The Flag (CTF) challenge. The objective was straightforward yet testing: analyze an Android APK, identify vulnerabilities, navigate through a web challenge, and capture a hidden flag.</p><p>This write-up details my methodology, the “happy accidents” encountered along the way, and a comprehensive report on the security findings.</p><h3>Phase 1: Reconnaissance &amp; Static Analysis</h3><p>The challenge began at <a href="https://challenge.fam-app.in.">https://challenge.fam-app.in.</a> The landing page presented a clean interface asking for a “Secret” to proceed, along with a download link for an Android application (fam-CTF.apk).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFshdf7I2_H_pOXb81BQQw.png" /><figcaption><em>Fig 1: The initial challenge landing page requiring a secret key</em></figcaption></figure><p>My first step was to perform static analysis on the provided APK file. Instead of running the app immediately, I wanted to inspect its internal structure. I uploaded the fam-CTF.apk to a Java decompiler to inspect the source code and resources.</p><p><strong>The Discovery:</strong><br>While browsing the AndroidManifest.xml file, I noticed a suspicious meta-data tag. Developers often leave API keys or configuration secrets in the manifest, and this case was no exception.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1-xRdtEyFOUrFg6M6XPAeQ.png" /><figcaption><em>Fig 2: Decompiled AndroidManifest.xml revealing the API Key</em></figcaption></figure><p>I found the following entry:</p><pre>&lt;meta-data android:name=&quot;com.famctf.API_KEY&quot; android:value=&quot;f4m_53cr37_70k3n&quot; /&gt;</pre><p>The value <strong>f4m_53cr37_70k3n</strong> looked exactly like the API_KEY secret required on the web portal.</p><h3>Phase 2: Gaining Access &amp; Web Enumeration</h3><p>Armed with the key found in the APK, I returned to the challenge website.</p><ol><li>I entered <strong>f4m_53cr37_70k3n</strong> into the secret input field.</li><li>Upon submission, I was redirected to a new endpoint.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3PgNmu6EINKNtNrUDiMsCA.png" /><figcaption><em>Fig 3: The File Upload portal accessible after entering the secret</em></figcaption></figure><p>The new page featured a simple file upload interface. In CTF scenarios, file upload forms are prime targets for Remote Code Execution (RCE) via malicious scripts (like PHP shells) or metadata exploits.</p><h3>Phase 3: Exploitation &amp; The “Happy Accident”</h3><p>I initially attempted to upload a standard PHP backdoor (&lt;?php $_GET[“cmd”] ?&gt;) to see if I could execute commands on the server.</p><ul><li><strong>Observation:</strong> The server accepted the PHP file without filtering the extension or MIME type.</li><li><strong>Result:</strong> However, on navigating to <em>/uploads/filename.ext</em>, the server returned the file content as plain text. The PHP was not executed, meaning the server was likely not configured to run PHP files in the upload directory.</li></ul><p><strong>The Pivot:</strong><br>I decided to test how the server handled image files. I uploaded a PNG file. Interestingly, the server response headers contained a custom field: X-Message.</p><p>When I uploaded my PHP script earlier, the header read: <em>“This is not a reverse code. Try harder!”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oKN-Mc8OQA4g_V_dljO3gw.png" /><figcaption>Fig 4: The Payload used</figcaption></figure><p>However, when I uploaded a specific AI-generated image (a cat in a Dr. Strange outfit), the behavior changed entirely. The server responded with a 200 OK and a crucial set of headers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T4pdpgr0rfdvRnl9tGRHqA.png" /><figcaption><em>Fig 5: Burp Suite response showing the generated token and endpoint hint</em></figcaption></figure><p><strong>The Response Headers:</strong></p><ul><li><strong>X-Message:</strong> “Token generated. Use this token to access /new-assignment-security-intern”</li><li><strong>X-Auth-Token:</strong> a95e1f4e-2c67–4c91-ba08–98d3a63eda4b</li><li><strong>X-Endpoint-Hint:</strong> c3VibWl0LWFzc2lnbm1lbnQ=</li></ul><p><strong>Analysis of the “Accident”:</strong><br>Why did a PNG trigger a success state when a PHP shell failed?<br>Upon inspecting the image metadata, I realized the AI-generated image contained Adobe XML tags (&lt;x:xmpmeta…&gt;). It appears the server-side security check was using a Regex or string matching to look for “code-like” syntax to detect reverse shells. Paradoxically, the innocent XML metadata in the image likely triggered a “False Positive” in the server’s security logic, which the system interpreted as a successful “exploit” of the level, granting me the token.</p><h3>Phase 4: Token Enumeration &amp; Flag Capture</h3><p>With the token and the endpoint hint, I moved to the final stage.</p><p><strong>Step 1: Decrypting the Hint</strong><br>The header X-Endpoint-Hint contained a Base64 string: <strong>c3VibWl0LWFzc2lnbm1lbnQ=</strong><br>Decoding this gave me the slug: <strong>submit-assignment</strong>.</p><p><strong>Step 2: Retrieving Instructions</strong><br>I navigated to <em>/new-assignment-security-intern</em> using the token I acquired. I passed it as a query parameter ?token=….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbwSwQ8_L_uKROhl7cHc_g.png" /><figcaption><em>Fig 6: GET request retrieving the submission instructions</em></figcaption></figure><p>The response provided a JSON object with instructions on how to submit the flag:</p><ul><li><strong>Endpoint:</strong> /c3VibWl0LWFzc2lnbm1lbnQ= (which is /submit-assignment)</li><li><strong>Method:</strong> POST</li><li><strong>Body:</strong> JSON containing email, flag, name, and phone-number.</li><li><strong>Flag Logic:</strong> The response included a flag field: “RkBNe1NFQ18zNzM3M19IM3kwMDkxMTB9==”.</li></ul><p><strong>Step 3: The Final Submission</strong><br>I constructed a POST request in Burp Suite to the submission endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*liCX7FSXxzj8ipbo3P3FvQ.png" /><figcaption><em>Fig 7: Successful submission of the assignment</em></figcaption></figure><p>The server responded: “Submission received successfully”.</p><p><strong>Step 4: Decoding the Flag</strong><br>The challenge provided the final flag in Base64 format. Running it through a decoder revealed the victory text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*G7ndHrCr1WbPercHSjybIA.png" /><figcaption><em>Fig 8: Decoding the final flag</em></figcaption></figure><h3>Post-Mortem &amp; Security Report</h3><h3>Vulnerability Analysis</h3><ol><li><strong>Hardcoded Credentials (APK):</strong><br>The most critical vulnerability was the storage of the API key (f4m_53cr37_70k3n) in plain text within the AndroidManifest.xml. This allowed for trivial bypass of the initial authentication layer.</li><li><strong>Insecure File Upload Logic:</strong><br>The server lacked strict validation on file contents. While it didn’t execute PHP (a good defense), its detection mechanism for “malicious code” (Reverse Shell detection) was flawed. It relied on pattern matching that produced false positives on legitimate file metadata (Adobe XMP data), inadvertently allowing an attacker to bypass the challenge logic.</li><li><strong>Token Re-use &amp; Predictability:</strong><br>During testing, I noticed the server mapped generated tokens to filenames.</li></ol><ul><li>Uploading image.png generated Token A.</li><li>Uploading image.png again (overwriting it) returned Token A.</li><li>Renaming the file to image2.png generated Token B.<br>This suggests a deterministic generation or weak session management tied to file attributes rather than user sessions.</li></ul><h3>Recommendations</h3><p>To improve the security posture of the application, I recommend the following:</p><ul><li><strong>Secrets Management:</strong> Never hardcode API keys or secrets in the client-side code (APK). Use Android Keystore or fetch session-specific tokens from a secure backend upon user authentication.</li><li><strong>Robust File Validation:</strong></li><li>Implement strict allow-listing for file types (check Magic Bytes, not just extensions).</li><li>Strip metadata (EXIF/XMP) from images upon upload to prevent payload hiding and logic errors like the one encountered.</li><li><strong>Logic Improvement:</strong> The “Reverse Shell” detection mechanism seems to rely on weak regex. It should be replaced with actual behavioral analysis or simply by ensuring the upload directory is non-executable ( noexec).</li><li><strong>Data Transmission:</strong> The challenge required sending the flag in Base64. In a production environment, sensitive data should never be encoded merely in Base64; use transport security and consider payload encryption if the data is highly sensitive. For example, we can use PGP keys with Emails for sending confidential data.</li></ul><h3>Conclusion</h3><p>This challenge was a fantastic exercise in combining mobile reconnaissance with web exploitation. It highlighted how even “secure” file uploaders can have logic flaws and reinforced the golden rule of mobile dev: <strong>The Manifest is not a safe functionality.</strong></p><p><strong>Final Flag:</strong> F@M{SEC_58392_1765982406}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c296bd219d" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/cracking-the-code-a-walkthrough-of-the-fam-product-security-challenge-21c296bd219d">Cracking the Code: A Walkthrough of the Fam Product Security Challenge</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[bi0s Recruitment CTF Writeup : Web Exploitation (5/5) — PHP tricks]]></title>
            <link>https://nishithp.medium.com/bi0s-recruitment-ctf-writeup-web-exploitation-5-5-php-tricks-3f4c70d6efe6?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f4c70d6efe6</guid>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 06:17:50 GMT</pubDate>
            <atom:updated>2023-04-23T06:17:50.593Z</atom:updated>
            <content:encoded><![CDATA[<h3>bi0s Recruitment CTF Writeup : Web Exploitation (5/5) — PHP tricks</h3><p>This challenge is to be solved using the knowledge of PHP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*qFUuX2AongGec2UKgq-D7A.png" /><figcaption>Challenge Page</figcaption></figure><p>The Challenge page presents the PHP source code which we must debug in order to obtain the flag.</p><h3>Summary</h3><p>The script includes a file named flags.php.</p><p>The script accepts four GET parameters named pass1, pass2, pass3, and pass4, each of which is used to check if a particular password is correct. If a password is correct, the corresponding flag is printed out.</p><p><strong>Here’s a breakdown of each password check:</strong></p><ol><li>pass1: The value of pass1 is checked against the string &quot;secret&quot;, with case-insensitivity and the word &quot;secret&quot; removed using a regular expression. If the value matches the modified string &quot;secret&quot;, the first flag is printed out.</li><li>pass2: The value of pass2 is checked against its MD5 hash. If the value matches its MD5 hash, the second flag is printed out.</li><li>pass3: The value of pass3 is checked against the string &quot;Array&quot;, with case sensitivity. If the value matches the string &quot;Array&quot;, the script terminates with an error message. Otherwise, the value is concatenated with the string &quot;123&quot; and checked against the string &quot;Array123&quot;. If the concatenated value matches the string &quot;Array123&quot;, the third flag is printed out.</li><li>pass4: The value of pass4 is treated as a filename, and the contents of that file are checked against the string &quot;Good Challenge&quot;. If the contents of the file match the string &quot;Good Challenge&quot;, the fourth flag is printed out.</li></ol><p>The script sets the error reporting level to include errors, warnings, and parse errors, and then outputs its own source code using the highlight_file function. This means that any error messages or output from the script will be visible to the user.</p><p><strong>Starting Point — URL Format</strong></p><pre>https://ch3521618630.ch.eng.run/?flags.php&amp;pass1=&amp;pass2=&amp;pass3=&amp;pass4=</pre><p>The above URL is obtained by placing the included files and request Query parameters.</p><h3><strong>Solution</strong></h3><ul><li>For <strong>pass1</strong>, we can use the following string or any similar variation of the string to pass the checks: sec<strong>secret</strong>ret . The payload after the replace operation changes to <strong>secret </strong>and hence the conditional check passes and the first part of the flag is printed.</li></ul><pre>if(isset($_GET[&#39;pass1&#39;])){<br>    $pass1 = $_GET[&#39;pass1&#39;];<br>    $pass1 = preg_replace(&quot;/secret/i&quot;,&quot;&quot;,$pass1);<br>    if($pass1 === &#39;secret&#39;){<br>        echo &#39;&lt;br&gt;&#39;.$flag1;<br>    }<br>    else{<br>        die(&quot;Nope !!!!!!!!!!!&quot;);<br>    }<br>}</pre><ul><li>For <strong>pass2</strong>, we can use 0e215962017 . The value 0e215962017 is a special string in PHP because it is interpreted as the floating-point number 0.0 when used in a numeric context, such as in a comparison using the == or === operators. This is because 0e is the exponent notation for scientific notation, and the digits that follow are treated as the exponent. For example, the expression 0e215962017 == 0 will evaluate to true because 0e215962017 is interpreted as 0.0 in a numeric context. This can lead to unexpected behaviour in certain situations, such as when using the == operator to compare a string that happens to be formatted in this way with a numeric value.</li></ul><pre>if(isset($_GET[&#39;pass2&#39;])){<br>    $pass2 = $_GET[&#39;pass2&#39;];<br>    if($pass2 == md5($pass2)){<br>        echo $flag2;<br>    }<br>    else{<br>        die(&#39;Mmm Nope&#39;);<br>    }<br>}</pre><ul><li>For <strong>pass3</strong>, we can bypass the conditional checks by passing pass3 as an Array (hinted by the keyword “Array” in the condition checks)</li></ul><pre>if(isset($_GET[&#39;pass3&#39;]))<br>{<br>    $pass = $_GET[&#39;pass3&#39;];<br>    if($pass === &#39;Array&#39;){<br>        die(&quot;Not that easy&quot;);<br>    }<br>    if($pass.&#39;123&#39; === &#39;Array123&#39;){<br>        echo $flag3;<br>    }<br>    else{<br>        die(&quot;Not that easy !!!&quot;);<br>    }<br>}</pre><ul><li>For <strong>pass4</strong>, using data://text/plain,Good%20Challengeas the parameter value, we get the final flag.</li></ul><pre>if(isset($_GET[&#39;pass4&#39;])){<br>    $pass = $_GET[&#39;pass4&#39;];<br>    if(file_get_contents($pass) === &quot;Good Challenge&quot;){<br>        echo $flag4;<br>    }<br>    else{<br>        die(&#39;Wow so rude&#39;);<br>    }<br>}</pre><h4>Final Payload</h4><pre>https://ch3521618630.ch.eng.run/?flags.php&amp;pass1=secsecretret&amp;pass2=0e215962017&amp;pass3[]=Array&amp;pass4=data://text/plain,Good%20Challenge</pre><p>Flag: <strong>flag{…}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*RLWPu0DULyjdPXDDTV-MwA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f4c70d6efe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[bi0s Recruitment CTF Writeup : Web Exploitation (4/5) — Client]]></title>
            <link>https://nishithp.medium.com/bi0s-recruitment-ctf-writeup-web-exploitation-4-5-client-7e4ccc6e5428?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e4ccc6e5428</guid>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 06:17:42 GMT</pubDate>
            <atom:updated>2023-04-23T06:17:42.170Z</atom:updated>
            <content:encoded><![CDATA[<h3>bi0s Recruitment CTF Writeup : Web Exploitation (4/5) — Client</h3><p>The Challenge description tells us everything that we need to know — to solve this challenge, we need to use our extensive knowledge of the scripting language of the web — JavaScript</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxnPspjwS1ap7tXZY9mUVA.png" /><figcaption>Challenge Home Page</figcaption></figure><p>There is little relevant information on the frontend UI, let&#39;s have a look at the page source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*9sZ49X-iDspvDZ_jzWJAGw.png" /><figcaption>Page Source Code</figcaption></figure><p>Let&#39;s have a look at the referenced script.jsfile since this challenge involves javascript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*0RV9AxQnbxcB664o6H7MPQ.png" /><figcaption>script.js file</figcaption></figure><p>The first part of the code just seems to grab the <strong>fleg </strong>query parameter from the URL and checks if it is a <strong>null </strong>value and logs “rEad JS ?” to the console if it is a <strong>null </strong>value.</p><p>Executing the following code snippet on the console, we get</p><pre>var charset=&quot;_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;<br>let flag=&quot;flag&quot;+fleg+&quot;}&quot;;<br>let actualflag=atob(&quot;ZmxhZ3tDbDEzblRfczFEM18xUwo=&quot;);<br>  actualflag=actualflag+charset.substring(0,1);<br>  actualflag=actualflag+charset.substring(24,25);<br>  actualflag=actualflag+charset.substring(1,2);<br>  actualflag=actualflag+charset.substring(56,57);<br>  actualflag=actualflag+charset.substring(0,1);<br>  actualflag=actualflag+charset.substring(55,56);<br>  actualflag=actualflag+charset.substring(4,5);<br>  actualflag=actualflag+charset.substring(13,14);<br>  actualflag=actualflag+charset.substring(57,58);<br>  actualflag=actualflag+charset.substring(28,29);<br>  actualflag=actualflag+charset.substring(4,5);<br>  actualflag=actualflag+String.fromCharCode(125)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*fJ3Ad5aQr8AfzaURmdZ_Fg.png" /><figcaption>Chrome DevTools Console</figcaption></figure><p>Removing the newline <strong>\n, </strong>we get</p><p>Flag: <strong>flag{…}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*lYisI1N-8SGF49kHkENq6Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e4ccc6e5428" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[bi0s Recruitment CTF Writeup : Web Exploitation (3/5) — c00kie-l0v3]]></title>
            <link>https://nishithp.medium.com/bi0s-recruitment-ctf-writeup-web-exploitation-3-5-c00kie-l0v3-b0fe296ecba3?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0fe296ecba3</guid>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 06:17:34 GMT</pubDate>
            <atom:updated>2023-04-23T06:17:34.784Z</atom:updated>
            <content:encoded><![CDATA[<h3>bi0s Recruitment CTF Writeup : Web Exploitation (3/5) — c00kie-l0v3</h3><p>The title of the CTF Challenge gives us a huge hint on how to go about solving the Challenge — HTTP Cookies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBplXQ5k7GbcAQpd7YywNA.png" /><figcaption>Challenge Login Page</figcaption></figure><p>The Challenge page seems to be Sign In page of some kind.</p><p>To get the login credentials for the above Sign In page, we need to view the page source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bdFsEZ399IoIc6cfzW98_A.png" /></figure><p>We obtain the credentials as guest: guest (username: password)</p><p>On Signing In with the obtained credentials, we can view a protected page where only admins are allowed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jU7R3yaD4yanEC6V_2eG-Q.png" /><figcaption>Protected Home Page</figcaption></figure><p>To bypass the above restriction, we need to manipulate the local session cookies.</p><p>To view and manipulate the site cookies Open <strong>Chrome DevTools &gt; Application &gt; Cookies</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lVxJ84V4zNR8QrDut01TQ.png" /><figcaption>Application Cookies</figcaption></figure><p>The cookie for <strong>login</strong> seems to be a base64 encoded token</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TG56zd4fT5TSR2oR.png" /></figure><p>The decrypted base64 token yields a JSON (JavaScript Object Notation) object which contains <strong>user </strong>and <strong>user_hash</strong> properties.</p><p>We can now try to leverage the idea of an <strong>IDOR </strong>(Insecure Direct Object Reference) vulnerability to fool the client—web application into thinking that we are an <strong>admin </strong>user and give us the flag.</p><p>To proceed further with the same, we need to figure out the type of hashing algorithm used in <strong>user_hash</strong></p><p>Using a web tool, we identify the hash as <strong>MD5, </strong>and the hash on decryption yields <strong>guest</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KiXdFU7LGfn3CZwseGb9_A.png" /><figcaption>from <a href="https://hashes.com/en/tools/hash_identifier">https://hashes.com/en/tools/hash_identifier</a></figcaption></figure><p>Now, all that we need to do is create a JSON Object with the <strong>user </strong>property set to <strong>admin </strong>and <strong>user_hash</strong> property set to an <strong>MD5 </strong>hash of <strong>admin</strong>. Finally, we encode the resulting JSON object to a base64 encoded string and replace the login cookie value with our new token.</p><pre>{<br>   &quot;user&quot;:&quot;admin&quot;,<br>   &quot;user_hash&quot;:&quot;21232f297a57a5a743894a0e4a801fc3&quot;<br>}</pre><p>Encoding the above using base64 gives us the following token</p><p><strong>ewogICAidXNlciI6ImFkbWluIiwKICAgInVzZXJfaGFzaCI6IjIxMjMyZjI5N2E1N2E1YTc0Mzg5NGEwZTRhODAxZmMzIgp9</strong></p><p>Replacing the login cookie with the above token and refreshing the page, we get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kLkls9kIYzA1dsJd14rU4Q.png" /><figcaption>Changing the cookie value to match the user admin</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NeZv35NDtCSql3srmMJ3ew.png" /><figcaption>Admin Page</figcaption></figure><p>Flag: <strong>flag{…}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*cc4ZsQ1su73YFzJomcctKQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0fe296ecba3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[bi0s Recruitment CTF Writeup : Web Exploitation (2/5) — Reference]]></title>
            <link>https://nishithp.medium.com/bi0s-recruitment-ctf-writeup-web-exploitation-2-5-reference-4888f7b5f332?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4888f7b5f332</guid>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 06:17:22 GMT</pubDate>
            <atom:updated>2023-04-23T06:17:22.309Z</atom:updated>
            <content:encoded><![CDATA[<h3>bi0s Recruitment CTF Writeup : Web Exploitation (2/5) — Reference</h3><p>Based on the challenge description, we need to solve the challenge using the knowledge of the client-server communication model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVVvq284PSQ1FLqBHlxjjw.png" /><figcaption>Challenge Website</figcaption></figure><p>On clicking “GET FLAG”,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*TWBfQhW1019ey_uVnTGIcw.png" /></figure><p>we get an alert stating <em>Unauthorized browser !!! Only users from bi0s are allowed</em></p><p>Now, the question arises that how did the web server know that my browser is not “bi0s”.</p><p>The answer to the above question lies in the request headers (more specifically, the <strong>User-Agent </strong>part of the Request Headers)</p><p>Using <strong>Chrome DevTools &gt; Network </strong>to view the network requests sent by the web application when we click on the “GET FLAG” button, we observe that a user-agent is already set by the web browser when the request was sent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*apTMsPXqGD_5W6I7A9Eewg.png" /><figcaption>Chrome DevTools Network Inspector</figcaption></figure><p>To intercept the network requests sent by the client-web application to the web server we need to use an intercepting proxy tool like <strong>Burp</strong>, and <strong>Owasp Zap</strong> which will allow us to manipulate the request data sent from the client side.</p><p>Changing the <strong>User-Agent </strong>to bi0s using Burp Suite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*alrssBlxx9bvk370euQ99g.png" /><figcaption>Intercept — Burp Suite</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*Wn0FvP_6E_vAYGWrW0BT8w.png" /></figure><p>We now receive an alert stating that only users from <strong>bi0s.in</strong> are permitted to view the requested resource.</p><p>The above issue can easily be fixed by changing the <strong>Referrer </strong>Request header to <strong>bi0s.in</strong> and sending the network request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*Prror3ayF8lWJDRrvICBHw.png" /><figcaption>Intercepted Network Request</figcaption></figure><p>We have now successfully bypassed the restrictions set and we can now find the flag in the last line of the received response / via the page source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*u6V3WrRw2CgoWlO9ijeQ9g.png" /><figcaption>Network Response</figcaption></figure><p>Flag: <strong>flag{…}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*wbO-DMvyuSsHYpw4dwt3sQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4888f7b5f332" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[bi0s Recruitment CTF Writeup : Web Exploitation (1/5) — Scattered]]></title>
            <link>https://nishithp.medium.com/bi0s-recruitment-ctf-writeup-web-exploitation-1-5-scattered-4fcc735f957a?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fcc735f957a</guid>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Sun, 23 Apr 2023 06:17:06 GMT</pubDate>
            <atom:updated>2023-04-23T06:17:06.107Z</atom:updated>
            <content:encoded><![CDATA[<h3>bi0s Recruitment CTF Writeup : Web Exploitation (1/5) — Scattered</h3><p>The name of the challenge by itself gives us a hint that the flag is scattered somewhere throughout the web application source code.</p><p>On opening the page source code using ctrl + u we can spot two hints</p><ul><li>The flag isn’t present in the main html source code of the page.</li><li>An external CSS stylesheet is referenced in the main html document.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*j4DjBloJqVhUW-_X8-yUwA.png" /><figcaption>Challenge Page source code</figcaption></figure><p>On opening the referenced stylesheet, we are presented with the first part of the flag along with a hint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*E9Qc54PPRWiZybfIkS85gw.png" /><figcaption>style.css file</figcaption></figure><p>The first part of the flag: `flag{… `</p><p>Going by the hint, we need to have a look at the robots.txt file of the site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*MRzrMDYSVUTfwAxqRnQ69Q.png" /><figcaption>robots.txt</figcaption></figure><p>The file indicates that /s3cr3t.html is prevented from being indexed by Search Engines.</p><p>On navigating to /s3cr3t.html we are presented with a challenge to decode the given base64 encoded text to receive the second part of the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*mpqkREGjP9copjg2N5VLEw.png" /></figure><p>Decoding the above text, we get `g3n1u5_L1L`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/0*E46xUu_o0u8jZ9WB.png" /></figure><p>To receive the remaining part of the flag, we need to view the source code of the challenge page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*1MkoVcl8UecS4sadH48UTA.png" /><figcaption>Page Source code — /s3cr3t.html</figcaption></figure><p>The final hint takes us to the /security.txt file hosted on the web server which gives us the final part of the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*ePBGDrto6JBCUxtkmeP89A.png" /><figcaption>/security.txt</figcaption></figure><p>The final part of the flag: `…}`</p><p>Joining the pieces of the puzzle, we get the final flag as</p><p><strong>flag{…}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*iJkAGhTNl6kRamAI7YV77w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fcc735f957a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking Microsoft Forms]]></title>
            <link>https://infosecwriteups.com/hacking-microsoft-forms-d05e22fb70d7?source=rss-7425ab5725e3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d05e22fb70d7</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[microsoft-forms]]></category>
            <category><![CDATA[microsoft-bug]]></category>
            <dc:creator><![CDATA[Nishith P]]></dc:creator>
            <pubDate>Wed, 29 Dec 2021 10:08:04 GMT</pubDate>
            <atom:updated>2024-01-18T23:41:42.931Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tj0vXkPS5NPeU9sw.png" /><figcaption>Microsoft Forms</figcaption></figure><p>From the growth of Online learning during this pandemic — students, researchers have been on a hunt for hacks on <strong>Microsoft Forms</strong> which could give them an unfair advantage in their tests, pop quizzes etc.</p><p>There have been many on YouTube who have claimed to have found such <em>treasures</em> by inspecting the source code, trying other tricks, etc but it&#39;s all just clickbait to attract viewers.</p><p>What I am going to share today will change all that…</p><p>As all of you may have read from the subject line of this story, yes I have found a way to <strong><em>hack</em></strong><em> </em>Microsoft Forms but its not quite what you may expect —</p><h3>Summary</h3><ul><li>Whenever a form is submitted, an API POST request is made to the <strong><em>/formapi/api/${API_Key}/users/${User_Key}/forms(${FormID})/responses</em></strong> endpoint</li><li>By intercepting the POST request, a user/attacker can put a new entry / null string, thereby bypassing the required field / adding a new option completely.</li><li>Due to the absence of Server-side checks, the same reflects in the forms responses available to the form owner.</li></ul><h3>Intercepted Payload</h3><pre>{“startDate”:”2021–12–02T18:38:36.784Z”,”submitDate”:”2021–12–02T18:38:40.820Z”,”answers”:”[{\”questionId\”:\[REDACTED]},\”answer1\”:\${New Option} OR null \”}]”}</pre><h3>Summary — Translated For Layman</h3><ul><li>When a user submits a form, the webpage / the form (Client) sends a message to the server saying that this user has submitted “X” as the response for a particular question with a <strong>unique id</strong> “Y” and the server saves the same in its database which is made available for the form owner to view as the responses.</li><li>By acting as a middle man and intercepting the message, the attacker can change the message sent by the webpage to say that the particular user has sent “Z” as the response for a particular MCQ based question where Z is <em>not in the options available </em>/ is an<strong> invalid</strong> input.</li><li>Due to the absence of server-side checks to confirm whether the option is one of the valid options, one can manipulate <strong>Ratings</strong>, <strong>Net Promoter Scores</strong>, and also add a new Option in an <strong>MCQ / Checkbox / Dropdown</strong> based Question.</li><li>The same gets saved in the Database and is sent to the Form owner as a part of the set of responses.</li><li>One problem with this attack that limits its impacts is that the attacker can manipulate only his / her response and not other users responses.</li></ul><h3>Attack Scenario</h3><ul><li>When corporates use this form for their internal competition for employees, any misuse may bring in reputational issues for the corporates and in turn, it will harm Microsoft’s brand image,</li><li>Large corporates running a certain campaign for the public through these forms can face huge revenue loss and reputational harm if there is scope for misuse through options beyond the listed ones.</li><li>Microsoft forms are predominantly used in schools for the conduct of examinations. Any potential attack or misuse can play havoc with students’ lives and can cause irreparable loss for the students and their families.</li></ul><p>This Bug affects both quizzes and normal Forms.</p><h3>Steps to Reproduce Bug</h3><ul><li>Create a new Form on MS Forms.</li><li>Open the Form.</li><li>Follow the steps as shown in the POC attached below.</li></ul><h4>POC (Proof Of Concept)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Frg2zylBbxUQ%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Drg2zylBbxUQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Frg2zylBbxUQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/504151cb0c058812db1daeb762b83a5c/href">https://medium.com/media/504151cb0c058812db1daeb762b83a5c/href</a></iframe><p><strong><em>Disclaimer</em></strong><em>: By reading this article, you agree to use this information only for educational purposes and not to cheat in your tests/pop quizzes and I, as the author of this article, take no responsibility for any ill practices from your end.</em></p><h3>🔈 🔈 Infosec Writeups is organizing its first-ever virtual conference and networking event. If you’re into Infosec, this is the coolest place to be, with 16 incredible speakers and 10+ hours of power-packed discussion sessions. <a href="https://iwcon.live/">Check more details and register here.</a></h3><p><a href="https://iwcon.live/">IWCon2022 - Infosec WriteUps Virtual Conference</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d05e22fb70d7" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/hacking-microsoft-forms-d05e22fb70d7">Hacking Microsoft Forms</a> was originally published in <a href="https://infosecwriteups.com">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>