<?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 Sparsh Kulshrestha on Medium]]></title>
        <description><![CDATA[Stories by Sparsh Kulshrestha on Medium]]></description>
        <link>https://medium.com/@0xsparsh?source=rss-14fc9dc2b08a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*M6PuGoq4Jk28i0SCkO-j7A.jpeg</url>
            <title>Stories by Sparsh Kulshrestha on Medium</title>
            <link>https://medium.com/@0xsparsh?source=rss-14fc9dc2b08a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:48:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@0xsparsh/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[Payments Gone Wrong !!]]></title>
            <link>https://0xsparsh.medium.com/payments-gone-wrong-7921c21b1ef9?source=rss-14fc9dc2b08a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7921c21b1ef9</guid>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Sparsh Kulshrestha]]></dc:creator>
            <pubDate>Sat, 19 Jun 2021 10:02:18 GMT</pubDate>
            <atom:updated>2021-06-19T10:02:18.934Z</atom:updated>
            <content:encoded><![CDATA[<h3>Payments Gone Wrong !!</h3><p>In the online payment process, merchants (seller) receive payments via the Internet or in situations when a payment is not physically presented to the merchant by the customer (buyer) at the time of the transaction. As an online merchant, you need to provide the highest level of payment security to assure your customers that their data are safe.</p><p>During the recent bug bounty engagement, I came across multiple payment integration bugs on different applications. Here, I will share few cases in which I was able to manipulate payments in one way or other. These are simple yet critical bugs that can cause serious financial damage to organizations.</p><h3>Manipulating Final Amount via Parameter Tampering</h3><p>The first application I was testing is a business analytics service company. It allows users to make payments either monthly or yearly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rz1DBJ9xkXgVzsckfpa0HQ.png" /></figure><p>In the request above, billingCycle parameter caught my attention as its value was 12 for yearly payments and 1 for monthly payments. From these two requests, it was clear that the application is using the value of this parameter to calculate the final bill amount.</p><p>Final Amount = (billingCycle * Base Amount) + taxes</p><p>I changed the value of billingCycle parameter to 0 and the final amount was $0.00 :D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W05i8LU4Qzz7BPJsT-BDWw.png" /></figure><h3>Buy Unlimited Credits via Payment Verification</h3><p>This application allows users to buy credits that can be used later for services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XbEYomf3iGp8POHfSPreOw.png" /><figcaption>Payment Flow</figcaption></figure><p>In order to verify payment, the application checks if the request is legit or not. If the request is legit then it adds credits to the user’s account. So I sent that verification request to the repeater and each time I repeat the request, more credits will be added to my account again and again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Duo4VkPzy2zVHsEZBdtbyA.png" /><figcaption>Payment Verification Request</figcaption></figure><h3>Order Food for Free</h3><p>This application is a food ordering app of a popular restaurant. While ordering food, we (me and <a href="https://medium.com/u/41152cde4d4d">Abhishek Jaiswal🕵️</a>)decided to check if we can order for free. With that objective in mind, we decided to play with the payment flow of this application and soon enough we found a way to manipulate multiple components of payments such as discount, item price, etc.</p><p>When you add an item to your cart, the app will create a temporary cart for you. The endpoint “/api/v1/create_cart” that does this was protected against parameter tampering attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7OFGfznR1_TH7ehpGFM3dA.png" /><figcaption>create_cart request</figcaption></figure><p>But when you modify the cart i.e increase or decrease the number of items, the app will send a request to “/api/v1/modify_cart” endpoint with similar parameters and here you can actually modify any parameter. You can either change the price of items or add the discount amount of as much as you want. It will be substracted from the total bill amount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C969JlvhD0a-Ld7vuqjHdg.png" /></figure><h3>How to prevent parameter tampering?</h3><ul><li>Server-side validation compared with all inputs.</li><li>Make sure sensitive signatures can not be re-used.</li><li>Use something less obvious that is harder to tamper as a reference. Eg., a random string instead of an incrementing integer.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7921c21b1ef9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quickstart Shodan: What is it and how does it work]]></title>
            <link>https://0xsparsh.medium.com/quickstart-shodan-what-is-it-and-how-does-it-work-7e1cd689fb5f?source=rss-14fc9dc2b08a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e1cd689fb5f</guid>
            <dc:creator><![CDATA[Sparsh Kulshrestha]]></dc:creator>
            <pubDate>Sat, 29 May 2021 11:54:46 GMT</pubDate>
            <atom:updated>2021-05-29T11:54:46.787Z</atom:updated>
            <content:encoded><![CDATA[<p>Rated the best search engine for hackers, Shodan was referred to as <a href="https://money.cnn.com/2013/04/08/technology/security/shodan/?iid=EL">the scariest search engine on the internet</a>, back in 2013. While Shodan is similar to Google, in that they are both search engines that use crawlers, it crawls the entire internet to map and index internet-connected IoT devices. To put this into perspective, Google’s crawlers only index a part of the internet that is publicly accessible, the World Wide Web. And although Shodan is infamous for being instrumental in blackhat hacking, in the right hands, this search engine is effective in the process of vulnerability assessment and pen-testing IoT devices.</p><p>In this article, we delve into Shodan and its work and discuss the features that make this search engine useful for pen-testers and bug bounty hunters.</p><h3>What is Shodan?</h3><p>As mentioned earlier, Shodan (Sentient Hyper-Optimized Data Access Network) is a search engine for devices connected to the internet. Designed and developed by Web Developer John Matherly, this search engine crawls the entire internet, parses the service banners of IoT devices, and indexes them for future searches. It maps and reports any device, such as webcams, smart devices, medical devices, traffic lights, C2 systems of devices, etc., that is connected to the internet and is not secure.</p><p>The service banners of IoT devices contain metadata relevant to the devices, such as:</p><ul><li>Geo-location</li><li>Make and model</li><li>IP address</li><li>Default username and password</li><li>Software version</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/0*6mtpiA517SoUI0Ny.png" /></figure><h3>How does Shodan work?</h3><p>Upon scanning the entire internet, the search engine sends queries to connected IoT devices for publicly available information related to them. The servers of such devices return their service banners to the user. Shodan also supports customized queries using filters like city, country, hostname, OS, etc. to find out the corresponding details.</p><h3>The Basics</h3><p>Similar to other search engines, Shodan also utilizes a search box, to which users can enter search terms that adhere to its search query syntax. Moreover, search results can be narrowed down to be as accurate as possible, by making use of quotation marks and other such operators.</p><p>For instance, boolean operators + or — can be used to include or exclude terms in the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p0_nVEkZLWakQIp4.png" /></figure><h3>Shodan Filters</h3><p>This search engine only searches for the data property on the IoT devices’ banners. Hence, it employs search filters for refined results. Here are some <a href="https://beta.shodan.io/search/filters">basic search filters</a> you can use:</p><ul><li><strong>city</strong>: find devices in a particular city</li><li><strong>country</strong>: find devices in a particular country</li><li><strong>geo</strong>: you can pass it coordinates</li><li><strong>hostname</strong>: find values that match the hostname</li><li><strong>net</strong>: search based on an IP or /x CIDR</li><li><strong>os</strong>: search based on the operating system</li><li><strong>port</strong>: find particular ports that are open</li><li><strong>before/after</strong>: find results within a timeframe</li></ul><p><strong>Search examples:</strong></p><p>org:”Amazon” ssl:”target”</p><p>ssl:”target”</p><p>html:”Dashboard Jenkins”</p><p>http.component:”jenkins”</p><p>http.title:”302 Found”</p><p>http.component:”java”</p><p>ssl.cert.subject.cn:”target”</p><p>hostname:”target”</p><p>http.favicon.hash:-335242539</p><p>html:”© 2020 target”</p><p>product:elastic port:9200</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ynf95ALnc5DWoh2E.png" /></figure><h3>Continuous Monitoring</h3><p>This IoT search engine can be used to monitor your networks or products continuously, to help you stay informed of any threats to them. For this, you can make use of the Shodan Command-line Interface (CLI).</p><ul><li>Use the following command to set up an alert for notifications related to your IP range:</li></ul><p><strong>shodan alert create “Bug-Bounty-Target” 198.172.0.0/24</strong></p><ul><li>The following command allows you to create a trigger to send the alert:</li></ul><p><strong>shodan alert triggers</strong></p><ul><li>When Shodan detects malware or a new CVE against your product, get a notification using this:</li></ul><p><strong>shodan alert enable {ALERTID} malware</strong></p><h3>Automation</h3><p>Every new trick boils down to automation these days. Fortunately, with this search engine, you can automate various tasks that are within its range of activities. There are three main ways to automate this search engine:</p><ul><li><strong>Shodan-API</strong></li><li><strong>Shodan Python Module</strong></li><li><strong>Shodan CLI</strong></li></ul><p>Check out this handy tool that makes the entire process easier and hassle-free: <a href="https://github.com/m4ll0k/Shodanfy.py"><strong>m4ll0k/Shodanfy.py</strong></a></p><h3>Conclusion</h3><p>Although it seems quite perverse, security professionals, researchers, and even government agencies trust Shodan to alert them on unmanaged IoT devices that may present vulnerabilities. Such devices could potentially expose critical data belonging to an enterprise, organization or individual, to attacks. This search engine helps prevent this. By following the methods prescribed above, you can also explore Shodan and monitor and protect your network or product from exploitation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e1cd689fb5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IDOR to Account Takeover]]></title>
            <link>https://0xsparsh.medium.com/idor-to-account-takeover-ebdab0f62017?source=rss-14fc9dc2b08a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebdab0f62017</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Sparsh Kulshrestha]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 11:57:25 GMT</pubDate>
            <atom:updated>2020-03-23T11:57:25.465Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys,</p><p>Today, I’ll share one of my recent finding on a web application.</p><p>The web app I was testing is a Ad Portal where you can register yourself and your company and create Ads using templates. While testing change profile functionality, I noticed that it is not using any CSRF token, so I quickly tested it for CSRF but failed.</p><p>Upon closer review I noticed that the request to change account details is using 2 parameters to identify user. These are: usr_id and cmp_id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*eB7WgGJauiK0NcMlK9X-jQ.png" /><figcaption>post req to /user/profile</figcaption></figure><p>Both usr_id and cmp_id are of type int.</p><p>Now, let us first talk about cmp_id. I found out two ways to get this work. Either you can register your company as that of victim or you can just completely remove this parameter from request 😝 Also, it can be brute forced as well.</p><p>Now, for usr_id I used brute force technique since it is just of 3 digits and very easy to brute force.</p><p>I changed user email address by exploiting this vulnerability and later did full account takeover using forget password functionality.</p><h3>Bonus :</h3><p>I’ve also put a small bug here which I found in this same application which is verification bypass.</p><p>When you create account in this application, it takes few hours to get your account verified before you can login. Upon successful verification, you’ll recieve a link in your mail which looked like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0o2wmBEVeqX8KshNbtScBg.png" /></figure><p>Just by looking at this screenshot, you might have guessed what is wrong here. I activated my other account just by increasing id value one by one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*Z5Xgc-dWaRpf_5iHpwukTQ.png" /></figure><p>Thanks for reading, Happy Hunting :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebdab0f62017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSCP : TRY HARDER]]></title>
            <link>https://0xsparsh.medium.com/oscp-try-harder-79b71e0baf99?source=rss-14fc9dc2b08a------2</link>
            <guid isPermaLink="false">https://medium.com/p/79b71e0baf99</guid>
            <dc:creator><![CDATA[Sparsh Kulshrestha]]></dc:creator>
            <pubDate>Mon, 09 Mar 2020 18:35:50 GMT</pubDate>
            <atom:updated>2020-03-12T09:49:42.044Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently became OSCP and wanted to share my thoughts and experience. During my preparation, I’ve read tons of OSCP reviews and they helped me a lot in understanding where I stand and what should I expect from OSCP. So, I’ll share my version of OSCP review here, hoping to make your path easier.</p><h3>INTRODUCTION:</h3><p>Penetration Testing with Kali Linux (PWK) is the most popular course offered by Offensive Security which when completed and passing the exam, gives you the OSCP certificate. It has a very high regard in the information security industry. An OSCP, by definition, is able to identify existing vulnerabilities and execute organized attacks in a controlled and focused manner, write simple Bash or Python scripts, modify existing exploit code to their advantage, perform network pivoting and data ex-filtration, and compromise poorly written PHP web applications.</p><h3><strong>MY BACKGROUND:</strong></h3><p>I’m a random college kid studying computer science who enjoys hacking and networking. I started learning about information security 2 years back. Overall, I’d say I have relatively solid background experience for the OSCP but upon reviewing the course syllabus there were some topics completely new to me so I decided to prepare until I feel comfortable.</p><h3>PREPARATION:</h3><p>I started my OSCP preparation in April 2019, booked 60 days of lab in August 2019 and took my first exam attempt in September 2019. Keeping it short and simple, below is the timeline of my OSCP preparation:</p><p><strong>April</strong> : From the syllabus I breakdown each section and start reading more and more articles for each section and bookmarked them for future reference. I also practiced on Hackthebox, VulnHub and PentesterAcademy. I also did penetration testing course by TheCyberMentor.</p><p><strong>May :</strong> Did nothing, wasted whole month due to university exams. BAD DECISION.</p><p><strong>June : </strong>When I came back home after exams in mid june, I lost track of where I was before but I’ve all the resources bookmarked as well as saved locally so it took me one week to revise them and then again I started doing VulnHub and HTB. I also did a cybrary course on python for security researchers, even though I was already familiar with python but it’s free and recommended by thecybermentor so why not :p</p><p><strong>July</strong> : This was the most productive month, I bought HTB VIP and solved around 35 retired boxes and watched ippsec videos and read 0xdf write-ups. I highly recommend watching ippsec videos, I watched them more than once. He helped me in building a solid methodology like how to approach your target, what ports are important, how to use available information for exploitation and enumeration and much more. He helped me a lot in boosting up my learning process.</p><p><strong>August : </strong>On 8 August 2019, I signed up for 2 months lab. Once you have registered yourself, it takes about 10 days for your course work to start. In these 10 days I practiced buffer overflow on vulnserver and brainpan.</p><p>I’ve created a list of all the resources and cheat-sheets I found helpful during preparation and labs. You can find it here:</p><p><a href="https://github.com/sparshkulshrestha/OSCP-TRY-HARDER-/">sparshkulshrestha/OSCP-TRY-HARDER-</a></p><h3><strong>LABS:</strong></h3><p>Here comes the best part of OSCP and what makes OSCP much much better than other certifications. The labs are nicely designed to simulate a real corporate network where you have different departments and several machines across multiple networks behind a firewall and you have to compromise them. I spend 12–15 hours per day in labs and pwned ~40 machines including the tough ones in first 28 days. I used metasploit in few machines but re-rooted them manually later before exam.</p><p><strong>Problems I faced in labs :</strong></p><p>The main issue I faced in labs is windows. Make sure you’re comfortable with windows command line before getting enrolled. Also, most of the windows machines in OSCP labs doesn’t require privilege escalation but that’s not the case in exam. I practiced windows privilege escalation on HTB.</p><p>I scheduled my first exam attempt on 24 September. My plan was that if I fail, I will analyze my attempt and figure out my weak points and try to work on them before second attempt. I obviously didn’t want to fail.</p><h3>THE EXAM :</h3><p>NOTE: This part of this blog has been edited because it’s leaking too much info about exam. So don’t blame me if it doesn’t make sense to you.</p><p>The exam structure is a 24-hour exam with 5 victim hosts and then a second 24-hour period for you to compose and turn in your report. You will be allocated 6 machines, 5 Exam Machines and 1 Windows Test VM just like in the Labs — this VM will be your debugger for exploit writing. In order to pass you need to score 70/100 points, each machine having a different amount of points depending on it’sobjective.</p><p>My exam was scheduled to begin at 2:30 PM. I woke up around 11:30 AM with no intention of sleeping again until I have enough points to pass.</p><p>The first and most important step is to run enumeration for all machines in the background. I wrote a super simple python script to automate different nmap scans. 35 minutes after my initial start time, I finished my buffer overflow machine but for some reason my exploit worked on debugger machine but not on the actual machine. I reverted the box and it worked. Next one was a 10 points machine, After enumerating it properly I found something fishy and drill down that path to get root(or system). By 4:00 PM I had 35 points under my belt. After 1 hour, I got low privilege user shell on 20 points machine. I enumerated and found something, and got root by exploiting it. I then decided to took a 15 min break to clear my mind.</p><p>After break, I decided to approach the second 20 points machine. I got user on this box after 1 hour. User shell on that box was very tricky. I chained multiple vulnerabilities to get user shell. By 6:00 PM I had 65 points and just need 5 more points to pass. I enumerated the system, found something vulnerable, exploited it and got root(or system) within 45 minutes bringing me up to 75 points. At this point, I decided to take a 1 hour break before approaching final machine.</p><p>After 1 hour, I got back on my system and reviewed recon data of final machine. I got remote code execution on this box after modifying my exploit several times and got reverse shell few minutes later bringing me to 87.5 points. I enumerated the system internally for privilege escalation but could not find any misconfiguration. At this point, I make sure that I have all the screenshots for report and decided to terminate my VPN connection.</p><p>I would say that exam machines are similar to lab machines but with latest vulnerabilities and patched operating systems. All of my exam machines except the buffer overflow one was filled with rabbit holes.</p><p>I submitted my not so miserable report of 40 pages at 10:00 PM on 25 September and received confirmation email from Offensive Security that I passed few weeks later.</p><h3>Some Random Tips:</h3><ol><li>Preparation is important. When I first started preparing for it I thought maybe I can do it in 90 days, later booked lab time of 60 days and did it in 30 days.</li><li>Make sure you have enough time to dedicate in labs. At least 8 hours each day. The more time you put in, the more you’ll learn from this course.</li><li>Do proper post exploitation on lab boxes. They contain information which is required later in labs.</li><li>Practice buffer overflow more than 10 times.</li><li>Try harder and never give up.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79b71e0baf99" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>