<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Alexander Roca | Security Manager &amp; Pentester</title><link>https://alexanderroca.dev/tactics/</link><description>Recent content on Alexander Roca | Security Manager &amp; Pentester</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://alexanderroca.dev/tactics/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://alexanderroca.dev/tactics/traverse-hybrid-analysis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alexanderroca.dev/tactics/traverse-hybrid-analysis/</guid><description>&lt;h1 id="risk-analysis-and-exploitation-case-traverse-tryhackme"&gt;Risk Analysis and Exploitation: Case &amp;ldquo;Traverse&amp;rdquo; (TryHackMe)&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Alexander Roca&lt;br&gt;
&lt;strong&gt;Date:&lt;/strong&gt; April 24, 2026&lt;br&gt;
&lt;strong&gt;Risk Level:&lt;/strong&gt; High (Critical for Data Integrity)&lt;br&gt;
&lt;strong&gt;Category:&lt;/strong&gt; Web Vulnerabilities / Secret Management / Command Injection&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-business-context--scenario"&gt;1. Business Context &amp;amp; Scenario&lt;/h2&gt;
&lt;p&gt;Imagine a digital tourism company (&amp;ldquo;Tourism MHT&amp;rdquo;) that manages reservations, customer data, and payments. Its web infrastructure is its most critical asset. A security failure in this platform is not merely a &amp;ldquo;bug&amp;rdquo;; it represents a breach of trust that could result in:&lt;/p&gt;</description><content:encoded><![CDATA[<h1 id="risk-analysis-and-exploitation-case-traverse-tryhackme">Risk Analysis and Exploitation: Case &ldquo;Traverse&rdquo; (TryHackMe)</h1>
<p><strong>Author:</strong> Alexander Roca<br>
<strong>Date:</strong> April 24, 2026<br>
<strong>Risk Level:</strong> High (Critical for Data Integrity)<br>
<strong>Category:</strong> Web Vulnerabilities / Secret Management / Command Injection</p>
<hr>
<h2 id="1-business-context--scenario">1. Business Context &amp; Scenario</h2>
<p>Imagine a digital tourism company (&ldquo;Tourism MHT&rdquo;) that manages reservations, customer data, and payments. Its web infrastructure is its most critical asset. A security failure in this platform is not merely a &ldquo;bug&rdquo;; it represents a breach of trust that could result in:</p>
<ul>
<li><strong>Direct Financial Loss:</strong> Theft of credit card data or fraud.</li>
<li><strong>Reputational Damage:</strong> Loss of customer confidence following a data leak.</li>
<li><strong>Regulatory Fines:</strong> Penalties for non-compliance with <strong>GDPR</strong> due to exposed personal data.</li>
</ul>
<p>In this scenario, an attacker has compromised the web server. Our objective is to analyze how this occurred, assess the business impact, and define the mitigation strategy.</p>
<hr>
<h2 id="2-technical-execution-the-attack-chain-tactics">2. Technical Execution: The Attack Chain (Tactics)</h2>
<p>The attack followed a classic methodology: <strong>Reconnaissance → Exploitation → Persistence</strong>. Below is the technical breakdown of the findings:</p>
<h3 id="phase-1-reconnaissance--vector-discovery">Phase 1: Reconnaissance &amp; Vector Discovery</h3>
<p>The attacker began with passive inspection of the HTML source code.</p>
<ul>
<li><strong>Finding:</strong> Hidden comments in the code revealed critical paths: <code>./logs</code> and <code>custom.min.js</code>.</li>
<li><strong>Technique:</strong> Browser inspection (F12) and network analysis.</li>
<li><strong>Obfuscation:</strong> The <code>custom.min.js</code> file was encoded in <strong>Hexadecimal</strong>.
<ul>
<li><strong>Action:</strong> Used <strong>CyberChef</strong> to decode the payload.</li>
<li><strong>Result:</strong> The decrypted message was <code>DIRECTORY LISTING IS THE ONLY WAY</code>, indicating that directory listing was enabled on the Apache server.</li>
</ul>
</li>
</ul>
<h3 id="phase-2-exploitation-of-misconfiguration">Phase 2: Exploitation of Misconfiguration</h3>
<p>The enabled directory listing allowed the attacker to navigate to <code>/logs</code>.</p>
<ul>
<li><strong>Vulnerability:</strong> Exposure of sensitive files (<code>email_dump.txt</code>) due to poor web server configuration.</li>
<li><strong>Intel Extraction:</strong> The file contained internal emails where a developer (&ldquo;Bob&rdquo;) shared credentials and API paths in plaintext.
<ul>
<li><strong>Credentials Found:</strong> <code>THM{100100111}</code> (Password for <code>/planning</code>).</li>
<li><strong>Business Logic:</strong> The developer named the API folder based on the first phase of the <strong>SSDLC</strong> (Secure Software Development Life Cycle): <strong>Planning</strong>.</li>
</ul>
</li>
</ul>
<h3 id="phase-3-lateral-movement--privilege-escalation">Phase 3: Lateral Movement &amp; Privilege Escalation</h3>
<p>Accessing <code>/planning</code> with the obtained password revealed an insecure API endpoint: <code>/api/?customer_id=X</code>.</p>
<ul>
<li><strong>Vulnerability:</strong> <strong>IDOR</strong> (Insecure Direct Object Reference). The system failed to validate if the user had permission to view data for any <code>customer_id</code>.</li>
<li><strong>Exploitation:</strong> Manual iteration of IDs (1, 2, 3&hellip;) until finding the admin user (ID: 3).</li>
<li><strong>Result:</strong> Obtained administrator credentials (<code>realadmin@traverse.com</code> / <code>admin_key!!!</code>) and the hidden endpoint <code>/realadmin</code>.</li>
</ul>
<h3 id="phase-4-remote-code-execution-rce">Phase 4: Remote Code Execution (RCE)</h3>
<p>The <code>/realadmin</code> administration panel allowed system command execution under the <code>www-data</code> user context.</p>
<ul>
<li><strong>Attack Vector:</strong> <strong>Command Injection</strong> via the <code>commands</code> parameter in the POST request.</li>
<li><strong>Payload:</strong> <code>ls -lsa</code> to enumerate the filesystem.</li>
<li><strong>Critical Finding:</strong> Existence of a <strong>Web Shell</strong> (<code>thm_shell.php</code>) and a renamed file manager (<code>renamed_file_manager.php</code>).</li>
<li><strong>Final Action:</strong> Used the file manager (authenticated with <code>THM{10101}</code>) to edit <code>index.php</code> and restore the site, demonstrating full control over content integrity.</li>
</ul>
<hr>
<h2 id="3-risk-analysis--business-impact-strategy---cism">3. Risk Analysis &amp; Business Impact (Strategy - CISM)</h2>
<p>From a management perspective, this incident is not an isolated event but the result of multiple failures in <strong>Security Governance</strong>.</p>
<h3 id="risk-assessment-matrix-impact-vs-probability">Risk Assessment Matrix (Impact vs. Probability)</h3>
<table>
  <thead>
      <tr>
          <th>Vulnerability</th>
          <th>Business Impact</th>
          <th>Probability</th>
          <th>Calculated Risk</th>
          <th>Justification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Log Exposure</strong></td>
          <td><strong>High</strong></td>
          <td><strong>High</strong></td>
          <td><strong>Critical</strong></td>
          <td>Allows credential theft with minimal effort. Violates Confidentiality.</td>
      </tr>
      <tr>
          <td><strong>IDOR in API</strong></td>
          <td><strong>High</strong></td>
          <td><strong>Medium</strong></td>
          <td><strong>High</strong></td>
          <td>Allows access to all customer data. GDPR risk.</td>
      </tr>
      <tr>
          <td><strong>Command Injection</strong></td>
          <td><strong>Critical</strong></td>
          <td><strong>High</strong></td>
          <td><strong>Critical</strong></td>
          <td>Full server compromise (RCE). Loss of Integrity &amp; Availability.</td>
      </tr>
  </tbody>
</table>
<h3 id="violated-security-principles">Violated Security Principles</h3>
<ol>
<li><strong>Confidentiality:</strong> Credentials and customer data exposed in plaintext.</li>
<li><strong>Integrity:</strong> Attacker ability to modify the website (<code>index.php</code>).</li>
<li><strong>Principle of Least Privilege:</strong> The <code>www-data</code> user had sufficient permissions to list system files and execute arbitrary commands.</li>
<li><strong>Secure by Design:</strong> Failure in the SDLC. Credentials shared via email; secrets left in comments.</li>
</ol>
<h3 id="financial-risk-calculation-hypothetical-example">Financial Risk Calculation (Hypothetical Example)</h3>
<p>Assuming the company handles <strong>10,000 customers</strong>:</p>
<ul>
<li><strong>SLE (Single Loss Expectancy):</strong> Cost of breach = <code>$150/record</code> x <code>10,000</code> = <strong><code>$1.5M</code></strong>.</li>
<li><strong>ARO (Annual Rate of Occurrence):</strong> Given the public nature of the vulnerabilities and ease of exploitation, estimated at <strong><code>1</code> time/year</strong> if unpatched.</li>
<li><strong>ALE (Annual Loss Expectancy):</strong> <code>$1.5M</code> x <code>1</code> = <strong><code>$1.5M</code> annually</strong>.</li>
<li><strong>Conclusion for Leadership:</strong> Investing in a vulnerability scanner (<code>$10k/year</code>) and developer training (<code>$5k</code>) yields a clear ROI against a potential loss of <code>$1.5M</code>.</li>
</ul>
<hr>
<h2 id="4-mitigation-plan--recommendations">4. Mitigation Plan &amp; Recommendations</h2>
<p>To reduce <strong>Residual Risk</strong> below the organization&rsquo;s <strong>Risk Appetite</strong>, the following actions are proposed based on the <strong>NIST CSF</strong> framework:</p>
<h3 id="a-preventive-controls-protect">A. Preventive Controls (Protect)</h3>
<ol>
<li><strong>Server Hardening:</strong>
<ul>
<li>Disable directory listing (<code>Options -Indexes</code> in Apache/Nginx).</li>
<li>Remove debug files and sensitive logs from web-accessible directories.</li>
</ul>
</li>
<li><strong>Secrets Management:</strong>
<ul>
<li>Prohibit storing credentials in source code, comments, or text files.</li>
<li>Implement a secrets manager (e.g., HashiCorp Vault, AWS Secrets Manager) to inject credentials at runtime.</li>
</ul>
</li>
<li><strong>Input Validation &amp; Authorization:</strong>
<ul>
<li>Implement <strong>Role-Based Access Control (RBAC)</strong> to ensure users only access their own data (mitigate IDOR).</li>
<li>Sanitize all user inputs to prevent command injection.</li>
</ul>
</li>
</ol>
<h3 id="b-detective-controls-detect">B. Detective Controls (Detect)</h3>
<ol>
<li><strong>Log Monitoring (SIEM):</strong>
<ul>
<li>Configure alerts for anomalous patterns in access logs (e.g., multiple requests to <code>/api/?customer_id=</code> with different IDs).</li>
<li>Detect command execution attempts in administration endpoints.</li>
</ul>
</li>
<li><strong>WAF (Web Application Firewall):</strong>
<ul>
<li>Deploy rules to block command injection patterns and access to sensitive paths.</li>
</ul>
</li>
</ol>
<h3 id="c-corrective-controls-respondrecover">C. Corrective Controls (Respond/Recover)</h3>
<ol>
<li><strong>Incident Response Plan (IRP):</strong>
<ul>
<li>Update playbooks for immediate rotation of all exposed credentials.</li>
<li>Establish a procedure for &ldquo;cleaning&rdquo; malicious files (Web Shells).</li>
</ul>
</li>
<li><strong>Security Culture:</strong>
<ul>
<li>Mandatory training for developers on <strong>OWASP Top 10</strong> and <strong>Secure Coding</strong> practices.</li>
<li>Integrate code reviews and <strong>SAST</strong> scans into the CI/CD pipeline.</li>
</ul>
</li>
</ol>
<hr>
<h2 id="5-conclusion--lessons-learned">5. Conclusion &amp; Lessons Learned</h2>
<p>The &ldquo;Traverse&rdquo; case demonstrates that security is a continuous process, not a product. The combination of insecure configurations (directory listing), poor data management (plaintext credentials), and lack of validation (IDOR) created a trivial attack chain.</p>
<p><strong>For Leadership:</strong> Security investment must be viewed as a business enabler, not a cost. A failure of this magnitude could have cost millions in fines and reputation loss. Implementing a robust <strong>Application Security (AppSec)</strong> program is the only way to ensure business continuity in a hostile digital environment.</p>
<p><strong>For Technical Teams:</strong> Defense in depth is mandatory. Do not rely on &ldquo;security through obscurity&rdquo; (hidden comments, obscure filenames). Validate, sanitize, and monitor every layer of the application.</p>
<h3 id="-technical-references">📎 Technical References</h3>
<ul>
<li><strong>OWASP Top 10:</strong> A01:2021-Broken Access Control, A03:2021-Injection, A05:2021-Security Misconfiguration.</li>
<li><strong>NIST SP 800-53:</strong> Security Controls for Information Systems.</li>
<li><strong>TryHackMe Room:</strong> Traverse</li>
</ul>
]]></content:encoded></item></channel></rss>