<?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 Gumn4m1 on Medium]]></title>
        <description><![CDATA[Stories by Gumn4m1 on Medium]]></description>
        <link>https://medium.com/@Gumn4m1?source=rss-4cd58fc52760------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k6hIn36ET0tAT1bc5iFXAw.jpeg</url>
            <title>Stories by Gumn4m1 on Medium</title>
            <link>https://medium.com/@Gumn4m1?source=rss-4cd58fc52760------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:18:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Gumn4m1/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[High-level logic vulnerability (business logic vuln.)]]></title>
            <link>https://medium.com/@Gumn4m1/high-level-logic-vulnerability-business-logic-vuln-04e65fdc18a3?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/04e65fdc18a3</guid>
            <category><![CDATA[business-logic-flaw]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 11:25:15 GMT</pubDate>
            <atom:updated>2025-08-13T11:25:15.603Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MvDmWoEVBM9oA-O0tO0xg.png" /><figcaption>Lab Description</figcaption></figure><p>In this lab we got a vulnerable shopping application like the “<a href="https://medium.com/@Gumn4m1/excessive-trust-in-client-side-controls-business-logic-vuln-99a813bcb79d">Excessive trust in client-side controls</a>” lab. But this time it doesn’t take the price value from client side requests.</p><p>So, now it is not taking price value from client requests and also checking whether the sub total of the ordered item is greater than 0 (should not be negative).</p><h3>Solution</h3><p>To solve the lab I open Burp Suite and started proxy server to intercept with the request to go though them. Then I added the intended Item in the cart. But this time it forgets to restrict users from ordering negative amount of items. So added another product in the cart and intercepted the request change the quantity to negative values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*z5ju1taLCvVW7NNXQWOjog.png" /><figcaption>negative quantity product added to cart</figcaption></figure><p>Bingo, this helps me to keep the amount within my budget (i.e. $100).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*E3_shxMlM139x-P7DnP-Tw.png" /><figcaption>Cart after adding negative amount of products</figcaption></figure><p>And finally placing the order make the lab solved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*GNj-BugZL6xphotq4Yk5GQ.png" /><figcaption>Lab Solved</figcaption></figure><h3>Mitigation</h3><p>Instead of calculating the actual value, use absolute value of quantity and price.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04e65fdc18a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2FA broken logic (Business logic Vuln.)]]></title>
            <link>https://medium.com/@Gumn4m1/2fa-broken-logic-business-logic-vuln-8bf6cbc68019?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bf6cbc68019</guid>
            <category><![CDATA[2fa-bypass]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[business-logic-flaw]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 10:54:31 GMT</pubDate>
            <atom:updated>2025-08-13T10:54:31.610Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfCzifn-uShYvNSnlblo0Q.png" /><figcaption>Lab Description</figcaption></figure><p>So as the name suggest its a authentication bypass challenge. In this lab we got a web application which contains 2FA mechanism for authentication (Password based + Token based).</p><h3><strong>Functionality</strong></h3><p>To understand the functionality I used burp suite. Firstly I entered the usernames, password and submit those, which generates a POST request to /login which validates the username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*MH0vmef03bGGWBahoiZs5Q.png" /><figcaption>Login creds</figcaption></figure><p>In case of a correct credentials, it generates a GET request to /login2 endpoint with a parameter to ask the server for OTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*8kRBPdmWbjpwJEW6a5Ab7g.png" /><figcaption>GET request to /login2</figcaption></figure><p>Then the server sends a mail to the mail client with the otp value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*sq_TJYCtPd0R2RZwMCpnrQ.png" /><figcaption>mail client</figcaption></figure><p>Lastly entering the otp correctly it generates a POST request to /login2 to validate the otp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*UN7isRUYrsoSDMYkCHU3iw.png" /><figcaption>Burp history showing POST request to /login2</figcaption></figure><h3><strong>Solution</strong></h3><p>I have used a brute force method to solve the lab. The overall planning was to</p><ol><li>Generate OTP for “carlos”</li><li>Brute-force OTP</li><li>Get into “carlos” account</li></ol><p>So I log into “wiener” again to generate a GET request to /login2 for getting OTP but this time I intercepted the request using burp proxy and change the cookie value from “verify:wiener” to “verify:carlos” to get OTP for carlos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*_XjZNPXIIICYv38ncdrGdQ.png" /><figcaption>Generate otp for “carlos”</figcaption></figure><p>Then I generate POST requests to /login2 and brute-force the OTP value. I used “curl” bash command instead of Burp Intruder as it was taking so long in my device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*OJo0coLxHxVCtnRDhfKLYQ.png" /><figcaption>OTP brute force</figcaption></figure><p>For this action I grab the headers from previous requests. To make it faster I ran it with xargs, which helps to execute multiple command at a time (for my case it is running 50 ports at a time). As I knew that the OTP is 4 digit long I used digits from 0000 to 9999.</p><p>After that I checked the status code of the responses and print the value if it is 302 status code. Then I generate the post request in Burp Repeater, send the OTP value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*oB5AFz8f3TIVb0Xpm6BpYA.png" /><figcaption>OTP verification for carlos</figcaption></figure><p>Lastly opening the response in web browser make the challenge solved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*zAxkwEUBJMikseghL079fg.png" /><figcaption>Lab Solved and got into carlos account</figcaption></figure><p>In this lab I got to know about OTP brute force method and the reason behind the flaw.</p><h3>Reason</h3><ol><li>Direct use of publicly available data to generate OTP</li><li>There isn’t any cookie value to validate user’s identity</li><li>No limitation of entering OTP value</li></ol><h3>Mitigation</h3><ol><li>Encrypt the information that is used for referring the user, with strong encryption algorithm.</li><li>Set cookie value with user’s identifiable information using strong cryptographic methods</li><li>Set limit for entering OTP</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bf6cbc68019" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excessive trust in client-side controls (Business Logic vuln.)]]></title>
            <link>https://medium.com/@Gumn4m1/excessive-trust-in-client-side-controls-business-logic-vuln-99a813bcb79d?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/99a813bcb79d</guid>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[business-logic-flaw]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Wed, 13 Aug 2025 09:50:21 GMT</pubDate>
            <atom:updated>2025-08-13T09:52:06.758Z</atom:updated>
            <content:encoded><![CDATA[<p>Platform: <a href="https://portswigger.net/">Portswigger</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWv17eaYM3KS4_ekvqIdQw.png" /><figcaption>Lab description</figcaption></figure><p>In this lab we got a vulnerable shopping application, where we can view product details, add them to cart, apply coupon and place order. Also, an amount of $100 is allocated to our user for testing.</p><p>Target recon: After logging into the given user account, I go the specific product that needed to be purchased. But we had only $100 and we needed $133700 to purchase the specific product. So check the purchasing functionality. First of all it generates a POST request to /cart endpoint with some query parameters to add the products.</p><p>Failed test cases:</p><ol><li>Negative quantity of product</li><li>Lookout for coupons (leaked data)</li></ol><p>Solution:</p><p>First of all I open Burp suite and started intercepting the browser requests. Then I generated an add to cart request of the product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jH-6Q5XmIRfGXD0-gW1dhw.png" /><figcaption>Intercepted POST request</figcaption></figure><p>Here I noticed that the web application is fetching the product information including the price from the client side for adding them into the cart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*anMys8rQuwbts-pg9VBGKQ.png" /><figcaption>POST /cart</figcaption></figure><p>Thus, I changed the price value to 1 (must be greater than 0), so that I can make the order placed (as I had $100 for testing).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*8R9olYTSVe-8UC4IJ8OGoA.png" /><figcaption>cart page</figcaption></figure><p>Here we go. I made the total amount to $0.01. Finally placing the order solved the lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*1Lf85Q-5ft3es06JlbBVcQ.png" /></figure><p>This is a business logic vulnerability where although the web application is performing some validations like negative values, set upper limit according the credit but it blindly trust the client side request which controls the total amount value.</p><p>Mitigation: Instead of fetching the amount from client request, it is suggested to fetch the data from back-end server using the product id.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99a813bcb79d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TCS Hackquest Season 9 (Selected for TCS Prime)]]></title>
            <link>https://medium.com/@Gumn4m1/tcs-hackquest-season-9-selected-for-tcs-prime-4c13dd7dc545?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c13dd7dc545</guid>
            <category><![CDATA[tcs-hackquest-s9]]></category>
            <category><![CDATA[tcs-prime]]></category>
            <category><![CDATA[tcs-hackquest]]></category>
            <category><![CDATA[cyber-secuity]]></category>
            <category><![CDATA[selected]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 22:52:17 GMT</pubDate>
            <atom:updated>2025-03-11T00:33:58.697Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, I am really excited to share that I got selected for TCS Prime job role through TCS Hackquest season 9. And here is my experience throughout the journey.</p><h3>First and Second round</h3><p>These 2 round were CTF rounds and the challenges were easy to moderate. I have also shared my write up for the first and second round, you guys can check that out .</p><p>1st round: <a href="https://medium.com/@Gumn4m1/tcs-hackquest-season-9-first-round-qualified-7cae235ce33b">https://medium.com/@Gumn4m1/tcs-hackquest-season-9-first-round-qualified-7cae235ce33b</a></p><p>2nd round: <a href="https://medium.com/@Gumn4m1/tcs-hackquest-s9-2nd-round-got-prime-interview-call-9b5f50d7a3c8">https://medium.com/@Gumn4m1/tcs-hackquest-s9-2nd-round-got-prime-interview-call-9b5f50d7a3c8</a></p><h3>Interview</h3><p>And Finally the interview round! I got an interview call for Prime role. These are the questions that they asked me during the interview, luckily I was able to answer them all.<br>First of all they asked me to introduce myself</p><p>Then some HTTP request related questions</p><p>OWASP TOP 10</p><p>Scenario based Questions like CSRF attack</p><p>Basic linux command like Find, Locate. Some tools like JohnTheRipper, nmap.</p><p>Resources: Port Swigger, Tryhackme, Hackthebox.</p><p>The above mention resources help me a lot in clearing my concepts and building the fundamental concepts</p><p>And finally after 2 weeks I got the offer letter 🎆.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBl0m5Ly0aDH0HBGMma67A.png" /></figure><p>— — — — — — — — — -End of TCS Hackquest s9 Journey — — — — — — — — — — —</p><p>Thank you guys for staying with me!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c13dd7dc545" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TCS Hackquest S9 2nd Round (Got Prime interview call)]]></title>
            <link>https://medium.com/@Gumn4m1/tcs-hackquest-s9-2nd-round-got-prime-interview-call-9b5f50d7a3c8?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b5f50d7a3c8</guid>
            <category><![CDATA[tcs-prime]]></category>
            <category><![CDATA[tcs-hackquest]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[tcs-hackquest-s9]]></category>
            <category><![CDATA[hackquest]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 22:22:21 GMT</pubDate>
            <atom:updated>2025-03-10T22:23:58.206Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the write up for the second round and I qualified this round also got an interview call for TCS Prime. If you haven’t checkout my first round write up then you can check that out first. link: <a href="https://medium.com/@Gumn4m1/tcs-hackquest-season-9-first-round-qualified-7cae235ce33b">https://medium.com/@Gumn4m1/tcs-hackquest-season-9-first-round-qualified-7cae235ce33b</a></p><p><strong>Challenge Title: Tere Bin QR</strong></p><p><strong>Flag: HQ9FLAG{1324e7766bb8875802ec99d1f939ec92719f2632}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>In this challenge we are given a file containing binary numbers, and it does look like an image representation, so I tried to convert the binary code into an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uk9ZCSnk9oGljhJW" /></figure><p>To convert this I used an online tool by <a href="https://www.daveeddy.com/">@Dave Eddy</a> to convert it from binary to image.</p><p>URL: <a href="https://bahamas10.github.io/binary-to-qrcode/">https://bahamas10.github.io/binary-to-qrcode/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/0*z32Wh6dG0ucHA15j" /></figure><p>After converting the data to image I downloaded the image of the qr and used a tool zbarimg to scan the qr and fetch the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/0*_UKdRC-qxOzceUUU" /></figure><p>Lastly, by submitting the key I got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*Vr2AajbXQqhsVePM" /></figure><p><strong>Challenge Title: Shade Wars</strong></p><p><strong>Flag: HQ9FLAG{983406eb02ef6367c2c93c414a53271420c0df9c}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>This is an image forensics challenge with a QR having multiple shades, thus I could not scan the QR directly due to the missing color contrast.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/0*YfYVPRuZiyw7x25L" /></figure><p>After going though the description and title I got a hint that I have to modify the shade. I used the Stegsolve tool to modify the shades and obtain a black and white QR code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/0*jFAZQFAWuK55mjnY" /></figure><p>Converting the image into a grey bit image gives the best result, and then I used zbarimg to bring out the key from the qr.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DQFe9_vNZ4i9OiN0" /></figure><p>Lastly I submitted the key and got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*edrqq4ONrwf4hPbE" /></figure><p><strong>Challenge Title: Tolkein’s Secret</strong></p><p><strong>Flag: HQ9FLAG{8afe652aecdcfa3ef61d26cg24ed8e79d60c28c6}</strong></p><p><strong>Approach (Step by Step):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eROIcxPgW2fTH3Eb" /></figure><p>This was a web challenge related to JSON Web Token as suggested in the name. We can try and see if there are no checks on the algorithm and simply change the role from guest to admin. I got the JWT token from the challenge from the Developer console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/0*SaR3C2wMmz-SrBQd" /></figure><p>The JWT token had HMAC-SHA256 encryption. I tried to change the algorithm to none and change the role from guest to admin in the below JWT token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QeiUMxqoOylk8qll" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*aiYY7Hhof3VtKjHh" /></figure><p>Replacing the JWT token in the developer console and refreshing the page gives us the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8xwtHZ7CVtm8Wh4X" /></figure><p>Lastly submitted the key and got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RI1yx9xKn1QrbcAT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*sRchfmdQjwrzgLSd" /></figure><p><strong>Challenge Title: Matrix Mayhem</strong></p><p><strong>Flag: HQ9FLAG{04e070825a27117ee21b67a02aae455d57250e9f}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>In this challenge we are given an executable file and the idea is to reverse the matrix generation algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4P0_dhst6lF2HLka" /></figure><p>So after some analysis I got to know that it is returning a matrix in which our intended characters are embedded. And to find those we had to find letters that contain the keys of all the columns of the array except the ith column will be the ith letter of the required string.</p><p>To get the strings we had to enter a length more than 30, this string is also revealed by running the strings command over the executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*IC1snkEzTfZ-ntmT" /></figure><p>I write a python code to build the logic and find out the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/0*UmI3GH8u7ryMifk9" /></figure><p>Executing this code gave me the key for the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/0*VmSV8_EsBmYQ-dKl" /></figure><p>At last I submit the key and flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EvCGC5QnMWP56ZWu" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*jDyi9wIypgjjKTGm" /></figure><p><strong>Challenge Title: Tangled</strong></p><p><strong>Flag: HQ9FLAG{ac23d6ae0a2b4dd7c3113047a8f70b2fb1bc2b87}</strong></p><p><strong>Approach (Step by Step:</strong></p><p>In this challenge we are given a web application in which source code I got the key for this challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kap5zzfvH62cFWKT" /></figure><p>By submitting this I got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*QJb1q70BwKGW-nK1" /></figure><p>— — — — — — — — — — — — — — -End of Round 2— — — — — — — — — — — — — — — -</p><p>Thank you guys ! For further update you can check out my profile <a href="https://medium.com/u/4cd58fc52760">Gumn4m1</a> !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b5f50d7a3c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TCS Hackquest Season 9 First Round(Qualified)]]></title>
            <link>https://medium.com/@Gumn4m1/tcs-hackquest-season-9-first-round-qualified-7cae235ce33b?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cae235ce33b</guid>
            <category><![CDATA[hackquest]]></category>
            <category><![CDATA[tcs-hackquest-s9]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tcs-hackquest]]></category>
            <category><![CDATA[selected]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 22:20:38 GMT</pubDate>
            <atom:updated>2025-03-11T04:29:07.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello guys, I am Pankaj Barman, a B.Tech CSE undergraduate (Passing year : 2025) from JGEC and in this blog I am sharing my write up for the first round.</p><p>TCS Hackquest is a Capture the flag event for all the final year graduation and post graduation students organized by Tata Consultancy Services. TCS also hire students from this event for various role (Prime, Digital, Ninja). There are 3 rounds in total (2 CTF round and a final interview round).</p><p>— — — — — — — — — — — -— — — — 1st Round — — — — — — — — — — — — — — — —</p><h3><strong>1st Round</strong></h3><p><strong>Challenge Title: Stranger Things — 500</strong></p><p><strong>Flag: HQ9FLAG(e626f35e23bccd0498d04adb8b7d65280e325a2c}</strong></p><p><strong>Approach (Step by Step):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KG110-vyQBzI6Stg" /></figure><p>This was a coding challenge where we are given a pseudo code and some encoded data. The objective is to reverse the algorithm and get the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*nJVoQ-74psfR1_qh" /></figure><p>I wrote the following python code that does the following tasks. Base64 decode the string. Then 5 bit binary convert and merge all binary 6 bit (As the length of the dictionary was 64 ) binary chunks to int convert and use the given list and print according to the number (converted from chunks)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I9qudcVnZ9NkeWRH" /></figure><p>Executing the following program gives us the key for the flag and then submitting this gives us the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*GNXcIT1vgF-_fPU_" /></figure><p>Key: HQ9{ca0d299d47719fb49fa9fdb9af67b2edf6cb41a7}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*J--ibAmr7fFEr8uT" /></figure><p><strong>Challenge Title: The Mask — 200</strong></p><p><strong>Flag: HQ9FLAG(0c8270dedc7e8165d46c6decf9b01ff4c2957b68}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>In this challenge we are given a password protected pdf file and the idea is to crack the password for this file, thus I started the challenge by brute forcing the password using johnTheRipper and rockyou.txt wordlist. To do this I first extracted the hash for the pdf using pdf2john and then used the hash with john to extract it using the rockyou.txt wordlist.</p><p>The password for the document is “password”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*qvkVacFoGWvra543" /></figure><p>Then I used a python script to remove the password and generate a new pdf without the password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*Qn6lj1AJ6kFwCyvy" /></figure><p>In that pdf there was a portion in 25th page where the key was masked</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GMrUmPZ8txZYFgQb" /></figure><p>So to unmask this we can use canva,adobe acrobat etc tools. Thus I used canva online platform to unmask that mask and obtain the key.</p><p>Key HQ9{1YUAZF84DMV77BJJS9DPYLWDEXRNK8MN}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XbMteKhFgUbwiNcT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f21MfEtEMQZUVx40" /></figure><p><strong>Challenge Title: Captain Atom — 100</strong></p><p><strong>Flag: HQ9FLAG(bfe7cfce861267c7af5f41c1892bf4b40f93fe24}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>In this challenge we are given a ciphertext with some hints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xi38HfttY95YSavN" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*HlAf7j0pK8R7UzLN" /></figure><p>Go to CyberChef and paste the value, then decode this with base64 encoding and atom 128 character set to get the key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nhz-Fj8RCrZvBAtD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Ug181BUXNZU2wYG" /></figure><p><strong>Challenge Title: A Bugs Life</strong></p><p><strong>Flag: HQ9{878ce322c56450aa062c88ed6b593d7e4ca26038}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>This was a web challenge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yMOBARdmhs_wIiZS" /></figure><p>I opened the challenge to go to its source code and look out for the js file. There I got a function called handleLadybugClick(), which is used to return a flagMessage if the game is running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*H7i86qqDH12iC0Mw" /></figure><p>Then go to the web page run the game and call the function in the page’s terminal and got the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*86g6aJZjaLcKZAZk" /></figure><p>By submitting the key I got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*62dkcgKxENHJ-Pe4" /></figure><p><strong>Challenge Title: Crypto Conundrum — 200</strong></p><p><strong>Flag: HQ9{1YUAZF84DMV77BJJS9DPYLWDEXRNK8MN}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>In this challenge we are given a transaction hash on the sepolia testnet.</p><p>And also a description which indicates towards Sepolia Testnet</p><p>So I enumerated the transaction hash on etherscan <a href="https://sepolia.etherscan.io/">https://sepolia.etherscan.io/</a></p><p>hex: 0xc2a691b9fd2bc5c28408efa34be7243d8ec96e3dbdbff14fb32716c882f734e9</p><p>Then I got a transaction report, then I look into the logs and got some suspicious text in the data along with the twitter handle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*scpEAz-M2DJhLUWw" /></figure><p>So extract the hex and decode that and got the key: HQ9(252a37e575b0de0f60053b5cb30255326fc6a078)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lNA4rDnI-zlmtYHW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TVa8E6OZvGO9XFDN" /></figure><p><strong>Challenge Title: Codepool</strong></p><p><strong>Flag: HQ9FLAG(bfe7cfce861267c7af5f41c1892bf4b40f93fe24</strong></p><p><strong>Approach (Step by Step):</strong></p><p>It was another cryptography challenge with a cipher text, I went to cyberchef and decoded this using a rot13 cipher with key 11.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z8K8aZjPtR_AQTxl" /></figure><p>Here I got the key and then submitting this returns the flag,</p><p>Key: HQ9{everyloquaciousdeadpoolhasapeter}</p><p><strong>Challenge Title: Breaking Bad</strong></p><p><strong>Flag: HQ9FLAG{ec7c86662416231da2e2e0768fe60e10fa768729}</strong></p><p><strong>Approach (Step by Step):</strong></p><p>Another cryptography challenge</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*g4DaBbKE6mEAaw8u" /></figure><p>This time I go to dcode.fr and search for cipher identifier to identify the cipher, and doing this gives me the probability of multiple ciphers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/0*v7ZWL2TKjLO4TTss" /></figure><p>From this the Periodic Table Cipher gives the key for the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/0*g7EmNYf9KhRjoUzv" /></figure><p>Then wrap the key in format and submit,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P-2zrpx5bTYDGCqB" /></figure><p><strong>Challenge Title: Garbalator Dussahas Dice — 200</strong></p><p><strong>Flag: HQ9FLAG(bfe7cfce861267c7af5f41c1892bf4b40f93fe24</strong></p><p><strong>Approach (Step by Step):</strong></p><p>Another web challenge in a hint was given that there is something in the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TPbpc69vJ0XGEHyQ" /></figure><p>Thus I go for the source code and from there go to the script file where I got a function called checkRolls(), which will return flag for 2 arguments being the value 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*topPwgtBqBfanoes" /></figure><p>So after understanding the code I go to the website’s console and run the function with 6,6 parameters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WeFQxMo8shVUzxRw" /></figure><p>Then just submitting the key gave me the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/0*34symy1WvLlO8f_B" /></figure><p><strong>Challenge Title: Garbalator</strong></p><p><strong>Flag: HQ9FLAG(41ffc8051aa2611614aa97d4d6fa4fc89f44f07e</strong></p><p><strong>Approach (Step by Step):</strong></p><p>It was another coding challenge with a question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CaQJg4-1xnVjEKCm" /></figure><p>And the question is given below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*t6eiqHAuiIxkk35R" /></figure><p>There was a file.txt also which contains huge text.</p><p>So I write a python code to dump the words with capital letter and number. Then apply the mapping on the words and lastly extract the 4th character for the key from each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sN5jOxWVD8P1Ewad" /></figure><p>This gives me the key and submitting that gives the flag.</p><p>key: HQ9{craiostlrarsnlhrlege}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*vrMev3g-cILYGHhJ" /></figure><p>— — — — — — — — — — — — — — End of Round 1 — — — — — — — — — — — — —</p><p>Thank you guys and for further update you can check out my profile <a href="https://medium.com/u/4cd58fc52760">Gumn4m1</a> !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cae235ce33b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Upload Vulnerability]]></title>
            <link>https://medium.com/@Gumn4m1/file-upload-vulnerability-00a5b7ca86a6?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/00a5b7ca86a6</guid>
            <category><![CDATA[file-upload-vulnerability]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 11:36:39 GMT</pubDate>
            <atom:updated>2024-12-10T11:36:39.329Z</atom:updated>
            <content:encoded><![CDATA[<p>Description and port swigger lab solutions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFYFDHgQq0-ylYuW5WYkcw.png" /></figure><p><strong>What are file upload vulnerabilities ?</strong></p><p>File upload vulnerabilities are those vulnerabilities, which are exploited by uploading malicious file. It occurs when the server allows clients to upload files without validating the name,type,contents or size properly.</p><p><strong>How do web servers handle requests for static files ?</strong></p><p>Now a days websites are more dynamic in storing files but previously it uses 1:1 mapping. It means the websites were used to store the file in a particular filesystem/directory. So by exploiting file upload vulnerabilities any file could be could be overwritten and depending on the servers configuration and malicious file,<br> 1. Any static page can be overwritten (if the file is non-executable)<br> 2. Reverse shell can be taken (if executable and server configuration allows to execute)<br> 3. Throw error (if executable and server configuration doesn’t allow to execute)</p><p><strong>Examples</strong>:</p><ol><li>Port Swigger:</li></ol><p>a. Exploiting unrestricted file upload to deploy a web shell ~</p><p>In this first example from port swigger a vulnerable website is given, which allows a user to upload php file and execute them in back-end without any validation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*pf1RCasc7s9e2CapUI5Zuw.png" /><figcaption>Uploaded ‘basic.php’ containing payload to exploit</figcaption></figure><p>b. Exploiting flawed validation of file uploads ~</p><p>The second scenario is not so different from the previous one. In this example we got the same website with some validations like checking content type, but it is also not so secured. Thus I just change the content type from “application/x-php” to “image/jpeg” or “image/png” with the same file and got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*Hb0kxP7N8SWXGASynElzuQ.png" /><figcaption>Same file with just changed content-type field</figcaption></figure><p>c. Preventing file execution in user-accessible directories ~</p><p>In the next lab from port swigger, the website is a bit more secure as it doesn’t allow the directory to execute any file, where the user uploaded files are stored. So, I exploited another vulnerability called directory traversal vulnerability to bypass this protection and exploit in another directory (send filename as “../basic.php”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5Xsgv1rEAaJU5aqOjKEIpg.png" /><figcaption>Directory traversal vulnerability exploited to execute the php file</figcaption></figure><p>d. Overriding the server configuration ~</p><p>In the next lab the website blacklisted php file from uploading, so to exploit this I had to overwrite the server’s configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*cznF0nRKbngYMle_lrOlnw.png" /><figcaption>Overwrite .htaccess file to add php execution through .l33t extension</figcaption></figure><p>Then just submitted the same file with .l33t extension, and got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*xws7iLxG_-oYJWKKu6Ycrw.png" /><figcaption>Change the filename from basic.php to basic.l33t</figcaption></figure><p>e. Obfuscating file extensions ~</p><p>The next lab was a bit easier than the previous one for me. In this lab the website only accepts image files. Thus I just added another file extension with my filename like jpg or png.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*w5HZwSASxIzbb_Rpe82Cxg.png" /><figcaption>Obfuscated file extension</figcaption></figure><p>f. Flawed validation of the file’s contents</p><p>A polyglot is a file that is valid in two or more formats. So in the next lab the website checks the file precisely but polyglot files are problematic for this kind of websites, because we can hide several files within the uploaded file. So to bypass the website’s security I hide my payload within the metadata of an original image and then change the extension with php and uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdCFFmKOpVaKmGZpssh3Kg.png" /><figcaption>Hide my payload within a image and change the filename polyglot.php</figcaption></figure><p>For more explanation you can refer to my <a href="https://www.youtube.com/@gumn4m1">youtube</a> video on File Upload Vulnerabilities. Link: <a href="https://www.youtube.com/watch?v=V6RzSWHLzpE">https://www.youtube.com/watch?v=V6RzSWHLzpE</a></p><p>Thank you for referring to my blogs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00a5b7ca86a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cryptography and Steganography]]></title>
            <link>https://medium.com/@Gumn4m1/cryptography-and-steganography-1464346f5d7d?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/1464346f5d7d</guid>
            <category><![CDATA[cryptanalysis]]></category>
            <category><![CDATA[cryptology]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[steganography]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 20:32:43 GMT</pubDate>
            <atom:updated>2024-06-14T20:32:43.037Z</atom:updated>
            <content:encoded><![CDATA[<h4>A brief introduction to cryptography and steganography</h4><h4><strong><em>Cryptography:~</em></strong></h4><p>The study of encryption and encoding schemes which includes encoding-decoding , encrypting-decrypting, and hashing is called cryptography</p><p><strong><em>Encoding:</em></strong><br> This is a technique of transforming data from intelligible to another (unintelligible) form</p><p><strong><em>Decoding:</em></strong><br> This is the technique of transforming data from unintelligible to intelligible form</p><p><strong><em>Encryption:</em></strong><br> It is a cryptographic technique for protecting the data confidentiality and preserving the usability of the data by using key or a pair of key to transform data.</p><p><strong><em>Decryption:</em></strong><br> It is the technique for transforming encrypted unintelligible data to intelligible form using key or pair of keys</p><p><strong><em>Hashing:</em></strong><br> It is the process of generating a fixed size output from an input of variable size using mathematical formulas known as hashing function.<br> Hashes cannot be reversed</p><p>Techniques that are used for deciphering a message:<br> 1. Cryptanalysis<br> 2. Bruteforce</p><p><strong><em>Cryptanalysis</em>:</strong><br> Study of Deciphering message without any knowledge of enciphering details is called cryptanalysis. The study of cryptography and cryptanalysis is also known as <em>cryptology.</em></p><p><strong><em>Bruteforce</em>:</strong><br> Everything is known except the key , then we can use bruteforce method</p><p><strong>Encryption scheme can be “<em>Unconditionally secure</em>” if,</strong><br> It doesn’t contain enough information to determine the corresponding plaintext uniquely, which means no matter how much time an opponent has, it is impossible for him to break or decrypt the message simply because the required information is not there.</p><p>but it is practically not possible.</p><p><strong>An encryption scheme can be called “<em>Computationally secure</em>” if</strong> <br> i. The cost of breaking the cipher exceed the cost of the encrypted information<br> ii. The time required to break the cipher exceeds the useful time of the information</p><p>Encryption:<br> 5 ingredient of encryption scheme<br> i. Plaintext = Input text to encrypt<br> ii. Encryption algorithm = algorithm to encrypt<br> iii. Secret key <br> iv. Cipher text = output or encrypted text<br> v. Decryption algorithm = reverse algorithm of the encryption algorithm</p><p>Classification:<br> Cryptographic systems are classified along 3 independent dimensions<br> 1.<strong> Type of operation</strong>:<br> i.<em> Substitution</em><br> ii. <em>Transposition</em><br> 2. <strong>Number of key used:</strong><br> i.<em> Symmetric key</em><br> ii. <em>Asymmetric key</em><br> 3. <strong>Processing of plaintext:</strong><br> i. <em>Block cipher</em><br> ii.<em> Stream cipher</em></p><p><em>— Substitution technique —</em></p><p><strong>Caeser cipher:</strong><br> c = E(3,p) = (p+3) mod 26</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*JoygZe5oYXwGrFZvKB3TtA.jpeg" /><figcaption>Caeser cipher wheel</figcaption></figure><p><strong>Monoalphabetic Cipher:</strong><br> — Permutation of the character set is used<br> eg. S = {a,b,c}<br> then there are 6 possibilities<br> abc , acb , bac , bca, cab , cba</p><p>Message = “bac” , Encryption perm = {c , a , b} then cipher text = “acb”. In caeser cipher only 25 keys are possible but in case of Monoalphabetic cipher 26! keys are possible if the character set is only alphabets</p><p><em>— Transposition cipher — </em><br> <br><strong> Rail fence cipher:</strong><br> “meet me after the party” = “meetmeaftertheparty”</p><p>m e m a t r h p r y<br> e t e f e t e a t</p><p>= “mematrhpryetefeteat”</p><p>— <em>Symmetric encryption</em> — <br> Encryption that uses a single key for both encryption and decryption</p><p>— <em>Asymmetric encryption</em> — <br> Encryption that uses different key or pair of key for encryption and decryption</p><p>— <em>Block cipher</em> — <br> Encryption in which a chunk of text or block is processed at a time</p><p>— <em>Stream cipher</em> — <br> Encryption that processes single character at a time and process continuously</p><h4><strong>Steganography :~</strong></h4><p>Steganography is the technique of hiding data within an ordinary, nonsecret file or message to avoid detection</p><p>Simple and historical examples of steganography</p><p>i. The sequence of first letter of each word spells out a hidden message<br>ii. Character marking (not visible marking unless the paper held at an angle to bright light)<br>iii. Invisible ink<br>iv. Pin puncture<br>v. Typewriter correction ribbon</p><p>Hiding message in a image :<br>eg.</p><p>Reference: <a href="https://www.geeksforgeeks.org/image-steganography-in-cryptography/">https://www.geeksforgeeks.org/image-steganography-in-cryptography/</a></p><pre>def hide_text(image_path, secret_text, output_path):<br> # Open the image<br> image = Image.open(image_path)<br> <br> # Convert the secret text to binary<br> binary_secret_text = ‘’.join(format(ord(char), ‘08b’) for char in secret_text)<br> <br> # Check if the image can accommodate the secret text<br> image_capacity = image.width * image.height * 3<br> if len(binary_secret_text) &gt; image_capacity:<br> raise ValueError(“Image does not have sufficient capacity to hide the secret text.”)<br> <br> # Hide the secret text in the image<br> pixels = image.load()<br> index = 0<br> for i in range(image.width):<br> for j in range(image.height):<br> r, g, b = pixels[i, j]<br> <br> # Modify the least significant bit of each color channel<br> if index &lt; len(binary_secret_text):<br> r = (r &amp; 0xFE) | int(binary_secret_text[index])<br> index += 1<br> if index &lt; len(binary_secret_text):<br> g = (g &amp; 0xFE) | int(binary_secret_text[index])<br> index += 1<br> if index &lt; len(binary_secret_text):<br> b = (b &amp; 0xFE) | int(binary_secret_text[index])<br> index += 1<br> <br> pixels[i, j] = (r, g, b)<br> <br> # Save the image with the hidden secret text<br> image.save(output_path)</pre><p>In this algorithm r,g,b values of each pixel is stored in a variable and then “AND” operation with 0xFE or 254 or 0b11111110 value to make the last bit 0 and “OR” operation with the corresponding index placed character of the secret message’s binary string is done to change the last value</p><p>In this operation a single bit of RGB is changes which cannot be differentiated without checking the RGB values</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1464346f5d7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mini RSA]]></title>
            <link>https://medium.com/@Gumn4m1/mini-rsa-3af34269c174?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/3af34269c174</guid>
            <category><![CDATA[picoctf-2021]]></category>
            <category><![CDATA[picoctf]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Fri, 20 Oct 2023 18:23:07 GMT</pubDate>
            <atom:updated>2023-10-20T18:23:07.125Z</atom:updated>
            <content:encoded><![CDATA[<p>picoCTF solution</p><p>Author: Sara</p><h4>Description</h4><p>What happens if you have a small exponent? There is a twist though, we padded the plaintext so that (M ** e) is just barely larger than N. Let’s decrypt this: <a href="https://mercury.picoctf.net/static/71f49c1459c00de5335d5dddc86c8841/ciphertext">ciphertext</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*K23DhDdItd5OMiSWPrmIKA.png" /></figure><p>First I check the cipher text file and got a cipher text with 2 more values of e and N. The title and hints tells that this is an <a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)"><em>RSA</em></a> cipher</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VcyCsw-TjOckWLaP30sIxg.png" /></figure><p>So <a href="https://en.wikipedia.org/wiki/RSA_(cryptosystem)"><em>RSA</em></a> is a asymmetric key encryption method , which has a public key and a private key to encrypt or decrypt any text. The encryption algorithm is as follows, “c = (M ^ e) % N ” , where c = cipher text, M = main text , e = encryption (public) key , N = part of both public and private key</p><p>So if N&gt;e then (M**e) % N == (M**e) but if N &lt; e then we cannot just root inverse it to decrypt, so I reverse the algorithm and find out a way to get the plain text , M = {(N*i) + c} ^ (1/3) // where , i = any positive integer</p><p>…………………………….…….Python code………………….……………………</p><p>N= 1615765684321463054078226051959887884233678317734892901740763321135213636796075462401950274602405095138589898087428337758445013281488966866073355710771864671726991918706558071231266976427184673800225254531695928541272546385146495736420261815693810544589811104967829354461491178200126099661909654163542661541699404839644035177445092988952614918424317082380174383819025585076206641993479326576180793544321194357018916215113009742654408597083724508169216182008449693917227497813165444372201517541788989925461711067825681947947471001390843774746442699739386923285801022685451221261010798837646928092277556198145662924691803032880040492762442561497760689933601781401617086600593482127465655390841361154025890679757514060456103104199255917164678161972735858939464790960448345988941481499050248673128656508055285037090026439683847266536283160142071643015434813473463469733112182328678706702116054036618277506997666534567846763938692335069955755244438415377933440029498378955355877502743215305768814857864433151287<br>e= 3</p><p>c= 1220012318588871886132524757898884422174534558055593713309088304910273991073554732659977133980685370899257850121970812405700793710546674062154237544840177616746805668666317481140872605653768484867292138139949076102907399831998827567645230986345455915692863094364797526497302082734955903755050638155202890599808146919581675891411119628108546342758721287307471723093546788074479139848242227243523617899178070097350912870635303707113283010669418774091018728233471491573736725568575532635111164176010070788796616348740261987121152288917179932230769893513971774137615028741237163693178359120276497700812698199245070488892892209716639870702721110338285426338729911942926177029934906215716407021792856449586278849142522957603215285531263079546937443583905937777298337318454706096366106704204777777913076793265584075700215822263709126228246232640662350759018119501368721990988895700497330256765579153834824063344973587990533626156498797388821484630786016515988383280196865544019939739447062641481267899176504155482</p><p>def find_invpow(x,n):<br> “””Finds the integer component of the n’th root of x,<br> an integer such that y ** n &lt;= x &lt; (y + 1) ** n.<br> “””<br> high = 1<br> while high ** n &lt; x:<br> high *= 2<br> low = high//2<br> while low &lt; high:<br> mid = (low + high) // 2<br> if low &lt; mid and mid**n &lt; x:<br> low = mid<br> elif high &gt; mid and mid**n &gt; x:<br> high = mid<br> else:<br> return mid<br> return mid + 1</p><p>“””<br>we know that in rsa , c = (M**e % N)<br>so M = (i*n+c)**(1/3) where i might be any integer<br>as I got the answer within 4000 I set the range of i as 4000<br>“””</p><p>from Crypto.Util.number import *<br>for i in range(4000):<br> flag = long_to_bytes(find_invpow(i*N+c,3))<br> if b’pico’ in flag:<br> f = str(flag)[2:-1].lstrip(“ “)<br> print(f)<br> break</p><p>and that’s how I got the flag :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3af34269c174" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[More SQLi]]></title>
            <link>https://medium.com/@Gumn4m1/more-sqli-5fb0589a147b?source=rss-4cd58fc52760------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fb0589a147b</guid>
            <category><![CDATA[more-sqli]]></category>
            <category><![CDATA[picoctf-2023]]></category>
            <dc:creator><![CDATA[Gumn4m1]]></dc:creator>
            <pubDate>Fri, 29 Sep 2023 20:19:00 GMT</pubDate>
            <atom:updated>2023-09-29T20:19:00.569Z</atom:updated>
            <content:encoded><![CDATA[<p>picoCTF solution</p><h4>Description</h4><p>Can you find the flag on this website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*ujEJtDhevAsj-EFzU8IoYg.png" /></figure><p>Go to website and tried default credentials first ,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*vHXmajX3QjzQKdhvKaLksQ.png" /></figure><p>I got the query from here and bypass authentication using basic sql injections , and this redirect to another directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Obir_P85tm3Rf08RmZXPNw.png" /></figure><p>After this I need to take the hint “sqlilite” and I checked the documentation of sqlite where I got to know about “sqlite_master” table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz3jUprpqNphpulcikDJAw.png" /></figure><p>As I did not have any other option I request data with additional query concatinating them using “Union” operation</p><p>query : Algiers ” UNION SELECT SQL,1,1 FROM sqlite_master —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xgs5UVjjYRtGwSu3NCE7w.png" /></figure><p>using this I got to know that a table name “more_tables” was created which contains a “flag” named column</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGgqSRJPeNNO5_J2p-Q4ZA.png" /></figure><p>and then I query for flag having id =1 from “more_tables”</p><p>Query: Algiers” UNION SELECT flag,id,1 FROM more_tables —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAK2-IaFcQl44leOPMFyNg.png" /></figure><p>Got the flag ! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fb0589a147b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>