<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OffSec Labs & Walkthroughs]]></title><description><![CDATA[Hands-on offensive security lab walkthroughs, CTF writeups, web application pentesting, Active Directory exploitation, and privilege escalation methodologies by]]></description><link>https://shadowsensei-sec.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a9429a66cd7e0a524209220/59df6efb-273f-41e0-906f-6c8918329ece.jpg</url><title>OffSec Labs &amp; Walkthroughs</title><link>https://shadowsensei-sec.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Tue, 15 Sep 2026 20:15:05 GMT</lastBuildDate><atom:link href="https://shadowsensei-sec.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[VesperAegis: My Journey of Building a Linux-Based Firewall]]></title><description><![CDATA[VesperAegis Firewall — Adaptive Network Security & Traffic Intelligence

Over the past few days, I have been working on something different from my usual penetration-testing labs.
Instead of only test]]></description><link>https://shadowsensei-sec.hashnode.dev/vesperaegis</link><guid isPermaLink="true">https://shadowsensei-sec.hashnode.dev/vesperaegis</guid><category><![CDATA[cybersecurity]]></category><category><![CDATA[network security]]></category><category><![CDATA[firewall]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[security engineering]]></category><dc:creator><![CDATA[shadow Sensei]]></dc:creator><pubDate>Mon, 07 Sep 2026 18:43:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/6e0b64f1-9cca-4f85-8563-1d8a1dcf5487.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><strong>VesperAegis Firewall — Adaptive Network Security &amp; Traffic Intelligence</strong></p>
</blockquote>
<p>Over the past few days, I have been working on something different from my usual penetration-testing labs.</p>
<p>Instead of only <strong>testing security controls</strong>, I wanted to understand what happens on the other side:</p>
<p><strong>How is a firewall actually built?</strong></p>
<p>That question led me to build <strong>VesperAegis Firewall</strong>, a Linux-based firewall project designed to provide rule management, traffic enforcement, monitoring, authentication, and a web-based management interface.</p>
<p>This started as part of my cybersecurity internship, but I decided to take the project beyond simply researching firewall technologies and actually build a working application around Linux's native firewall infrastructure.</p>
<p>The project is still evolving, and this article documents <strong>what I have actually built so far, how it is structured, how I am testing it, and what I plan to build next.</strong></p>
<hr />
<h1>Why Build a Firewall?</h1>
<p>During my research into firewall technologies, I spent time understanding how firewalls evolved from basic packet filtering to stateful inspection, NGFWs, cloud firewalls, and modern security platforms.</p>
<p>But theoretical understanding only gets you so far.</p>
<p>I wanted to answer questions such as:</p>
<ul>
<li><p>How does a firewall rule become an actual kernel-level enforcement rule?</p>
</li>
<li><p>How should firewall policies be represented in an application?</p>
</li>
<li><p>How can invalid or conflicting rules be detected before deployment?</p>
</li>
<li><p>How should firewall configuration be stored?</p>
</li>
<li><p>How should administrators interact with the firewall?</p>
</li>
<li><p>How can traffic statistics and firewall events be monitored?</p>
</li>
<li><p>How can an application safely control the underlying firewall?</p>
</li>
</ul>
<p>Instead of building another theoretical architecture diagram, I decided to build a practical system.</p>
<p>That became <strong>VesperAegis</strong>.</p>
<hr />
<h1>Introducing VesperAegis</h1>
<p><strong>VesperAegis Firewall</strong></p>
<blockquote>
<p><em>Adaptive Network Security &amp; Traffic Intelligence</em></p>
</blockquote>
<p>The idea is relatively simple:</p>
<p>The application should provide the <strong>management and intelligence layer</strong>, while Linux should remain responsible for the actual packet enforcement.</p>
<p>I did not want to implement a firewall engine from scratch in Python.</p>
<p>Instead, the project uses <strong>nftables/Netfilter</strong>, which allows Linux to perform the actual network filtering.</p>
<p>The application sits above that enforcement layer.</p>
<hr />
<h1>The Core Architecture</h1>
<p>The current architecture looks like this:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/298a8167-8de2-441a-af81-081566a5f31e.png" alt="" style="display:block;margin:0 auto" />

<p>The important design decision here is the separation between <strong>application-level policy management</strong> and <strong>actual packet enforcement</strong>.</p>
<p>The Python application does not replace the Linux firewall subsystem.</p>
<p>This gives VesperAegis a clear responsibility boundary.</p>
<hr />
<h1>Why nftables?</h1>
<p>One of the most important decisions was choosing the actual enforcement mechanism. I chose <strong>nftables/Netfilter</strong> because I wanted the project to operate on top of Linux's native packet-filtering infrastructure rather than attempting to simulate firewall behaviour inside Python.</p>
<p>A Python application displaying:</p>
<pre><code class="language-text">ALLOW TCP 192.168.50.10 → 192.168.60.20:80
</code></pre>
<p>doesn't make that traffic allowed by itself. The policy eventually needs to reach the actual enforcement layer. That's why nftables is central to the project.</p>
<hr />
<h1>Why Python?</h1>
<p>Python is used as the primary application-development language.</p>
<p>The project has several components that benefit from Python:</p>
<ul>
<li>API development, Rule processing, Validation, Configuration management, Database interaction, Authentication logic, System integration, Testing, Operational scripts.</li>
</ul>
<p>Python also makes it easier to iterate quickly while keeping the project understandable.</p>
<p>The goal wasn't to create an enormous codebase. The goal was to create something where I could understand <strong>how the components interact</strong>.</p>
<hr />
<h1>Why FastAPI?</h1>
<p>The firewall needs an interface through which the dashboard and other clients can communicate with the backend.</p>
<p>For that layer, I chose <strong>FastAPI</strong>.</p>
<p>The REST API provides endpoints for operations such as:</p>
<ul>
<li>Firewall status, Rule management, Configuration, Logs, Traffic statistics, Authentication, System information.</li>
</ul>
<p>This also gives the project a cleaner separation between the frontend and backend. The dashboard doesn't need to directly manipulate nftables. Instead, it communicates with the API.</p>
<hr />
<h1>Why SQLite?</h1>
<p>I intentionally kept the database layer lightweight. VesperAegis uses <strong>SQLite</strong> for configuration and application state.</p>
<p>For this project, I don't need a large distributed database infrastructure.</p>
<p>SQLite is sufficient for storing information such as:</p>
<ul>
<li>Firewall rules, Rule configuration, Application state, Relevant event, information, Authentication-related application data</li>
</ul>
<p>This keeps the project easy to deploy in a laboratory environment while still giving it a proper persistence layer.</p>
<hr />
<h1>Firewall Rule Management</h1>
<p>One of the main components I wanted to build was proper rule management.</p>
<p>The application currently supports operations such as:</p>
<ul>
<li>Create rules, Edit rules, Delete rules, Enable rules, Disable rules, Configure priority, Configure protocols, Configure source/destination, addresses, Configure ports</li>
</ul>
<p>A conceptual rule could look like:</p>
<pre><code class="language-yaml">action: allow
protocol: tcp
source: 192.168.50.10
destination: 192.168.60.20
destination_port: 80
enabled: true
priority: 10
</code></pre>
<p>The YAML representation is useful for making firewall policy readable and manageable. But before a rule reaches nftables, it should go through validation.</p>
<hr />
<h1>Rule Validation</h1>
<p>This became one of the more interesting parts of the project. A firewall application shouldn't blindly accept every rule entered by an administrator.</p>
<p>VesperAegis currently performs validation for areas such as:</p>
<h3>IP / CIDR validation</h3>
<p>For example:</p>
<pre><code class="language-text">192.168.50.10
192.168.60.0/24
</code></pre>
<h3>Port validation</h3>
<p>The application checks whether port values fall within valid ranges and whether the rule structure is correct.</p>
<h3>Protocol validation</h3>
<p>Rules need to use supported protocols rather than arbitrary values.</p>
<h3>Priority</h3>
<p>Rules can have priorities so that policy ordering can be managed explicitly.</p>
<hr />
<h1>Detecting Conflicting Rules</h1>
<p>Another feature I wanted to implement was <strong>rule conflict detection</strong>.</p>
<p>Consider:</p>
<pre><code class="language-text">Rule 1:
ALLOW TCP → 192.168.60.20:80

Rule 2:
DENY TCP → 192.168.60.20:80
</code></pre>
<p>Both rules target the same traffic. Without proper handling, administrators could create confusing policies and wonder why traffic behaves differently from what they expected. The application therefore attempts to identify problematic combinations before they become operational issues.</p>
<hr />
<h1>Rule Shadowing</h1>
<p>A related problem is <strong>rule shadowing</strong>.</p>
<p>For example:</p>
<pre><code class="language-text">Rule 1:
DENY 192.168.60.0/24

Rule 2:
ALLOW 192.168.60.20
</code></pre>
<p>Depending on ordering and evaluation logic, the second rule may never become effective. This is an important firewall-management problem because a rule can look perfectly valid syntactically while being ineffective from a policy perspective.</p>
<p>VesperAegis therefore includes shadowing detection as part of its rule-analysis layer.</p>
<hr />
<h1>Security Warnings</h1>
<p>The project also provides warnings for potentially dangerous or overly broad rules.</p>
<p>For example, administrators should be careful with policies equivalent to:</p>
<pre><code class="language-text">ALLOW
ANY
ANY
ANY
</code></pre>
<p>A rule can be syntactically valid while still being a poor security decision. This is where the application layer can provide value beyond simply passing configuration to nftables.</p>
<hr />
<h1>Authentication and Access Control</h1>
<p>A firewall management interface itself is a security-sensitive application.</p>
<p>If an attacker can access the dashboard and modify firewall policy, the firewall becomes another attack surface. Because of that, authentication was included in the project.</p>
<p>The current implementation includes:</p>
<ul>
<li>Authentication, Session-based access control, Protected API access, Protected application pages, Administrator credential management, Password hashing using PBKDF2-SHA256.</li>
</ul>
<p>The initial administrator account also requires a credential change rather than relying on permanent default credentials.</p>
<hr />
<h1>Dashboard and Monitoring</h1>
<p>VesperAegis also includes a web dashboard.</p>
<p>The purpose of the dashboard isn't simply to make the project look nice.</p>
<p>It provides an operational interface for viewing things such as:</p>
<ul>
<li>Firewall status, Rules, Logs, Traffic statistics, System information, Configuration state.</li>
</ul>
<p>The frontend is built using:</p>
<pre><code class="language-text">HTML
CSS
JavaScript
</code></pre>
<p>while communication with the backend happens through the FastAPI REST API.</p>
<hr />
<h1>Firewall Enforcement vs Logging vs Packet Capture</h1>
<p>One distinction I specifically wanted to maintain in the architecture is that <strong>firewall enforcement, logging, statistics, and packet capture are not the same thing.</strong></p>
<p>It would be incorrect to describe VesperAegis as storing every raw packet in SQLite.</p>
<p>That's not the design.</p>
<p>Instead:</p>
<pre><code class="language-text">                ┌───────────────┐
Traffic ───────→│   nftables    │
                └───────┬───────┘
                        │
                 Enforcement
                        │
                        ▼
                 Packet Counters
                        │
                        ▼
              Application Statistics
</code></pre>
<p>The application can record relevant firewall events and statistics.</p>
<p>For deeper packet-level investigation, tools such as:</p>
<pre><code class="language-text">tcpdump
Wireshark
</code></pre>
<p>can be used separately during testing. This separation keeps the database from becoming an unnecessary packet-storage system.</p>
<hr />
<h1>The Laboratory Network</h1>
<p>The next important stage was moving from application testing toward <strong>real network testing</strong>. I built an isolated laboratory environment so that I could test forwarded traffic without mixing it with management traffic.</p>
<p>The current topology is:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/22b1fcbf-8a1d-4e69-9095-d6661bf31692.png" alt="" style="display:block;margin:0 auto" />

<p>The intended traffic path is:</p>
<pre><code class="language-text">Kali
  ↓
VesperAegis
  ↓
Protected Network
  ↓
Target
</code></pre>
<p>This isolation is important because I want to test <strong>actual forwarded traffic through the firewall</strong>, rather than simply testing rules against the firewall's own management traffic.</p>
<hr />
<h1>Testing From the Attacker Side</h1>
<p>Kali will act as the attacker/testing machine. The protected network contains Ubuntu or intentionally vulnerable machines.</p>
<p>This allows me to test scenarios such as:</p>
<pre><code class="language-text">Kali
 ↓
Reconnaissance
 ↓
Firewall
 ↓
Protected Target
</code></pre>
<p>I can then modify firewall policies and observe how traffic behaviour changes.</p>
<p>For example:</p>
<pre><code class="language-text">ALLOW TCP/80
</code></pre>
<p>should produce different behaviour from:</p>
<pre><code class="language-text">DENY TCP/80
</code></pre>
<p>The important part isn't simply seeing a rule inside the dashboard.The objective is to verify that the <strong>actual network traffic is affected by the policy</strong>.</p>
<hr />
<h1>AI Is a Future Layer</h1>
<p>The name <em>Adaptive Network Security &amp; Traffic Intelligence</em> points toward something I want to explore later:</p>
<p><strong>AI-assisted security.</strong></p>
<p>But I deliberately did <strong>not</strong> make AI responsible for directly controlling nftables.</p>
<p>Potential future capabilities include:</p>
<ul>
<li>Risk scoring, Rule recommendations, Log summarization, Policy, explanation, Traffic anomaly analysis.</li>
</ul>
<p>The architecture:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/3a2626d9-50ed-430b-8d4b-95a8a4ab25c5.png" alt="" style="display:block;margin:0 auto" />

<p>The important part is the <strong>human approval layer</strong>. I don't want a probabilistic model to directly modify firewall enforcement without oversight. AI can provide recommendations and analysis. The firewall should remain deterministic and controlled.</p>
<hr />
<h1>What Building a Firewall Taught Me</h1>
<p>One of the biggest lessons from this project is that a firewall isn't just an <code>ALLOW</code> or <code>DENY</code> command.</p>
<p>There are several layers involved:</p>
<pre><code class="language-text">User Policy
    ↓
Application
    ↓
Validation
    ↓
Rule Engine
    ↓
Configuration
    ↓
nftables
    ↓
Netfilter
    ↓
Linux Kernel
    ↓
Network Interface
    ↓
Traffic
</code></pre>
<p>Every layer introduces its own engineering and security considerations. A mistake in the UI can become a bad policy. A mistake in validation can become an invalid rule. A mistake in rule translation can result in unexpected enforcement. And a mistake in authentication can potentially allow an attacker to control the entire security boundary. That makes firewall development a much more interesting engineering problem than I initially expected.</p>
<hr />
<h1>Final Thoughts</h1>
<p>VesperAegis started with a simple question:</p>
<blockquote>
<p><strong>Why can't I build a firewalls and actually learn while building it?</strong></p>
</blockquote>
<p>The answer has been a much deeper engineering experience than I expected. I've had to think about Linux networking, nftables, APIs, databases, authentication, rule processing, network topology, testing, and the security of the management application itself.</p>
<p>The project is <strong>not an enterprise firewall</strong>, and I don't intend to present it as one.</p>
<p>It is a practical cybersecurity engineering project that I am building to understand how firewall systems work from the inside out.</p>
<hr />
<h2>Project</h2>
<p><strong>VesperAegis Firewall</strong> <em>Adaptive Network Security &amp; Traffic Intelligence</em></p>
<p>The project is being developed as part of my cybersecurity internship and is maintained as a practical learning and engineering project.</p>
<p>🔗 <strong>GitHub:</strong> <a href="https://github.com/ShadowSensei-Sec/VesperAegis">VesperAegis Firewall</a></p>
<hr />
<h3>Disclaimer</h3>
<p>VesperAegis is an independent cybersecurity engineering project developed for learning, research, and authorized laboratory testing. It should not be considered an enterprise-ready firewall or deployed in production without extensive security review, testing, hardening, and validation.</p>
<p>All network testing described in this article is intended for isolated and authorized laboratory environments.</p>
<hr />
]]></content:encoded></item><item><title><![CDATA[PJPT Certified My Journey ]]></title><description><![CDATA[One Password, Two Characters, and a Power Cut — My PJPT Journey 😅
August 25, 2026. 9:00 AM.
I started my Practical Junior Penetration Tester (PJPT) exam.
I knew the technical concepts. I had worked t]]></description><link>https://shadowsensei-sec.hashnode.dev/pjpt-exam-review-tcm-security</link><guid isPermaLink="true">https://shadowsensei-sec.hashnode.dev/pjpt-exam-review-tcm-security</guid><category><![CDATA[penetration testing]]></category><category><![CDATA[Ethical Hacking]]></category><category><![CDATA[TCM Security]]></category><category><![CDATA[PJPT]]></category><category><![CDATA[Active Directory]]></category><category><![CDATA[vapt]]></category><dc:creator><![CDATA[shadow Sensei]]></dc:creator><pubDate>Tue, 01 Sep 2026 16:41:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/b602baa0-14d1-4462-bad3-ba2289bbe5cb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>One Password, Two Characters, and a Power Cut — My PJPT Journey 😅</h1>
<p><strong>August 25, 2026. 9:00 AM.</strong></p>
<p>I started my <strong>Practical Junior Penetration Tester (PJPT)</strong> exam.</p>
<p>I knew the technical concepts. I had worked through the Practical Ethical Hacking course, practiced Active Directory, solved labs, and spent countless hours enumerating systems.</p>
<p>But once the exam started, all of that preparation had to come together.</p>
<p>No walkthroughs. No step-by-step instructions. Just me, the target environment, and my methodology.</p>
<p>And, of course, a few moments where I questioned my entire existence. 😅</p>
<p>Today, I can finally say:</p>
<blockquote>
<p><strong>I am officially PJPT certified.</strong></p>
</blockquote>
<p>This is my <strong>first professional cybersecurity certification</strong>, and it means considerably more to me than simply adding another badge to my profile.</p>
<h2>The Exam — Starting From Zero</h2>
<p>I started at around <strong>9:00 AM on August 25th</strong>.</p>
<p>My first step was straightforward: understand the environment.</p>
<p>I began with network reconnaissance, service enumeration, and identifying the available attack surface.</p>
<p>Rather than immediately following a predefined checklist from the course, I decided to approach the environment using <strong>my own methodology</strong>.</p>
<p>My mindset was simple:</p>
<pre><code class="language-text">Reconnaissance
      ↓
Enumeration
      ↓
Identify Attack Path
      ↓
Initial Access
      ↓
Privilege Escalation
      ↓
Domain Compromise
      ↓
Reporting
</code></pre>
<p>The first major obstacle came fairly early.</p>
<p>I spent almost <strong>two hours</strong> stuck at one point.</p>
<p>I started questioning my methodology.</p>
<p>Was I missing something?</p>
<p>Was my enumeration wrong?</p>
<p>Was there another attack path?</p>
<p>Should I start over?</p>
<p>Eventually, I decided to step back, reassess the information I had already collected, and approach the problem again.</p>
<p>That decision paid off.</p>
<p>I found the first step and continued moving through the environment.</p>
<hr />
<h1>The Most Embarrassing Mistake 😭</h1>
<p>This was probably my favorite lesson from the entire exam.</p>
<p>Around <strong>2:00 PM</strong>, I got stuck again.</p>
<p>This time, I spent almost an hour trying to figure out what I had done wrong.</p>
<p>I went back through my enumeration.</p>
<p>I checked the information again.</p>
<p>And again.</p>
<p>And again.</p>
<p>I had actually looked at the same output <strong>two or three times</strong>.</p>
<p>The problem?</p>
<p>I had missed <strong>two characters in a password</strong>.</p>
<p>Two.</p>
<p>Characters.</p>
<p>They were sitting right there in the information I had already collected.</p>
<p>I wasn't technically doing anything wrong.</p>
<p>My problem was simply <strong>attention to detail</strong>.</p>
<p>When I finally noticed it, my reaction was basically:</p>
<blockquote>
<p><em>“What rey... seriously?”</em> 😂</p>
</blockquote>
<p>That moment reinforced something extremely important:</p>
<h3>Enumeration isn't just about collecting information.</h3>
<p>It's about <strong>actually reading and understanding the information you collect</strong>.</p>
<p>A perfect tool output is useless if you don't notice the one detail that matters.</p>
<hr />
<h2>Going Back to the Fundamentals</h2>
<p>Once I got past that obstacle, the assessment started moving much more naturally.</p>
<p>I continued enumerating the environment, identifying relationships between systems and accounts, and working through the Active Directory attack path.</p>
<p>At different points, I went back to concepts from the <strong>Practical Ethical Hacking (PEH)</strong> course to refresh specific techniques and make sure I was approaching the problem correctly.</p>
<p>Eventually, I reached the point I had been working toward:</p>
<blockquote>
<p><strong>Domain compromise.</strong></p>
</blockquote>
<p>That was probably the most satisfying moment of the entire assessment.</p>
<p>Not because I had simply reached the end of a lab, but because I had taken everything I had learned during preparation and applied it against an environment where I wasn't being given the exact next step.</p>
<hr />
<h2>The Exam Wasn't the Hardest Part</h2>
<p>One thing that surprised me was how approachable the technical assessment felt once the fundamentals were in place.</p>
<p>Before starting, I had built it up in my head as something much more complicated.</p>
<p>But once I started working methodically, I realized that the assessment wasn't about knowing hundreds of obscure techniques.</p>
<p>It was about understanding the fundamentals and being able to reason through an attack path.</p>
<p>For me, the most important skills were:</p>
<ul>
<li><p>Network enumeration</p>
</li>
<li><p>Service enumeration</p>
</li>
<li><p>Active Directory fundamentals</p>
</li>
<li><p>Credential enumeration</p>
</li>
<li><p>Understanding attack paths</p>
</li>
<li><p>Privilege escalation</p>
</li>
<li><p>Careful analysis of collected information</p>
</li>
<li><p>Knowing when to step back and reassess</p>
</li>
</ul>
<p>The <strong>PEH course was the primary resource I relied on during preparation</strong>, and I found that the concepts covered there provided a strong foundation for the assessment.</p>
<p>I also had extensive hands-on practice through labs, which helped me become comfortable with enumeration and troubleshooting.</p>
<hr />
<h2>And Then I Lost My Entire Report 🤦‍♂️</h2>
<p>After successfully taking over the domain, there was still one major part left:</p>
<p><strong>The report.</strong></p>
<p>I started documenting the assessment and eventually reached approximately <strong>75% completion</strong>.</p>
<p>Then...</p>
<p><strong>Power cut.</strong></p>
<p>And I had made one incredibly stupid mistake.</p>
<p>I hadn't saved the document.</p>
<p>My report was gone.</p>
<p>After everything I had just done, I now had another challenge:</p>
<blockquote>
<p><strong>Do the report again.</strong></p>
</blockquote>
<p>That was probably more painful than any enumeration problem during the exam. 😂</p>
<p>After taking a long break, I came back and started rebuilding the report.</p>
<p>This time, I saved constantly.</p>
<p>Eventually, I completed the report, reviewed it, and submitted it.</p>
<hr />
<h2>What PJPT Taught Me</h2>
<p>The biggest lessons from the exam weren't actually specific commands.</p>
<p>They were habits.</p>
<h2>1. Attention to detail beats speed</h2>
<p>The password incident taught me this directly.</p>
<p>Sometimes the information you need is already in front of you.</p>
<p>Don't keep searching for a complicated answer when you haven't completely analyzed the simple information you've already collected.</p>
<h2>2. Trust your methodology</h2>
<p>Getting stuck doesn't automatically mean your methodology is wrong.</p>
<p>Sometimes you simply haven't found the correct path yet.</p>
<p>Instead of immediately abandoning everything, step back:</p>
<pre><code class="language-text">Stop
 ↓
Review
 ↓
Reassess
 ↓
Enumerate Again
 ↓
Continue
</code></pre>
<p>A calm reassessment is often more useful than randomly trying another tool.</p>
<h2>3. Don't overcomplicate the assessment</h2>
<p>During preparation, it's easy to think you need every tool, every framework, and every advanced technique.</p>
<p>You don't.</p>
<p>Strong fundamentals combined with good enumeration and logical reasoning can take you surprisingly far.</p>
<h2>4. Reporting is part of penetration testing</h2>
<p>This was another major lesson.</p>
<p>Compromising the environment isn't the end of the engagement.</p>
<p>A professional penetration tester must also be able to communicate:</p>
<ul>
<li><p>What was discovered</p>
</li>
<li><p>How it was exploited</p>
</li>
<li><p>Why it matters</p>
</li>
<li><p>What impact it creates</p>
</li>
<li><p>How it should be remediated</p>
</li>
</ul>
<p>The technical work means little if the findings cannot be communicated clearly.</p>
<p>And yes...</p>
<p><strong>Save your report. Frequently.</strong></p>
<p>I learned that one the hard way. 😂</p>
<h2>Would I Recommend PJPT?</h2>
<p>Absolutely—especially if you're building your fundamentals in penetration testing.</p>
<p>For someone coming from a beginner/junior offensive-security background, I found the assessment valuable because it forces you to move beyond simply following walkthroughs.</p>
<p>You have to:</p>
<p><strong>Think → Enumerate → Test → Adapt → Exploit → Document.</strong></p>
<p>That process is where the real learning happens.</p>
<p>My preparation was primarily built around <strong>TCM Security's Practical Ethical Hacking course</strong>, combined with hands-on lab practice.</p>
<p>I wouldn't say someone should blindly memorize the course and expect to pass. Understanding <strong>why</strong> the techniques work is much more important than memorizing commands.</p>
<h2>The Milestone</h2>
<p>Today, I officially received my <strong>Practical Junior Penetration Tester (PJPT)</strong> certification and badge from <strong>TCM Security</strong>.</p>
<p>This is my <strong>first official professional cybersecurity certification</strong>.</p>
<p>For someone working toward a career in offensive security, this isn't the finish line.</p>
<p>It's a checkpoint.</p>
<p>There are still a lot of things I want to learn:</p>
<p>The certificate is proof that I completed one stage.</p>
<p>The real goal is becoming better at the craft.</p>
<hr />
<h2>Final Thoughts</h2>
<p>Looking back at the exam, the most valuable part wasn't the moment I obtained domain compromise.</p>
<p>It was everything that happened <strong>before</strong> it.</p>
<p>Getting stuck.</p>
<p>Starting again.</p>
<p>Missing two characters in a password.</p>
<p>Questioning my methodology.</p>
<p>Going back to fundamentals.</p>
<p>And eventually figuring it out.</p>
<p>Those moments are exactly what make hands-on security work interesting.</p>
<p>You don't always need another tool.</p>
<p>Sometimes you just need to <strong>slow down and look again.</strong></p>
<p>And after all of that...</p>
<p><strong>PJPT is officially unlocked. 🥷🔴</strong></p>
<p>On to the next challenge.</p>
<hr />
<h2>More From ShadowSensei</h2>
<p>I'll be documenting my future penetration-testing labs and assessments through professional reports and technical write-ups.</p>
<ul>
<li><p><strong>Professional Pentest Reports:</strong> <a href="https://github.com/ShadowSensei-Sec">GitHub — ShadowSensei</a></p>
</li>
<li><p><strong>Technical Write-ups:</strong> <a href="https://shadowsensei-sec.hashnode.dev/">Hashnode — ShadowSensei</a></p>
</li>
<li><p><strong>Professional Profile:</strong> <a href="http://www.linkedin.com/in/baddula-pavan-kumar">LinkedIn</a></p>
</li>
</ul>
<hr />
<h3>Disclaimer</h3>
<p>This article describes my personal experience preparing for and completing the PJPT certification assessment. Specific exam content, credentials, flags, or other restricted assessment information have intentionally not been disclosed.</p>
<p>All laboratory and security testing activities discussed in my technical work are performed only in authorized environments.</p>
<hr />
<p><strong>ShadowSensei</strong> <em>PJPT Certified Penetration Tester | Offensive Security | VAPT | Red Teaming</em></p>
<blockquote>
<p><strong>Learn by testing. Understand by breaking. Improve by securing.</strong></p>
</blockquote>
<hr />
]]></content:encoded></item><item><title><![CDATA[JUMP — TryHackMe External Penetration Testing Assessment]]></title><description><![CDATA[Introduction
As part of my hands-on penetration testing practice, I performed an external security assessment against the JUMP machine in the TryHackMe laboratory environment.
The objective was to app]]></description><link>https://shadowsensei-sec.hashnode.dev/jump-pentest-report</link><guid isPermaLink="true">https://shadowsensei-sec.hashnode.dev/jump-pentest-report</guid><dc:creator><![CDATA[shadow Sensei]]></dc:creator><pubDate>Sun, 30 Aug 2026 17:13:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/091494b2-61bc-44de-a24f-dff521f438c7.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<h2>Introduction</h2>
<p>As part of my hands-on penetration testing practice, I performed an external security assessment against the <strong>JUMP</strong> machine in the TryHackMe laboratory environment.</p>
<p>The objective was to approach the target from the perspective of an <strong>unauthenticated external attacker</strong>, identify exposed services and security weaknesses, validate exploitable vulnerabilities, and determine whether those weaknesses could ultimately lead to administrative compromise.</p>
<p>The assessment resulted in <strong>complete compromise of the Linux target</strong>, achieved by chaining multiple security misconfigurations across different privilege levels.</p>
<blockquote>
<p><strong>Environment:</strong> TryHackMe — JUMP <strong>Assessment Type:</strong> External Penetration Test <strong>Target:</strong> Linux Host <strong>Testing Period:</strong> August 5–7, 2026 <strong>Assessment Status:</strong> Full system compromise achieved</p>
</blockquote>
<hr />
<h2>Assessment Approach</h2>
<p>The assessment followed a structured penetration-testing methodology consisting of:</p>
<ol>
<li><p>Reconnaissance</p>
</li>
<li><p>Service discovery</p>
</li>
<li><p>Enumeration</p>
</li>
<li><p>Vulnerability identification</p>
</li>
<li><p>Controlled exploitation</p>
</li>
<li><p>Privilege escalation</p>
</li>
<li><p>Validation of root-level access</p>
</li>
<li><p>Risk assessment and remediation</p>
</li>
</ol>
<p>The assessment was performed against the authorized TryHackMe laboratory environment.</p>
<hr />
<h1>Initial Reconnaissance</h1>
<p>The first stage focused on identifying externally accessible services and understanding the target's attack surface.</p>
<p>The assessment identified <strong>FTP and SSH</strong> as externally accessible services. While the exposed attack surface was relatively small, the FTP service presented a significant security weakness because it allowed <strong>anonymous authentication</strong>.</p>
<p>Anonymous FTP access provided an opportunity to enumerate accessible directories and retrieve information about the target's internal workflow.</p>
<p>Further investigation revealed an automated file-processing mechanism associated with an FTP-accessible directory.</p>
<p>This became the initial attack vector.</p>
<hr />
<h1>Initial Access Through Insecure File Processing</h1>
<p>The FTP service allowed anonymous users to interact with a directory that was monitored by an automated processing mechanism.</p>
<p>The critical issue was that <strong>user-controlled files were processed without sufficient validation or security controls</strong>.</p>
<p>This allowed a malicious payload to be introduced into the processing workflow and ultimately resulted in <strong>arbitrary command execution</strong> on the target.</p>
<p>The initial shell was obtained as:</p>
<pre><code class="language-text">recon_user
</code></pre>
<p>This finding was classified as <strong>Critical</strong> because an unauthenticated external attacker could obtain an initial foothold and continue toward full system compromise.</p>
<h3>Finding</h3>
<p><strong>EPT-001 — Anonymous FTP Authentication with Insecure Automated File Processing</strong></p>
<p><strong>Severity:</strong> Critical</p>
<p><strong>Impact:</strong> Successful exploitation allowed arbitrary command execution and provided the initial foothold required for subsequent privilege escalation.</p>
<h3>Recommended Remediation</h3>
<ul>
<li><p>Disable anonymous FTP authentication.</p>
</li>
<li><p>Restrict write access to upload directories.</p>
</li>
<li><p>Validate uploaded files before processing.</p>
</li>
<li><p>Execute automated processing using dedicated least-privileged accounts.</p>
</li>
</ul>
<hr />
<h1>Local Enumeration &amp; Privilege Escalation</h1>
<p>After obtaining the initial shell, the assessment moved into local enumeration.</p>
<p>The objective was to identify:</p>
<ul>
<li><p>Running processes</p>
</li>
<li><p>Scheduled tasks</p>
</li>
<li><p>File permissions</p>
</li>
<li><p>Service configurations</p>
</li>
<li><p>Writable scripts</p>
</li>
<li><p>Privileged execution paths</p>
</li>
<li><p>Sudo permissions</p>
</li>
</ul>
<p>This revealed several weaknesses that could be chained to progressively increase privileges.</p>
<hr />
<h1>Privilege Escalation Path 1 — Scheduled Backup Process</h1>
<p>A scheduled backup process was identified running under the <code>dev_user</code> account.</p>
<p>The backup mechanism interacted with files controlled by a lower-privileged user without sufficient permission restrictions.</p>
<p>This allowed the lower-privileged account to influence a privileged process and resulted in escalation from:</p>
<pre><code class="language-text">recon_user
      ↓
dev_user
</code></pre>
<p>The finding was rated <strong>High</strong> due to the ability to elevate privileges and continue progressing toward full system compromise.</p>
<p><strong>Finding:</strong> EPT-002 <strong>Severity:</strong> High</p>
<p>The recommended remediation includes reviewing scheduled tasks, enforcing proper ownership and permissions, and ensuring privileged automation cannot be influenced by lower-privileged accounts.</p>
<hr />
<h1>Privilege Escalation Path 2 — Systemd Execution Path Hijacking</h1>
<p>Further enumeration identified a systemd health-check service executing a binary through a writable execution path.</p>
<p>Because a lower-privileged user could influence the execution environment, the service could be manipulated to execute attacker-controlled code.</p>
<p>This resulted in:</p>
<pre><code class="language-text">dev_user
    ↓
monitor_user
</code></pre>
<p>The vulnerability was classified as <strong>High</strong>.</p>
<p><strong>Finding:</strong> EPT-003 — Insecure System Service Leading to Privilege Escalation</p>
<p>The report maps this weakness to <strong>CWE-427: Uncontrolled Search Path Element</strong> and <strong>MITRE ATT&amp;CK T1574: Hijack Execution Flow</strong>.</p>
<h3>Recommended Remediation</h3>
<ul>
<li><p>Use absolute paths for trusted executables.</p>
</li>
<li><p>Ensure service-related directories are not writable by unprivileged users.</p>
</li>
<li><p>Apply least privilege to service accounts.</p>
</li>
<li><p>Monitor the integrity of service binaries.</p>
</li>
<li><p>Regularly review systemd services and timers.</p>
</li>
</ul>
<hr />
<h1>Privilege Escalation Path 3 — Writable Deployment Script</h1>
<p>The next stage involved a deployment helper script that was writable by a lower-privileged account but executed within a higher-privileged context.</p>
<p>This created another opportunity for arbitrary command execution.</p>
<p>The resulting privilege transition was:</p>
<pre><code class="language-text">monitor_user
      ↓
ops_user
</code></pre>
<p><strong>Finding:</strong> EPT-004 <strong>Severity:</strong> High</p>
<p>The core issue was improper file permissions on a script trusted by a privileged deployment process.</p>
<p>This demonstrates an important security principle:</p>
<blockquote>
<p><strong>A privileged process must never trust files that can be modified by a lower-privileged user.</strong></p>
</blockquote>
<hr />
<h1>Final Privilege Escalation — Sudo Misconfiguration</h1>
<p>The final stage of the attack involved examining the sudo permissions assigned to <code>ops_user</code>.</p>
<p>The account was permitted to execute the <code>less</code> binary as root without authentication through a <code>NOPASSWD</code> sudo rule.</p>
<p>Because <code>less</code> can provide an interactive shell, this configuration could be abused to obtain unrestricted root-level access.</p>
<p>The final privilege transition was:</p>
<pre><code class="language-text">ops_user
    ↓
root
</code></pre>
<p><strong>Finding:</strong> EPT-005 <strong>Severity:</strong> Critical</p>
<p>The report identifies the issue as an abuse of elevated privileges and maps it to <strong>MITRE ATT&amp;CK T1548 — Abuse Elevation Control Mechanism</strong>.</p>
<p>At this point, complete administrative control of the target was achieved.</p>
<hr />
<h1>Complete Attack Chain</h1>
<p>The entire compromise can be summarized as:</p>
<pre><code class="language-text">Unauthenticated External Attacker
            │
            ▼
     Anonymous FTP Access
            │
            ▼
 Insecure Automated File Processing
            │
            ▼
    Arbitrary Command Execution
            │
            ▼
        recon_user
            │
            ▼
  Insecure Scheduled Backup
            │
            ▼
         dev_user
            │
            ▼
 Systemd Execution Path Hijacking
            │
            ▼
       monitor_user
            │
            ▼
 Writable Deployment Script
            │
            ▼
         ops_user
            │
            ▼
 Misconfigured sudo (less)
            │
            ▼
           ROOT
</code></pre>
<p>This attack path required chaining several weaknesses rather than relying on a single vulnerability. The assessment therefore demonstrated the importance of <strong>defense in depth and least-privilege controls</strong>.</p>
<hr />
<h1>Findings Summary</h1>
<p>The assessment identified <strong>five confirmed vulnerabilities</strong>:</p>
<table>
<thead>
<tr>
<th>ID</th>
<th>Finding</th>
<th>Severity</th>
</tr>
</thead>
<tbody><tr>
<td>EPT-001</td>
<td>Anonymous FTP &amp; Insecure Automated File Processing</td>
<td>🔴 Critical</td>
</tr>
<tr>
<td>EPT-002</td>
<td>Insecure Scheduled Backup Process</td>
<td>🟠 High</td>
</tr>
<tr>
<td>EPT-003</td>
<td>Insecure System Service / Execution Path</td>
<td>🟠 High</td>
</tr>
<tr>
<td>EPT-004</td>
<td>Writable Deployment Helper Script</td>
<td>🟠 High</td>
</tr>
<tr>
<td>EPT-005</td>
<td>Misconfigured sudo Permissions (<code>less NOPASSWD</code>)</td>
<td>🔴 Critical</td>
</tr>
</tbody></table>
<p>Overall, the report classified the findings as <strong>2 Critical, 3 High, 0 Moderate, 0 Low, and 1 Informational</strong>.</p>
<hr />
<h1>Key Security Lessons</h1>
<p>This assessment reinforced several important penetration-testing and defensive-security concepts:</p>
<h3>1. Small attack surfaces can still be dangerous</h3>
<p>Only a limited number of services were externally accessible, but one misconfigured service was sufficient to establish the initial foothold.</p>
<h3>2. Privilege escalation is often about chaining weaknesses</h3>
<p>The target did not expose root access immediately. Instead, multiple configuration weaknesses had to be identified and chained together.</p>
<h3>3. File permissions matter</h3>
<p>Several escalation paths depended on lower-privileged users being able to modify files or directories trusted by privileged processes.</p>
<h3>4. Automation requires security controls</h3>
<p>Scheduled tasks, deployment systems, and service processes can become privilege-escalation mechanisms when they execute attacker-influenced content.</p>
<h3>5. Least privilege is critical</h3>
<p>The final compromise demonstrated how excessive sudo permissions can turn a limited account compromise into complete operating-system compromise.</p>
<hr />
<h1>Remediation Priorities</h1>
<p>Based on the assessment, the highest-priority remediation actions are:</p>
<ol>
<li><p><strong>Disable anonymous FTP access.</strong></p>
</li>
<li><p><strong>Secure automated file-processing workflows.</strong></p>
</li>
<li><p><strong>Review scheduled tasks and backup processes.</strong></p>
</li>
<li><p><strong>Remove writable paths from privileged execution contexts.</strong></p>
</li>
<li><p><strong>Restrict permissions on deployment scripts and helper files.</strong></p>
</li>
<li><p><strong>Review and minimize sudo privileges.</strong></p>
</li>
<li><p><strong>Remove unnecessary</strong> <code>NOPASSWD</code> <strong>configurations.</strong></p>
</li>
<li><p><strong>Regularly audit privileged services, scripts, and scheduled tasks.</strong></p>
</li>
</ol>
<p>These recommendations are consistent with the remediation guidance documented for the individual findings in the assessment report.</p>
<hr />
<h1>Conclusion</h1>
<p>The JUMP assessment demonstrated how multiple seemingly isolated security weaknesses can be chained into a complete system compromise.</p>
<p>The attack progressed from <strong>unauthenticated external access → initial command execution → multiple privilege-escalation stages → root-level access</strong>.</p>
<p>The most important takeaway from this assessment is that security should not be evaluated only by looking at individual vulnerabilities in isolation. Attackers can combine weaknesses across authentication, file permissions, automation, services, and privilege management to create a significantly more serious attack path.</p>
<p>The assessment ultimately achieved <strong>full administrative control of the target Linux system</strong>, demonstrating the importance of secure automation, strict permission management, least privilege, and continuous security assessment.</p>
<hr />
<h2>📄 Professional Assessment Report</h2>
<p>I documented the assessment separately as a <strong>professional penetration testing report</strong>, including the assessment overview, scope, executive summary, vulnerability report card, technical findings, evidence, risk ratings, remediation recommendations, and overall risk assessment.</p>
<p><strong>Full PDF Report:</strong> 👉 <a href="https://github.com/ShadowSensei-Sec/pentest-engagement-reports/blob/main/THM/JUMP-Pentest-Report.pdf"><strong>View the JUMP Professional Penetration Test Report</strong></a></p>
<p><strong>GitHub Repository:</strong> 👉 <a href="https://github.com/ShadowSensei-Sec/pentest-engagement-reports"><strong>ShadowSensei — Professional Penetration Testing Reports</strong></a></p>
<hr />
<h2>Disclaimer</h2>
<p>This assessment was performed against the <strong>TryHackMe JUMP laboratory environment</strong> as an authorized cybersecurity training exercise.</p>
<p>The report and this article represent my <strong>independent work, analysis, testing methodology, and documentation</strong>. They are not official security assessments, confidential reports, or security findings belonging to any external company or organization.</p>
<p>All testing described here was performed within an authorized training environment.</p>
<hr />
<h3>🥷 ShadowSensei</h3>
<p><strong>PJPT Certified Penetration Tester | Offensive Security | VAPT | Red Teaming</strong></p>
<p><strong>Learn by testing. Understand by breaking. Improve by securing.</strong></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[Recruit -THM CTF Challenge Walkthrough]]></title><description><![CDATA[Infiltrate Recruit's new portal. Map the site, hunt for flaws, and gain unauthorised access


TASK
Recruit has just launched its new recruitment portal, allowing HR staff to manage candidate applicati]]></description><link>https://shadowsensei-sec.hashnode.dev/tryhackme-recruit-walkthrough</link><guid isPermaLink="true">https://shadowsensei-sec.hashnode.dev/tryhackme-recruit-walkthrough</guid><dc:creator><![CDATA[shadow Sensei]]></dc:creator><pubDate>Sun, 30 Aug 2026 14:26:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/de17aa5f-0cfe-46a1-9891-57ead87f6c3c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Infiltrate Recruit's new portal. Map the site, hunt for flaws, and gain unauthorised access</h1>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/c22b60b3-e530-4a15-b3f6-ec4e1386ba29.png" alt="" style="display:block;margin:0 auto" />

<h2>TASK</h2>
<p><strong>Recruit</strong> has just launched its new recruitment portal, allowing HR staff to manage candidate applications and administrators to oversee hiring decisions. While the platform appears functional, management suspects that security may have been overlooked during development. Your task is to assess the application like a real attacker, mapping its structure, abusing exposed functionality, and exploiting vulnerabilities.</p>
<p>Can you gain an initial foothold, escalate your access, and ultimately log in as the <strong>administrator?</strong></p>
<p>Let’s start our room by nmap scan and identify the hosts &amp; open ports.</p>
<pre><code class="language-jsx">sudo nmap -sS -p- &lt;IP_Address&gt;

# -sS is an stealthy-scan [SYN-scan] identifies open ports without completing the full TCP handshake, preventing the target system from logging the connection. 
# -p- scans all 65,535 ports.
</code></pre>
<p>We obtained the 3 open ports:</p>
<ol>
<li><p>22/tcp ssh</p>
</li>
<li><p>53/tcp domain</p>
</li>
<li><p>80/tcp http</p>
</li>
</ol>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/b9e58812-3d53-4dc2-87f9-5bba9c53a534.png" alt="" style="display:block;margin:0 auto" />

<p>Now let’s try to access the system using the SSH server.</p>
<pre><code class="language-jsx">sudo ssh -p 22 usr_name@IP 
</code></pre>
<p>Here I took username as admin, we can try with different names as well, see there is an requirements of password. I just passed the default credentials but its not working.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/1506406f-b63b-46d9-a1f8-12acf89d7de4.png" alt="" style="display:block;margin:0 auto" />

<p>Next, the Port 80 let’s view the page..</p>
<p>We can see that we have a login page, however I tried several commands to test for sql injection and also using default credentials as <strong>admin: admin</strong>, <strong>admin: password, etc..</strong> but nothing worked..</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/a920cf58-46a6-4023-b71c-335401f4b8d8.png" alt="" style="display:block;margin:0 auto" />

<p>So, let’s run the nikto or gobuster for directories Enumeration. In my case I used nikto scan for enumeration.</p>
<pre><code class="language-jsx">sudo nikto -h http://&lt;IP&gt;
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/11626fc6-1c0d-4ac8-9e46-58dfc78abf0d.png" alt="" style="display:block;margin:0 auto" />

<p>Yep, we would able to see we found few interesting directories and server version..</p>
<ul>
<li>Server: Apache/2.4.41 (Ubuntu)</li>
</ul>
<p>Directories like:</p>
<ol>
<li><p>/mail</p>
</li>
<li><p>/config.php</p>
</li>
<li><p>sitemap.xml</p>
</li>
</ol>
<p>Now let us look into sitemap.xml is a file that lists a website's essential pages. It may contain other pages that are not listed in directory scanning..</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/89ee3b4e-c024-4d5a-8e82-fa729e55f28d.png" alt="" style="display:block;margin:0 auto" />

<p>Cool we found few interesting directories like mail and assets and the php pages..</p>
<p>let's look into mail folder..</p>
<p>we can see there an another page called mail.log.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/13f66aa0-97eb-40b6-89b1-7f4e0b410f89.png" alt="" style="display:block;margin:0 auto" />

<p>I think we have got the login credential of HR like Username: hr but the password is stored in the config.php file.</p>
<p>let's try to view the config,php.</p>
<p>We are not able to fetch the config.php. let look into another php files that are listed in sitemap.xml, the interesting one is api.php lets look into it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/6311f81b-3dcf-481e-bab7-ca7632d89d5f.png" alt="" style="display:block;margin:0 auto" />

<p>The api.php contains the FAQ’s, the 2nd FAQ reveals the endpoint for cv is <code>/file.php?cv=&lt;url&gt;</code></p>
<p>let's try to use that endpoint to access the config.php</p>
<pre><code class="language-jsx">http://&lt;IP&gt;/file.php?cv=config.php
</code></pre>
<p>Hey it's bit more interesting say only local file are allowed.</p>
<p>It means the developers have added the security filter to avoid RFI [Remote File Inclusion]. To stop RFI, the developer likely wrote a filter that blocks or complains if the input looks like a standard web request, but they accidentally left the door wide open for <strong>Local File Inclusion (LFI)</strong>.</p>
<p>So we can use the PHP Wrappers to access the config.php file.</p>
<pre><code class="language-jsx">http://&lt;IP&gt;/file.php?cv=file:///var/www/html/config.php

# file:// [Local File System] -&gt; it tells the server's backend, "Do not go to the internet; fetch this file directly from your own local file system."
# /var/www/html default root directory for web servers (like Apache or Nginx) on Linux systems.
</code></pre>
<p>Aahaa we got the access to the config.php file, and we found the password to the HR.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/2de87a26-e1cb-4ced-a4b5-ae063ca14439.png" alt="" style="display:block;margin:0 auto" />

<p>It’s a milestone and we got the user access finally. lets login as HR.</p>
<p>And the flag too..</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/cb00dd79-431d-48d0-b234-d2f6a4a4d6d3.png" alt="" style="display:block;margin:0 auto" />

<p>We just accomplished the task1 user login. Now let’s find the Admin Credentials.</p>
<p>We can see there is an search box lets try with SQL Injection.</p>
<pre><code class="language-jsx">In search Box add this ' OR 1=1-- 
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/e791e730-a252-472b-a66a-1b790be3282e.png" alt="" style="display:block;margin:0 auto" />

<p>We can see the Data base revels that it is using MySql server. Cool its vulnerable to SQLI.</p>
<p>The error show’s that need to use % at the end. Don't panic simple, as it is an mysql server it can pass the SQL commands only when the there is an space or + or # added in the end.</p>
<pre><code class="language-jsx">Like, 'OR 1=1-- , 'OR 1=1--+ , 'OR 1=1--# 
</code></pre>
<p>In our case just we can add space in the end of comment..</p>
<p>we can see no error it is normally showing the 4 Colum's of candidates. Here is an imp thing that we need to notice is there are 4 columns in the database.. we can confirm it by ORDER BY injection.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/b9294632-fa00-4c0a-b34a-e23da4b243be.png" alt="" style="display:block;margin:0 auto" />

<p>By incrementing the <code>ORDER BY</code> clause, we trigger an error at <code>ORDER BY 5</code>. This enumerates the number of columns returned by the active <code>SELECT</code> statement, confirming there are exactly 4 columns we can interact with."</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/396572c0-0baa-41c6-9a2f-92549364e9fd.png" alt="" style="display:block;margin:0 auto" />

<p>Now let us try to output the version of Mysql using the UNION SELECT.</p>
<pre><code class="language-jsx">' UNION SELECT version(),NULL,NULL,NULL-- 
</code></pre>
<p>The DB version is 8.0.33-Oubuntu0.20.04.2</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/52fa39be-f224-4a22-870e-016e045623e6.png" alt="" style="display:block;margin:0 auto" />

<p>Now let try to retrive the columns present in this DB..</p>
<pre><code class="language-jsx">'UNION SELECT table_name.NULL,NULL,NULL FROM information_schema.tables-- 
</code></pre>
<p>We can multiple tables almost 60+ tables.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/2381c158-f673-4acc-b43d-4b1364ed47c3.png" alt="" style="display:block;margin:0 auto" />

<p>But from all of them there are only few interesting tables that may reveal the usernames and passwords like</p>
<ul>
<li><p>users</p>
</li>
<li><p>accounts</p>
</li>
<li><p>hosts</p>
</li>
<li><p>user</p>
</li>
</ul>
<p>Let enumerate all the tables one by one by using the UNION SELECT clause..</p>
<pre><code class="language-jsx">'UNION SELECT column_name.NULL,NULL,NULL FROM information_schema.columns WHERE table_name= 'hosts'--

# try to modify the table name using the differnt tables what are intresting.. 
</code></pre>
<p>And I can see that in only users contains the username and passwords column's.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/26e2c0c6-35cd-45e4-ae13-51766c793fa0.png" alt="" style="display:block;margin:0 auto" />

<p>Now enumerate the columns to get the admin credentials.</p>
<pre><code class="language-jsx">'UNION SELECT username,password,NULL,NULL FROM users-- 
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/013f89ff-3ece-4fa5-9685-300cdabb8ff6.png" alt="" style="display:block;margin:0 auto" />

<p>And here we go we got our administrator credentials to use them to log in</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a9429a66cd7e0a524209220/47aa6469-6392-4348-978b-632e9b23e03d.png" alt="" style="display:block;margin:0 auto" />

<p>And that’s it we got our administrator flag..</p>
<h2>Remediations: Fix the Vulnerabilities.</h2>
<h3>1. Local File Inclusion (LFI)</h3>
<ul>
<li><p><strong>The Flaw:</strong> The <code>cv</code> parameter in <code>file.php</code> failed to properly sanitize user input, allowing the use of the <code>file://</code> wrapper to access local server files. The filter designed to block RFI was insufficient.</p>
</li>
<li><p><strong>The Fix:</strong> Never pass user-supplied input directly to filesystem APIs. The best approach is to use <strong>Indirect Object References</strong>. Instead of passing a file path (e.g., <code>?cv=config.php</code>), pass an ID (e.g., <code>?cv=1</code>) that the backend maps to the correct file safely. If direct file referencing is absolutely necessary, strictly validate the input against a hardcoded allowlist of permitted filenames and completely strip out directory traversal characters (<code>../</code>) and URI wrappers (<code>file://</code>, <code>php://</code>).</p>
</li>
</ul>
<h3>2. Sensitive Data Exposure (Hardcoded Credentials)</h3>
<ul>
<li><p><strong>The Flaw:</strong> The <code>config.php</code> file contained plain-text HR credentials, which were exposed once the LFI vulnerability was exploited.</p>
</li>
<li><p><strong>The Fix:</strong> Never hardcode passwords, API keys, or sensitive configuration details directly in the source code. Credentials should be stored in secure environment variables or a dedicated secrets management system. Furthermore, ensure configuration files are stored <em>outside</em> the web root directory (<code>/var/www/html/</code>) so they cannot be accessed directly via the web server even if a vulnerability exists.</p>
</li>
</ul>
<h3>3. SQL Injection (SQLi)</h3>
<ul>
<li><p><strong>The Flaw:</strong> The application's search feature concatenated user input directly into the backend MySQL query, allowing for boolean-based and UNION-based SQL injection to extract the administrator's credentials.</p>
</li>
<li><p><strong>The Fix:</strong> Implement <strong>Parameterized Queries (Prepared Statements)</strong>. This ensures that the database treats user input strictly as data rather than executable SQL code, neutralizing any injected payloads like <code>' OR 1=1 --</code>. Alternatively, utilizing a well-configured Object-Relational Mapper (ORM) can handle this sanitization automatically.</p>
</li>
</ul>
<h3>4. Weak Password Storage</h3>
<ul>
<li><p><strong>The Flaw:</strong> Since we were able to dump the <code>users</code> table and immediately use the admin credentials, it implies the passwords were not properly hashed.</p>
</li>
<li><p><strong>The Fix:</strong> Passwords in the database should never be stored in plain text. They must be hashed and salted using strong, modern cryptographic algorithms like <strong>bcrypt</strong> or <strong>Argon2id</strong>.</p>
</li>
</ul>
]]></content:encoded></item></channel></rss>