<?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 Shadow on Medium]]></title>
        <description><![CDATA[Stories by Shadow on Medium]]></description>
        <link>https://medium.com/@xalpha032?source=rss-8d87fb21d94c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rcqfG1DWyun0sZwXcyWddQ.jpeg</url>
            <title>Stories by Shadow on Medium</title>
            <link>https://medium.com/@xalpha032?source=rss-8d87fb21d94c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 21:46:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xalpha032/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[API Security Testing: A Complete Guide to Reconnaissance, Hidden Endpoints, Mass Assignment, and…]]></title>
            <link>https://medium.com/@xalpha032/api-security-testing-a-complete-guide-to-reconnaissance-hidden-endpoints-mass-assignment-and-de89b28b2b3c?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de89b28b2b3c</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 22:59:51 GMT</pubDate>
            <atom:updated>2026-11-01T22:59:51.120Z</atom:updated>
            <content:encoded><![CDATA[<h3>API Security Testing: A Complete Guide to Reconnaissance, Hidden Endpoints, Mass Assignment, and Server-Side Parameter Pollution:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uOV49oj8A_XXxZw8ZmmWLg.png" /></figure><p>APIs are one of the most important components of modern web applications. They connect front-end interfaces with back-end services, handle authentication, process user data, and allow different systems to communicate.</p><p>However, APIs also introduce a significant attack surface. An application may appear secure through its graphical interface while exposing undocumented endpoints, accepting unexpected HTTP methods, trusting hidden parameters, or incorrectly processing user-controlled input.</p><p>For penetration testers, testing the API directly can reveal vulnerabilities that are difficult or impossible to discover through normal browser interaction.</p><p>This article explores API security testing from a penetration testing perspective, covering reconnaissance, endpoint discovery, API documentation, HTTP methods, content types, hidden parameters, mass assignment, Server-Side Parameter Pollution (SSPP), Burp Suite workflows, OWASP API Security, and defensive techniques.</p><h3>1. Understanding APIs</h3><h3>What Is an API?</h3><p>An API (Application Programming Interface) is a mechanism that allows different software components to communicate with each other.</p><p>In a typical web application, the browser does not necessarily communicate directly with the database. Instead, it sends HTTP requests to an API, which processes the request and communicates with the back-end infrastructure.</p><p>A simplified architecture looks like this:</p><pre>+----------------------+<br>|      User Browser    |<br>+----------------------+<br>           |<br>           | HTTP Request<br>           v<br>+----------------------+<br>|    Front-End App     |<br>+----------------------+<br>           |<br>           | API Request<br>           v<br>+----------------------+<br>|      API Server      |<br>+----------------------+<br>           |<br>           | Database Query<br>           v<br>+----------------------+<br>|       Database       |<br>+----------------------+</pre><p>For example, when a user opens their profile, the application might send:</p><pre>GET /api/users/123 HTTP/1.1<br>Host: example.com<br>Authorization: Bearer &lt;TOKEN&gt;</pre><p>The API processes the request and returns information about the requested user.</p><h3>Common API Types</h3><p><strong>REST API</strong></p><p>REST (Representational State Transfer) is an architectural style commonly used with HTTP methods and resource-based URLs.</p><p>Example:</p><pre>GET    /api/users<br>GET    /api/users/123<br>POST   /api/users<br>PATCH  /api/users/123<br>DELETE /api/users/123</pre><p><strong>GraphQL API</strong></p><p>GraphQL allows clients to request specific data through a structured query language.</p><p>Example:</p><pre>query {<br>    user(id: 123) {<br>        username<br>        email<br>    }<br>}</pre><p>Unlike traditional REST APIs, GraphQL commonly uses a single endpoint to handle multiple operations.</p><p><strong>SOAP API</strong></p><p>SOAP (Simple Object Access Protocol) is a messaging protocol that commonly uses XML-based messages and structured service definitions.</p><p>This article primarily focuses on RESTful and JSON-based APIs, while also discussing structured-data injection and internal API communication.</p><h3>2. API Reconnaissance</h3><p>API reconnaissance is the first stage of API penetration testing.</p><p>The objective is to understand how the application communicates with its back-end services and identify as much of the available attack surface as possible.</p><p>Before testing vulnerabilities, a penetration tester should identify:</p><ul><li>API endpoints.</li><li>Supported HTTP methods.</li><li>Required and optional parameters.</li><li>Authentication mechanisms.</li><li>Accepted content types.</li><li>API versions.</li><li>Rate limits.</li><li>Exposed documentation.</li><li>Differences between user roles.</li></ul><h3>2.1 Identifying API Endpoints</h3><p>An endpoint is a specific URL where an API receives requests for a particular resource or operation.</p><p>For example:</p><pre>GET /api/books</pre><p>The endpoint is /api/books.</p><p>Another endpoint might be:</p><pre>GET /api/books/123</pre><p>This could retrieve a specific book.</p><p>During reconnaissance, look for URL patterns such as:</p><pre>/api/<br>/api/v1/<br>/api/v2/<br>/rest/<br>/graphql<br>/users/<br>/admin/<br>/internal/</pre><p>These paths are examples of naming conventions, not guaranteed endpoint locations.</p><h3>2.2 Browse the Application Through Burp Suite</h3><p>One of the most effective ways to discover API endpoints is to browse the application while Burp Suite intercepts the traffic.</p><p>Recommended workflow:</p><ol><li>Open Burp Suite.</li><li>Configure the browser to use Burp Proxy.</li><li>Open the target application.</li><li>Navigate through different features.</li><li>Monitor requests in HTTP history.</li><li>Identify requests containing /api/.</li><li>Send interesting requests to Repeater.</li><li>Record discovered endpoints and parameters.</li></ol><p>Pay particular attention to:</p><ul><li>Login and registration.</li><li>User profiles.</li><li>Account settings.</li><li>Search functionality.</li><li>File uploads.</li><li>Administrative interfaces.</li><li>Password changes.</li><li>Shopping carts and payment workflows.</li></ul><p>A front-end application may communicate with several API endpoints without displaying their URLs directly to the user.</p><h3>2.3 Inspect JavaScript Files</h3><p>JavaScript files can reveal API endpoints that have not been accessed through normal browser navigation.</p><p>For example:</p><pre>fetch(&quot;/api/v1/account/details&quot;);</pre><p>Or:</p><pre>axios.get(&quot;/api/admin/users&quot;);</pre><p>These references may reveal additional functionality.</p><p>Useful approaches include:</p><ul><li>Manually reviewing JavaScript files.</li><li>Using Burp Scanner to crawl the application.</li><li>Using the JS Link Finder Burp extension.</li><li>Searching downloaded JavaScript files for API-related paths.</li></ul><p>Remember that discovering an endpoint does not automatically mean that it is vulnerable or accessible.</p><h3>3. Discovering API Documentation</h3><p>API documentation explains how developers are expected to interact with an API.</p><p>It may contain:</p><ul><li>Available endpoints.</li><li>Supported HTTP methods.</li><li>Required parameters.</li><li>Request formats.</li><li>Response structures.</li><li>Authentication requirements.</li><li>Example requests.</li></ul><p>Documentation can be human-readable or machine-readable.</p><h3>3.1 Human-Readable Documentation</h3><p>Human-readable documentation explains how to use an API through descriptions and examples.</p><p>Common documentation paths include:</p><pre>/api<br>/docs<br>/swagger<br>/swagger-ui<br>/swagger/index.html<br>/api-docs</pre><p>These are common examples worth checking during authorized reconnaissance.</p><h3>3.2 Machine-Readable Documentation</h3><p>Machine-readable documentation allows tools to process API specifications automatically.</p><p>Common formats include:</p><ul><li>OpenAPI.</li><li>Swagger.</li><li>JSON.</li><li>YAML.</li><li>XML.</li></ul><p>Example OpenAPI-style JSON:</p><pre>{<br>  &quot;openapi&quot;: &quot;3.0.0&quot;,<br>  &quot;paths&quot;: {<br>    &quot;/api/users&quot;: {<br>      &quot;get&quot;: {<br>        &quot;summary&quot;: &quot;Retrieve users&quot;<br>      },<br>      &quot;post&quot;: {<br>        &quot;summary&quot;: &quot;Create a user&quot;<br>      }<br>    }<br>  }<br>}</pre><p>This document reveals that /api/users supports GET and POST operations.</p><h3>3.3 Analyzing API Documentation</h3><p>When documentation is discovered, compare its information with the actual application behavior.</p><p>Look for:</p><ul><li>Endpoints missing from the visible interface.</li><li>Old API versions.</li><li>Administrative operations.</li><li>Unexpected HTTP methods.</li><li>Optional parameters.</li><li>Sensitive object properties.</li><li>Differences between documented and implemented behavior.</li></ul><p>Useful tools include:</p><p>ToolPurposeBurp SuiteIntercept and analyze HTTP trafficOpenAPI ParserParse OpenAPI documentationPostmanSend and organize API requestsSoapUITest API servicesBurp RepeaterManually modify requests</p><p>An important point: documentation is not always accurate or up to date. Always verify discovered functionality against the actual API.</p><h3>4. Identifying and Interacting With API Endpoints</h3><p>After discovering endpoints, the next step is to understand how they behave.</p><p>A useful testing approach is to send requests through Burp Repeater and observe the application’s responses.</p><p>Consider:</p><pre>GET /api/tasks HTTP/1.1<br>Host: example.com</pre><p>The API might return:</p><pre>{<br>  &quot;tasks&quot;: [<br>    {<br>      &quot;id&quot;: 1,<br>      &quot;title&quot;: &quot;Complete security assessment&quot;<br>    }<br>  ]<br>}</pre><p>Now investigate whether the endpoint supports other operations.</p><h3>4.1 Understanding HTTP Methods</h3><p>HTTP methods define the intended operation performed on a resource.</p><p>MethodTypical PurposeGETRetrieve informationPOSTCreate a resource or perform an operationPUTReplace a resourcePATCHPartially update a resourceDELETEDelete a resourceOPTIONSDiscover communication options, including supported methods</p><p>For example:</p><pre>GET /api/tasks</pre><p>Retrieves tasks.</p><pre>POST /api/tasks<br>Content-Type: application/json</pre><pre>{<br>  &quot;title&quot;: &quot;New task&quot;<br>}</pre><p>Creates a task.</p><pre>PATCH /api/tasks/1<br>Content-Type: application/json</pre><pre>{<br>  &quot;title&quot;: &quot;Updated task&quot;<br>}</pre><p>Updates part of an existing task.</p><pre>DELETE /api/tasks/1</pre><p>Deletes a task.</p><h3>4.2 Testing Supported HTTP Methods</h3><p>An API endpoint may support multiple methods, even if the front-end only uses one.</p><p>During authorized testing:</p><ol><li>Capture a legitimate request.</li><li>Send it to Burp Repeater.</li><li>Change the HTTP method.</li><li>Observe the response.</li><li>Compare status codes and response bodies.</li><li>Document any unexpected functionality.</li></ol><p>The OPTIONS method may also provide information about supported methods:</p><pre>OPTIONS /api/tasks HTTP/1.1<br>Host: example.com</pre><p>A response might contain:</p><pre>Allow: GET, POST, OPTIONS</pre><p>This is useful reconnaissance information, although the Allow header is not always a complete or reliable representation of the server&#39;s actual behavior.</p><p><strong>Important:</strong> Test state-changing methods only against authorized test resources. Use low-impact objects to avoid unintended modifications or deletions.</p><h3>4.3 Identifying Supported Content Types</h3><p>An API may accept different request formats.</p><p>Common content types include:</p><p><strong>JSON</strong></p><pre>Content-Type: application/json</pre><p>Example:</p><pre>{<br>  &quot;username&quot;: &quot;testuser&quot;,<br>  &quot;email&quot;: &quot;test@example.com&quot;<br>}</pre><p><strong>URL-Encoded Form Data</strong></p><pre>Content-Type: application/x-www-form-urlencoded</pre><p>Example:</p><pre>username=testuser&amp;email=test%40example.com</pre><p><strong>Multipart Form Data</strong></p><pre>Content-Type: multipart/form-data; boundary=----Boundary123</pre><p>Commonly used for forms containing file uploads.</p><p><strong>XML</strong></p><pre>Content-Type: application/xml</pre><p>Example:</p><pre>&lt;user&gt;<br>    &lt;username&gt;testuser&lt;/username&gt;<br>    &lt;email&gt;test@example.com&lt;/email&gt;<br>&lt;/user&gt;</pre><h3>Why Does Content-Type Matter?</h3><p>Different content types can be processed by different parsers and application components.</p><p>This may introduce inconsistent security behavior.</p><p>For example:</p><ul><li>JSON requests may be validated correctly.</li><li>XML requests may follow a different processing path.</li><li>Form data may be handled by another parser.</li><li>Unexpected formats may trigger informative error messages.</li></ul><p>A tester should determine which formats are actually supported and whether validation is consistent across them.</p><p>In Burp Suite, modify the Content-Type header and ensure that the body matches the selected format.</p><p>Burp’s Content Type Converter extension can help convert request bodies between supported formats.</p><h3>5. Discovering Hidden API Endpoints</h3><p>Not every API endpoint is linked from the application’s front-end.</p><p>Some endpoints may exist for administrative operations, internal features, legacy functionality, or mobile applications.</p><p>For example, you might discover:</p><pre>PUT /api/user/update</pre><p>However, other operations could exist under similar naming conventions.</p><p>Potential naming patterns include:</p><pre>/api/user/update<br>/api/user/delete<br>/api/user/create<br>/api/user/export<br>/api/user/search</pre><p>These are illustrative examples.</p><h3>5.1 Using Burp Intruder</h3><p>Burp Intruder can automate endpoint discovery by replacing a selected part of a request with values from a wordlist.</p><p>A basic workflow:</p><ol><li>Capture an existing API request.</li><li>Send it to Intruder.</li><li>Select the endpoint operation as the payload position.</li><li>Load a suitable API endpoint wordlist.</li><li>Start the authorized test.</li><li>Compare response status codes, lengths, and content.</li></ol><p>For example, the request:</p><pre>PUT /api/user/update</pre><p>can be used as a starting point for discovering related operations.</p><h3>5.2 Interpreting Responses</h3><p>Pay attention to differences such as:</p><p>ResponsePossible Meaning200 OKRequest processed successfully201 CreatedResource created204 No ContentSuccessful operation without response body400 Bad RequestInvalid request401 UnauthorizedAuthentication required or invalid403 ForbiddenAccess denied404 Not FoundResource or route not found405 Method Not AllowedHTTP method unsupported</p><p>These responses are clues, not definitive vulnerability indicators.</p><p>A 403 response does not prove that an endpoint is secure, and a 404 response does not always prove that a route does not exist.</p><h3>6. Finding Hidden API Parameters</h3><p>An API may accept parameters that are not documented or displayed in the front-end.</p><p>These parameters may influence application behavior.</p><p>For example:</p><pre>GET /api/users?id=123</pre><p>The application visibly uses only the id parameter.</p><p>However, additional parameters might be supported internally.</p><p>Potential examples include:</p><pre>role<br>isAdmin<br>status<br>debug<br>email<br>access_level</pre><p>These are examples of parameter names, not evidence that a particular application supports them.</p><h3>6.1 Burp Intruder</h3><p>Burp Intruder can help discover undocumented parameters by testing candidate parameter names.</p><p>For example:</p><pre>GET /api/users?id=123&amp;§parameter§=test</pre><p>A wordlist is inserted into the selected position.</p><p>Compare responses to identify parameters that influence application behavior.</p><h3>6.2 Param Miner</h3><p>Param Miner is a Burp Suite extension designed to discover hidden parameters and headers.</p><p>It can automatically guess parameter names using information gathered from the application.</p><p>It is especially useful when manually testing a large number of potential parameters would be inefficient.</p><h3>6.3 Content Discovery</h3><p>Burp’s Content Discovery functionality can help identify resources that are not directly linked from the application’s visible pages.</p><p>This can reveal additional paths and functionality that should be included in the API attack surface assessment.</p><h3>7. Mass Assignment Vulnerabilities</h3><p>Mass Assignment is a vulnerability that occurs when an application automatically binds user-supplied request parameters to internal objects without properly restricting which properties users are allowed to modify.</p><p>It is also known as:</p><ul><li>Auto-binding.</li><li>Automatic parameter binding.</li></ul><h3>7.1 Understanding the Root Cause</h3><p>Consider an application that allows users to update their profiles.</p><p>The front-end sends:</p><pre>PATCH /api/users/123 HTTP/1.1<br>Host: example.com<br>Content-Type: application/json</pre><pre>{<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;<br>}</pre><p>The server processes these properties and updates the corresponding user object.</p><p>Internally, the user object may contain additional properties:</p><pre>{<br>  &quot;id&quot;: 123,<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;,<br>  &quot;isAdmin&quot;: false,<br>  &quot;accountStatus&quot;: &quot;active&quot;<br>}</pre><p>The problem occurs when the application automatically binds every submitted property to the internal object.</p><p>Instead of allowing only username and email, it might also accept properties such as isAdmin.</p><h3>7.2 Identifying Hidden Properties</h3><p>A tester can compare the properties returned by a GET request with the properties accepted by a legitimate update operation.</p><p>For example:</p><p><strong>GET request:</strong></p><pre>GET /api/users/123</pre><p>Response:</p><pre>{<br>  &quot;id&quot;: 123,<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;,<br>  &quot;isAdmin&quot;: false<br>}</pre><p><strong>Normal PATCH request:</strong></p><pre>{<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;<br>}</pre><p>The response reveals that the user object contains an isAdmin property, even though the normal update interface does not expose it.</p><p>This creates a testing hypothesis: perhaps the API accepts properties that the front-end does not allow users to modify.</p><h3>7.3 Testing Mass Assignment</h3><p>In an authorized lab, a tester can compare how the application handles an additional property.</p><p>For example:</p><pre>{<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;,<br>  &quot;isAdmin&quot;: &quot;invalid&quot;<br>}</pre><p>Then compare it with a valid Boolean value:</p><pre>{<br>  &quot;username&quot;: &quot;wiener&quot;,<br>  &quot;email&quot;: &quot;wiener@example.com&quot;,<br>  &quot;isAdmin&quot;: true<br>}</pre><p>Observe:</p><ul><li>Response status.</li><li>Response body.</li><li>Error messages.</li><li>Whether the property changes.</li><li>Whether the change persists.</li><li>Whether the application’s authorization behavior changes.</li></ul><p>A different response to an invalid value can provide evidence that the property is being processed.</p><p>However, response differences alone do not confirm exploitation. The actual server-side state and authorization behavior must be verified.</p><h3>7.4 Security Impact</h3><p>Successful mass assignment can result in:</p><ul><li>Unauthorized privilege changes.</li><li>Account manipulation.</li><li>Modification of protected properties.</li><li>Changes to account status.</li><li>Unauthorized access to administrative functionality.</li></ul><p>The impact depends on which internal properties are exposed and how the application uses them.</p><h3>7.5 Prevention</h3><p>Developers should:</p><ol><li>Use explicit allowlists of properties that users can update.</li><li>Never bind untrusted request data directly to sensitive internal objects.</li><li>Apply server-side authorization to sensitive properties.</li><li>Validate property types and values.</li><li>Separate public user models from internal database models.</li></ol><p>A secure update operation should explicitly select permitted properties instead of accepting arbitrary fields.</p><h3>8. Server-Side Parameter Pollution (SSPP)</h3><p>Server-Side Parameter Pollution occurs when an application inserts user-controlled input into a server-side request without correctly encoding or validating it.</p><p>This is particularly important when an application communicates with internal APIs.</p><h3>8.1 Understanding the Architecture</h3><p>Consider the following architecture:</p><pre>+----------------------+<br>|      User Browser    |<br>+----------------------+<br>           |<br>           | User Request<br>           v<br>+----------------------+<br>|    Public Website    |<br>+----------------------+<br>           |<br>           | Internal API Request<br>           v<br>+----------------------+<br>|     Internal API     |<br>+----------------------+<br>           |<br>           v<br>+----------------------+<br>|       Database       |<br>+----------------------+</pre><p>The user cannot directly access the internal API.</p><p>However, the public website sends requests to that API on the user’s behalf.</p><p>If user input is inserted into those requests without proper encoding, the user may be able to manipulate the resulting request.</p><p>Potential impacts include:</p><ul><li>Overriding existing parameters.</li><li>Changing internal API behavior.</li><li>Accessing unauthorized data.</li><li>Manipulating structured request data.</li></ul><h3>8.2 Testing Query String Pollution</h3><p>Consider a public endpoint:</p><pre>GET /userSearch?name=peter&amp;back=/home</pre><p>The application internally constructs:</p><pre>GET /users/search?name=peter&amp;publicProfile=true</pre><p>The important detail is that the public application is generating a second request.</p><p>If the name parameter is not encoded correctly, special query characters may affect the internal request.</p><h3>8.3 Query String Truncation</h3><p>A URL-encoded # character can potentially cause the remainder of an internal URL to be interpreted as a fragment.</p><p>For example, in an authorized test:</p><pre>GET /userSearch?name=peter%23foo&amp;back=/home</pre><p>The application may construct:</p><pre>GET /users/search?name=peter#foo&amp;publicProfile=true</pre><p>In URL processing, the fragment begins at # and is not normally sent as part of an HTTP request target.</p><p>This could effectively remove the remaining query string from the internal request.</p><p>The result may change how the internal API processes the request.</p><p><strong>Important:</strong> The # must be URL-encoded in the original request so that the browser or HTTP client does not interpret it as a client-side fragment before sending it.</p><h3>8.4 Injecting Additional Parameters</h3><p>An encoded ampersand may introduce another parameter into a poorly constructed internal query string.</p><p>Example:</p><pre>GET /userSearch?name=peter%26foo=xyz&amp;back=/home</pre><p>The internal application might generate:</p><pre>GET /users/search?name=peter&amp;foo=xyz&amp;publicProfile=true</pre><p>If the internal API ignores the unknown parameter, the response may remain unchanged.</p><p>This does not necessarily mean the injection failed. It may simply indicate that the parameter has no effect.</p><h3>8.5 Injecting Valid Parameters</h3><p>If a tester identifies a parameter that the internal API recognizes, it may be possible to influence its behavior.</p><p>For example, suppose the internal API accepts an email parameter.</p><p>A test request could introduce that parameter through user-controlled input:</p><pre>GET /userSearch?name=peter%26email=test&amp;back=/home</pre><p>The resulting internal request could resemble:</p><pre>GET /users/search?name=peter&amp;email=test&amp;publicProfile=true</pre><p>The response should be compared with a normal request to determine whether the additional parameter is being processed.</p><h3>8.6 Overriding Existing Parameters</h3><p>One important SSPP test is determining how an internal API handles duplicate parameters.</p><p>For example:</p><pre>GET /userSearch?name=peter%26name=carlos&amp;back=/home</pre><p>The internal request may become:</p><pre>GET /users/search?name=peter&amp;name=carlos&amp;publicProfile=true</pre><p>Different technologies may process duplicate parameters differently.</p><p>Technology / Parser BehaviorPossible ResultPHPCommonly uses the last scalar valueNode.js / ExpressCommonly uses the first scalar valueASP.NETMay combine repeated values</p><p>Actual behavior depends on the framework, parser configuration, and application code.</p><p>This difference is important because the public application and internal API may interpret duplicate parameters differently.</p><h3>8.7 Testing REST Path Pollution</h3><p>SSPP is not limited to query strings.</p><p>Some APIs place resource identifiers directly inside URL paths.</p><p>For example:</p><pre>/api/users/123</pre><p>The URL can be interpreted as:</p><pre>/api       -&gt; API root<br>/users     -&gt; Resource<br>/123       -&gt; Resource identifier</pre><p>Consider a public request:</p><pre>GET /edit_profile.php?name=peter</pre><p>The application internally generates:</p><pre>GET /api/private/users/peter</pre><p>If the input is not correctly encoded, path manipulation may affect the internal resource path.</p><p>For example:</p><pre>GET /edit_profile.php?name=peter%2f..%2fadmin</pre><p>The internal request may resemble:</p><pre>/api/private/users/peter/../admin</pre><p>If the server normalizes the path, it could resolve to a different resource.</p><p>This demonstrates why server-side URL construction must use proper encoding and strict validation.</p><h3>8.8 Testing Structured Data Pollution</h3><p>SSPP can also affect structured formats such as JSON and XML.</p><p>Consider a public application that allows users to update their names.</p><p>The browser sends:</p><pre>POST /myaccount<br>Content-Type: application/x-www-form-urlencoded</pre><pre>name=peter</pre><p>The server internally creates:</p><pre>PATCH /users/7312/update<br>Content-Type: application/json</pre><pre>{<br>  &quot;name&quot;: &quot;peter&quot;<br>}</pre><p>If the server inserts user input directly into the JSON string instead of using a proper JSON serializer, special characters may alter the resulting structure.</p><p>The security problem is not JSON itself. It is unsafe construction of structured data using untrusted strings.</p><p>The same principle applies when JSON data is built from user-controlled input.</p><p><strong>Key distinction:</strong> Properly parsing and serializing JSON is fundamentally different from concatenating raw strings to construct JSON documents.</p><h3>8.9 Automated SSPP Testing</h3><p>Burp Suite can assist with identifying suspicious input transformations.</p><p>Useful approaches include:</p><ul><li>Burp Scanner audits.</li><li>Manual testing through Repeater.</li><li>Backslash Powered Scanner.</li><li>Comparing normal and modified responses.</li></ul><p>Automated findings should always be manually verified.</p><p>A suspicious transformation does not automatically establish a vulnerability.</p><h3>8.10 Preventing SSPP</h3><p>Developers should:</p><ul><li>Properly encode all user-controlled input.</li><li>Use structured URL-building libraries.</li><li>Avoid constructing internal requests through string concatenation.</li><li>Validate input against expected formats.</li><li>Use parameterized interfaces where applicable.</li><li>Reject unexpected characters when they are not part of the intended input.</li><li>Ensure that internal APIs independently enforce authorization.</li></ul><h3>9. API Security Testing Workflow With Burp Suite</h3><p>A structured workflow makes API testing more effective and helps prevent missed functionality.</p><h3>Phase 1: Reconnaissance</h3><p>Objective: Understand the application and discover its API attack surface.</p><p>Activities:</p><ul><li>Browse the application through Burp Proxy.</li><li>Identify API-related requests.</li><li>Review JavaScript files.</li><li>Identify API versions.</li><li>Search for exposed documentation.</li><li>Record discovered endpoints.</li></ul><h3>Phase 2: Endpoint Enumeration</h3><p>Objective: Discover additional API functionality.</p><p>Activities:</p><ul><li>Examine URL patterns.</li><li>Review undocumented paths.</li><li>Use authorized content discovery.</li><li>Use Intruder to test candidate endpoint names.</li><li>Compare responses.</li></ul><h3>Phase 3: HTTP Method Testing</h3><p>Objective: Determine which operations each endpoint supports.</p><p>Activities:</p><ul><li>Test relevant HTTP methods.</li><li>Review OPTIONS responses.</li><li>Identify unexpected functionality.</li><li>Compare application behavior.</li></ul><h3>Phase 4: Content-Type Testing</h3><p>Objective: Understand how the API processes different request formats.</p><p>Activities:</p><ul><li>Identify the expected content type.</li><li>Review JSON and form-data handling.</li><li>Test other supported formats.</li><li>Examine parser errors.</li><li>Compare validation behavior.</li></ul><h3>Phase 5: Hidden Parameter Discovery</h3><p>Objective: Identify undocumented parameters and sensitive object properties.</p><p>Activities:</p><ul><li>Examine API responses.</li><li>Compare GET and PATCH requests.</li><li>Use Param Miner.</li><li>Review hidden object fields.</li><li>Investigate unexpected behavior.</li></ul><h3>Phase 6: Authorization Testing</h3><p>Objective: Verify that API operations enforce the correct permissions.</p><p>Activities:</p><ul><li>Compare access between authorized test accounts.</li><li>Check object-level authorization.</li><li>Check function-level authorization.</li><li>Verify access to sensitive properties.</li><li>Test whether server-side permissions match the application’s intended access model.</li></ul><h3>Phase 7: Injection and Parameter Pollution</h3><p>Objective: Determine whether untrusted input can influence server-side processing.</p><p>Activities:</p><ul><li>Review how parameters are transformed.</li><li>Inspect internal request behavior where observable.</li><li>Test query-string handling.</li><li>Review path construction.</li><li>Examine structured-data processing.</li></ul><h3>Phase 8: Verification and Reporting</h3><p>Objective: Confirm findings and document their security impact.</p><p>For every finding, record:</p><ul><li>Vulnerability title.</li><li>Affected endpoint.</li><li>Preconditions.</li><li>Reproduction steps.</li><li>Evidence.</li><li>Security impact.</li><li>Recommended remediation.</li></ul><h3>10. OWASP API Security Top 10 (2023)</h3><p>The OWASP API Security Top 10 identifies major security risks affecting APIs.</p><p>Understanding these categories helps penetration testers build a broader testing methodology.</p><p>IDVulnerabilityDescriptionAPI1Broken Object Level Authorization (BOLA)Users can access objects they are not authorized to access.API2Broken AuthenticationAuthentication mechanisms can be bypassed or abused.API3Broken Object Property Level AuthorizationUnauthorized access to or modification of sensitive object properties.API4Unrestricted Resource ConsumptionAPIs lack sufficient controls over resource usage.API5Broken Function Level AuthorizationUsers can access functions beyond their permissions.API6Unrestricted Access to Sensitive Business FlowsSensitive business operations lack adequate protection.API7Server-Side Request Forgery (SSRF)Server-side requests can be manipulated to reach unintended destinations.API8Security MisconfigurationInsecure configurations expose the API to attacks.API9Improper Inventory ManagementOld, undocumented, or forgotten API versions remain exposed.API10Unsafe Consumption of APIsApplications do not safely validate or process responses from external APIs.</p><h3>How API Testing Relates to These Risks</h3><p>API reconnaissance helps identify undocumented versions and endpoints.</p><p>Authorization testing helps discover BOLA and BFLA vulnerabilities.</p><p>Mass assignment testing is particularly relevant to object property authorization.</p><p>Resource and rate-limit testing helps assess unrestricted resource consumption.</p><p>SSRF testing examines whether APIs can be abused to make unintended server-side requests.</p><p>This demonstrates that API security testing is not limited to finding hidden endpoints. It requires understanding the complete security model of the application.</p><h3>11. API Security Best Practices</h3><p>API security should be implemented at the application and infrastructure levels.</p><h3>Authentication and Authorization</h3><ul><li>Require authentication for protected operations.</li><li>Enforce authorization on every request.</li><li>Verify ownership of requested resources.</li><li>Apply role-based or attribute-based access controls where appropriate.</li><li>Never rely exclusively on front-end restrictions.</li></ul><h3>Input Validation</h3><ul><li>Validate all user-controlled input.</li><li>Enforce expected data types.</li><li>Validate request structures.</li><li>Use safe parsers and serializers.</li><li>Reject unexpected properties where appropriate.</li></ul><h3>HTTP Method Restrictions</h3><ul><li>Allowlist supported HTTP methods.</li><li>Disable unnecessary operations.</li><li>Apply authorization independently to every method.</li></ul><h3>Content-Type Validation</h3><ul><li>Validate incoming content types.</li><li>Use appropriate parsers.</li><li>Avoid inconsistent validation between formats.</li></ul><h3>Mass Assignment Protection</h3><ul><li>Allowlist user-editable properties.</li><li>Separate internal models from public API models.</li><li>Protect administrative and security-sensitive fields.</li></ul><h3>SSPP Protection</h3><ul><li>Encode input before including it in server-side requests.</li><li>Avoid string concatenation when constructing URLs and structured data.</li><li>Use safe URL-building libraries.</li><li>Validate internal request parameters.</li></ul><h3>Error Handling</h3><ul><li>Avoid exposing internal stack traces.</li><li>Do not reveal sensitive database information.</li><li>Use appropriate error messages.</li><li>Log useful security events internally.</li></ul><h3>API Version Management</h3><ul><li>Maintain an inventory of active API versions.</li><li>Remove unsupported versions.</li><li>Apply security controls consistently.</li><li>Avoid exposing unnecessary internal documentation.</li></ul><h3>12. Practical API Testing Checklist</h3><p>The following checklist can be used during an authorized web application penetration test.</p><p><strong>Reconnaissance</strong></p><ul><li>Identify API endpoints.</li><li>Review JavaScript files.</li><li>Identify API versions.</li><li>Locate API documentation.</li><li>Understand authentication requirements.</li></ul><p><strong>Endpoint Testing</strong></p><ul><li>Identify supported HTTP methods.</li><li>Review OPTIONS responses.</li><li>Test relevant content types.</li><li>Search for undocumented endpoints.</li><li>Review error messages.</li></ul><p><strong>Parameter Testing</strong></p><ul><li>Identify required parameters.</li><li>Identify optional parameters.</li><li>Search for hidden parameters.</li><li>Review returned object properties.</li><li>Test mass assignment safely.</li></ul><p><strong>Authorization</strong></p><ul><li>Test object-level authorization.</li><li>Test function-level authorization.</li><li>Review sensitive properties.</li><li>Compare behavior across authorized test accounts.</li></ul><p><strong>Server-Side Parameter Pollution</strong></p><ul><li>Review query-string construction.</li><li>Investigate parameter truncation.</li><li>Investigate additional parameter injection.</li><li>Review duplicate parameter handling.</li><li>Examine REST path construction.</li><li>Review structured-data processing.</li></ul><p><strong>Reporting</strong></p><ul><li>Verify findings.</li><li>Record affected endpoints.</li><li>Capture relevant HTTP requests and responses.</li><li>Explain the security impact.</li><li>Provide remediation recommendations.</li></ul><h3>13. Conclusion</h3><p>API security testing is an essential part of modern web application penetration testing.</p><p>A web application may expose only a small portion of its functionality through the front-end, while its API provides additional operations, parameters, and resources that require independent security assessment.</p><p>Understanding API architecture, performing effective reconnaissance, identifying hidden endpoints, testing HTTP methods, examining content types, and discovering undocumented parameters can reveal weaknesses that ordinary browser testing may overlook.</p><p>Mass assignment demonstrates the risks of automatically binding user input to internal objects, while Server-Side Parameter Pollution highlights the dangers of constructing internal requests from untrusted data.</p><p>Most importantly, successful API testing requires more than sending unusual requests. It requires understanding how the application processes input, enforces authorization, communicates with internal services, and protects sensitive operations.</p><p><strong>The key principle is simple: never assume that an API is secure just because its front-end interface appears restricted. Every exposed endpoint, method, parameter, and object property should be evaluated within the application’s intended security model.</strong></p><h3>References and Further Reading</h3><ol><li><a href="https://portswigger.net/web-security/api-testing">PortSwigger Web Security Academy — API Testing</a></li><li><a href="https://portswigger.net/web-security/api-testing/server-side-parameter-pollution">PortSwigger — Server-Side Parameter Pollution</a></li><li><a href="https://portswigger.net/web-security/access-control">PortSwigger — Access Control Vulnerabilities</a></li><li><a href="https://portswigger.net/web-security/graphql">PortSwigger — GraphQL API Vulnerabilities</a></li><li><a href="https://owasp.org/API-Security/editions/2023/en/0x00-header/">OWASP API Security Top 10–2023</a></li><li><a href="https://spec.openapis.org/oas/latest.html">OpenAPI Specification</a></li><li><a href="https://portswigger.net/burp/documentation">Burp Suite Documentation</a></li></ol><p><em>Disclaimer: This article is intended for educational purposes and authorized security testing. Only assess systems for which you have explicit permission.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de89b28b2b3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GraphQL API Security: Reconnaissance, Common Vulnerabilities, Exploitation Techniques, and…]]></title>
            <link>https://medium.com/@xalpha032/graphql-api-security-reconnaissance-common-vulnerabilities-exploitation-techniques-and-cb422d9aed78?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb422d9aed78</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 21:53:58 GMT</pubDate>
            <atom:updated>2026-11-01T21:53:58.521Z</atom:updated>
            <content:encoded><![CDATA[<h3>GraphQL API Security: Reconnaissance, Common Vulnerabilities, Exploitation Techniques, and Prevention</h3><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*djxCyqjekDBm_hw75rR92A.png" /></figure><p>GraphQL has become a popular technology for building APIs because it gives clients more control over the data they request. Instead of interacting with multiple endpoints, clients can use a single GraphQL endpoint to retrieve or modify different types of data.</p><p>However, this flexibility introduces security challenges.</p><p>GraphQL vulnerabilities generally arise from implementation and design flaws rather than from the GraphQL language itself. Incorrect authorization checks, excessive information disclosure, weak input validation, and inadequate resource controls can expose sensitive information or allow unauthorized operations.</p><p>For web penetration testers, understanding how GraphQL works is essential before attempting to identify vulnerabilities.</p><p>In this article, we will explore the fundamentals of GraphQL, understand its internal structure, and examine common security weaknesses, including:</p><ul><li>Insecure Direct Object References (IDOR).</li><li>Information Disclosure through Introspection.</li><li>Schema Enumeration through Suggestions.</li><li>Introspection Defense Bypasses.</li><li>Rate Limiting Bypasses using Aliases.</li><li>Cross-Site Request Forgery (CSRF).</li></ul><p>We will also examine how to investigate these issues using Burp Suite and how developers can prevent them.</p><h3>1. Understanding GraphQL</h3><h3>1.1 What is GraphQL?</h3><p>GraphQL is a query language for APIs and a runtime for executing those queries using a defined schema.</p><p>It allows clients to request exactly the information they need instead of receiving a predefined response containing unnecessary fields.</p><p>Consider an application that stores the following user information:</p><pre>{<br>  &quot;id&quot;: 1,<br>  &quot;username&quot;: &quot;alex&quot;,<br>  &quot;email&quot;: &quot;alex@example.com&quot;,<br>  &quot;age&quot;: 22,<br>  &quot;address&quot;: &quot;Morocco&quot;<br>}</pre><p>If the client only needs the username and email, it can send the following GraphQL query:</p><pre>query {<br>  user(id: 1) {<br>    username<br>    email<br>  }<br>}</pre><p>The server might return:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;user&quot;: {<br>      &quot;username&quot;: &quot;alex&quot;,<br>      &quot;email&quot;: &quot;alex@example.com&quot;<br>    }<br>  }<br>}</pre><p>Notice that the response contains only the requested fields.</p><p>This is one of the main advantages of GraphQL: clients control the structure of the requested data.</p><p>An important distinction is that GraphQL does not necessarily communicate directly with a database. Instead, GraphQL resolvers process requests and interact with databases, internal services, or other data sources.</p><h3>1.2 GraphQL vs REST API</h3><p>REST and GraphQL approach API communication differently.</p><p>In a traditional REST API, different resources usually have different endpoints:</p><pre>GET /api/users/1<br>GET /api/users/1/orders<br>GET /api/users/1/profile</pre><p>Each endpoint provides access to a particular resource or operation.</p><p>GraphQL usually uses a single endpoint:</p><pre>POST /graphql</pre><p>The GraphQL query inside the request determines what the server should execute.</p><p>For example:</p><pre>query {<br>  user(id: 1) {<br>    name<br>    email<br>    orders {<br>      id<br>      total<br>    }<br>  }<br>}</pre><p>A single request can retrieve information about a user and their associated orders.</p><p>This difference is particularly important during security testing.</p><p>In REST, penetration testers often discover multiple endpoints. In GraphQL, discovering the main endpoint can reveal access to a much larger collection of operations.</p><h3>1.3 GraphQL Architecture</h3><p>A typical GraphQL request follows this process:</p><ol><li>The client sends a GraphQL operation.</li><li>The GraphQL server parses the request.</li><li>The server validates the operation against the schema.</li><li>The appropriate resolvers execute.</li><li>Resolvers retrieve or modify the required data.</li><li>The server constructs a response based on the requested selection set.</li></ol><p>The following components are important:</p><p><strong>Client:</strong> The application or browser sending GraphQL requests.</p><p><strong>Endpoint:</strong> The HTTP endpoint receiving GraphQL operations.</p><p><strong>Schema:</strong> Defines the available types, fields, operations, and arguments.</p><p><strong>Resolvers:</strong> Functions responsible for retrieving or modifying data.</p><p><strong>Data Sources:</strong> Databases, internal APIs, or other services used by resolvers.</p><p>From a security perspective, resolvers deserve particular attention because they frequently contain the business logic and authorization decisions.</p><h3>2. Understanding the GraphQL Schema</h3><h3>2.1 What is a Schema?</h3><p>A GraphQL schema defines the structure of an API and describes which operations clients are allowed to request.</p><p>Think of it as a contract between the client and the server.</p><p>For example:</p><pre>type User {<br>  id: ID!<br>  name: String!<br>  email: String!<br>}</pre><pre>type Product {<br>  id: ID!<br>  name: String!<br>  price: Float!<br>}</pre><p>This schema defines two object types:</p><ul><li>User</li><li>Product</li></ul><p>Each type contains fields describing the information available on that object.</p><h3>2.2 Types and Fields</h3><p>A Type represents a particular structure of data.</p><p>A Field represents an individual piece of information inside that structure.</p><p>For example:</p><pre>type User {<br>  id: ID!<br>  name: String!<br>  email: String!<br>}</pre><p>Here:</p><ul><li>User is the Object Type.</li><li>id is a Field.</li><li>name is a Field.</li><li>email is a Field.</li></ul><p>GraphQL supports several types:</p><p><strong>Scalar Types</strong></p><p>These represent basic values:</p><ul><li>String</li><li>Int</li><li>Float</li><li>Boolean</li><li>ID</li></ul><p><strong>Enum Types</strong></p><p>Enums restrict a field to a predefined set of values.</p><pre>enum OrderStatus {<br>  PENDING<br>  PAID<br>  CANCELLED<br>}</pre><p><strong>Object Types</strong></p><p>Objects contain multiple fields.</p><pre>type Product {<br>  id: ID!<br>  name: String!<br>}</pre><p><strong>Union Types</strong></p><p>A Union allows a field to return one of several object types.</p><pre>union SearchResult = User | Product</pre><p><strong>Interface Types</strong></p><p>An Interface defines common fields that multiple object types must implement.</p><pre>interface Animal {<br>  name: String!<br>}</pre><pre>type Dog implements Animal {<br>  name: String!<br>  breed: String!<br>}</pre><pre>type Cat implements Animal {<br>  name: String!<br>  color: String!<br>}</pre><h3>2.3 Understanding the Exclamation Mark (!)</h3><p>In GraphQL, ! indicates that a value is non-nullable.</p><p>For example:</p><pre>type Product {<br>  id: ID!<br>  name: String!<br>  price: Float<br>}</pre><p>The difference is:</p><ul><li>id: ID! must have a value.</li><li>name: String! must have a value.</li><li>price: Float can be null.</li></ul><p>This is important when understanding the expected input and output types of an API.</p><h3>2.4 Root Types</h3><p>GraphQL schemas define root operation types.</p><p>The main three are:</p><ul><li>Query</li><li>Mutation</li><li>Subscription</li></ul><p>A schema must define a Query root type.</p><p>Example:</p><pre>type Query {<br>  user(id: ID!): User<br>  product(id: ID!): Product<br>  products: [Product]<br>}</pre><p>This tells us which read operations are available.</p><p>A schema may also define mutations:</p><pre>type Mutation {<br>  createProduct(name: String!): Product<br>  deleteProduct(id: ID!): Boolean<br>}</pre><h3>3. Understanding GraphQL Operations</h3><p>GraphQL has three primary operation types.</p><h3>3.1 Queries</h3><p>A Query retrieves information without intentionally modifying application state.</p><p>Example:</p><pre>query {<br>  getProduct(id: 123) {<br>    name<br>    description<br>  }<br>}</pre><p>The server executes the corresponding resolver and returns the requested information.</p><p>From a penetration testing perspective, Queries are particularly interesting when they expose sensitive objects through user-controlled arguments.</p><h3>3.2 Mutations</h3><p>Mutations perform operations that modify application data.</p><p>They are commonly used for:</p><ul><li>Creating records.</li><li>Updating information.</li><li>Deleting resources.</li><li>Changing account settings.</li></ul><p>Example:</p><pre>mutation {<br>  updateUser(id: 1, name: &quot;Ali&quot;) {<br>    id<br>    name<br>  }<br>}</pre><p>A successful mutation might return:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;updateUser&quot;: {<br>      &quot;id&quot;: 1,<br>      &quot;name&quot;: &quot;Ali&quot;<br>    }<br>  }<br>}</pre><p>Security testing should focus on whether the server verifies that the authenticated user is authorized to perform the requested modification.</p><h3>3.3 Subscriptions</h3><p>Subscriptions allow clients to receive real-time updates from the server.</p><p>Unlike ordinary Queries, which return a response to a request, Subscriptions establish a longer-lived communication mechanism.</p><p>Example:</p><pre>subscription {<br>  newMessage {<br>    id<br>    content<br>    sender<br>  }<br>}</pre><p>When a new message is published, the server can send an update to connected clients.</p><p>Subscriptions are commonly implemented using WebSockets, although other transports, such as Server-Sent Events, are possible.</p><h3>Security considerations</h3><p>Subscriptions introduce additional security concerns:</p><ul><li>Authentication during connection establishment.</li><li>Authorization for individual subscription events.</li><li>Access to private rooms or channels.</li><li>Connection limits.</li><li>Resource consumption.</li><li>Sensitive information exposure.</li></ul><p>For example, a user should not be able to subscribe to messages from a private room simply by changing its identifier.</p><p>The server must verify room membership independently of the supplied GraphQL arguments.</p><h3>4. Understanding GraphQL Query Components</h3><p>Before testing GraphQL vulnerabilities, it is important to understand how individual query components work.</p><h3>4.1 Fields</h3><p>Fields represent the information requested from an object.</p><p>Example:</p><pre>query {<br>  getEmployees {<br>    id<br>    name<br>    email<br>  }<br>}</pre><p>The client requests three fields:</p><ul><li>id</li><li>name</li><li>email</li></ul><p>GraphQL can also return nested objects.</p><pre>query {<br>  getEmployees {<br>    id<br>    name {<br>      firstname<br>      lastname<br>    }<br>  }<br>}</pre><p>Here, name is an object containing two additional fields.</p><p>This structure is called a nested selection set.</p><h3>4.2 Arguments</h3><p>Arguments provide values to fields and help determine which data the server should return.</p><p>Example:</p><pre>query {<br>  getEmployee(id: 1) {<br>    name<br>    email<br>  }<br>}</pre><p>Here:</p><ul><li>getEmployee is the field.</li><li>id is the argument name.</li><li>1 is the argument value.</li></ul><p>Arguments become particularly important during authorization testing.</p><p>If an application relies on an object ID without verifying the user’s permissions, an attacker may be able to access another user’s information.</p><h3>4.3 Variables</h3><p>Variables allow clients to provide dynamic values without rewriting the query itself.</p><p>Instead of:</p><pre>query {<br>  getEmployee(id: 1) {<br>    name<br>  }<br>}</pre><p>We can write:</p><pre>query getEmployee($id: ID!) {<br>  getEmployee(id: $id) {<br>    name<br>  }<br>}</pre><p>The variable value is provided separately:</p><pre>{<br>  &quot;id&quot;: 1<br>}</pre><p>A complete HTTP request might look like this:</p><pre>POST /graphql HTTP/1.1<br>Host: example.local<br>Content-Type: application/json</pre><pre>{<br>  &quot;query&quot;: &quot;query getEmployee($id: ID!) { getEmployee(id: $id) { name } }&quot;,<br>  &quot;variables&quot;: {<br>    &quot;id&quot;: 1<br>  }<br>}</pre><p>Variables improve query reusability, but they are not security controls.</p><p>The server must still validate their values and enforce authorization.</p><h3>4.4 Aliases</h3><p>Aliases allow clients to assign alternative names to fields in the response.</p><p>They are useful when requesting the same field multiple times with different arguments.</p><p>Without aliases, the following query creates a field conflict:</p><pre>query {<br>  getProduct(id: 1) {<br>    name<br>  }</pre><pre>  getProduct(id: 2) {<br>    name<br>  }<br>}</pre><p>The solution is to use aliases:</p><pre>query {<br>  product1: getProduct(id: 1) {<br>    id<br>    name<br>  }</pre><pre>  product2: getProduct(id: 2) {<br>    id<br>    name<br>  }<br>}</pre><p>The response will contain two separate properties:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;product1&quot;: {<br>      &quot;id&quot;: 1,<br>      &quot;name&quot;: &quot;Product 1&quot;<br>    },<br>    &quot;product2&quot;: {<br>      &quot;id&quot;: 2,<br>      &quot;name&quot;: &quot;Product 2&quot;<br>    }<br>  }<br>}</pre><p>Aliases have important security implications, especially when rate limiting is implemented incorrectly.</p><p>We will examine this later.</p><h3>4.5 Fragments</h3><p>Fragments are reusable sections of GraphQL queries.</p><p>They help avoid repeating the same fields across multiple operations.</p><p>Example:</p><pre>fragment productInfo on Product {<br>  id<br>  name<br>  price<br>}</pre><p>We can reuse this fragment:</p><pre>query {<br>  getProduct(id: 1) {<br>    ...productInfo<br>  }<br>}</pre><p>The ...productInfo syntax tells GraphQL to include the fields defined inside the fragment.</p><p>From a security testing perspective, remember that sensitive fields may appear inside nested objects or fragments, not only in the top-level query.</p><h3>5. Finding GraphQL Endpoints</h3><p>Endpoint discovery is the first practical step in GraphQL penetration testing.</p><p>Unlike REST APIs, GraphQL services commonly expose their operations through a single endpoint.</p><p>For example:</p><pre>https://example.com/graphql</pre><p>However, the endpoint name is not always obvious.</p><h3>5.1 Universal Queries</h3><p>GraphQL provides a reserved field called __typename.</p><p>It returns the name of the current object type.</p><p>A simple query is:</p><pre>query {<br>  __typename<br>}</pre><p>A shorter version is:</p><pre>{ __typename }</pre><p>A GraphQL endpoint may respond with:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;__typename&quot;: &quot;Query&quot;<br>  }<br>}</pre><p>This is known as a universal query because it can help determine whether a particular endpoint is a GraphQL service.</p><h3>5.2 Common Endpoint Names</h3><p>During authorized reconnaissance, common endpoint paths include:</p><pre>/graphql<br>/api<br>/api/graphql<br>/graphql/api<br>/graphql/graphql</pre><p>Some applications also use versioned endpoints:</p><pre>/graphql/v1<br>/api/v1/graphql</pre><p>These paths are useful starting points, not a complete list.</p><h3>5.3 HTTP Request Methods</h3><p>GraphQL implementations commonly accept POST requests.</p><p>However, some also support GET or POST requests with alternative content types.</p><p>The three important request formats to understand are:</p><p><strong>POST with application/json</strong></p><pre>POST /graphql HTTP/1.1<br>Host: example.com<br>Content-Type: application/json</pre><pre>{<br>  &quot;query&quot;: &quot;{ __typename }&quot;<br>}</pre><p><strong>POST with application/x-www-form-urlencoded</strong></p><pre>POST /graphql HTTP/1.1<br>Host: example.com<br>Content-Type: application/x-www-form-urlencoded</pre><pre>query={__typename}</pre><p><strong>GET</strong></p><pre>GET /graphql?query=%7B__typename%7D HTTP/1.1<br>Host: example.com</pre><p>The difference is where and how the query is transmitted.</p><ul><li>JSON requests place the query inside a JSON body.</li><li>Form URL-encoded requests place it inside form parameters.</li><li>GET requests commonly place it inside the URL.</li></ul><p>The supported methods depend on the server implementation.</p><h3>5.4 Initial Testing with Burp Suite</h3><p>Once you identify a possible endpoint:</p><ol><li>Open the application using Burp’s browser.</li><li>Browse through its functionality.</li><li>Open Proxy → HTTP history.</li><li>Search for requests containing GraphQL operations.</li><li>Send interesting requests to Repeater.</li><li>Examine their fields, arguments, variables, and responses.</li></ol><p>Do not immediately assume that finding a GraphQL endpoint means a vulnerability exists.</p><p>The objective at this stage is to understand how the application communicates with its API.</p><h3>6. Exploiting Unsanitized Arguments: GraphQL IDOR</h3><p>One of the most important GraphQL security issues is Broken Access Control.</p><p>An API may use arguments to retrieve objects directly from a database.</p><p>If the server does not verify whether the authenticated user is authorized to access the requested object, this can result in an IDOR vulnerability.</p><h3>6.1 Understanding the Scenario</h3><p>Imagine an online shop that contains several products.</p><p>The application only displays products where:</p><pre>listed = true</pre><p>The client sends:</p><pre>query {<br>  products {<br>    id<br>    name<br>    listed<br>  }<br>}</pre><p>The server returns:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;products&quot;: [<br>      {<br>        &quot;id&quot;: 1,<br>        &quot;name&quot;: &quot;Product 1&quot;,<br>        &quot;listed&quot;: true<br>      },<br>      {<br>        &quot;id&quot;: 2,<br>        &quot;name&quot;: &quot;Product 2&quot;,<br>        &quot;listed&quot;: true<br>      },<br>      {<br>        &quot;id&quot;: 4,<br>        &quot;name&quot;: &quot;Product 4&quot;,<br>        &quot;listed&quot;: true<br>      }<br>    ]<br>  }<br>}</pre><p>Notice that product ID 3 is missing.</p><p>This does not prove that the product exists or that it is vulnerable, but it gives us a useful testing hypothesis.</p><p>The API might contain a separate field that retrieves individual products:</p><pre>query {<br>  product(id: 3) {<br>    id<br>    name<br>    listed<br>  }<br>}</pre><p>Suppose the response is:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;product&quot;: {<br>      &quot;id&quot;: 3,<br>      &quot;name&quot;: &quot;Product 3&quot;,<br>      &quot;listed&quot;: false<br>    }<br>  }<br>}</pre><p>The application returned a product that was not included in the original public list.</p><h3>6.2 Root Cause</h3><p>The underlying problem is inconsistent authorization or filtering between two resolvers.</p><p>The products resolver applies the publication filter, but the product(id) resolver does not enforce the same access restrictions.</p><p>The issue is not caused by GraphQL arguments themselves.</p><p>It is caused by missing server-side authorization.</p><h3>6.3 Burp Suite Testing Methodology</h3><p><strong>Target component:</strong> GraphQL query arguments.</p><p>Start with the normal request:</p><pre>POST /graphql HTTP/1.1<br>Host: example.local<br>Content-Type: application/json</pre><pre>{<br>  &quot;query&quot;: &quot;{ products { id name listed } }&quot;<br>}</pre><p>Then identify individual-object queries and their arguments.</p><p>In an authorized test environment:</p><ol><li>Capture the normal request.</li><li>Send it to Repeater.</li><li>Identify object identifiers and related arguments.</li><li>Compare the behavior of list and individual-object resolvers.</li><li>Verify whether access restrictions are consistently enforced.</li><li>Record the response and the impact.</li></ol><p>A valid IDOR finding requires demonstrating unauthorized access, not merely changing an ID and receiving a different response.</p><h3>6.4 Potential Impact</h3><p>Depending on the application, GraphQL IDOR vulnerabilities can expose:</p><ul><li>Private user information.</li><li>Internal product information.</li><li>Unpublished records.</li><li>Private messages.</li><li>Orders and transaction details.</li><li>Administrative resources.</li></ul><p>The severity depends on the sensitivity of the exposed data and the actions available to the user.</p><h3>7. Discovering GraphQL Schema Information</h3><p>Understanding the schema is one of the most valuable parts of GraphQL reconnaissance.</p><p>There are two important techniques:</p><ol><li>Introspection.</li><li>Suggestions.</li></ol><h3>7.1 What is Introspection?</h3><p>Introspection is a built-in GraphQL feature that allows clients to query information about the API’s own schema.</p><p>It can reveal:</p><ul><li>Available Types.</li><li>Fields.</li><li>Queries.</li><li>Mutations.</li><li>Subscriptions.</li><li>Arguments.</li><li>Data types.</li><li>Descriptions.</li><li>Deprecated fields.</li></ul><p>For a penetration tester, this information can provide a detailed overview of the API’s available functionality.</p><h3>7.2 Important Introspection Fields</h3><p>GraphQL provides several special fields:</p><p>FieldPurpose__schemaReturns information about the schema__typeReturns information about a specific type__typenameReturns the current object&#39;s type name</p><p>For example:</p><pre>query {<br>  __schema {<br>    queryType {<br>      name<br>    }<br>  }<br>}</pre><p>The response might be:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;__schema&quot;: {<br>      &quot;queryType&quot;: {<br>        &quot;name&quot;: &quot;Query&quot;<br>      }<br>    }<br>  }<br>}</pre><h3>7.3 Discovering Mutations</h3><p>You can also request the available mutation names:</p><pre>query {<br>  __schema {<br>    mutationType {<br>      fields {<br>        name<br>      }<br>    }<br>  }<br>}</pre><p>A response might reveal:</p><pre>{<br>  &quot;data&quot;: {<br>    &quot;__schema&quot;: {<br>      &quot;mutationType&quot;: {<br>        &quot;fields&quot;: [<br>          {<br>            &quot;name&quot;: &quot;createProduct&quot;<br>          },<br>          {<br>            &quot;name&quot;: &quot;updateProduct&quot;<br>          },<br>          {<br>            &quot;name&quot;: &quot;deleteProduct&quot;<br>          }<br>        ]<br>      }<br>    }<br>  }<br>}</pre><p>This provides an overview of the available mutation operations.</p><p>However, knowing that a mutation exists does not mean that every user can execute it.</p><p>Authorization must still be enforced by the server.</p><h3>7.4 Running a Full Introspection Query</h3><p>A full introspection query can retrieve extensive information about the schema.</p><p>It may include:</p><ul><li>Root operation types.</li><li>Object types.</li><li>Input types.</li><li>Fields.</li><li>Arguments.</li><li>Interfaces.</li><li>Unions.</li><li>Enums.</li><li>Descriptions.</li><li>Deprecation information.</li></ul><p>The following is a commonly used introspection query:</p><pre>query IntrospectionQuery {<br>  __schema {<br>    queryType {<br>      name<br>    }<br>    mutationType {<br>      name<br>    }<br>    subscriptionType {<br>      name<br>    }<br>    types {<br>      ...FullType<br>    }<br>    directives {<br>      name<br>      description<br>      args {<br>        ...InputValue<br>      }<br>    }<br>  }<br>}</pre><pre>fragment FullType on __Type {<br>  kind<br>  name<br>  description<br>  fields(includeDeprecated: true) {<br>    name<br>    description<br>    args {<br>      ...InputValue<br>    }<br>    type {<br>      ...TypeRef<br>    }<br>    isDeprecated<br>    deprecationReason<br>  }<br>  inputFields {<br>    ...InputValue<br>  }<br>  interfaces {<br>    ...TypeRef<br>  }<br>  enumValues(includeDeprecated: true) {<br>    name<br>    description<br>    isDeprecated<br>    deprecationReason<br>  }<br>  possibleTypes {<br>    ...TypeRef<br>  }<br>}</pre><pre>fragment InputValue on __InputValue {<br>  name<br>  description<br>  type {<br>    ...TypeRef<br>  }<br>  defaultValue<br>}</pre><pre>fragment TypeRef on __Type {<br>  kind<br>  name<br>  ofType {<br>    kind<br>    name<br>    ofType {<br>      kind<br>      name<br>      ofType {<br>        kind<br>        name<br>      }<br>    }<br>  }<br>}</pre><p>Some implementations may require adjustments to introspection queries depending on the supported schema features.</p><h3>7.5 Visualizing Introspection Results</h3><p>Full introspection responses can be extremely large.</p><p>Reading the entire JSON response manually can become difficult, especially when the API contains many interconnected types.</p><p>A GraphQL visualizer can help transform the returned schema into a visual representation.</p><p>For example:</p><pre>Query<br> ├── products<br> │    └── Product<br> │         ├── id<br> │         ├── name<br> │         └── price<br> │<br> └── product(id)<br>      └── Product</pre><p>This makes it easier to understand relationships between operations and objects.</p><p>A visualizer does not discover new information independently; it organizes information already obtained from the schema.</p><h3>8. GraphQL Suggestions: Discovering Schema Without Introspection</h3><p>Disabling introspection does not necessarily prevent all schema discovery.</p><p>Some GraphQL implementations, particularly Apollo configurations, provide suggestions in error messages.</p><p>These suggestions can reveal valid field names when a query contains an invalid field.</p><p>For example, suppose the application contains:</p><pre>type Query {<br>  productInformation(id: ID!): Product<br>}</pre><p>A request referencing an incorrect field might generate an error similar to:</p><pre>Cannot query field &quot;productInfo&quot;.<br>Did you mean &quot;productInformation&quot;?</pre><p>This response provides information about the underlying schema.</p><h3>8.1 Why is This a Security Concern?</h3><p>Even when introspection is disabled, detailed error messages may reveal:</p><ul><li>Valid field names.</li><li>Operation names.</li><li>Possible schema relationships.</li><li>Incorrectly guessed field names.</li></ul><p>By collecting enough suggestions, it may be possible to reconstruct parts of the schema.</p><h3>8.2 Clairvoyance</h3><p>Clairvoyance is a tool designed to recover GraphQL schema information through suggestions.</p><p>It can automate the process of sending queries and analyzing suggestion responses.</p><p>From a defensive perspective, this demonstrates why disabling introspection alone may not be sufficient.</p><h3>8.3 Prevention</h3><p>Developers should avoid exposing unnecessary schema details through client-facing error messages.</p><p>For Apollo Server v4 and above, the hideSchemaDetailsFromClientErrors configuration option can help disable schema suggestions.</p><p>Errors should remain useful for developers through appropriate internal logging without exposing unnecessary implementation details to external clients.</p><h3>9. Bypassing GraphQL Introspection Defenses</h3><p>Some applications attempt to disable introspection using simple request filters.</p><p>However, poorly designed filters may only inspect the textual representation of a query instead of understanding its GraphQL syntax.</p><h3>9.1 Regex-Based Filtering</h3><p>Imagine a developer wants to block introspection requests.</p><p>They create a regular expression that searches for:</p><pre>__schema{</pre><p>If the pattern is detected, the server rejects the request.</p><p>The problem is that GraphQL allows certain characters, including spaces, commas, and newlines, to be ignored between tokens.</p><p>For example:</p><pre>query {<br>  __schema<br>  {<br>    queryType {<br>      name<br>    }<br>  }<br>}</pre><p>This is still a valid GraphQL structure.</p><p>However, a filter looking only for the exact string:</p><pre>__schema{</pre><p>may fail to recognize it.</p><h3>9.2 Text Matching vs GraphQL Parsing</h3><p>There is an important difference between:</p><p><strong>Text Matching</strong></p><p>Checks whether a specific character sequence exists in a request.</p><p><strong>GraphQL Parsing</strong></p><p>Understands the structure and meaning of a GraphQL operation.</p><p>Security controls that rely only on text matching can be unreliable because multiple textual representations may describe the same GraphQL operation.</p><p>The correct approach is to apply security policies to the parsed GraphQL document rather than relying on fragile regular expressions.</p><h3>9.3 Alternative Request Methods</h3><p>Another common implementation mistake is blocking introspection only for one HTTP request format.</p><p>For example, a developer might filter POST requests but leave GET requests or URL-encoded POST requests available.</p><p>Depending on the server configuration, GraphQL queries may be accepted through:</p><ul><li>POST with JSON.</li><li>GET with URL parameters.</li><li>POST with application/x-www-form-urlencoded.</li></ul><p>An authorized tester should verify that the same security policy applies across all supported request methods and content types.</p><p>For example:</p><pre>POST /graphql HTTP/1.1<br>Content-Type: application/json</pre><pre>{<br>  &quot;query&quot;: &quot;{ __typename }&quot;<br>}</pre><p>A GET request might instead contain:</p><pre>GET /graphql?query=%7B__typename%7D HTTP/1.1</pre><p>The following URL-encoded characters are useful to recognize:</p><p>Encoded valueCharacter%7B{%7D}%0ANewline</p><p>The main lesson is that blocking one representation does not guarantee that every equivalent representation is blocked.</p><h3>10. Bypassing Rate Limiting Using Aliases</h3><p>GraphQL aliases provide a convenient way to request multiple instances of the same field within a single operation.</p><p>However, this feature can introduce a security weakness when rate limiting is implemented incorrectly.</p><h3>10.1 Understanding the Problem</h3><p>Consider a GraphQL API that checks whether a discount code is valid.</p><p>A traditional rate limiter might restrict the number of HTTP requests sent by a client.</p><p>For example:</p><pre>Maximum: 10 HTTP requests per minute</pre><p>However, one GraphQL HTTP request may contain multiple aliased fields.</p><p>For example:</p><pre>query {<br>  product1: getProduct(id: 1) {<br>    name<br>  }</pre><pre>  product2: getProduct(id: 2) {<br>    name<br>  }<br>}</pre><p>This means that multiple resolver executions can occur inside one HTTP request.</p><p>If the application only counts incoming HTTP requests, it may underestimate the actual amount of work being performed.</p><h3>10.2 Root Cause</h3><p>The problem is a mismatch between HTTP-level rate limiting and GraphQL-level operation execution.</p><p>A single request can contain:</p><ul><li>Multiple root fields.</li><li>Multiple aliases.</li><li>Nested selections.</li><li>Expensive resolver operations.</li></ul><p>Counting only HTTP requests does not necessarily reflect the real computational cost.</p><h3>10.3 Potential Impact</h3><p>Depending on the exposed functionality, insufficient limits can increase the risk of:</p><ul><li>Brute-force attempts.</li><li>Excessive resource consumption.</li><li>Automated enumeration.</li><li>Denial-of-Service conditions.</li></ul><h3>10.4 Prevention</h3><p>Developers should implement rate limiting that considers GraphQL operations rather than relying exclusively on HTTP request counts.</p><p>Useful controls include:</p><ul><li>Maximum number of aliases.</li><li>Maximum number of root fields.</li><li>Operation limits.</li><li>Query complexity analysis.</li><li>Execution time limits.</li><li>Per-user and per-IP rate limits.</li></ul><h3>11. GraphQL Cross-Site Request Forgery (CSRF)</h3><p>Cross-Site Request Forgery is a vulnerability that allows an attacker to induce a victim’s browser to send an unwanted request to an application where the victim is authenticated.</p><p>GraphQL endpoints can also be vulnerable to CSRF.</p><h3>11.1 Understanding the Scenario</h3><p>Imagine a user is logged in to an application.</p><p>The application uses a GraphQL mutation to change account information.</p><p>If the endpoint accepts requests that can be submitted cross-origin by a browser, and it does not implement appropriate CSRF protections, an attacker may be able to induce the victim’s browser to perform an unintended action.</p><p>The important point is that the browser may automatically include the victim’s authentication cookies.</p><h3>11.2 How GraphQL CSRF Vulnerabilities Arise</h3><p>A common combination of weaknesses is:</p><ol><li>The GraphQL endpoint accepts requests using application/x-www-form-urlencoded.</li><li>The endpoint does not properly validate the request content type.</li><li>No effective CSRF token mechanism is implemented.</li><li>Authentication relies on cookies that the browser may automatically attach.</li></ol><p>GET requests that perform state-changing operations are also dangerous.</p><p>The risk depends on the application’s authentication configuration, browser behavior, cookie settings, and cross-origin protections.</p><h3>11.3 Why application/json Matters</h3><p>A correctly enforced application/json requirement helps protect against traditional HTML form-based CSRF.</p><p>Ordinary HTML forms cannot directly submit arbitrary JSON bodies with an application/json content type.</p><p>However, developers should not rely on the content type alone as their entire security strategy.</p><p>A secure implementation should also consider:</p><ul><li>CSRF tokens.</li><li>Origin validation.</li><li>Appropriate SameSite cookie settings.</li><li>Strict content-type validation.</li><li>Correct CORS configuration.</li><li>Preventing state-changing operations over GET.</li></ul><p>CORS and CSRF are related to browser security but solve different problems. CORS alone should not be treated as a replacement for CSRF protection.</p><h3>12. Burp Suite: GraphQL Security Testing Methodology</h3><p>Burp Suite is particularly useful when testing GraphQL because it allows testers to inspect and modify HTTP requests and analyze server responses.</p><h3>12.1 Identifying GraphQL Requests</h3><p>Start by browsing the application through Burp’s browser.</p><p>Navigate to:</p><pre>Proxy → HTTP history</pre><p>Look for requests containing:</p><pre>/graphql</pre><p>or GraphQL operations inside their request bodies.</p><h3>12.2 Sending Requests to Repeater</h3><p>Once you identify a GraphQL request:</p><ol><li>Right-click the request.</li><li>Select Send to Repeater.</li><li>Open the Repeater tab.</li><li>Examine the query and variables.</li><li>Modify the request within the authorized testing scope.</li><li>Compare the original and modified responses.</li></ol><h3>12.3 Understanding the GraphQL Request</h3><p>Example:</p><pre>POST /graphql HTTP/1.1<br>Host: example.local<br>Content-Type: application/json</pre><pre>{<br>  &quot;query&quot;: &quot;query getEmployee($id: ID!) { employee: getEmployee(id: $id) { id name } }&quot;,<br>  &quot;variables&quot;: {<br>    &quot;id&quot;: 1<br>  }<br>}</pre><p>Important components:</p><p>ComponentMeaningPOST /graphqlGraphQL endpointqueryOperation typegetEmployeeOperation name$id: ID!Variable declarationid: $idArgumentemployee:Aliasid, nameRequested fieldsvariablesVariable values</p><p>Understanding these components makes it much easier to analyze complex requests.</p><h3>12.4 Useful Burp Features</h3><p><strong>Proxy</strong></p><p>Used to capture GraphQL requests and inspect application behavior.</p><p><strong>Repeater</strong></p><p>Used to modify requests and compare responses.</p><p><strong>HTTP History</strong></p><p>Used to identify GraphQL endpoints and application operations.</p><p><strong>WebSockets History</strong></p><p>Useful when investigating GraphQL subscriptions implemented over WebSockets.</p><p><strong>GraphQL Support</strong></p><p>Burp can identify GraphQL requests and provide a dedicated GraphQL view separating the query and variables.</p><p><strong>InQL Extension</strong></p><p>InQL is a Burp Suite extension designed to assist with GraphQL security testing.</p><p>Its features include:</p><ul><li>Schema analysis.</li><li>Query and mutation generation.</li><li>Introspection support.</li><li>Sending generated requests to Repeater.</li><li>Organizing discovered operations.</li></ul><p>These features can help with reconnaissance, but manually validating authorization and application behavior remains essential.</p><h3>13. Preventing GraphQL Attacks</h3><p>Finding vulnerabilities is only one side of penetration testing. Understanding how to prevent them is equally important.</p><p>The following controls address the main weaknesses discussed in this article.</p><h3>13.1 Disable Introspection Where Appropriate</h3><p>For private APIs that do not require public schema discovery, consider disabling introspection in production.</p><p>However, public APIs may legitimately require introspection for documentation and developer tooling.</p><p>In those cases, carefully review the schema and ensure that it does not expose unintended information.</p><p>Disabling introspection is a defense-in-depth measure, not a replacement for authorization.</p><h3>13.2 Disable Schema Suggestions</h3><p>Error messages should not reveal unnecessary information about the API’s internal structure.</p><p>Disable or appropriately restrict suggestions and detailed schema errors in production.</p><p>For Apollo Server v4 and above, review:</p><pre>hideSchemaDetailsFromClientErrors</pre><p>Use the configuration appropriate to the installed server version.</p><h3>13.3 Protect Sensitive Fields</h3><p>Review the GraphQL schema to ensure that private user information is not unnecessarily exposed.</p><p>Examples include:</p><ul><li>Email addresses.</li><li>Internal user identifiers.</li><li>Private account information.</li><li>Administrative metadata.</li><li>Sensitive business data.</li></ul><p>Remember that hiding a field in the frontend does not secure it.</p><p>Authorization must be enforced on the server.</p><h3>13.4 Implement Strong Authorization</h3><p>Every resolver that accesses sensitive resources should verify the authenticated user’s permissions.</p><p>For example, a resolver should not simply retrieve an object using an ID supplied by the client.</p><p>It should also verify that the current user is permitted to access that object.</p><p>Authorization checks should be consistent across:</p><ul><li>Queries.</li><li>Mutations.</li><li>Nested fields.</li><li>Subscriptions.</li><li>Different resolver paths accessing the same resource.</li></ul><p>This is one of the most important protections against GraphQL IDOR vulnerabilities.</p><h3>13.5 Implement Query Depth Limits</h3><p>GraphQL supports nested fields, which can result in deeply nested operations.</p><p>For example:</p><pre>query {<br>  user {<br>    orders {<br>      products {<br>        reviews {<br>          author {<br>            orders {<br>              products {<br>                id<br>              }<br>            }<br>          }<br>        }<br>      }<br>    }<br>  }<br>}</pre><p>Deeply nested operations can create significant processing overhead.</p><p>Developers should configure maximum query depth limits to prevent excessively nested requests.</p><h3>13.6 Implement Operation Limits</h3><p>Query depth alone is not sufficient.</p><p>A relatively shallow query can still contain many fields or aliases.</p><p>Consider limiting:</p><ul><li>Total number of aliases.</li><li>Number of root fields.</li><li>Number of unique fields.</li><li>Total operations per request.</li><li>Maximum query size.</li></ul><p>These restrictions help control the amount of work performed by a single GraphQL request.</p><h3>13.7 Implement Query Complexity Analysis</h3><p>Query complexity analysis estimates the computational cost of executing a GraphQL operation.</p><p>For example, a query retrieving a single user may be inexpensive.</p><p>A query retrieving thousands of users, each containing multiple nested collections, may be significantly more expensive.</p><p>The server can calculate an estimated cost before execution and reject operations that exceed an acceptable threshold.</p><p>This helps reduce resource exhaustion and abuse.</p><h3>13.8 Enforce Proper Rate Limiting</h3><p>Rate limiting should consider more than the number of HTTP requests.</p><p>A robust implementation should account for:</p><ul><li>Aliases.</li><li>Root fields.</li><li>Operation complexity.</li><li>Authentication identity.</li><li>Request frequency.</li><li>Resource consumption.</li></ul><p>The objective is to limit the actual workload generated by a client.</p><h3>13.9 Prevent GraphQL CSRF</h3><p>To reduce CSRF risks:</p><ol><li>Accept queries through JSON-encoded POST requests where appropriate.</li><li>Validate that the actual request content matches the declared content type.</li><li>Implement secure CSRF tokens when cookie-based authentication requires them.</li><li>Validate request origins where appropriate.</li><li>Configure SameSite cookie attributes correctly.</li><li>Avoid allowing state-changing operations through GET requests.</li><li>Review CORS policies carefully.</li></ol><p>No single control should be considered sufficient in every application.</p><h3>14. Practical GraphQL Security Testing Checklist</h3><p>During an authorized GraphQL penetration test, the following checklist can help organize the assessment.</p><h3>Reconnaissance</h3><ul><li>Identify possible GraphQL endpoints.</li><li>Inspect HTTP History.</li><li>Test for a valid GraphQL response using __typename.</li><li>Identify supported HTTP methods.</li><li>Examine request content types.</li><li>Understand the application’s normal GraphQL operations.</li></ul><h3>Schema Discovery</h3><ul><li>Check whether introspection is enabled.</li><li>Identify available Queries.</li><li>Identify available Mutations.</li><li>Identify available Subscriptions.</li><li>Review object Types and Fields.</li><li>Examine arguments and input types.</li><li>Review error messages and suggestions.</li><li>Identify sensitive or unnecessary fields.</li></ul><h3>Access Control</h3><ul><li>Review object-level authorization.</li><li>Compare list and individual-object resolvers.</li><li>Check whether private information is properly protected.</li><li>Verify mutation authorization.</li><li>Review nested field authorization.</li><li>Verify subscription access controls.</li></ul><h3>Request and Resource Controls</h3><ul><li>Review alias limits.</li><li>Check query depth restrictions.</li><li>Review operation limits.</li><li>Check query complexity controls.</li><li>Review rate limiting.</li><li>Examine maximum request size.</li></ul><h3>CSRF</h3><ul><li>Review accepted HTTP methods.</li><li>Verify content-type validation.</li><li>Review cookie configuration.</li><li>Check CSRF token enforcement.</li><li>Review CORS configuration.</li><li>Ensure GET requests cannot perform state-changing operations.</li></ul><h3>15. Conclusion</h3><p>GraphQL provides a flexible way to build and interact with APIs, but its flexibility also creates security challenges that developers and penetration testers must understand.</p><p>A single endpoint can expose numerous operations, fields, and relationships. Without proper authorization, resource restrictions, and input validation, these features can become entry points for security vulnerabilities.</p><p>The most important lesson is that GraphQL security is not simply about hiding the schema or disabling introspection.</p><p>Even when introspection is disabled, an application may still expose sensitive information through suggestions, error messages, improperly protected resolvers, or other implementation flaws.</p><p>As a penetration tester, the goal is to understand how the API works, identify where trust boundaries exist, and verify whether the server enforces the intended security rules.</p><p>As a developer, the goal is to ensure that every operation is properly authorized, every request is appropriately validated, and every resource-consuming operation is controlled.</p><p><strong>A well-designed GraphQL API should not rely on obscurity. Its security should come from strong authorization, strict validation, and carefully designed resource controls.</strong></p><h3>References and Further Reading</h3><ol><li><a href="https://portswigger.net/web-security/graphql">PortSwigger Web Security Academy — GraphQL API Vulnerabilities</a></li><li><a href="https://portswigger.net/web-security/graphql/what-is-graphql">PortSwigger — What is GraphQL?</a></li><li><a href="https://portswigger.net/burp/documentation/desktop/testing-workflow/working-with-graphql">PortSwigger — Working with GraphQL in Burp Suite</a></li><li><a href="https://portswigger.net/bappstore/296e9a0730384be4b2fffef7b4e19b1f">PortSwigger — InQL GraphQL Scanner</a></li><li><a href="https://graphql.org/learn/">GraphQL Official Documentation</a></li><li><a href="https://www.apollographql.com/docs/apollo-server/">Apollo Server Documentation</a></li></ol><p><strong>Disclaimer:</strong> All testing techniques discussed in this article should only be performed against systems you own or have explicit authorization to assess.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb422d9aed78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access Control Vulnerabilities: A Practical Guide to Broken Authorization]]></title>
            <link>https://medium.com/@xalpha032/access-control-vulnerabilities-a-practical-guide-to-broken-authorization-23759c8d879b?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/23759c8d879b</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Thu, 29 Oct 2026 23:56:35 GMT</pubDate>
            <atom:updated>2026-10-29T23:56:35.272Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Understanding vertical and horizontal privilege escalation, IDOR, and common access control weaknesses through PortSwigger Web Security Academy.</em></p><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*e_ZgThORZxgKs-k-ALMbZA.jpeg" /></figure><p>Access control is one of the most important security mechanisms in modern web applications. It determines what authenticated users are allowed to access and which actions they can perform.</p><p>However, authentication does not automatically mean authorization. A user may successfully log in to an application while still attempting to access resources or functionality they are not permitted to use.</p><p>When an application fails to enforce these restrictions correctly, it can introduce <strong>Broken Access Control</strong> vulnerabilities.</p><p>Depending on the application and the permissions involved, these vulnerabilities may expose sensitive information, allow unauthorized modifications, or enable privilege escalation.</p><p>In this article, we will explore the fundamental concepts of access control, common vulnerability patterns, testing methodologies, and recommended security practices.</p><h3>1. Authentication vs. Authorization</h3><p>Before exploring access control vulnerabilities, it is important to understand three related concepts.</p><ul><li><strong>Authentication:</strong> Verifies the identity of a user.</li><li><strong>Session management:</strong> Maintains the user’s authenticated state across requests.</li><li><strong>Authorization:</strong> Determines which resources and actions the user is permitted to access.</li></ul><p>For example, logging in successfully proves that a user has authenticated. It does not mean that the user is authorized to access an administrator’s dashboard.</p><p>A secure application must verify permissions whenever a user attempts to access a protected resource or perform a sensitive operation.</p><h3>2. Types of Access Control</h3><h3>Vertical Access Control</h3><p>Vertical access control restricts functionality according to privilege levels or user roles.</p><p>For example, an administrator may be allowed to manage user accounts, while a regular user can only manage their own profile.</p><p><strong>Vertical privilege escalation</strong> occurs when a user gains access to functionality intended for a more privileged role.</p><h3>Horizontal Access Control</h3><p>Horizontal access control restricts access to resources belonging to individual users.</p><p>For example, a customer should be able to view their own orders but should not be able to access another customer’s private order history.</p><p><strong>Horizontal privilege escalation</strong> occurs when a user accesses another user’s resources without obtaining a higher privilege level.</p><h3>Context-Dependent Access Control</h3><p>Some applications restrict actions according to the current state of a workflow.</p><p>For example, an application may allow a customer to modify an order before confirmation but prevent changes after the order has been finalized.</p><p>A vulnerability occurs when an application fails to enforce these restrictions consistently.</p><h3>3. Common Access Control Vulnerabilities</h3><h3>3.1 Unprotected Administrative Functionality</h3><p>Administrative pages are often designed to be accessible only to privileged users.</p><p>Consider an endpoint such as:</p><p><a href="https://example.com/admin">https://example.com/admin</a></p><p>If the application does not verify the current user’s permissions, an ordinary user might access administrative functionality simply by requesting the endpoint directly.</p><p>Removing an administrative link from the user interface does not prevent direct access to the underlying resource.</p><p>The server must independently enforce the appropriate permissions.</p><h3>3.2 Security Through Obscurity</h3><p>Some applications attempt to protect administrative functionality by using difficult-to-guess URLs.</p><p>For example:</p><p><a href="https://example.com/administrator-panel-x7k29">https://example.com/administrator-panel-x7k29</a></p><p>Although an obscure URL may make discovery more difficult, it does not provide reliable authorization.</p><p>If the URL becomes known, the application must still prevent unauthorized users from accessing the resource.</p><p><strong>Key takeaway:</strong> Hiding functionality is not the same as securing it.</p><h3>3.3 Parameter-Based Access Control</h3><p>Applications sometimes use request parameters or cookies to represent user roles and permissions.</p><p>For example:</p><p>GET /account?role=user</p><p>A poorly designed application may trust client-controlled information when deciding whether to grant access to privileged functionality.</p><p>If the server relies on such values without verifying the user’s actual permissions, the authorization mechanism may be bypassed.</p><p>Similar weaknesses can involve cookies, hidden form fields, and JSON request properties.</p><p>The fundamental problem is trusting information supplied by the client instead of enforcing authorization using trusted server-side data.</p><h3>3.4 Insecure Direct Object References (IDOR)</h3><p>An Insecure Direct Object Reference occurs when an application uses a user-controlled identifier to retrieve an object without correctly checking whether the current user is authorized to access it.</p><p>Consider this request:</p><p>GET /account?id=1001</p><p>The application uses the identifier to select an account.</p><p>If it checks only whether the account exists, rather than whether the current user is allowed to access it, private information may be exposed.</p><p>IDOR vulnerabilities can affect user profiles, invoices, documents, private messages, orders, and API resources.</p><p>The identifier does not have to be numeric. UUIDs and other identifiers can also be involved.</p><p><strong>The essential issue is missing authorization, not the predictability of the identifier.</strong></p><h3>3.5 Horizontal and Vertical Privilege Escalation</h3><p>These two vulnerability classes describe different authorization failures.</p><p>Horizontal escalation occurs when a user accesses resources belonging to another user at the same privilege level.</p><p>Vertical escalation occurs when a user obtains access to functionality associated with a higher privilege level.</p><p>In some cases, a horizontal access control flaw can expose information that contributes to a more serious privilege escalation.</p><h3>3.6 URL-Based Access Control Bypass</h3><p>Web applications may use reverse proxies, web servers, and application frameworks to process requests.</p><p>If these components interpret a URL differently, access restrictions may not be applied consistently.</p><p>Some environments recognize headers such as X-Original-URL or X-Rewrite-URL. When routing and authorization logic disagree about the effective request path, protected resources may become accessible.</p><p>The underlying problem is inconsistent request interpretation between application components.</p><h3>3.7 HTTP Method-Based Access Control Bypass</h3><p>Applications support different HTTP methods, including GET, POST, PUT, PATCH, and DELETE.</p><p>A poorly implemented authorization mechanism may restrict an operation when one method is used but fail to enforce the same restriction for another accepted method.</p><p>Authorization should apply to the underlying action, regardless of the HTTP method used to invoke it.</p><h3>3.8 Referer-Based Access Control</h3><p>The HTTP Referer header can indicate the page from which a request originated.</p><p>However, this header can be manipulated by a client and should not be treated as proof of authorization.</p><p>If an application grants access to a sensitive operation based only on the presence of a particular Referer value, the restriction may be bypassed.</p><p>Authorization decisions must rely on trusted identity and permission checks.</p><h3>3.9 Multi-Step Workflow Vulnerabilities</h3><p>Some sensitive operations require several steps.</p><p>For example:</p><ol><li>Opening a form.</li><li>Submitting a change.</li><li>Confirming the operation.</li></ol><p>An application may verify permissions during the first step but fail to repeat the necessary checks during a later step.</p><p>If the final operation can be reached independently, the workflow may allow unauthorized actions.</p><p>Every sensitive server-side operation must enforce its own authorization requirements.</p><h3>4. Testing Access Control with Burp Suite</h3><p>Burp Suite is useful for examining HTTP requests and evaluating how an application enforces permissions.</p><h3>Step 1: Map the Application</h3><p>Identify important pages, API endpoints, user roles, and sensitive operations.</p><p>Determine which actions should be available to regular users and which should be restricted to administrators.</p><h3>Step 2: Inspect HTTP Requests</h3><p>Use Burp Suite Proxy and HTTP history to examine requests and responses.</p><p>Pay attention to:</p><ul><li>URL paths and query parameters.</li><li>Cookies and authorization headers.</li><li>HTTP methods.</li><li>JSON request bodies.</li><li>Identifiers associated with individual resources.</li></ul><p>These components help reveal how the application identifies resources and processes actions.</p><h3>Step 3: Compare User Permissions</h3><p>Where authorized test accounts are available, compare the behavior of users with different privilege levels.</p><p>Check whether the server correctly enforces the expected restrictions rather than relying on the user interface.</p><h3>Step 4: Examine Resource Ownership</h3><p>Review requests that retrieve or modify user-specific resources.</p><p>Determine whether the server verifies that the current user owns the requested object or has another explicit permission to access it.</p><h3>Step 5: Review Sensitive Workflows</h3><p>Examine multi-step operations and verify that authorization checks are consistently enforced throughout the workflow.</p><p>Also consider whether supported HTTP methods and alternate application routes apply the same security restrictions.</p><h3>Step 6: Confirm the Vulnerability</h3><p>A suspected issue should be validated using a controlled test account and an authorized, harmless test.</p><p>Record the affected endpoint, expected behavior, actual behavior, and demonstrated impact.</p><p>A successful HTTP response alone does not prove a vulnerability. The evidence must demonstrate that an unauthorized resource or operation was actually accessible.</p><h3>5. Security Impact</h3><p>The impact of a broken access control vulnerability depends on the permissions involved and the sensitivity of the affected resources.</p><p>Potential consequences include:</p><ul><li>Unauthorized disclosure of private information.</li><li>Access to another user’s account records.</li><li>Unauthorized modification or deletion of data.</li><li>Exposure of administrative functionality.</li><li>Privilege escalation.</li><li>Compromise of confidentiality and data integrity.</li></ul><p>Not every access control issue has the same severity. Risk should be evaluated according to the demonstrated impact and realistic exploitability.</p><h3>6. Prevention and Mitigation</h3><h3>Enforce Authorization on the Server</h3><p>Every sensitive request must be checked against the authenticated user’s permissions before the requested operation is performed.</p><h3>Apply Deny-by-Default</h3><p>Access should be denied unless the application explicitly determines that the request is authorized.</p><h3>Verify Resource Ownership</h3><p>When users request individual records, verify that they own those records or have an appropriate permission to access them.</p><h3>Avoid Trusting Client-Controlled Roles</h3><p>Do not treat query parameters, hidden fields, or editable cookies as authoritative proof of a user’s privileges.</p><h3>Centralize Authorization Logic</h3><p>Use consistent authorization mechanisms across application endpoints to reduce the risk of individual routes implementing weaker checks.</p><h3>Validate Every Sensitive Operation</h3><p>Enforce authorization for API endpoints, administrative actions, and every relevant stage of multi-step workflows.</p><h3>Test Different User Roles</h3><p>Perform regular security testing with accounts representing different privilege levels. Verify both allowed and denied operations.</p><h3>Monitor Security-Relevant Events</h3><p>Log appropriate authorization failures and sensitive administrative actions without unnecessarily recording secrets or session tokens.</p><h3>7. Key Lessons</h3><p>Working through access control concepts highlights several important principles:</p><ol><li>Authentication and authorization solve different security problems.</li><li>Hidden URLs do not replace proper permission checks.</li><li>IDOR vulnerabilities arise when access to an object is not correctly authorized.</li><li>Vertical and horizontal privilege escalation affect different permission boundaries.</li><li>Client-controlled values and headers should not determine authorization by themselves.</li><li>Every sensitive endpoint must enforce the intended permissions.</li><li>Security testing must verify actual unauthorized access, not simply successful HTTP responses.</li></ol><h3>Conclusion</h3><p>Broken access control is a significant web application security risk because it allows users to perform actions or access resources beyond their intended permissions.</p><p>Understanding vertical and horizontal privilege escalation, IDOR, URL-based restrictions, and workflow weaknesses provides a strong foundation for identifying these vulnerabilities.</p><p>Using Burp Suite to inspect requests, compare user roles, and validate authorization decisions can help security testers assess whether an application enforces its intended security boundaries.</p><p>Ultimately, effective access control depends on consistent server-side authorization, explicit permission checks, and systematic testing.</p><h3>References</h3><ul><li><a href="https://portswigger.net/web-security/access-control">PortSwigger Web Security Academy — Access Control</a></li><li><a href="https://owasp.org/Top10/A01_2021-Broken_Access_Control/">OWASP Top 10 — Broken Access Control</a></li><li><a href="https://portswigger.net/kb/issues/00100850_broken-access-control">PortSwigger Web Security Knowledge Base — Broken Access Control</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23759c8d879b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Injection]]></title>
            <link>https://medium.com/@xalpha032/sql-injection-b80288883fe7?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b80288883fe7</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Fri, 09 Oct 2026 17:26:06 GMT</pubDate>
            <atom:updated>2026-10-09T17:26:06.322Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL Injection</p><h3>1. Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9gcHVZPSvLzOB_-OvOrBQ.jpeg" /></figure><p>SQL Injection (SQLi) is a web application vulnerability that occurs when an application incorporates user-controlled input into SQL queries without handling it safely.</p><p>SQL queries allow applications to interact with databases. When input is processed incorrectly, it may change the logic of a query and cause the application to behave in unintended ways.</p><p>Depending on the vulnerability and database permissions, SQL injection may allow unauthorized data access, authentication bypass, or modification of database records.</p><p>This writeup covers the major concepts in the SQL Injection learning path from PortSwigger Web Security Academy, including detection, UNION attacks, blind SQL injection, database identification, and prevention.</p><p><strong>Learning resource:</strong> <a href="https://portswigger.net/web-security/learning-paths/sql-injection">PortSwigger SQL Injection Learning Path</a></p><h3>2. Understanding SQL Injection</h3><p>Consider a simple SQL query used to retrieve products from a database:</p><pre>SELECT * FROM products<br>WHERE category = &#39;Books&#39;;</pre><p>The application returns products belonging to the Books category.</p><p>A vulnerability may occur when an application constructs SQL queries by concatenating user input directly into a query string.</p><p>The core problem is that the database may interpret part of the input as SQL syntax instead of treating the entire input as data.</p><p>The important distinction is:</p><ul><li><strong>Safe handling:</strong> User input is supplied as a parameter.</li><li><strong>Unsafe handling:</strong> User input changes the structure or logic of the SQL statement.</li></ul><p>SQL injection is therefore primarily a problem of how applications construct and execute database queries.</p><h3>3. Detecting SQL Injection Vulnerabilities</h3><p>The first step in testing for SQL injection is identifying inputs that may influence database queries.</p><p>Potential entry points include:</p><ul><li>URL query parameters</li><li>Search fields</li><li>Login forms</li><li>Product filters</li><li>Cookies</li><li>HTTP headers</li><li>JSON and XML request bodies</li></ul><h3>Testing for unusual behavior</h3><p>A tester can compare a normal request with carefully controlled test inputs.</p><p>For example, a single quote character may reveal an error if the application handles SQL strings incorrectly.</p><p>However, an error alone does not prove that SQL injection exists.</p><p>Look for repeatable differences such as:</p><ul><li>Database-related error messages</li><li>Changes in returned content</li><li>Unexpected HTTP status codes</li><li>Different responses to logically different conditions</li><li>Consistent response delays</li></ul><p>A useful methodology is to record a baseline request, change one input at a time, and compare the responses.</p><h3>SQL injection in different parts of a query</h3><p>SQL injection is not limited to string values in a WHERE clause. Depending on how an application constructs its queries, user input may affect other parts of a statement, including sorting expressions or other query components.</p><p>The appropriate testing method depends on the context in which the input is used.</p><h3>4. Retrieving Hidden Data</h3><p>Applications sometimes use SQL queries to filter records according to user-selected categories or other parameters.</p><p>For example:</p><pre>SELECT * FROM products<br>WHERE category = &#39;Books&#39;<br>AND visible = TRUE;</pre><p>The application may intend to show only products that belong to a particular category and are marked as visible.</p><p>If the query is vulnerable, its logic may be altered so that records normally hidden from users are returned.</p><p>The security impact depends on the query, the application, and the database permissions.</p><p><strong>Key lesson:</strong> A filter in the user interface is not a reliable security boundary unless access to the underlying data is also properly controlled.</p><h3>5. Subverting Application Logic</h3><p>SQL injection can also affect application logic.</p><p>For example, an application might check credentials with a query conceptually similar to:</p><pre>SELECT * FROM users<br>WHERE username = ?<br>AND password = ?;</pre><p>If the application constructs this query unsafely, an attacker may be able to interfere with the conditions used for authentication.</p><p>This can potentially lead to authentication bypass.</p><p>The key issue is not the appearance of the login form. It is whether the server safely constructs and evaluates the database query.</p><p>Applications should use parameterized queries and established authentication mechanisms instead of building SQL statements from untrusted strings.</p><h3>6. SQL Injection UNION Attacks</h3><p>The SQL UNION operator combines the results of two or more SELECT queries.</p><p>For example:</p><pre>SELECT name, category FROM products<br>UNION<br>SELECT name, category FROM archived_products;</pre><p>This combines rows from both queries into a single result set.</p><p>In a vulnerable application, a UNION-based SQL injection may allow the results of another query to appear in the application’s response.</p><h3>Requirements for UNION</h3><p>The queries combined with UNION generally need to satisfy two important requirements:</p><ol><li>Both queries must return the same number of columns.</li><li>Corresponding columns must have compatible data types.</li></ol><p>These requirements explain why a UNION attack cannot always be constructed immediately.</p><h3>Determining the number of columns</h3><p>The number of columns returned by the original query is important because a compatible UNION query must return the same number.</p><p>In an authorized lab, this can be investigated by observing how controlled test queries affect the response.</p><h3>Finding a column with a suitable data type</h3><p>Even when the column count is known, the data types must be compatible.</p><p>For example, a column containing text may be suitable for displaying a username, whereas a numeric column may not accept an arbitrary text value.</p><p>The general learning process is to establish the column count, understand the relevant data types, and observe how the application presents query results.</p><h3>7. Retrieving Data from Other Tables</h3><p>A database often contains multiple tables that serve different purposes.</p><p>For example:</p><p>TablePurposeproductsProduct informationusersUser accountsordersCustomer orderscategoriesProduct categories</p><p>A vulnerable query may expose data from tables that the application did not intend to display through that page.</p><p>The potential impact can include unauthorized access to personal or business information.</p><p>This is one reason database permissions should be restricted to the minimum required for each application component.</p><h3>8. Retrieving Multiple Values from One Column</h3><p>Sometimes the original query returns only one suitable column.</p><p>In certain database systems, string concatenation can combine several values into a single string.</p><p>For example, conceptually:</p><pre>username + separator + email</pre><p>The separator helps distinguish one value from another when they appear together.</p><p>The exact concatenation syntax varies between database systems. Therefore, identifying the database type can be important when studying SQL injection behavior.</p><h3>9. Examining the Database</h3><p>Understanding the database structure can help explain how an application stores and retrieves information.</p><p>Two important questions are:</p><ul><li>Which database management system is being used?</li><li>Which tables and columns exist in the database?</li></ul><h3>Identifying the database type</h3><p>Different database systems have their own syntax and built-in functions.</p><p>Common examples include:</p><ul><li>MySQL</li><li>Microsoft SQL Server</li><li>PostgreSQL</li><li>Oracle Database</li></ul><p>Differences in syntax can help identify the database system when testing a controlled lab.</p><h3>Database metadata</h3><p>Database systems often provide metadata that describes the database structure.</p><p>Depending on the system and permissions, this metadata may reveal information about tables, columns, and other database objects.</p><p>Understanding database metadata is useful for both database administration and security testing.</p><p><strong>Important:</strong> Database-specific syntax is not universal. A query that works on one database may fail on another.</p><h3>10. Blind SQL Injection</h3><p>Blind SQL injection occurs when an application is vulnerable to SQL injection but does not directly return the results of the relevant query or detailed database errors.</p><p>The application may appear to respond normally even when its database query has been affected.</p><p>In this situation, testers must rely on indirect evidence.</p><p>Common forms include:</p><ul><li>Boolean-based testing</li><li>Conditional error behavior</li><li>Time-based behavior</li><li>Out-of-band interactions</li></ul><h3>Boolean-based behavior</h3><p>A boolean condition evaluates to either true or false.</p><p>A tester can compare responses to controlled conditions and determine whether the application’s behavior consistently reflects the result.</p><p>For example, the application might return different content depending on whether a condition evaluates to true or false.</p><p>Consistent differences can provide evidence of a SQL injection vulnerability.</p><h3>Conditional errors</h3><p>Some applications handle database errors differently depending on what happens during query execution.</p><p>If a controlled condition consistently causes a particular error behavior, that difference may reveal information about the query.</p><p>However, errors should be interpreted carefully because unrelated application failures can produce similar symptoms.</p><h3>Time-based behavior</h3><p>Some database expressions can cause a query to pause.</p><p>If an application is vulnerable, a controlled test may cause a repeatable delay even when the response contains no useful database output.</p><p>A single slow request is not sufficient evidence. Network latency, server load, and other factors can also affect response times.</p><h3>Out-of-band testing</h3><p>Out-of-band application security testing, or OAST, uses a separate communication channel to detect certain interactions.</p><p>This may help identify vulnerabilities when the application’s normal HTTP response does not reveal what happened in the database.</p><p>The observed interaction must be correlated with the controlled test before drawing conclusions.</p><h3>11. SQL Injection in Different Contexts</h3><p>SQL injection can occur in inputs other than ordinary URL parameters.</p><p>For example, an application might accept structured data in JSON or XML and then use that data to construct a SQL query.</p><p>The request format does not automatically make the application safe.</p><p>Security testers should understand how the server parses the request and how the resulting values are used in database queries.</p><h3>Encoding and filtering</h3><p>Applications may decode or transform incoming data before processing it.</p><p>For this reason, security testing must consider how input is handled across the entire processing chain.</p><p>Simple keyword filtering is not a dependable defense against SQL injection. Correct query construction is much more important than attempting to block individual SQL keywords.</p><h3>12. Second-Order SQL Injection</h3><p>Second-order SQL injection occurs when input is stored first and later used unsafely in a SQL query.</p><p>The initial action may appear harmless because the input is only saved.</p><p>The vulnerability becomes relevant when another part of the application retrieves that stored value and incorporates it into a new query without proper parameterization.</p><p>Conceptually:</p><pre>User input<br>    ↓<br>Stored in the database<br>    ↓<br>Retrieved later<br>    ↓<br>Used unsafely in a new SQL query<br>    ↓<br>Unexpected query behavior</pre><p>This illustrates why security testing should examine how data moves through an application, not only what happens when a form is submitted.</p><p>Input that was previously stored should still be treated as untrusted data.</p><h3>13. How Burp Suite Helps with SQL Injection Testing</h3><p>Burp Suite provides useful tools for inspecting and comparing HTTP traffic during authorized security assessments.</p><h3>Proxy</h3><p>Burp Proxy allows testers to inspect requests and responses between the browser and the application.</p><p>It helps identify parameters, cookies, headers, and request-body fields.</p><h3>HTTP history</h3><p>HTTP history records requests and responses, making it easier to identify which input was submitted and what the application returned.</p><h3>Repeater</h3><p>Repeater allows a captured request to be sent again after controlled modifications.</p><p>This is useful for comparing a baseline request with a test request.</p><p>A careful workflow is:</p><ol><li>Capture a normal request.</li><li>Send it to Repeater.</li><li>Change one input.</li><li>Send the request again.</li><li>Compare the response status, body, and timing.</li><li>Repeat to confirm that the behavior is consistent.</li></ol><p>Changing one variable at a time makes the results easier to interpret.</p><h3>14. Preventing SQL Injection</h3><p>The most important defense against SQL injection is to ensure that user input cannot change the intended SQL query structure.</p><h3>Parameterized queries</h3><p>Parameterized queries separate SQL code from user-supplied values.</p><p>For example, in Java:</p><pre>String query =<br>    &quot;SELECT * FROM products WHERE category = ?&quot;;</pre><pre>PreparedStatement statement =<br>    connection.prepareStatement(query);</pre><pre>statement.setString(1, category);</pre><p>The category is passed as a parameter instead of being concatenated directly into the query string.</p><p>This helps the database treat the value as data rather than executable SQL syntax.</p><h3>Additional defenses</h3><ul><li>Use parameterized queries or prepared statements.</li><li>Avoid concatenating untrusted input into SQL statements.</li><li>Use allowlists for dynamic identifiers such as table names or sort fields.</li><li>Apply least-privilege permissions to database accounts.</li><li>Avoid displaying detailed database errors to end users.</li><li>Test applications regularly for security vulnerabilities.</li><li>Use secure frameworks and database libraries.</li><li>Review stored values when they are later used in queries.</li></ul><p>Input validation can provide additional protection, but it should not replace parameterized queries.</p><h3>15. Common Mistakes During SQL Injection Testing</h3><h3>Assuming every error proves a vulnerability</h3><p>An error may result from unrelated application logic. Additional evidence is needed.</p><h3>Ignoring the original response</h3><p>A baseline response provides a reference for understanding whether the test changed the application’s behavior.</p><h3>Testing only URL parameters</h3><p>Cookies, headers, JSON fields, and other inputs may also influence database queries.</p><h3>Relying on a single timing result</h3><p>One delayed response may be caused by normal performance variations. Repeatable comparisons are more reliable.</p><h3>Forgetting database differences</h3><p>Different database systems support different functions and syntax.</p><h3>Confusing detection with confirmation</h3><p>A suspicious response is a clue. A well-supported finding requires repeatable evidence that connects the input to the unexpected query behavior.</p><h3>16. SQL Injection Testing Workflow</h3><p>The following workflow summarizes the main concepts:</p><pre>Understand the application<br>          ↓<br>Identify database-related inputs<br>          ↓<br>Record a baseline request<br>          ↓<br>Test input handling<br>          ↓<br>Compare application responses<br>          ↓<br>Investigate relevant SQL behavior<br>          ↓<br>Confirm the finding<br>          ↓<br>Document impact and evidence<br>          ↓<br>Recommend remediation</pre><p>Testing should remain within the scope of an authorized lab or security assessment.</p><h3>17. Key Takeaways</h3><p>The major lessons from the SQL Injection learning path are:</p><ul><li>SQL injection happens when user input can interfere with SQL query construction.</li><li>A vulnerability may affect data retrieval, authentication, or other application behavior.</li><li>UNION attacks depend on compatible column counts and data types.</li><li>Database metadata can describe tables and columns.</li><li>Blind SQL injection relies on indirect observations rather than directly returned query results.</li><li>Boolean, conditional-error, time-based, and out-of-band techniques provide different forms of evidence.</li><li>Second-order SQL injection can occur when stored input is used unsafely later.</li><li>Burp Suite helps inspect requests and compare responses.</li><li>Parameterized queries are a primary defense against SQL injection.</li><li>Reliable testing requires controlled experiments, repeatable results, and careful interpretation.</li></ul><h3>Conclusion</h3><p>The SQL Injection learning path provides a foundation for understanding how web applications interact with databases and how unsafe query construction can introduce serious vulnerabilities.</p><p>The most important skill is learning to reason about application behavior: identify where input enters the system, understand how the application processes it, compare controlled responses, and distinguish reliable evidence from false positives.</p><p>For anyone learning web penetration testing, SQL injection is an important topic because it combines HTTP analysis, SQL fundamentals, application logic, and secure coding principles.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b80288883fe7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Metasploit: Exploitation — TryHackMe Writeup]]></title>
            <link>https://medium.com/@xalpha032/metasploit-exploitation-tryhackme-writeup-867386437f87?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/867386437f87</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 11:37:31 GMT</pubDate>
            <atom:updated>2026-09-23T11:37:31.674Z</atom:updated>
            <content:encoded><![CDATA[<p>Metasploit: Exploitation — TryHackMe Writeup</p><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*FmuU80nTiSVd3m4lsuZ-5A.jpeg" /></figure><p>After learning the fundamentals of the Metasploit Framework, the next step is understanding how Metasploit can be used during a penetration testing workflow.</p><p>In this TryHackMe room, I explored how Metasploit can be used for:</p><ul><li>Network and service scanning</li><li>Managing information with the Metasploit database</li><li>Vulnerability scanning</li><li>Exploiting vulnerable services</li><li>Generating payloads with msfvenom</li><li>Establishing Meterpreter sessions</li></ul><p>All practical activities in this writeup are performed inside the authorized TryHackMe lab environment.</p><h3>1. Starting Metasploit</h3><p>The main interface of Metasploit is msfconsole.</p><pre>msfconsole</pre><p>After launching it, the prompt becomes:</p><pre>msf6 &gt;</pre><p>From here, we can search for modules, perform scans, configure exploits, and manage sessions.</p><h3>2. Scanning with Metasploit</h3><p>Metasploit includes several auxiliary modules that can be used for reconnaissance and service enumeration.</p><p>The general workflow is:</p><pre>Search for a scanner<br>        ↓<br>Select the module<br>        ↓<br>Configure the target<br>        ↓<br>Run the scanner<br>        ↓<br>Analyse the results</pre><p>For example:</p><pre>search scanner</pre><p>This searches for available scanning modules.</p><p>After finding an appropriate module:</p><pre>use &lt;scanner_module&gt;</pre><p>Then we can inspect its options:</p><pre>show options</pre><p>And configure the target:</p><pre>set RHOSTS &lt;LAB_TARGET_IP&gt;</pre><p>Finally:</p><pre>run</pre><p>The purpose of this stage is to identify services and information that may later be useful during vulnerability assessment.</p><h3>3. The Metasploit Database</h3><p>Metasploit includes a database feature that helps organize information collected during a penetration test.</p><p>This becomes especially useful when working with multiple hosts and services.</p><p>The database can store information such as:</p><ul><li>Hosts</li><li>Services</li><li>Credentials</li><li>Vulnerabilities</li><li>Scan results</li></ul><p>Before using database features, the database status can be checked with:</p><pre>db_status</pre><p>A properly configured database allows Metasploit to keep information from different activities in one place.</p><h3>4. Working with Hosts</h3><p>After scanning a target, information can be stored in the Metasploit database.</p><p>To display discovered hosts:</p><pre>hosts</pre><p>This can provide information about systems that have been identified during the assessment.</p><p>For example, a host entry may contain information such as:</p><pre>Address<br>Hostname<br>Operating System<br>Purpose</pre><p>This is useful when dealing with larger lab environments.</p><h3>5. Working with Services</h3><p>The services command can be used to display discovered services.</p><pre>services</pre><p>The output can contain information such as:</p><ul><li>IP address</li><li>Port</li><li>Protocol</li><li>Service</li><li>Version</li></ul><p>For example:</p><pre>PORT<br>80/tcp<br>22/tcp<br>445/tcp</pre><p>Knowing which services are available helps determine which vulnerabilities or exploits may be relevant.</p><h3>6. Vulnerability Scanning</h3><p>Metasploit can also be used to perform vulnerability scanning.</p><p>The general idea is:</p><pre>Discover services<br>       ↓<br>Identify versions<br>       ↓<br>Search for vulnerabilities<br>       ↓<br>Select an appropriate module<br>       ↓<br>Validate the target</pre><p>For example, after discovering a service, we can search Metasploit for related modules:</p><pre>search &lt;service&gt;</pre><p>The search results may contain auxiliary scanners, exploits, or other modules.</p><h3>7. Finding an Exploit</h3><p>Once a vulnerable service has been identified, Metasploit can be searched for an appropriate exploit.</p><p>The basic syntax is:</p><pre>search &lt;keyword&gt;</pre><p>For example:</p><pre>search smb</pre><p>The results can contain different module types.</p><p>Before using an exploit, it is important to understand:</p><ul><li>Which vulnerability it targets</li><li>Which operating system it supports</li><li>Which service/version it affects</li><li>Which options are required</li><li>Which payloads are compatible</li></ul><h3>8. Selecting an Exploit</h3><p>After identifying an appropriate module:</p><pre>use &lt;exploit_module&gt;</pre><p>Then inspect the module:</p><pre>info</pre><p>And check its configuration:</p><pre>show options</pre><p>The required parameters should be configured before execution.</p><p>For example:</p><pre>set RHOSTS &lt;LAB_TARGET_IP&gt;</pre><p>Depending on the exploit, additional parameters may be required.</p><h3>9. Checking the Exploit</h3><p>Some Metasploit modules support:</p><pre>check</pre><p>This attempts to determine whether the target is vulnerable without performing the full exploitation process.</p><p>This can be useful because it provides an additional validation step before running an exploit.</p><p>The workflow becomes:</p><pre>Select exploit<br>      ↓<br>Configure options<br>      ↓<br>check<br>      ↓<br>exploit</pre><h3>10. Exploitation</h3><p>Once the target and required parameters are configured, an exploit can be launched with:</p><pre>run</pre><p>or:</p><pre>exploit</pre><p>The exact result depends on the exploit and payload being used.</p><p>If successful, Metasploit may establish a session with the target.</p><h3>11. Understanding Payloads</h3><p>An exploit and a payload are different concepts.</p><h3>Exploit</h3><p>The exploit takes advantage of a vulnerability.</p><h3>Payload</h3><p>The payload defines what happens after successful exploitation.</p><p>Conceptually:</p><pre>Vulnerability<br>      ↓<br>   Exploit<br>      ↓<br>   Payload<br>      ↓<br>   Session</pre><p>This distinction is important when working with Metasploit.</p><h3>12. Meterpreter</h3><p>One of the most important payload/session types in Metasploit is <strong>Meterpreter</strong>.</p><p>Meterpreter provides an interactive environment for authorized post-exploitation activities.</p><p>A successful Meterpreter session may look similar to:</p><pre>meterpreter &gt;</pre><p>The session can then be managed through Metasploit.</p><p>To see available sessions:</p><pre>sessions</pre><p>To interact with a particular session:</p><pre>sessions -i &lt;SESSION_ID&gt;</pre><h3>13. Backgrounding a Session</h3><p>A session does not necessarily need to be closed when returning to the Metasploit console.</p><p>You can background the current session with:</p><pre>background</pre><p>The session remains available.</p><p>You can later list sessions:</p><pre>sessions</pre><p>and interact with one again:</p><pre>sessions -i &lt;SESSION_ID&gt;</pre><p>This is useful when working with multiple sessions.</p><h3>14. Msfvenom</h3><p>Another important component covered in this room is msfvenom.</p><p>msfvenom is a Metasploit tool used to generate payloads.</p><p>Its general structure includes:</p><pre>msfvenom -p &lt;PAYLOAD&gt; &lt;OPTIONS&gt;</pre><p>The exact payload and configuration depend on the authorized lab scenario.</p><p>A payload may require parameters such as:</p><pre>LHOST<br>LPORT</pre><p>These determine where a connection should be directed in the lab environment.</p><h3>15. Payload Generation Workflow</h3><p>The general workflow for msfvenom is:</p><pre>Choose a payload<br>       ↓<br>Configure required parameters<br>       ↓<br>Choose an output format<br>       ↓<br>Generate the payload<br>       ↓<br>Use it in the authorized lab<br>       ↓<br>Establish a session</pre><p>This demonstrates how Metasploit can be used not only to exploit existing vulnerabilities but also to generate payloads for controlled testing environments.</p><h3>16. Meterpreter Session Workflow</h3><p>A simplified workflow looks like this:</p><pre>Generate payload<br>       ↓<br>Prepare the lab listener<br>       ↓<br>Execute payload in the lab<br>       ↓<br>Receive connection<br>       ↓<br>Meterpreter session</pre><p>Once the session is established, Metasploit can manage it through the session interface.</p><h3>17. Why the Database Is Useful</h3><p>The Metasploit database becomes especially valuable when a penetration test involves multiple systems.</p><p>Instead of keeping information separately, Metasploit can organize discovered information.</p><p>For example:</p><pre>Host<br> ├── Services<br> ├── Ports<br> ├── Vulnerabilities<br> └── Other collected information</pre><p>This makes it easier to understand the overall attack surface of a lab environment.</p><h3>18. Metasploit Exploitation Workflow</h3><p>The complete workflow covered in this room can be summarized as:</p><pre>1. Scan the target<br>        ↓<br>2. Identify services<br>        ↓<br>3. Store information in the database<br>        ↓<br>4. Identify potential vulnerabilities<br>        ↓<br>5. Search for an appropriate module<br>        ↓<br>6. Configure the exploit<br>        ↓<br>7. Validate when possible<br>        ↓<br>8. Execute the exploit<br>        ↓<br>9. Obtain and manage a session</pre><p>This workflow is much more important than memorizing individual commands.</p><h3>19. Important Commands</h3><p>CommandPurposemsfconsoleStart Metasploitsearch &lt;term&gt;Search for modulesuse &lt;module&gt;Select a moduleinfoDisplay module informationshow optionsDisplay module optionsset &lt;option&gt; &lt;value&gt;Configure an optionunset &lt;option&gt;Remove an optioncheckCheck vulnerability when supportedrunExecute a moduleexploitLaunch an exploitdb_statusCheck database connectionhostsDisplay database hostsservicesDisplay discovered servicessessionsList active sessionssessions -i &lt;ID&gt;Interact with a sessionbackgroundBackground the current session</p><h3>20. Key Takeaways</h3><p>The main concepts I learned from this room are:</p><ul><li>Metasploit can perform network and service scanning.</li><li>The Metasploit database helps organize information from an assessment.</li><li>Services discovered during scanning can be used to identify potential vulnerabilities.</li><li>Metasploit provides exploit modules for many known vulnerabilities.</li><li>Exploits and payloads serve different purposes.</li><li>msfvenom can generate payloads.</li><li>Meterpreter provides an interactive session after successful exploitation.</li><li>Sessions can be managed directly from Metasploit.</li><li>A structured workflow is essential when using an exploitation framework.</li></ul><h3>Conclusion</h3><p>The <strong>Metasploit: Exploitation</strong> room builds on the fundamentals learned in the previous Metasploit room and introduces a more complete penetration testing workflow.</p><p>The most important concept is understanding how the different components connect:</p><pre>Scanning<br>   ↓<br>Enumeration<br>   ↓<br>Vulnerability Identification<br>   ↓<br>Exploit Selection<br>   ↓<br>Payload<br>   ↓<br>Session</pre><p>Learning this workflow provides a foundation for more advanced penetration testing concepts and helps explain how exploitation frameworks are used during authorized security assessments.</p><p>All exploitation techniques discussed here should only be practiced against systems where you have explicit permission, such as TryHackMe labs and other authorized environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=867386437f87" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Metasploit: Introduction — TryHackMe Writeup]]></title>
            <link>https://medium.com/@xalpha032/metasploit-introduction-tryhackme-writeup-ab2e392c62ed?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab2e392c62ed</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 00:08:53 GMT</pubDate>
            <atom:updated>2026-09-23T00:08:53.939Z</atom:updated>
            <content:encoded><![CDATA[<p>Metasploit: Introduction — TryHackMe Writeup</p><h3>Introduction</h3><p>Metasploit is one of the most widely used penetration testing frameworks. It provides a structured environment for security testing, including vulnerability research, scanning, exploitation, and post-exploitation.</p><p>In this TryHackMe room, I learned the fundamentals of the <strong>Metasploit Framework</strong>, including how to navigate msfconsole, understand different module types, search for modules, configure parameters, use payloads, and manage sessions.</p><p>All practical exploitation in this writeup is performed in the authorized TryHackMe lab environment.</p><h3>1. What is Metasploit?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUFCU41wtPi9l3MM_hIFjA.png" /></figure><p>Metasploit is an open-source penetration testing framework designed to help security professionals test vulnerabilities in controlled environments.</p><p>The main version covered in this room is <strong>Metasploit Framework</strong>, which is primarily operated through the command-line interface.</p><p>The main components include:</p><ul><li>msfconsole — the main Metasploit command-line interface</li><li>Modules — components designed for specific security-testing tasks</li><li>Payloads — code executed after successful exploitation</li><li>Auxiliary modules — scanners and other supporting tools</li><li>Post modules — modules used during post-exploitation</li><li>msfvenom — a standalone tool for generating payloads</li></ul><p>Metasploit can support several stages of a penetration test, from information gathering to post-exploitation.</p><h3>2. Vulnerability, Exploit and Payload</h3><p>Before working with Metasploit, it is important to understand three fundamental concepts.</p><h3>Vulnerability</h3><p>A <strong>vulnerability</strong> is a weakness or flaw in software, configuration, design, or logic.</p><p>For example, outdated software may contain a known vulnerability.</p><h3>Exploit</h3><p>An <strong>exploit</strong> is code or a technique that takes advantage of a vulnerability.</p><p>In simple terms:</p><pre>Vulnerability<br>      ↓<br>   Exploit<br>      ↓<br>Target behavior / access</pre><h3>Payload</h3><p>A <strong>payload</strong> is the code delivered or executed after an exploit successfully takes advantage of a vulnerability.</p><p>A simple way to remember the difference is:</p><pre>Vulnerability = The weakness</pre><pre>Exploit = The method used to take advantage of the weakness</pre><pre>Payload = What is executed after exploitation</pre><p>Understanding these three concepts is essential when working with Metasploit.</p><h3>3. Starting Metasploit</h3><p>Metasploit can be launched using:</p><pre>msfconsole</pre><p>After starting it, the prompt changes to something similar to:</p><pre>msf6 &gt;</pre><p>This is the main Metasploit console.</p><p>From here, we can search for modules, select modules, configure parameters, and execute them in the authorized lab environment.</p><h3>4. Metasploit Modules</h3><p>Metasploit is modular. Each module is designed for a particular task.</p><p>Some important module categories are:</p><h3>Auxiliary</h3><p>Auxiliary modules provide supporting functionality such as:</p><ul><li>Scanning</li><li>Enumeration</li><li>Crawling</li><li>Fuzzing</li></ul><p>Example:</p><pre>auxiliary/scanner/</pre><h3>Exploit</h3><p>Exploit modules contain code designed to take advantage of specific vulnerabilities.</p><p>Example:</p><pre>exploit/windows/smb/</pre><h3>Payload</h3><p>Payloads define what happens after successful exploitation.</p><p>Examples include shell-based payloads and other payload types.</p><h3>Post</h3><p>Post modules are used after gaining access to a target.</p><p>They can help with tasks such as information gathering and further assessment.</p><h3>Encoders</h3><p>Encoders can transform payload data into different representations. They are one of the module categories available in Metasploit.</p><h3>NOPs</h3><p>NOP modules provide no-operation instructions and are historically useful in certain exploitation techniques.</p><h3>5. Searching for Modules</h3><p>One of the most useful commands in Metasploit is:</p><pre>search</pre><p>For example, to search for modules related to Apache:</p><pre>search apache</pre><p>Metasploit will return matching modules.</p><p>You can then inspect a specific module before using it.</p><h3>6. Selecting a Module</h3><p>After finding a relevant module, the use command selects it.</p><p>Example:</p><pre>use auxiliary/scanner/ssh/ssh_login</pre><p>The prompt changes to show the selected context:</p><pre>msf6 auxiliary(scanner/ssh/ssh_login) &gt;</pre><p>This tells us which module is currently selected.</p><h3>7. Viewing Module Information</h3><p>Before configuring a module, it is useful to inspect it.</p><p>The command:</p><pre>info</pre><p>can display information about the selected module.</p><p>You can also use:</p><pre>show options</pre><p>This displays the parameters that can be configured.</p><h3>8. Important Metasploit Parameters</h3><p>Metasploit modules often require different parameters.</p><p>Some common ones are:</p><h3>RHOSTS</h3><p><strong>RHOSTS</strong> means Remote Hosts.</p><p>It identifies the target system or systems.</p><pre>set RHOSTS &lt;LAB_TARGET_IP&gt;</pre><h3>RPORT</h3><p><strong>RPORT</strong> means Remote Port.</p><p>It specifies the port of the service being tested.</p><pre>set RPORT &lt;LAB_PORT&gt;</pre><h3>LHOST</h3><p><strong>LHOST</strong> means Local Host.</p><p>It represents the IP address of the machine running Metasploit when a connection needs to return to the testing machine.</p><pre>set LHOST &lt;YOUR_LAB_IP&gt;</pre><h3>LPORT</h3><p><strong>LPORT</strong> means Local Port.</p><p>It specifies the local port used for the connection.</p><pre>set LPORT &lt;LAB_PORT&gt;</pre><h3>PAYLOAD</h3><p>The PAYLOAD parameter specifies the payload used by the exploit.</p><h3>9. Setting Parameters</h3><p>Metasploit uses the following syntax:</p><pre>set PARAMETER VALUE</pre><p>For example:</p><pre>set RHOSTS &lt;LAB_TARGET_IP&gt;</pre><p>After configuring the module, always check the settings with:</p><pre>show options</pre><p>This helps verify that the required parameters have been configured correctly.</p><h3>10. Clearing a Parameter</h3><p>If you want to remove a previously configured payload, you can use:</p><pre>unset PAYLOAD</pre><p>The unset command removes a configured value.</p><p>You can also clear all configured parameters with:</p><pre>unset all</pre><h3>11. Checking a Target</h3><p>Some Metasploit modules support:</p><pre>check</pre><p>The check command can determine whether the target appears vulnerable without actually launching the exploit.</p><p>This can be useful when validating a vulnerability before exploitation.</p><h3>12. Launching a Module</h3><p>Once the required parameters have been configured, the module can be executed with:</p><pre>run</pre><p>For exploit modules, another commonly used command is:</p><pre>exploit</pre><p>The room demonstrates the exploitation workflow using a vulnerable lab target.</p><p>The general process is:</p><pre>Find a module<br>      ↓<br>Select the module<br>      ↓<br>Configure parameters<br>      ↓<br>Check options<br>      ↓<br>Check vulnerability (if supported)<br>      ↓<br>Run the module</pre><h3>13. Sessions</h3><p>When an exploit successfully establishes communication with a target, Metasploit can create a <strong>session</strong>.</p><p>A session represents an active communication channel between Metasploit and the target.</p><p>You can view active sessions using:</p><pre>sessions</pre><p>A session can be moved to the background with:</p><pre>background</pre><p>or:</p><pre>CTRL + Z</pre><p>This returns you to the Metasploit console while keeping the session available.</p><h3>14. Understanding Metasploit Prompts</h3><p>It is important to recognize the different prompts.</p><h3>Normal Linux terminal</h3><pre>root@kali:~#</pre><p>This is your normal operating-system shell.</p><h3>Metasploit console</h3><pre>msf6 &gt;</pre><p>This means you are at the main Metasploit console.</p><h3>Module context</h3><pre>msf6 exploit(...) &gt;</pre><p>This means a specific module has been selected.</p><h3>Session shell</h3><p>Depending on the payload and target, you may receive a shell or another type of session.</p><p>Understanding the current prompt helps prevent mistakes when entering commands.</p><h3>15. Linux Commands Inside Metasploit</h3><p>Metasploit can also execute some operating-system commands.</p><p>For example:</p><pre>ls</pre><p>Metasploit can execute the command and display the result.</p><p>This is useful for interacting with the underlying system when appropriate.</p><h3>16. Single and Staged Payloads</h3><p>Metasploit supports different payload structures.</p><p>A <strong>single/inline payload</strong> contains the required functionality together.</p><p>A <strong>staged payload</strong> is divided into components:</p><pre>Stager<br>   ↓<br>Stage</pre><p>The stager establishes the communication channel and the stage provides the remaining functionality.</p><p>The room shows how payload names can indicate whether a payload is staged or single.</p><p>For example:</p><pre>generic/shell_reverse_tcp</pre><p>and:</p><pre>windows/x64/shell/reverse_tcp</pre><p>have different naming structures.</p><h3>17. The Exploitation Workflow</h3><p>The room summarizes the Metasploit workflow into three important stages:</p><pre>1. Find the appropriate exploit<br>          ↓<br>2. Configure the exploit<br>          ↓<br>3. Execute the exploit</pre><p>The important part is not simply memorizing commands.</p><p>You need to understand:</p><ul><li>What vulnerability you are testing</li><li>Why the module is relevant</li><li>Which parameters are required</li><li>What payload is being used</li><li>What type of session is expected</li></ul><h3>18. Key Commands Cheat Sheet</h3><p>CommandPurposemsfconsoleStart Metasploitsearch &lt;term&gt;Search for modulesuse &lt;module&gt;Select a moduleinfoDisplay module informationshow optionsDisplay module parametersset &lt;option&gt; &lt;value&gt;Configure a parameterunset &lt;option&gt;Remove a parameterunset allClear configured parameterscheckCheck vulnerability if supportedrunExecute a moduleexploitLaunch an exploitsessionsList active sessionsbackgroundBackground the current sessionhelpDisplay available commands</p><h3>19. What I Learned</h3><p>After completing this room, I understood the basic architecture and workflow of the Metasploit Framework.</p><p>The most important concepts I learned were:</p><ul><li>What Metasploit is</li><li>How msfconsole works</li><li>The difference between vulnerabilities, exploits, and payloads</li><li>The different Metasploit module categories</li><li>How to search for modules</li><li>How to select and inspect modules</li><li>How to configure parameters</li><li>The purpose of RHOSTS, RPORT, LHOST, and LPORT</li><li>How to check a target when a module supports check</li><li>How sessions work</li><li>How to background and manage sessions</li><li>The difference between staged and single payloads</li></ul><h3>Conclusion</h3><p>Metasploit is more than a collection of exploits. It provides a structured framework for conducting controlled security testing.</p><p>The most important lesson from this room is understanding the workflow:</p><pre>Identify a vulnerability<br>        ↓<br>Find a suitable module<br>        ↓<br>Configure the module<br>        ↓<br>Validate the configuration<br>        ↓<br>Execute in an authorized lab<br>        ↓<br>Manage the resulting session</pre><p>Learning these fundamentals provides a strong foundation for more advanced Metasploit topics, including vulnerability scanning, database management, Meterpreter, payload generation, and post-exploitation.</p><p>For me, this room was an important step toward understanding how exploitation frameworks fit into a penetration testing methodology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab2e392c62ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL Fundamentals — Complete Beginner Guide]]></title>
            <link>https://medium.com/@xalpha032/sql-fundamentals-complete-beginner-guide-330c01d4d68f?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/330c01d4d68f</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 13:28:44 GMT</pubDate>
            <atom:updated>2026-09-20T13:28:44.077Z</atom:updated>
            <content:encoded><![CDATA[<p>SQL Fundamentals — Complete Beginner Guide</p><h3>Introduction</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqBepaSWxhFS4XaFDynAzA.png" /></figure><p>Databases are one of the most important components of modern web applications.</p><p>Websites and applications use databases to store and manage information such as users, products, orders, messages, and authentication data.</p><p>For anyone learning web penetration testing, understanding databases and SQL is essential because many web applications rely on SQL queries to process user input.</p><p>This guide covers the fundamental concepts of databases, SQL, DBMS, database structure, CRUD operations, filtering, operators, functions, and relationships between tables.</p><h3>1. What is a Database?</h3><p>A <strong>database</strong> is an organized collection of data that can be stored, accessed, managed, and analyzed.</p><p>Databases are used in many types of applications, including:</p><ul><li>Authentication systems</li><li>Social media platforms</li><li>Streaming services</li><li>E-commerce websites</li><li>Banking systems</li><li>Content management systems</li><li>Web applications</li></ul><p>A simplified web application architecture looks like:</p><pre>User<br>  ↓<br>Web Application<br>  ↓<br>Database<br>  ↓<br>Stored Data</pre><p>For example, an e-commerce application might store:</p><pre>Users<br>Products<br>Orders<br>Payments<br>Addresses</pre><h3>2. Types of Databases</h3><p>There are two major categories worth understanding at the beginner level:</p><h3>Relational Databases — SQL</h3><p>Relational databases store structured data using tables.</p><p>A table consists of:</p><pre>Rows<br>Columns</pre><p>Examples include:</p><ul><li>MySQL</li><li>MariaDB</li><li>PostgreSQL</li><li>Oracle Database</li><li>Microsoft SQL Server</li><li>SQLite</li></ul><p>Relational databases are commonly used when data has clearly defined relationships and structures.</p><p>Examples:</p><pre>Users<br>Products<br>Orders<br>Customers<br>Transactions</pre><h3>Non-Relational Databases — NoSQL</h3><p>NoSQL databases do not necessarily use traditional tables, rows, and columns.</p><p>They can store data using formats such as:</p><ul><li>Documents</li><li>Key-value pairs</li><li>Graphs</li><li>Wide-column structures</li></ul><p>Examples include:</p><ul><li>MongoDB</li><li>Redis</li><li>Cassandra</li></ul><p>NoSQL databases are useful when applications need flexible data structures or specific scalability models.</p><h3>Important distinction</h3><pre>SQL<br>→ Usually structured relational data</pre><pre>NoSQL<br>→ Flexible non-relational data models</pre><p>NoSQL does not simply mean “no structure”; it means the database does not primarily follow the traditional relational model.</p><h3>3. Tables, Rows, and Columns</h3><p>Understanding the structure of a relational database is essential.</p><h3>Table</h3><p>A <strong>table</strong> is a collection of related data.</p><p>Example:</p><pre>Books<br>--------------------------------<br>id | name | author<br>--------------------------------<br>1  | Book A | Author 1<br>2  | Book B | Author 2<br>3  | Book C | Author 3</pre><h3>Column</h3><p>A <strong>column</strong> defines an attribute of the stored data.</p><p>Examples:</p><pre>id<br>name<br>email<br>author<br>price</pre><p>Each column normally has a specific data type.</p><h3>Row</h3><p>A <strong>row</strong> represents one complete record.</p><p>For example:</p><pre>1 | Book A | Author 1</pre><p>is one row in the Books table.</p><h3>4. Common Data Types</h3><p>Databases support different types of data.</p><p>Common examples include:</p><h3>String</h3><p>Used for text.</p><pre>Alice<br>hello@example.com<br>Book A</pre><h3>Integer</h3><p>Used for whole numbers.</p><pre>1<br>25<br>100</pre><h3>Float / Decimal</h3><p>Used for numbers containing decimal values.</p><pre>19.99<br>3.14<br>99.50</pre><h3>Date / Time</h3><p>Used for dates and timestamps.</p><pre>2026-09-20<br>2026-09-20 14:30:00</pre><p>The exact data types available can vary between database systems.</p><h3>5. Primary Keys</h3><p>A <strong>Primary Key (PK)</strong> uniquely identifies a row in a table.</p><p>Example:</p><pre>Books<br>-------------------<br>id (PK)<br>-------------------<br>1<br>2<br>3</pre><p>The primary key should uniquely identify each record.</p><p>Important characteristics:</p><ul><li>Uniquely identifies a record</li><li>Cannot contain duplicate values</li><li>A table has one primary key constraint</li><li>It can consist of one column or multiple columns</li></ul><p>For a simple example:</p><pre>id | name<br>-----------<br>1  | Book A<br>2  | Book B<br>3  | Book C</pre><p>The id column identifies each book.</p><h3>6. Foreign Keys</h3><p>A <strong>Foreign Key (FK)</strong> creates a relationship between tables.</p><p>For example:</p><pre>Books<br>----------------<br>id<br>author_id  ← FK</pre><p>and:</p><pre>Authors<br>----------------<br>id  ← PK<br>name</pre><p>The relationship can be represented as:</p><pre>Books.author_id<br>       |<br>       ↓<br>Authors.id</pre><p>A foreign key usually references a primary key or another candidate key in another table.</p><p>Unlike a primary key, a foreign key can contain repeated values because multiple records may reference the same record.</p><h3>7. Primary Key vs Foreign Key</h3><p>Primary KeyForeign KeyUniquely identifies a recordReferences a record in another tableEnforces uniquenessDoes not have to be uniqueUsed to identify rowsUsed to create relationshipsOne primary key constraint per tableMultiple foreign key constraints can existCommonly referenced by foreign keysCommonly references another table’s key</p><h3>Easy way to remember</h3><pre>PK = Unique identifier</pre><pre>FK = Link between tables</pre><h3>8. What is SQL?</h3><p><strong>SQL</strong> stands for <strong>Structured Query Language</strong>.</p><p>It is used to communicate with relational database systems.</p><p>SQL can be used to:</p><ul><li>Retrieve data</li><li>Insert data</li><li>Update data</li><li>Delete data</li><li>Create databases</li><li>Create tables</li><li>Modify tables</li><li>Manage database structures</li></ul><p>Example:</p><pre>SELECT * FROM users;</pre><p>This asks the database to return all columns from the users table.</p><h3>9. What is a DBMS?</h3><p><strong>DBMS</strong> stands for <strong>Database Management System</strong>.</p><p>A DBMS is software used to create, manage, store, and interact with databases.</p><p>Examples include:</p><ul><li>MySQL</li><li>MariaDB</li><li>PostgreSQL</li><li>Oracle Database</li><li>Microsoft SQL Server</li><li>SQLite</li><li>MongoDB</li></ul><p>One important distinction:</p><pre>Database<br>= Stored data</pre><pre>DBMS<br>= Software that manages the database</pre><pre>SQL<br>= Language used to communicate with a relational DBMS</pre><p>MongoDB is a DBMS, but it is a NoSQL database system rather than a traditional relational SQL DBMS.</p><h3>10. Connecting to MySQL</h3><p>A common MySQL login command is:</p><pre>mysql -u root -p</pre><p>The options mean:</p><pre>-u<br>→ Specify username</pre><pre>root<br>→ Username</pre><pre>-p<br>→ Prompt for password</pre><p>After successful authentication, you may see:</p><pre>mysql&gt;</pre><p>This indicates that you are inside the MySQL command-line client.</p><h3>11. Creating a Database</h3><p>To create a database:</p><pre>CREATE DATABASE database_name;</pre><p>For example:</p><pre>CREATE DATABASE library;</pre><p>This creates a database called library.</p><h3>12. Listing Databases</h3><p>To display available databases:</p><pre>SHOW DATABASES;</pre><p>Example output might include:</p><pre>information_schema<br>library<br>mysql<br>performance_schema</pre><h3>13. Selecting a Database</h3><p>Before working with tables inside a database, select it:</p><pre>USE database_name;</pre><p>Example:</p><pre>USE library;</pre><p>You are now working with the library database.</p><h3>14. Deleting a Database</h3><p>A database can be permanently removed using:</p><pre>DROP DATABASE database_name;</pre><p>Example:</p><pre>DROP DATABASE library;</pre><p><strong>Important:</strong> DROP DATABASE permanently removes the database and its contents.</p><h3>15. Creating a Table</h3><p>A table can be created with:</p><pre>CREATE TABLE table_name (<br>    column_name data_type<br>);</pre><p>For example:</p><pre>CREATE TABLE books (<br>    id INT,<br>    name VARCHAR(100),<br>    price DECIMAL(10,2)<br>);</pre><p>This creates a table containing:</p><pre>id<br>name<br>price</pre><h3>16. Showing Tables</h3><p>To list the tables in the currently selected database:</p><pre>SHOW TABLES;</pre><h3>17. Describing a Table</h3><p>To inspect the structure of a table:</p><pre>DESCRIBE books;</pre><p>or:</p><pre>DESC books;</pre><p>This can show information such as:</p><ul><li>Column names</li><li>Data types</li><li>Keys</li><li>Whether NULL values are allowed</li><li>Default values</li><li>Additional attributes</li></ul><p>This is an important command when performing database enumeration.</p><h3>18. Altering a Table</h3><p>The ALTER TABLE statement modifies an existing table.</p><p>For example:</p><pre>ALTER TABLE books<br>ADD description TEXT;</pre><p>This adds a new description column.</p><h3>19. Dropping a Table</h3><p>To permanently delete a table:</p><pre>DROP TABLE books;</pre><p>This removes the table and its data.</p><h3>20. CRUD Operations</h3><p>CRUD represents the four fundamental operations performed on data.</p><pre>C = Create<br>R = Read<br>U = Update<br>D = Delete</pre><p>These correspond to:</p><pre>INSERT<br>SELECT<br>UPDATE<br>DELETE</pre><h3>21. CREATE — INSERT</h3><p>The INSERT statement adds a new record.</p><p>Example:</p><pre>INSERT INTO books<br>(id, name)<br>VALUES (1, &#39;Book A&#39;);</pre><p>Multiple values can also be inserted:</p><pre>INSERT INTO books (id, name)<br>VALUES<br>(1, &#39;Book A&#39;),<br>(2, &#39;Book B&#39;),<br>(3, &#39;Book C&#39;);</pre><h3>22. READ — SELECT</h3><p>The SELECT statement retrieves data.</p><p>To retrieve everything:</p><pre>SELECT * FROM books;</pre><p>The * means all columns.</p><p>To retrieve specific columns:</p><pre>SELECT name, price<br>FROM books;</pre><p>This returns only the selected columns.</p><h3>23. UPDATE</h3><p>The UPDATE statement modifies existing records.</p><p>Example:</p><pre>UPDATE books<br>SET name = &#39;New Book&#39;<br>WHERE id = 1;</pre><p>The WHERE clause is important because it specifies which record should be modified.</p><p>Without an appropriate WHERE condition, an UPDATE statement can affect multiple or all rows.</p><h3>24. DELETE</h3><p>The DELETE statement removes records.</p><p>Example:</p><pre>DELETE FROM books<br>WHERE id = 1;</pre><p>Again, the WHERE clause determines which rows are deleted.</p><p>Without a WHERE clause:</p><pre>DELETE FROM books;</pre><p>all rows in the table may be deleted.</p><h3>25. WHERE Clause</h3><p>The WHERE clause filters records based on a condition.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>WHERE id = 1;</pre><p>This returns only records where the id is 1.</p><p>WHERE is one of the most important SQL concepts because it controls which records are affected by a query.</p><h3>26. Comparison Operators</h3><p>SQL provides operators for comparing values.</p><p>OperatorMeaning=Equal!=Not equal&lt;&gt;Not equal&lt;Less than&gt;Greater than&lt;=Less than or equal&gt;=Greater than or equal</p><p>Examples:</p><pre>SELECT * FROM books WHERE price &gt; 20;</pre><pre>SELECT * FROM books WHERE id != 5;</pre><h3>27. AND</h3><p>AND requires all conditions to be true.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>WHERE price &gt; 10 AND price &lt; 50;</pre><p>Both conditions must be satisfied.</p><h3>28. OR</h3><p>OR requires at least one condition to be true.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>WHERE id = 1 OR id = 2;</pre><p>The result can contain records matching either condition.</p><h3>29. NOT</h3><p>NOT reverses a condition.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>WHERE NOT id = 1;</pre><p>This selects records where the condition is not true.</p><h3>30. BETWEEN</h3><p>BETWEEN checks whether a value falls within a range.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>WHERE id BETWEEN 2 AND 4;</pre><p>This selects values within the specified range.</p><h3>31. LIKE</h3><p>LIKE is used for pattern matching.</p><p>For example:</p><pre>SELECT *<br>FROM books<br>WHERE name LIKE &#39;%book%&#39;;</pre><p>The % wildcard represents zero or more characters.</p><p>Common patterns include:</p><pre>LIKE &#39;book%&#39;</pre><p>Starts with book.</p><pre>LIKE &#39;%book&#39;</pre><p>Ends with book.</p><pre>LIKE &#39;%book%&#39;</pre><p>Contains book.</p><h3>32. DISTINCT</h3><p>DISTINCT removes duplicate values from the result.</p><p>Example:</p><pre>SELECT DISTINCT author<br>FROM books;</pre><p>Instead of showing the same author multiple times, SQL returns each unique value once.</p><h3>33. ORDER BY</h3><p>ORDER BY sorts query results.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>ORDER BY price;</pre><p>By default, the results are generally sorted in ascending order.</p><p>For descending order:</p><pre>SELECT *<br>FROM books<br>ORDER BY price DESC;</pre><p>For ascending order:</p><pre>SELECT *<br>FROM books<br>ORDER BY price ASC;</pre><h3>34. LIMIT</h3><p>LIMIT restricts the number of rows returned.</p><p>Example:</p><pre>SELECT *<br>FROM books<br>LIMIT 5;</pre><p>This returns up to five rows.</p><p>It is useful when working with large datasets.</p><h3>35. NULL Values</h3><p>NULL represents a missing or unknown value.</p><p>It is important to understand that:</p><pre>NULL ≠ 0</pre><pre>NULL ≠ &#39;&#39;</pre><pre>NULL ≠ FALSE</pre><p>To check for NULL values, use:</p><pre>SELECT *<br>FROM users<br>WHERE email IS NULL;</pre><p>To find values that are not NULL:</p><pre>SELECT *<br>FROM users<br>WHERE email IS NOT NULL;</pre><p>You should not normally use:</p><pre>WHERE email = NULL</pre><p>because NULL requires IS NULL or IS NOT NULL.</p><h3>36. String Functions</h3><p>SQL provides functions for manipulating text.</p><h3>CONCAT()</h3><p>Combines strings.</p><pre>SELECT CONCAT(first_name, &#39; &#39;, last_name)<br>FROM users;</pre><h3>GROUP_CONCAT()</h3><p>Combines values from multiple rows into a single string in database systems that support it, such as MySQL.</p><p>Example:</p><pre>SELECT GROUP_CONCAT(name)<br>FROM users;</pre><h3>SUBSTRING()</h3><p>Extracts part of a string.</p><p>Example:</p><pre>SELECT SUBSTRING(&#39;Cybersecurity&#39;, 1, 4);</pre><p>This extracts a portion of the string.</p><h3>LENGTH()</h3><p>Returns the length of a string.</p><p>Example:</p><pre>SELECT LENGTH(&#39;Cybersecurity&#39;);</pre><h3>37. Aggregate Functions</h3><p>Aggregate functions perform calculations across multiple rows.</p><h3>COUNT()</h3><p>Counts rows.</p><pre>SELECT COUNT(*)<br>FROM users;</pre><h3>SUM()</h3><p>Adds numeric values.</p><pre>SELECT SUM(price)<br>FROM products;</pre><h3>MAX()</h3><p>Returns the largest value.</p><pre>SELECT MAX(price)<br>FROM products;</pre><h3>MIN()</h3><p>Returns the smallest value.</p><pre>SELECT MIN(price)<br>FROM products;</pre><p>Another important aggregate function is:</p><h3>AVG()</h3><p>Calculates the average value.</p><pre>SELECT AVG(price)<br>FROM products;</pre><h3>38. GROUP BY</h3><p>GROUP BY groups rows that have the same value.</p><p>For example:</p><pre>SELECT author, COUNT(*)<br>FROM books<br>GROUP BY author;</pre><p>This can show how many books belong to each author.</p><p>A simplified result could look like:</p><pre>Author  | COUNT<br>----------------<br>Alice   | 3<br>Bob     | 5<br>Charlie | 2</pre><h3>39. HAVING</h3><p>HAVING filters grouped results.</p><p>Example:</p><pre>SELECT author, COUNT(*)<br>FROM books<br>GROUP BY author<br>HAVING COUNT(*) &gt; 2;</pre><p>The important difference is:</p><pre>WHERE<br>→ Filters rows before grouping</pre><pre>HAVING<br>→ Filters groups after grouping</pre><h3>40. SQL JOINs</h3><p>Relational databases are designed around relationships between tables.</p><p>JOIN statements allow data from multiple tables to be combined.</p><p>Suppose we have:</p><pre>Users<br>----------------<br>id<br>name</pre><p>and:</p><pre>Orders<br>----------------<br>id<br>user_id<br>product</pre><p>The user_id can reference Users.id.</p><h3>INNER JOIN</h3><p>Returns matching records from both tables.</p><pre>SELECT users.name, orders.product<br>FROM users<br>INNER JOIN orders<br>ON users.id = orders.user_id;</pre><h3>LEFT JOIN</h3><p>Returns all rows from the left table and matching rows from the right table.</p><pre>SELECT users.name, orders.product<br>FROM users<br>LEFT JOIN orders<br>ON users.id = orders.user_id;</pre><p>If a user has no matching order, the order fields can contain NULL.</p><h3>41. SQL Comments</h3><p>SQL supports comments, although the exact syntax can vary between database systems.</p><p>A common single-line comment syntax is:</p><pre>-- comment</pre><p>MySQL also supports:</p><pre># comment</pre><p>Comments are useful when documenting SQL queries and understanding existing database code.</p><h3>42. SQL Statement Structure</h3><p>A basic SQL query often follows this structure:</p><pre>SELECT column<br>FROM table<br>WHERE condition<br>ORDER BY column<br>LIMIT number;</pre><p>For example:</p><pre>SELECT name, price<br>FROM books<br>WHERE price &gt; 20<br>ORDER BY price DESC<br>LIMIT 5;</pre><p>This query:</p><ol><li>Selects name and price</li><li>From the books table</li><li>Keeps books costing more than 20</li><li>Sorts them from highest to lowest price</li><li>Returns up to five results</li></ol><h3>43. SQL Fundamentals for Web Security</h3><p>Understanding SQL is especially important for web penetration testing.</p><p>A typical web application might receive input:</p><pre>/search?id=10</pre><p>The application could use that value in a database query.</p><p>Conceptually:</p><pre>HTTP Request<br>     ↓<br>Web Application<br>     ↓<br>SQL Query<br>     ↓<br>Database<br>     ↓<br>Response</pre><p>If developers incorrectly construct SQL queries using untrusted input, SQL Injection may become possible.</p><p>This is why learning SQL fundamentals should come <strong>before</strong> learning tools such as SQLMap.</p><p>You should understand what the application is doing before trying to automate the testing.</p><h3>44. SQL vs SQL Injection</h3><p>These concepts should not be confused.</p><h3>SQL</h3><p>A legitimate language used to communicate with relational databases.</p><h3>SQL Injection</h3><p>A security vulnerability that occurs when untrusted input can improperly influence an SQL query.</p><pre>SQL<br>→ Language</pre><pre>SQL Injection<br>→ Vulnerability</pre><p>SQL itself is not a vulnerability.</p><h3>45. Quick SQL Cheat Sheet</h3><h3>Database</h3><pre>CREATE DATABASE database_name;<br>SHOW DATABASES;<br>USE database_name;<br>DROP DATABASE database_name;</pre><h3>Tables</h3><pre>CREATE TABLE table_name (...);<br>SHOW TABLES;<br>DESCRIBE table_name;<br>ALTER TABLE table_name ...;<br>DROP TABLE table_name;</pre><h3>CRUD</h3><pre>INSERT INTO table_name (...) VALUES (...);</pre><pre>SELECT * FROM table_name;</pre><pre>UPDATE table_name<br>SET column = value<br>WHERE condition;</pre><pre>DELETE FROM table_name<br>WHERE condition;</pre><h3>Filtering</h3><pre>WHERE<br>AND<br>OR<br>NOT<br>LIKE<br>BETWEEN</pre><h3>Sorting and Limiting</h3><pre>ORDER BY<br>LIMIT<br>DISTINCT</pre><h3>Aggregation</h3><pre>COUNT()<br>SUM()<br>AVG()<br>MAX()<br>MIN()<br>GROUP BY<br>HAVING</pre><h3>Relationships</h3><pre>JOIN<br>INNER JOIN<br>LEFT JOIN</pre><h3>String Functions</h3><pre>CONCAT()<br>GROUP_CONCAT()<br>SUBSTRING()<br>LENGTH()</pre><h3>Key Takeaways</h3><p>After studying SQL Fundamentals, I should be able to explain:</p><ul><li>What a database is</li><li>The difference between SQL and NoSQL</li><li>What a relational database is</li><li>What tables, rows, and columns represent</li><li>What primary and foreign keys are</li><li>What SQL is</li><li>What a DBMS is</li><li>How to connect to MySQL</li><li>How to create and manage databases</li><li>How to create and manage tables</li><li>How CRUD operations work</li><li>How SELECT retrieves data</li><li>How WHERE filters data</li><li>How comparison and logical operators work</li><li>How LIKE performs pattern matching</li><li>How ORDER BY sorts results</li><li>How LIMIT restricts results</li><li>How DISTINCT removes duplicates</li><li>How NULL values work</li><li>How aggregate functions work</li><li>How GROUP BY and HAVING work</li><li>How tables can be connected using JOINs</li><li>Why SQL knowledge is important for web penetration testing</li></ul><h3>Conclusion</h3><p>SQL fundamentals are an important foundation for anyone interested in web security and penetration testing.</p><p>Before studying SQL Injection or using automated tools such as SQLMap, it is important to understand how databases are structured and how SQL queries work.</p><p>The core concepts to remember are:</p><pre>Database<br>→ Stores data</pre><pre>DBMS<br>→ Manages the database</pre><pre>SQL<br>→ Communicates with relational databases</pre><pre>Table<br>→ Stores related records</pre><pre>Row<br>→ Represents one record</pre><pre>Column<br>→ Represents an attribute</pre><pre>Primary Key<br>→ Uniquely identifies a record</pre><pre>Foreign Key<br>→ Creates a relationship between tables</pre><pre>CRUD<br>→ Create, Read, Update, Delete</pre><p>Once these fundamentals are clear, topics such as <strong>SQL Injection, SQLMap, database enumeration, and web application security</strong> become much easier to understand.</p><p><strong>Main lesson:</strong> don’t memorize SQL commands only. Understand what each query does to the database and why the result changes depending on the conditions you provide.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=330c01d4d68f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gobuster: The Basics — TryHackMe Write-UpIntroduction]]></title>
            <link>https://medium.com/@xalpha032/gobuster-the-basics-tryhackme-write-upintroduction-e3f5f1e7a33a?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3f5f1e7a33a</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Mon, 24 Aug 2026 19:18:19 GMT</pubDate>
            <atom:updated>2026-08-24T19:18:19.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Gobuster: The Basics — TryHackMe Write-UpIntroduction</p><h3>Introduction</h3><p>Web applications often expose resources that are not directly linked from the main page. Directories, files, subdomains, and virtual hosts may exist on a web server without being immediately visible to a user.</p><p>This is where <strong>web enumeration</strong> becomes useful.</p><p>In this TryHackMe room, I explored <strong>Gobuster</strong>, a command-line tool commonly used for discovering hidden web resources during authorized security assessments.</p><p>The room introduces Gobuster’s basic syntax, wordlists, directory and file enumeration, subdomain enumeration, and virtual host enumeration.</p><p><strong>Platform:</strong> TryHackMe<br><strong>Room:</strong> Gobuster: The Basics<br><strong>Difficulty:</strong> Beginner<br><strong>Focus:</strong> Web Enumeration</p><h3>1. What is Gobuster?</h3><p><strong>Gobuster</strong> is a command-line enumeration tool written in Go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*1CqVqIeUMTvJSYyJARZLgg.jpeg" /></figure><p>It can be used to discover resources such as:</p><ul><li>Directories</li><li>Files</li><li>Subdomains</li><li>Virtual hosts</li></ul><p>The basic idea is to provide Gobuster with a target and a wordlist.</p><p>Gobuster then takes entries from the wordlist and makes requests based on them.</p><p>A simplified workflow looks like this:</p><pre>Wordlist<br>   ↓<br>Gobuster<br>   ↓<br>Target Web Server<br>   ↓<br>HTTP Requests<br>   ↓<br>Discovered Resources</pre><p>For example, if a wordlist contains:</p><pre>admin<br>login<br>images<br>backup</pre><p>Gobuster can test whether resources corresponding to these names exist on the target.</p><h3>2. Why Web Enumeration Matters</h3><p>When performing a web application security assessment, the homepage is usually only one part of the application.</p><p>A web server might contain additional resources such as:</p><pre>/admin<br>/login<br>/uploads<br>/backup<br>/config</pre><p>Some of these resources may not be linked from the homepage.</p><p>Enumeration helps security testers build a better understanding of the application’s attack surface.</p><h3>Security relevance</h3><p>Discovering hidden resources does not automatically mean they are vulnerable.</p><p>The purpose of enumeration is to identify what exists so that it can be investigated further.</p><h3>3. Gobuster Help</h3><p>Before using a command-line security tool, it is useful to understand its available options.</p><p>Gobuster provides a help menu:</p><pre>gobuster --help</pre><p>It can also provide help for a specific mode.</p><p>For example:</p><pre>gobuster dir --help</pre><p>This displays the options available for directory enumeration.</p><p>Reading the help output is an important habit because tool syntax and options can vary between versions.</p><h3>4. Gobuster Modes</h3><p>Gobuster provides different enumeration modes.</p><p>The room focuses on three important modes:</p><pre>dir<br>dns<br>vhost</pre><h3>dir</h3><p>Used for discovering directories and files on a web server.</p><h3>dns</h3><p>Used for DNS subdomain enumeration.</p><h3>vhost</h3><p>Used for discovering virtual hosts configured on a web server.</p><p>Each mode has a different purpose, but the underlying idea is similar: use a wordlist to test possible resources.</p><h3>5. Directory Enumeration</h3><p>One of the most common uses of Gobuster is directory enumeration.</p><p>The mode is:</p><pre>dir</pre><p>A basic structure is:</p><pre>gobuster dir -u http://TARGET -w WORDLIST</pre><p>Here:</p><ul><li>dir selects directory enumeration</li><li>-u specifies the target URL</li><li>-w specifies the wordlist</li></ul><p>For example:</p><pre>gobuster dir -u http://TARGET -w wordlist.txt</pre><p>Gobuster then tests words from the wordlist against the target.</p><h3>6. Understanding Directory Enumeration</h3><p>Suppose the wordlist contains:</p><pre>admin<br>login<br>images<br>uploads<br>backup</pre><p>Gobuster may test requests such as:</p><pre>/admin<br>/login<br>/images<br>/uploads<br>/backup</pre><p>If the server responds differently because a resource exists, Gobuster reports the result.</p><p>This can reveal directories that were not visible from the main website.</p><h3>7. HTTP Status Codes</h3><p>When enumerating a website, understanding HTTP status codes is important.</p><p>Some common examples include:</p><h3>200 — OK</h3><p>The requested resource was successfully returned.</p><h3>301 — Moved Permanently</h3><p>The requested resource redirects to another location.</p><h3>302 — Found</h3><p>The server redirects the client to another location.</p><h3>403 — Forbidden</h3><p>The server understood the request but refuses to provide access.</p><h3>404 — Not Found</h3><p>The requested resource does not exist.</p><p>Gobuster can display these status codes alongside discovered resources.</p><h3>Security relevance</h3><p>A 403 response can still be interesting during enumeration.</p><p>It may indicate that a resource exists even though direct access is currently forbidden.</p><h3>8. File Enumeration</h3><p>Gobuster can also search for files.</p><p>This can be done by specifying file extensions with the appropriate option.</p><p>For example:</p><pre>gobuster dir -u http://TARGET -w wordlist.txt -x php,txt,html</pre><p>The -x option tells Gobuster which extensions to test.</p><p>Instead of checking only:</p><pre>/admin</pre><p>Gobuster can also test:</p><pre>/admin.php<br>/admin.txt<br>/admin.html</pre><p>The exact extensions should depend on the technology being assessed.</p><h3>9. Wordlists</h3><p>Wordlists are a key component of Gobuster.</p><p>A wordlist contains potential names that Gobuster will test against the target.</p><p>For example:</p><pre>admin<br>login<br>dashboard<br>uploads<br>images<br>backup</pre><p>The larger and more relevant the wordlist, the more potential resources can be tested.</p><p>However, larger wordlists also mean more requests and potentially longer enumeration times.</p><h3>Security perspective</h3><p>A good penetration tester chooses wordlists based on the target rather than blindly using the largest available list.</p><p>For example, technology-specific or application-specific wordlists can sometimes produce better results.</p><h3>10. Subdomain Enumeration</h3><p>Web applications may use multiple subdomains.</p><p>For example:</p><pre>www.example.com<br>admin.example.com<br>api.example.com<br>dev.example.com</pre><p>Some subdomains may expose completely different applications or services.</p><p>Gobuster provides a DNS enumeration mode:</p><pre>dns</pre><p>A basic structure is:</p><pre>gobuster dns -d example.com -w wordlist.txt</pre><p>Here:</p><ul><li>dns selects DNS enumeration</li><li>-d specifies the domain</li><li>-w specifies the wordlist</li></ul><p>Gobuster then tests potential subdomain names.</p><h3>11. Why Subdomain Enumeration Matters</h3><p>Organizations often separate applications across different subdomains.</p><p>For example:</p><pre>www.example.com<br>api.example.com<br>dev.example.com<br>mail.example.com</pre><p>The main website may have strong security controls while another subdomain could expose a development application or administrative interface.</p><p>Therefore, discovering subdomains can significantly expand the known attack surface.</p><h3>Important distinction</h3><p>Finding a subdomain does not mean that it is vulnerable.</p><p>It simply gives the tester another asset to investigate.</p><h3>12. Virtual Host Enumeration</h3><p>Another concept covered by the room is <strong>Virtual Host (VHost) enumeration</strong>.</p><p>A single web server can host multiple websites.</p><p>The server can determine which website the client wants based on the HTTP Host header.</p><p>For example:</p><pre>Host: www.example.com</pre><p>could return one application, while:</p><pre>Host: admin.example.com</pre><p>could return another.</p><p>Gobuster provides the:</p><pre>vhost</pre><p>mode for this type of enumeration.</p><p>A basic structure is:</p><pre>gobuster vhost -u http://example.com -w wordlist.txt</pre><p>Gobuster tests potential virtual host names and analyzes the server’s responses.</p><h3>13. Subdomains vs Virtual Hosts</h3><p>These two concepts are easy to confuse.</p><h3>Subdomain Enumeration</h3><p>Looks for DNS records such as:</p><pre>admin.example.com<br>dev.example.com<br>api.example.com</pre><p>The goal is to discover subdomains that resolve through DNS.</p><h3>VHost Enumeration</h3><p>Tests different hostnames against a web server to identify virtual hosts configured on that server.</p><p>A hostname may be configured on the web server even if it is not publicly listed as a normal DNS record.</p><p>Therefore, DNS enumeration and VHost enumeration can reveal different information.</p><h3>14. Useful Gobuster Options</h3><p>Some commonly used options include:</p><pre>-u</pre><p>Specifies the target URL.</p><pre>-w</pre><p>Specifies the wordlist.</p><pre>-x</pre><p>Specifies file extensions to test.</p><pre>-t</pre><p>Controls the number of concurrent threads.</p><pre>-o</pre><p>Saves the output to a file.</p><p>The available options depend on the Gobuster mode being used.</p><h3>15. Enumeration Workflow</h3><p>A simple web enumeration workflow can look like this:</p><h3>Step 1 — Identify the target</h3><p>Determine the authorized target URL or domain.</p><h3>Step 2 — Choose a suitable wordlist</h3><p>Select a wordlist appropriate for the target.</p><h3>Step 3 — Enumerate directories</h3><p>Use:</p><pre>gobuster dir -u http://TARGET -w WORDLIST</pre><h3>Step 4 — Enumerate files</h3><p>Add relevant extensions:</p><pre>gobuster dir -u http://TARGET -w WORDLIST -x php,txt,html</pre><h3>Step 5 — Enumerate subdomains</h3><p>Use DNS enumeration:</p><pre>gobuster dns -d example.com -w WORDLIST</pre><h3>Step 6 — Test virtual hosts</h3><p>Use:</p><pre>gobuster vhost -u http://example.com -w WORDLIST</pre><h3>Step 7 — Investigate discoveries</h3><p>After finding a resource, investigate it manually and determine whether it is expected, accessible, or potentially interesting from a security perspective.</p><h3>16. Why Enumeration Should Come Before Exploitation</h3><p>One of the most important lessons from this room is that enumeration should happen before attempting to exploit a target.</p><p>A tester needs to understand the attack surface first.</p><p>For example:</p><pre>Reconnaissance<br>      ↓<br>Enumeration<br>      ↓<br>Identify Technologies<br>      ↓<br>Discover Resources<br>      ↓<br>Analyze Potential Issues<br>      ↓<br>Security Testing</pre><p>Without proper enumeration, important resources may remain undiscovered.</p><h3>17. Defensive Perspective</h3><p>Gobuster is primarily an offensive-security tool, but understanding how it works is also useful for defenders.</p><p>Organizations can reduce exposure by:</p><ul><li>Removing unnecessary files</li><li>Removing unused directories</li><li>Restricting administrative interfaces</li><li>Avoiding exposed backup files</li><li>Properly configuring virtual hosts</li><li>Monitoring unusual HTTP request patterns</li><li>Using appropriate access controls</li></ul><p>For example, sensitive administrative interfaces should not be unnecessarily exposed to the public Internet.</p><h3>Key Takeaways</h3><p>After completing the Gobuster room, I learned:</p><ul><li>What Gobuster is</li><li>Why web enumeration is important</li><li>How wordlists are used</li><li>How to enumerate directories</li><li>How to enumerate files</li><li>How HTTP status codes help identify resources</li><li>How to perform DNS subdomain enumeration</li><li>How virtual host enumeration works</li><li>The difference between subdomains and virtual hosts</li><li>How Gobuster options modify enumeration</li><li>Why enumeration should happen before exploitation</li><li>How defenders can reduce unnecessary web exposure</li></ul><h3>Conclusion</h3><p>Gobuster is a useful enumeration tool for discovering resources that may not be immediately visible on a web application.</p><p>The room demonstrates three important areas of enumeration:</p><pre>Directory/File Enumeration<br>        +<br>DNS Enumeration<br>        +<br>Virtual Host Enumeration</pre><p>Understanding these techniques is an important part of web penetration testing because they help security professionals map an application’s attack surface.</p><p>The most important lesson is that <strong>enumeration is about discovering and understanding the target before attempting further security testing</strong>.</p><p>Gobuster does not automatically identify vulnerabilities. Instead, it helps reveal resources that can then be analyzed manually or with other security tools.</p><p><strong>Main lesson:</strong> a good penetration test starts with thorough enumeration because you cannot properly assess what you have not discovered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3f5f1e7a33a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Fundamentals Part 1: Getting Started with Linux]]></title>
            <link>https://medium.com/@xalpha032/linux-fundamentals-part-1-getting-started-with-linux-4245744e23af?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4245744e23af</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 01:27:37 GMT</pubDate>
            <atom:updated>2026-08-23T01:27:37.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Linux Fundamentals Part 1: Getting Started with Linux</p><h3>Linux Fundamentals Part 1 — TryHackMe Write-Up</h3><h3>Introduction</h3><p>Linux is one of the most important operating systems to understand in cybersecurity. It is widely used in servers, cloud infrastructure, networking, security tools, and penetration-testing environments.</p><p>For someone starting in cybersecurity, learning how to navigate Linux and use the command line is an essential foundation.</p><p>In this TryHackMe room, I explored the basics of Linux, including distributions, the Linux terminal, filesystem navigation, file searching, and shell operators.</p><p><strong>Platform:</strong> TryHackMe<br><strong>Room:</strong> Linux Fundamentals Part 1<br><strong>Difficulty:</strong> Beginner<br><strong>Focus:</strong> Linux Command Line Fundamentals</p><h3>1. What is Linux?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*n3_k2TvgL97HH_N2te2ppQ.jpeg" /></figure><p>Linux is an open-source operating system kernel that forms the foundation of many operating systems known as <strong>Linux distributions</strong>.</p><p>Unlike Windows, Linux is commonly interacted with through the command line, although graphical desktop environments are also available.</p><p>Linux is widely used in:</p><ul><li>Servers</li><li>Cloud environments</li><li>Networking</li><li>Cybersecurity</li><li>Embedded systems</li><li>Development environments</li></ul><p>For cybersecurity professionals, Linux knowledge is especially useful because many security tools and testing environments are built around Linux.</p><h3>2. Linux Distributions</h3><p>Linux itself is a kernel. A <strong>Linux distribution</strong>, or distro, combines the Linux kernel with other software to create a complete operating system.</p><p>Examples include:</p><ul><li>Ubuntu</li><li>Debian</li><li>Fedora</li><li>Arch Linux</li><li>Kali Linux</li></ul><p>Different distributions are designed for different purposes.</p><p>For example, <strong>Kali Linux</strong> is specifically designed for penetration testing and security research.</p><p>Understanding different distributions is useful because commands and package-management systems can vary between them.</p><h3>3. The Linux Terminal</h3><p>The terminal provides a way to interact with Linux through commands.</p><p>Instead of clicking through graphical interfaces, users can type commands to perform actions.</p><p>A shell interprets the commands entered by the user and communicates with the operating system.</p><p>One common shell is:</p><pre>Bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*lh3Cddl6urkuibkvt5oprQ.png" /></figure><p>The command line is extremely important in cybersecurity because many security tasks can be performed more efficiently through a terminal.</p><h3>4. Basic Linux Commands</h3><p>The room introduces several commands that are essential for navigating Linux.</p><h3>echo</h3><p>The echo command prints text to the terminal.</p><p>Example:</p><pre>echo Hello</pre><p>This produces:</p><pre>Hello</pre><p>It can also be used with variables and command output.</p><h3>whoami</h3><p>The whoami command displays the username of the current user.</p><pre>whoami</pre><p>This is useful when you need to determine which account you are currently using.</p><h3>Security relevance</h3><p>Knowing the current user is important because permissions and access depend on the account.</p><h3>5. Navigating the Filesystem</h3><p>Linux uses a hierarchical filesystem.</p><p>At the top is the root directory:</p><pre>/</pre><p>Everything else exists somewhere below this directory.</p><p>Important directories include:</p><pre>/home<br>/etc<br>/var<br>/tmp<br>/usr<br>/root</pre><p>Each directory has a specific purpose.</p><h3>6. Listing Files with ls</h3><p>The ls command displays the contents of a directory.</p><pre>ls</pre><p>It can also be combined with options.</p><p>For example:</p><pre>ls -l</pre><p>The -l option provides a more detailed listing.</p><p>Another useful option is:</p><pre>ls -la</pre><p>This also displays hidden files.</p><h3>Security relevance</h3><p>Being able to list files and understand permissions is fundamental when performing Linux enumeration.</p><h3>7. Changing Directories with cd</h3><p>The cd command is used to move between directories.</p><p>For example:</p><pre>cd /home</pre><p>moves into the /home directory.</p><p>To move to the parent directory:</p><pre>cd ..</pre><p>To return to the home directory:</p><pre>cd ~</pre><p>The cd command is one of the most frequently used commands when navigating Linux.</p><h3>8. Finding Your Current Location with pwd</h3><p>The pwd command stands for:</p><p><strong>Print Working Directory</strong></p><p>Example:</p><pre>pwd</pre><p>It displays the full path of the directory you are currently inside.</p><p>For example:</p><pre>/home/user</pre><p>This is useful when navigating through a large filesystem because it tells you exactly where you are.</p><h3>9. Reading Files with cat</h3><p>The cat command can be used to display the contents of a file.</p><p>Example:</p><pre>cat file.txt</pre><p>The contents of the file are printed directly to the terminal.</p><p>This command is commonly used when reading configuration files, text files, and other small files.</p><h3>10. Searching for Files with find</h3><p>Linux provides the find command for searching the filesystem.</p><p>A basic example is:</p><pre>find / -name filename</pre><p>This searches for a file with a specific name.</p><p>Another example:</p><pre>find /home -name &quot;*.txt&quot;</pre><p>This searches for .txt files inside /home.</p><h3>Security relevance</h3><p>The find command is extremely useful during Linux enumeration.</p><p>A security professional may use it to locate:</p><ul><li>Configuration files</li><li>Scripts</li><li>Interesting directories</li><li>Files with specific names</li><li>Potentially sensitive data</li></ul><h3>11. Searching Text with grep</h3><p>The grep command searches for specific text inside files.</p><p>For example:</p><pre>grep &quot;password&quot; file.txt</pre><p>This searches the file for occurrences of the word password.</p><p>It can also be combined with other commands.</p><p>For example:</p><pre>cat file.txt | grep &quot;admin&quot;</pre><p>This sends the output of cat to grep.</p><h3>Security relevance</h3><p>grep is extremely useful for searching configuration files, logs, source code, and other text-based data.</p><h3>12. Shell Operators</h3><p>The room introduces several shell operators that allow commands to be combined or their output redirected.</p><p>These operators are important because they make the Linux command line much more powerful.</p><h3>The &amp; Operator</h3><p>The &amp; operator can be used to run a command in the background.</p><p>Example:</p><pre>command &amp;</pre><p>This allows the shell to continue accepting commands while the previous process runs.</p><h3>The &amp;&amp; Operator</h3><p>The &amp;&amp; operator runs the second command only if the first command succeeds.</p><p>Example:</p><pre>command1 &amp;&amp; command2</pre><p>This is useful when commands depend on the successful completion of previous commands.</p><h3>The &gt; Operator</h3><p>The &gt; operator redirects command output into a file.</p><p>Example:</p><pre>echo &quot;Hello&quot; &gt; file.txt</pre><p>If the file already exists, its contents are overwritten.</p><h3>The &gt;&gt; Operator</h3><p>The &gt;&gt; operator also redirects output to a file, but appends the output instead of replacing the existing content.</p><p>Example:</p><pre>echo &quot;Another line&quot; &gt;&gt; file.txt</pre><p>This adds the new content to the end of the file.</p><h3>The | Operator</h3><p>The pipe operator sends the output of one command into another command.</p><p>Example:</p><pre>cat file.txt | grep &quot;admin&quot;</pre><p>Here:</p><pre>cat<br> ↓<br>file contents<br> ↓<br>grep<br> ↓<br>matching lines</pre><p>Pipes are extremely important in Linux because they allow multiple simple commands to be combined into more powerful workflows.</p><h3>13. Why the Command Line Matters in Cybersecurity</h3><p>The Linux command line is one of the most important skills for cybersecurity professionals.</p><p>Many security activities require working with:</p><ul><li>Files</li><li>Processes</li><li>Logs</li><li>Network information</li><li>Permissions</li><li>Configuration files</li></ul><p>Instead of manually navigating through a graphical interface, command-line tools allow security professionals to perform tasks quickly and automate repetitive operations.</p><p>For example:</p><pre>whoami<br>pwd<br>ls<br>find<br>grep</pre><p>These are simple commands, but they form the foundation for much more advanced Linux enumeration.</p><h3>14. Practical Enumeration Workflow</h3><p>The commands introduced in this room can already be combined into a simple workflow.</p><p>For example:</p><pre>whoami<br>pwd<br>ls -la</pre><p>This can help answer three basic questions:</p><ol><li><strong>Who am I?</strong></li><li><strong>Where am I?</strong></li><li><strong>What files are here?</strong></li></ol><p>Then, commands such as:</p><pre>find<br>grep<br>cat</pre><p>can be used to investigate files and their contents.</p><p>This simple workflow becomes much more important in later penetration-testing and Linux privilege-escalation rooms.</p><h3>Key Takeaways</h3><p>After completing Linux Fundamentals Part 1, I learned:</p><ul><li>What Linux and Linux distributions are</li><li>Why Linux is important in cybersecurity</li><li>How to use the terminal</li><li>How to identify the current user with whoami</li><li>How to navigate directories with cd</li><li>How to list files with ls</li><li>How to identify the current directory with pwd</li><li>How to read files with cat</li><li>How to search for files with find</li><li>How to search text with grep</li><li>How shell operators work</li><li>How to redirect output</li><li>How to combine commands using pipes</li></ul><h3>Conclusion</h3><p>Linux Fundamentals Part 1 provides the basic command-line knowledge required to work comfortably in a Linux environment.</p><p>The commands introduced in this room may appear simple, but they are fundamental to cybersecurity. Commands such as ls, cd, pwd, find, and grep are regularly used during system administration, troubleshooting, enumeration, and security investigations.</p><p>The most important lesson is that mastering Linux starts with understanding the filesystem and becoming comfortable with the command line.</p><p>These fundamentals provide the foundation for more advanced topics such as <strong>Linux permissions, privilege escalation, networking, system administration, and penetration testing</strong>.</p><p><strong>Main lesson:</strong> before learning advanced Linux security techniques, become comfortable navigating the filesystem and combining basic commands through the terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4245744e23af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hydra — TryHackMe Write-Up]]></title>
            <link>https://medium.com/@xalpha032/hydra-tryhackme-write-up-a3409fe18ab0?source=rss-8d87fb21d94c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3409fe18ab0</guid>
            <dc:creator><![CDATA[Shadow]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 00:05:29 GMT</pubDate>
            <atom:updated>2026-08-19T00:10:27.579Z</atom:updated>
            <content:encoded><![CDATA[<p>Hydra — TryHackMe Write-Up</p><h3>Introduction</h3><p>Password security is an important part of cybersecurity. Weak or predictable passwords can make accounts vulnerable to automated guessing attacks.</p><p>In this TryHackMe room, I explored <strong>Hydra</strong>, a popular command-line tool used to perform automated password guessing against network authentication services.</p><p>The room demonstrates how Hydra works and how it can be used in a controlled lab environment against services such as <strong>SSH</strong> and web login forms.</p><p><strong>Platform:</strong> TryHackMe<br><strong>Room:</strong> Hydra<br><strong>Difficulty:</strong> Easy<br><strong>Focus:</strong> Password Attacks and Hydra</p><h3>1. What is Hydra?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*AXl0J3XIT_zAEFCF6k8MeQ.jpeg" /></figure><p>Hydra is a command-line password-cracking tool designed to perform automated login attempts against supported network services.</p><p>Instead of manually testing passwords one by one, Hydra can automate the process using a username and a wordlist.</p><p>The general idea is:</p><pre>Username<br>   +<br>Password Wordlist<br>   ↓<br>Hydra<br>   ↓<br>Authentication Attempts<br>   ↓<br>Potential Valid Credentials</pre><p>Hydra supports many different protocols and services, making it a useful tool for security testing in authorized environments.</p><p>Useful Resource: <a href="https://github.com/vanhauser-thc/thc-hydra">https://github.com/vanhauser-thc/thc-hydra</a></p><p>Additional Resource : <a href="https://en.kali.tools/?p=220#google_vignette">https://en.kali.tools/?p=220#google_vignette</a></p><h3>2. Why Password Attacks Matter</h3><p>Passwords are still widely used for authentication.</p><p>If a password is weak, predictable, or reused, an attacker may be able to guess it.</p><p>Automated tools make this process much faster than manually trying credentials.</p><p>This is why organizations should use:</p><ul><li>Strong passwords</li><li>Multi-factor authentication</li><li>Account lockout policies</li><li>Rate limiting</li><li>Monitoring and logging</li></ul><p>From a penetration-testing perspective, testing password strength can help identify weak authentication controls.</p><h3>3. Hydra Syntax</h3><p>Hydra follows a relatively simple command structure.</p><p>A basic syntax looks like:</p><pre>hydra [options] TARGET SERVICE</pre><p>Hydra can also be supplied with usernames and password wordlists.</p><p>For example, the room introduces the use of:</p><pre>-l</pre><p>for a single username,</p><p>and:</p><pre>-P</pre><p>for a password wordlist.</p><p>The target and service are then specified.</p><h3>4. Password Wordlists</h3><p>A wordlist is a file containing possible passwords.</p><p>Instead of generating passwords randomly, Hydra can read candidate passwords from a wordlist and test them against the target service.</p><p>A common wordlist used in security labs is:</p><pre>/usr/share/wordlists/rockyou.txt</pre><p>The wordlist contains a large collection of commonly used passwords.</p><h3>Security relevance</h3><p>Wordlists demonstrate why password complexity matters.</p><p>If a user’s password appears in a commonly used password list, automated password guessing may be able to discover it.</p><h3>5. Hydra Against SSH</h3><p>The room demonstrates using Hydra against an SSH service.</p><p>SSH, or <strong>Secure Shell</strong>, provides remote command-line access to a system.</p><p>The relevant Hydra module is:</p><pre>ssh</pre><p>A typical lab command follows the structure:</p><pre>hydra -l &lt;username&gt; -P &lt;wordlist&gt; ssh://&lt;target&gt;</pre><p>Here:</p><ul><li>-l specifies the username</li><li>-P specifies the password wordlist</li><li>ssh:// specifies the SSH service</li><li>&lt;target&gt; represents the authorized lab machine</li></ul><p>Hydra then attempts the passwords from the wordlist against the SSH authentication service.</p><h3>Security lesson</h3><p>If a weak password is accepted by a remotely accessible SSH service, the account may be exposed to automated password guessing.</p><p>This demonstrates why SSH servers should use strong authentication controls and appropriate access restrictions.</p><h3>6. Understanding Hydra Output</h3><p>When Hydra performs authentication attempts, it displays information about its progress.</p><p>If valid credentials are discovered, Hydra reports the successful combination.</p><p>The important part of the result is the relationship between:</p><pre>Username<br>+<br>Password<br>+<br>Target</pre><p>A successful result means that the tested credentials were accepted by the target service.</p><p>In a real penetration test, this information would need to be handled carefully because credentials are sensitive information.</p><h3>7. Hydra and HTTP Login Forms</h3><p>The room also introduces password guessing against an HTTP POST login form.</p><p>Web applications often authenticate users through forms.</p><p>A simplified login process looks like:</p><pre>Username + Password<br>        ↓<br>HTTP POST Request<br>        ↓<br>Web Application<br>        ↓<br>Authentication Result</pre><p>Hydra can automate attempts against certain HTTP forms when the required parameters are known.</p><h3>8. HTTP POST Forms</h3><p>A POST request can contain login parameters such as:</p><pre>username=&lt;username&gt;<br>password=&lt;password&gt;</pre><p>The application then processes these values and returns a response.</p><p>For Hydra to work correctly against a form, the tester needs to understand:</p><ul><li>The login page</li><li>The HTTP method</li><li>The submitted parameters</li><li>The failure response</li></ul><p>This information allows Hydra to determine whether an authentication attempt succeeded or failed.</p><h3>9. Identifying a Failed Login</h3><p>One important concept when attacking a web login form is identifying how the application indicates failure.</p><p>For example, the server may return a message such as:</p><pre>Invalid username or password</pre><p>Hydra can use a failure string to distinguish unsuccessful attempts from successful ones.</p><p>This is important because Hydra needs some way to determine whether the credentials it tested were accepted.</p><h3>10. Hydra Options</h3><p>Some useful Hydra options include:</p><pre>-l</pre><p>Specifies a single username.</p><pre>-L</pre><p>Specifies a file containing multiple usernames.</p><pre>-p</pre><p>Specifies a single password.</p><pre>-P</pre><p>Specifies a password wordlist.</p><pre>-v</pre><p>Enables verbose output.</p><pre>-f</pre><p>Stops after finding a valid login.</p><p>The exact options used depend on the target service and the testing requirements.</p><h3>11. Hydra in a Controlled Environment</h3><p>Hydra is a powerful tool, but password-guessing attacks should only be performed against systems where you have explicit authorization.</p><p>In the TryHackMe environment, the target is intentionally provided for security training.</p><p>This makes the lab useful for understanding:</p><ul><li>How authentication works</li><li>How wordlists are used</li><li>How automated guessing works</li><li>How weak passwords can be discovered</li><li>How defensive controls can reduce password attacks</li></ul><h3>12. Defensive Perspective</h3><p>Learning Hydra is not only about attacking authentication.</p><p>It also helps understand how to defend against automated password guessing.</p><p>Organizations can reduce the risk by implementing:</p><h3>Strong Passwords</h3><p>Passwords should be long and difficult to guess.</p><h3>Multi-Factor Authentication</h3><p>MFA adds another authentication factor beyond the password.</p><h3>Rate Limiting</h3><p>Applications can limit the number of authentication attempts.</p><h3>Account Lockout</h3><p>Repeated failed authentication attempts can trigger temporary account restrictions.</p><h3>Monitoring</h3><p>Security teams can monitor authentication logs for unusual numbers of failed login attempts.</p><h3>Network Restrictions</h3><p>Services such as SSH should not necessarily be exposed to every network or user.</p><h3>13. Key Takeaways</h3><p>After completing the Hydra room, I learned:</p><ul><li>What Hydra is and what it is used for</li><li>How password wordlists work</li><li>How Hydra can test authentication services</li><li>How Hydra can interact with SSH</li><li>How HTTP POST login forms work</li><li>Why identifying failed-login responses matters</li><li>How Hydra options control authentication attempts</li><li>Why weak passwords create security risks</li><li>How defensive controls can reduce automated password attacks</li></ul><h3>Conclusion</h3><p>The Hydra room demonstrates how automated password guessing works in a controlled penetration-testing environment.</p><p>Hydra makes it possible to automate authentication attempts against supported services instead of manually testing credentials.</p><p>The most important lesson is that password security is not only about choosing a strong password. Organizations should also use <strong>MFA, rate limiting, account protection, monitoring, and proper network restrictions</strong> to reduce the effectiveness of automated authentication attacks.</p><p>Understanding tools such as Hydra gives penetration testers a practical way to evaluate authentication security while also helping defenders understand how these attacks can be detected and prevented.</p><p><strong>Main lesson:</strong> strong authentication controls are essential because automated tools can test large numbers of credential combinations much faster than a human can.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3409fe18ab0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>