<?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 ghostvirus on Medium]]></title>
        <description><![CDATA[Stories by ghostvirus on Medium]]></description>
        <link>https://medium.com/@ghostvirus62?source=rss-35013220192d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3AEX8wW0BOQZNKiZq8c0OA.jpeg</url>
            <title>Stories by ghostvirus on Medium</title>
            <link>https://medium.com/@ghostvirus62?source=rss-35013220192d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:49:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ghostvirus62/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[DLLHijacking Explained to a 10yr 0ld]]></title>
            <link>https://medium.com/@ghostvirus62/dllhijacking-explained-to-a-10yr-0ld-b66f49fe1c57?source=rss-35013220192d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b66f49fe1c57</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dll-hijacking]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <dc:creator><![CDATA[ghostvirus]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 11:18:39 GMT</pubDate>
            <atom:updated>2026-03-10T11:18:39.541Z</atom:updated>
            <content:encoded><![CDATA[<p>To really understand DLL hijacking, you need to understand how Windows actually loads a DLL internally. The key component is the Windows loader, mainly the function:<br>LdrLoadDll<br>inside ntdll.dll. Almost every DLL load eventually goes through this function.<br>I&#39;ll explain the real loading process step-by-step, because this explains why hijacking works and where the weaknesses are.</p><h3>What Happens When a Program Loads a DLL</h3><p><strong>When a program calls something like:<br></strong>LoadLibrary(&quot;helper.dll&quot;)<br><strong>the following happens internally:<br></strong>LoadLibrary -&gt; LoadLibraryEx -&gt; LdrLoadDll<br>The real loader logic lives in LdrLoadDll.<br><strong>This function:</strong></p><ol><li>resolves the DLL name</li><li>searches for the file</li><li>maps it into memory</li><li>resolves dependencies</li><li>runs initialization code</li></ol><h3>First Step: KnownDLL Check</h3><p>Before searching the filesystem, Windows checks KnownDLLs.<br><strong>Registry location:<br></strong>HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs<br><strong>Example entries:<br></strong>kernel32.dll, user32.dll, advapi32.dll<br>These DLLs are protected.<br><strong>If the loader sees:<br></strong>LoadLibrary(&quot;kernel32.dll&quot;)<br>it loads the copy already mapped in memory instead of searching disk.<br>This prevents hijacking system-critical DLLs.</p><h3>API Set Resolution</h3><p>Modern Windows uses API Set DLLs.<br><strong>Example:<br></strong>api-ms-win-core-file-l1-1-0.dll<br>These are virtual DLL names.<br>The loader maps them internally to real DLLs like:<br>kernelbase.dll<br>This mapping happens before filesystem search.<br>Tools that don&#39;t understand API sets can misinterpret dependencies.</p><h3>Manifest &amp; Side-by-Side (WinSxS)</h3><p>Next, the loader checks the application manifest.<br><strong>Example:<br></strong>app.exe.manifest<br><strong>This may specify:<br></strong>Microsoft.VC90.CRT<br><strong>Windows then loads DLLs from:<br></strong>C:\Windows\WinSxS\<br>instead of normal search paths.<br>This is called Side-by-Side assemblies.</p><h3>The DLL Search Order</h3><p>If the DLL was not resolved earlier, Windows begins the search order.<br><strong>Modern Windows default search order:<br></strong>App Dir -&gt; System32 -&gt; System -&gt; Windows -&gt; CWD -&gt; PATH<br><strong>Example:<br></strong>C:\Program Files\App\app.exe<br>If helper.dll exists in the same folder, it will load from there.<br>This is the most common DLL sideloading technique.</p><h3>Safe DLL Search Mode</h3><p>Windows introduced SafeDllSearchMode to reduce hijacking.<br><strong>Registry:<br></strong>HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode<br><strong>If enabled (default), the search order becomes:<br></strong>App Dir -&gt; System32 -&gt; System -&gt; Windows -&gt; CWD -&gt; PATH<br>Without SafeDllSearchMode, the working directory was earlier in the order.</p><h3>Special Loading Flags</h3><p>Programs can modify search behavior with LoadLibraryEx flags.<br><strong>Examples:<br></strong>LOAD_LIBRARY_SEARCH_SYSTEM32<br><strong>Only loads from:<br></strong>C:\Windows\System32\<br>This prevents hijacking.</p><p>LOAD_LIBRARY_SEARCH_APPLICATION_DIR<br>Restricts search to the app folder.</p><p>LOAD_WITH_ALTERED_SEARCH_PATH<br>Changes the base directory used during dependency resolution.</p><h3>Mapping the DLL into Memory</h3><p>Once the file is found, the loader:</p><ol><li>opens the file</li><li>maps it into memory</li><li>parses the PE headers</li><li>loads dependent DLLs<br>Example dependency chain:<br>app.exe -&gt; helper.dll -&gt; core.dll -&gt; ntdll.dll<br>Each dependency goes through the same search process.<br>This is where many hijacks occur.</li></ol><h3>Running Initialization Code</h3><p>Once the DLL loads, <strong>Windows calls:</strong><br>DllMain<br><strong>with:<br></strong>DLL_PROCESS_ATTACH<br><strong>Example:<br></strong>BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)<br>Malware often executes its payload here.</p><h3>Why DLL Hijacking Works</h3><p>The weakness exists because <strong>programs often do:</strong><br>LoadLibrary(&quot;helper.dll&quot;)<br><strong>instead of:<br></strong>LoadLibrary(&quot;C:\SecureApp\helper.dll&quot;)<br>The loader then searches multiple directories.<br>If an attacker can write to one of them, they can place:<br>malicious helper.dll<br>and gain code execution.</p><h3>Example Real-World Attack</h3><p><strong>Example vulnerable structure:<br></strong>C:\ProgramData\VulnApp\ (Writable by Users)<br><strong>App loads:<br></strong>missing.dll<br><strong>If attacker places:<br></strong>C:\ProgramData\VulnApp\missing.dll<br>Windows loads the malicious DLL.<br>This is DLL sideloading.</p><h3>Why Tools Like DLLHijackHunter Exist</h3><p>Manual detection of these issues is extremely hard.<br><strong>Tools attempt to:<br></strong>Scan directories -&gt; Check ACLs -&gt; Simulate load -&gt; Verify execution<br>The verification step is the most reliable way to confirm exploitation.</p><h3>The Most Interesting Part of the Windows Loader</h3><p><strong>The core logic actually lives in these functions:<br></strong>LdrpResolveDllName, LdrpLoadDll<br>inside ntdll.dll.<br><strong>Advanced malware sometimes hooks these functions to:<br></strong>hide loaded DLLs or redirect execution.</p><p><strong>Key takeaway<br>DLL hijacking works because Windows:<br></strong>prioritizes flexibility over strict pathing.<br>Understanding the loader helps security researchers detect privilege escalation and persistence techniques.</p><h3>Automating the Hunt with DLLHijackHunter</h3><p>Finding these search order flaws manually by digging through thousands of Process Monitor NAME NOT FOUND events is exhausting. Furthermore, static analysis tools often fail to account for the OS mitigations mentioned above (like API sets, Manifests, and LoadLibraryEx flags), resulting in hundreds of false positives.</p><p><a href="https://github.com/GhostVectorAcademy/DLLHijackHunter"><strong>DLLHijackHunter</strong></a> exists to solve this exact problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqay3ILJu2ZGqUc5L9VUJg.png" /></figure><p><strong>DLLHijackHunter</strong> is an automated detection framework that does the heavy lifting for you:</p><ol><li><strong>Intelligent Discovery:</strong> It uses ETW runtime tracing and static PE analysis to find applications that load DLLs from user-writable paths.</li><li><strong>The “Canary” Engine</strong> (Zero False Positives): Instead of just guessing, it automatically compiles a harmless proxy DLL, drops it into the vulnerable path, triggers the application, and verifies if it achieved SYSTEM or High Integrity execution. If it says [CONFIRMED], you have a guaranteed exploit.</li><li><strong>Advanced Hunting: </strong>It natively detects .local bypasses, Phantom DLLs, and even hunts for silent UAC Bypasses via COM AutoElevation.</li></ol><p>If you want to stop chasing false positives and start finding real persistence and privilege escalation vectors, <strong>grab the open-source release here:</strong></p><p><strong>📥 </strong><a href="https://github.com/GhostVectorAcademy/DLLHijackHunter"><strong>Download DLLHijackHunter on GitHub</strong></a></p><p><strong>Thank you!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b66f49fe1c57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Got a P3 in NASA]]></title>
            <link>https://medium.com/@ghostvirus62/how-i-got-a-p3-in-nasa-5d98f07d888f?source=rss-35013220192d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d98f07d888f</guid>
            <category><![CDATA[nasa-vdp]]></category>
            <category><![CDATA[nasa]]></category>
            <category><![CDATA[bugbounty-writeup]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[ghostvirus]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 16:15:45 GMT</pubDate>
            <atom:updated>2025-08-08T09:03:17.409Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello researchers, In this article I’ll share my journey of getting LOR from NASA. I’ll keep this article as beginner friendly as I can. Let’s begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/0*j6d8qW5PRA-2vKKR.gif" /><figcaption>batman begins</figcaption></figure><p>At first, same like every researcher out there I did some common subdomain enumeration, for NASA I used subfinder, BBOT, assetfinder and findomain. after that I ran dnsx for resolved domains and httpx for the URLs. I usually don’t run nuclei on URLs right after httpx but I manually test them one by one and only run nuclei on the target which I find interesting. I tested them one by one, got some surface level knowledge of how NASA is handeling things on web. After a bit research on couple of subdomains I found Self-XSS and DNS SSRF, all marked as Informational P5.</p><p>After weeks, I still did not had a valid finding just a bunch of P5s and NAs or Out-of-Scope (which was valid but not for NASA). The findings till yet was helpful but it was really stressing me out. I took a few days break to start with a fresh mind again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*PXI2uAVnHD-PlMPs.gif" /><figcaption>batlight shines</figcaption></figure><p>I started again after few days. I chose a domain <em>redacted.nasa.gov.</em> I saw that the website has a login functionality, I registered an account, I logged in and edited my profile a bit while capturing it with Burp proxy to inspect those requests later. After that, I went to HTTP History section of Burp and saw all the requests and response of the actions I just did. I saw that the register, login and the editing requests are being sent with GET request which is a solid red flag. All the data is being trasmitted using parameters to that GET request.</p><blockquote>For example,</blockquote><blockquote>GET /login?username=test?password=test</blockquote><p>Usually when I find something like this I test for CSRF, I captured a request of Email change through the edit profile section and created a CSRF POC through Burp. I copied the URL through burp and ran it on a new browser window with changed email.</p><blockquote>To the people who don’t know how this works, heres the flow:</blockquote><blockquote>&gt; I Captured the Email change request</blockquote><blockquote>for example,</blockquote><blockquote>GET /editprofile?email=test@test.com?confirm_email=test@test.com</blockquote><blockquote>Host: redacted.nasa.gov</blockquote><blockquote>&gt; In Burp pro, there is a feature to create a POC for CSRF, basically it will give you the HTML code for the exploitation that you can execute in your browser.</blockquote><blockquote>for example,</blockquote><blockquote>&lt;html&gt;<br> &lt;body&gt;<br> &lt;img src=”<a href="https://redacted.nasa.gov/editprofile?email=test@test.com&amp;confirm_email=test@test.com">https://redacted.nasa.gov/editprofile?email=hacked@hacked.com&amp;confirm_email=hacked@hacked.com</a>&quot; /&gt;<br> &lt;/body&gt;<br>&lt;/html&gt;</blockquote><blockquote>&gt; When you run that HTML page with changed Email in a new browser window, the Email gets changed to hacked@hacked.com, confirming CSRF vulnerability.</blockquote><p>After running it into the new window, I checked my Email on the profile page and BOOM the Email changes. I couldn’t believe I found CSRF in NASA! But unfortunately this bug was a duplicate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*qIyMgH_ugde45lmAqe2YrA.png" /><figcaption>from Bugcrowd</figcaption></figure><p>Now this one hurt real bad. I got demotivated and gave up on NASA. At this point there was no point of me going back, like I did find a valid vulnerability but there is no proof that I did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*GPVl6NOfKfPSmfN9.gif" /><figcaption>its just the rain</figcaption></figure><p>While I was learning the way of recon from the king - <a href="https://x.com/Jhaddix">Jason Haddix</a>, there was one thing he said about the world of bug bounty is that “Do not get attached to a bug”. There will be a lot of times when we feel that the bug deserves more and you didn’t get the deserving reward for it and its totally okay and the best path is to accept the loss and move to the next bug.</p><p>Keeping that in mind, after few weeks I got back at it again with high motivation and a big break. Again one domain at a time, while researching I found that on subdomain <em>redacted2.nasa.gov </em>I can access raw REST API responses. Now this is not vulnerable by default but this kind of things may have hidden endpoints or an exposed endpoints that might reveal sensitive information.</p><blockquote>for example,</blockquote><blockquote>https://<em>redacted2.nasa.gov</em>/rest/api/content/[page] &gt; Raw API Responses</blockquote><p>Now here, there was a page that revealed many users’ API keys, usernames, their real names and many sensitive information. I reported it, It got triaged, assigned P3 and now it is resolved.</p><blockquote>so now when we try to acccess [page] it returns 403.</blockquote><blockquote>https://<em>redacted2.nasa.gov</em>/rest/api/content/[page] &gt; 403 Forbbiden</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDDCv1ptA6urhD76eUN3Lw.png" /><figcaption>the endpoint after fix</figcaption></figure><p>Timeline,</p><blockquote>Submitted: 25 Jun 2025 12:12:01 UTC</blockquote><blockquote>Triaged: 25 Jun 2025 19:51:17 UTC</blockquote><blockquote>Accepted by NASA: 27 Jun 2025 14:58:45 UTC</blockquote><blockquote>Resolved/Fixed: 06 Aug 2025 15:39:29 UTC</blockquote><blockquote>Disclosed: 07 Aug 2025 15:52:50 UTC</blockquote><blockquote>Link: <a href="https://bugcrowd.com/disclosures/73ce2fb6-25c8-40f8-b3fa-e553427d63fb/user-information-disclosure-via-exposed-api-endpoint">https://bugcrowd.com/disclosures/73ce2fb6-25c8-40f8-b3fa-e553427d63fb/user-information-disclosure-via-exposed-api-endpoint</a></blockquote><p>and yes, the LOR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/0*CAgnFXo5tycuOWc8" /><figcaption>The LOR for ghostvirus</figcaption></figure><p>So, yes this is what I did to get that LOR from NASA. It definitely wasn’t easy to get it but a journey that is worth the trouble, I learned a lot through this about web applications, and how we have to change our methodology according to the target.</p><blockquote>You can follow me on,</blockquote><blockquote>github: <a href="https://github.com/ghostvirus62">https://github.com/ghostvirus62</a></blockquote><blockquote>LinkedIn: <a href="https://www.linkedin.com/in/ghostvirus/">https://www.linkedin.com/in/ghostvirus/</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*SsHkzQqf5vCAVwgw.gif" /><figcaption>onto saving more of gotham</figcaption></figure><p>BYE BYE!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d98f07d888f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All About API Hacking]]></title>
            <link>https://medium.com/@ghostvirus62/all-about-api-hacking-15f3d3ae4ada?source=rss-35013220192d------2</link>
            <guid isPermaLink="false">https://medium.com/p/15f3d3ae4ada</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[apihacking]]></category>
            <category><![CDATA[red-teaming]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[ghostvirus]]></dc:creator>
            <pubDate>Mon, 19 May 2025 16:58:33 GMT</pubDate>
            <atom:updated>2025-05-20T07:33:14.873Z</atom:updated>
            <content:encoded><![CDATA[<p>Lets get started on API Hacking.</p><h3><strong>API Recon</strong></h3><p><strong>First step includes<br></strong>Gathering as much as information about the API as possible. Look for API Endpoints where the actual calls to the server is been made.</p><p><strong>For Example,</strong></p><blockquote>/api/users &gt; retrieves a list of users<br>/api/users/jogi &gt; retrieves that particular user</blockquote><p>To find these API Endpoints, APIs are usually documented so that developers know how to use and develop applications with them. If API Documentation is available, always start your recon reviewing it first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VRoR3h16co2-3O16dMAykw.png" /><figcaption>SwaggerUI of Earthdata API (NASA) — API Docs</figcaption></figure><p>You may also be able to use a specialized tool to test the documented endpoints, such as Postman. Postman is a must learn tool for API testing. For me, I use Burpsuite (my man) and Postman both.</p><p><strong><em>Learn Burpsuite and Postman!</em></strong></p><h4>Discovering API Endpoints</h4><p>If API Documentation isn’t publicly available, you can crawl the application, you can do this manually or by using tool for crawling (Burp or Postman, which you have to do anyways). You can also use Katana, waybackurls, gau or any other tool for URL Collection.</p><p>After you find some intial endpoints, you can use Burp’s Intruder for hidden endpoints or use fuff, feroxbuster or any fuzzing tool.</p><p><strong>For example</strong> you find,</p><blockquote>/api/user/update</blockquote><p>you might want to fuzz,</p><blockquote>/api/user/FUZZ</blockquote><p>While doing recon you may find some hidden parameters that API supports. To find Hidden Parameters on the Endpoints to change and see their behavior (Tools: Arjun, ParamSpider&gt;BApp).</p><blockquote><a href="https://target.com/api/user?id=123">/api/user?id=123</a></blockquote><blockquote>id &gt; is the parameter, we want to fuzz that for more (hidden) parameters</blockquote><blockquote><a href="https://target.com/api/user?id=123">/api/user?FUZZ=123</a></blockquote><p>Arjun is the automated fuzzer for hidden parameters so just run,</p><blockquote>$ arjun -u https://xxxxx.com/api/user?id=123</blockquote><p>You should also look out for Javascript files because they contain some API calls aren’t directly triggered from the browser.</p><p>Once you’ve identified the endpoints interact with them to discover attack surface.</p><h4><strong>Interacting with API endpoints</strong></h4><p>You could investigate how the API responds to changing the HTTP method and media type.<br>(I’ll assume you know what each http method does).</p><p>An API endpoint may support multiple HTTP methods so its important to test all the possible methods and review the error messages or responses closely so that you can understand how to construct a valid API request for the attack.</p><p>API endpoints often expects data in a specific format, changing the content-type through the Content-Type Header (and changing the response body accordingly) we can get bypass flawed defenses or maybe the application is secure for only that specific content type.</p><p>Play around with them, pass unexpected values and see how the application responds.</p><p><strong><em>That’s all for the Recon Phase! We’ll move to vulnerabilities now.</em></strong></p><h3>Mass Assignment Vulnerabilities</h3><p>Mass Assignment or Auto-Binding creates hidden parameters.</p><p>What is mass-assignment, It’s when the application framework automatically binds user-supplied input (like request parameters) to object properties (like model fields) without proper filtering or access control. <br>Mass assignment may therefore result in the application supporting parameters that were never intended to be processed by the developer.</p><p><strong>For example,</strong></p><p>consider a POST /api/users/update request, which enables users update information, and includes the following JSON:</p><blockquote>{ <br> “username”: “Jogi”, <br> “email”: “<a href="/service/mailto:jogi@example.com">jogi@xxxxx.com</a>”, <br>}</blockquote><p>A GET request to /api/user/1 returns this response:</p><blockquote>{<br> “id”: 1, <br> “name”: “Jogi”, <br> “email”: “<a href="/service/mailto:jogi@example.com">jogi@xxxxx.com</a>”, <br> “is_admin”: “false” <br>}</blockquote><p>This may indicate that the hidden ‘id’ and ‘is_admin’ parameters are bound to the internal user object.</p><p>To verify if the enumerated ‘is_admin’ parameter can be manipulated, include it in the POST request. Then, attempt to exploit the potential vulnerability by setting the ‘is_admin’ parameter to ‘true’ and sending the request.</p><blockquote>{ <br> “username”: “Jogi”, <br> “email”: “<a href="/service/mailto:jogi@example.com">jogi@xxxxx.com</a>”, <br> “is_admin”: true, <br>}</blockquote><p>If the ‘is_admin’ value in the request is assigned to the user object without proper validation or sanitization, the user ‘Jogi’ could be mistakenly granted administrative privileges.</p><h3>Server-Side Parameter Pollution</h3><p>Some websites use internal APIs that aren’t open to the public. Server-side parameter pollution happens when the website includes user input in a request to one of these internal APIs without properly handling it. This can let an attacker add or change parameters.</p><p>To check for this issue, try adding characters like ‘#’, ‘&amp;’, or ‘=’ in your input and see how the website reacts.</p><p>You can use a URL-encoded ‘#’ character to truncate the server-side request.</p><p><strong>For example,</strong></p><blockquote>GET /profile?user=1001%23//evil.com OR %26role=admin</blockquote><blockquote>(URL Encoded: %23&gt;# and %26&gt;&amp;)</blockquote><p>You can use an URL-encoded ‘&amp;’ character to add a second parameter.</p><p><strong>For example,</strong></p><blockquote>GET /profile?user=1001%26admin=true</blockquote><p>To confirm whether the application is vulnerable to server-side parameter pollution, you could try to override the original parameter. The impact of this depends on how the application processes the second parameter. This varies across different web technologies.</p><p><strong>For example:</strong></p><blockquote>GET /profile?user=1001%26user=2121</blockquote><ul><li>PHP parses the last parameter only. This would result in a user search for second parameter.</li><li>ASP.NET combines both parameters. This would result in a user search for both parameters, which might result in an ‘Invalid username’ error message.</li><li>Node.js / express parses the first parameter only. This would result in a user search for first parameter, giving an unchanged result.</li></ul><p>If you’re able to override the original parameter, you may be able to conduct an exploit. <strong>For example,</strong> you could add ‘name=admin’ to the request. This may enable you to log in as the administrator user.</p><h4><strong>In REST APIs</strong></h4><p>A RESTful API may place parameter names and values in the URL path, rather than the query string.</p><p>Consider an application that enables you to edit user profiles based on their username. Requests are sent to the following endpoint:</p><blockquote>GET /edit_profile.php?name=jogi</blockquote><p>This results in the following server-side request:</p><blockquote>GET /api/private/users/jogi</blockquote><p>An attacker may be able to manipulate server-side URL path parameters to exploit the API. To test for this vulnerability, add path traversal sequences to modify parameters and observe how the application responds.</p><p>You could submit URL-encoded ‘jogi/../admin’ as the value of the ‘name’ parameter:</p><blockquote>GET /edit_profile.php?name=jogi%2f..%2fadmin</blockquote><p>This may result in the following server-side request:</p><blockquote>GET /api/private/users/jogi/../admin</blockquote><h3>Authorization Vulnerabilities</h3><p>Authorization NOT Authentication.</p><p>BOLA (Broken Object Level Authorization): BOLA occurs when an application fails to properly verify that the user is allowed to access or modify a specific object/resource, such as another user’s data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*3cZTeS7hID_1G8JHxk79kw.png" /><figcaption>Broken Object Level Authorization — BOLA</figcaption></figure><p>BFLA (Broken Function Level Authorization): BFLA happens when an application exposes privileged functions (admin-only actions), but doesn’t check if the user has permission to perform them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*vGFgtRyEVuCpo0AUW4AX6w.png" /><figcaption>BFLA — Broken Function Level Authorization</figcaption></figure><p><strong><em>Now these might sound a little bit confusing. So let’s talk through an example.</em></strong></p><p>If we have a web shop and let’s say you go to your account page and it says, ‘/user/ID’. If I change this ID to the ID of another user and I can access their information, this is BOLA (Broken objects level Authorization).</p><p>Within the same web shop, if I can carry out functions such as ordering on another user’s behalf or accessing administrative functionality, this is BFLA (Broken Function Level Authorization).</p><p>So try to think of BOLA as access to objects referenced by their ID, such as a user ID or a GUID or something like this and try to think of BFLA as access to functionality that you shouldn’t have access to.</p><h3>Authentication Vulnerabilities</h3><p>In APIs, there are few different methods of authentication that we need to know about:</p><ol><li>HTTP Basic Authentication: It sends the username and password with each request encoded in Base64, using the Authorization header.</li><li>Bearer Tokens: Client gets a token from an authorization server, then uses it in requests.</li><li>JWT Tokens: A signed token (often using HMAC or RSA) contains claims like user ID and role. Used with Bearer scheme.</li><li>API Keys: The client includes a unique API key in the request header or query string.</li></ol><h4>Attacks on Authentication:</h4><p>Most basic, bruteforcing. Lets move on to next one.</p><h4>Attacking Tokens:</h4><p>Doing Burp Sequencer check on the cookie randomness and crafting a new admin cookie if its not very random.</p><h4>Attacking JWT Tokens:</h4><p>A JWT Token consists of three parts, separated by dots (.):<br>HEADER.PAYLOAD.SIGNATURE</p><p><strong>for example,</strong></p><p>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. <br>eyJ1c2VySWQiOiIxMjM0Iiwicm9sZSI6ImFkbWluIn0. <br>SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</p><p>All these is encoded in base64.</p><blockquote>Tools: <a href="https://jwt.io/">jwt.io</a> &gt; paste your token for better view</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzEijIzXhffPFROz1bbucA.png" /><figcaption>token view in jwt.io</figcaption></figure><p>Header: Describes the token type and the algorithm used to sign it.<br>Payload: Contains the actual data, like the user’s ID and role.<br>Signature: Cryptographic signature that proves the token wasn’t tampered with. JWT can be signed with symmetric or asymmetric encryption.</p><p>The token is passed like this in the request:</p><blockquote>Authorization: Bearer &lt;JWT-Token&gt;</blockquote><p>Now tempering with the token results in error with if don’t know the secret.</p><p>One way to get the secret is to crack it using hashcat or jwt_tool.</p><blockquote>$hashcat -a 0 -m 16500 [token] [wordlist] — show</blockquote><p>using jwt_tool,</p><blockquote>jwt_tool -t [url] -rh [authorisation_header] -M at</blockquote><p>refer: <a href="https://github.com/ticarpi/jwt_tool/wiki">https://github.com/ticarpi/jwt_tool/wiki</a></p><p>Another way includes seaching for the secret in the javascript files discovered in the recon phase. Sometimes the secret is hardcoded in the variables by the developer.</p><p>let’s say you got the secret by following one of these methods, you can craft a token for like admin privileges by modifying the payload section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Z3Hj6bnOo991lVwezJV_g.png" /><figcaption>changing the user id and its role to admin by adding the correct secret</figcaption></figure><h3>Other Vulnerabilities to Consider</h3><p><strong>&gt; SQL Injection</strong>, it occurs when user input is included directly in a SQL query without proper validation or escaping. Attackers can manipulate the input to run malicious SQL commands on the database.</p><p><strong>For example,</strong></p><blockquote><strong>Vulnerable query:<br></strong>SELECT * FROM users WHERE username = ‘admin’ AND password = ‘1234’;</blockquote><blockquote><strong>If an attacker enters:<br></strong>Username: admin’ — <br>Password: anything</blockquote><blockquote><strong>The query becomes:<br></strong>SELECT * FROM users WHERE username = ‘admin’ — ‘ AND password = ‘anything’;</blockquote><blockquote><strong>bypassing the password check.</strong></blockquote><p><strong>&gt; NoSQL Injection</strong> is similar, but it targets NoSQL databases like MongoDB, which often use JSON-based queries. If user input is inserted unsafely into the query, attackers can inject objects to manipulate behavior.</p><p><strong>For example,</strong></p><blockquote><strong>Vulnerable query<br></strong>db.users.find({ “username”: inputUsername, “password”: inputPassword })</blockquote><blockquote><strong>If the attacker sends:</strong><br>{<br> “username”: { “$ne”: null },<br> “password”: { “$ne”: null }<br>}<br><strong>It becomes:</strong><br>db.users.find({ “username”: { “$ne”: null }, “password”: { “$ne”: null } })</blockquote><blockquote><strong>This will return all users, bypassing login authentication.</strong></blockquote><p><strong>&gt; Sensitive Data Exposure</strong> happens when a web application inadvertently reveals personal, financial, or security-related information, either in transit, in storage, or through poor handling. This can occur without any hacking, just because data isn’t properly protected.</p><p><strong>For example,</strong></p><blockquote><strong>Exposed password in plain text:</strong></blockquote><blockquote>GET /api/user/1</blockquote><blockquote>{<br> “id”: 1,<br> “name”: “jogi”,<br> “email”: “jogi@xxxxx.com”,<br> “password”: “ilikemen”<br>}</blockquote><p><strong>&gt; SSRF (Server-Side Request Forgery)</strong> allows an attacker to make the server send HTTP requests on behalf of the attacker, usually to internal or private systems that the attacker cannot access directly.</p><p><strong>For example,</strong></p><blockquote>GET /fetch?url=<a href="http://example.com/">http://xxxxx.com</a></blockquote><p>The attacker can send,</p><blockquote>/fetch?url=<a href="http://localhost:8080/admin">http://localhost:8080/admin</a></blockquote><p>The server makes a request to localhost/admin (on its own system), potentially revealing internal content.</p><h3>The End</h3><p>I hope you learned something from this. I use these for my personal notes and decided to share them with everyone.</p><p>I tried to cover as much as I could. I did not cover much practical stuff, you can perform hands-on on these platforms:</p><p><a href="https://github.com/OWASP/crAPI">https://github.com/OWASP/crAPI</a> (Recommended)</p><p><a href="https://portswigger.net/web-security">https://portswigger.net/web-security</a> (Recommended)</p><p><a href="https://owasp.org/www-project-juice-shop/">OWASP Juice Shop | OWASP Foundation</a></p><p>Look for labs on Tryhackme or HackTheBox for the API Hacking.</p><p>Thank You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15f3d3ae4ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>