<?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[Gonski Cyber Blog]]></title><description><![CDATA[Gonski Cyber Blog]]></description><link>https://blog.gonskicyber.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1685926050189/i9y2pIZjC.png</url><title>Gonski Cyber Blog</title><link>https://blog.gonskicyber.com</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 06:11:53 GMT</lastBuildDate><atom:link href="https://blog.gonskicyber.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[A Real-World Analysis of Security Risks in Telephony Systems]]></title><description><![CDATA[Follow along as I recount a real-world toll fraud attack which targeted corporate VoIP infrastructure and unfortunately led to serious monetary damages. In this blog, I share my investigation process, some interesting findings, and lessons learned. T...]]></description><link>https://blog.gonskicyber.com/a-real-world-analysis-of-security-risks-in-telephony-systems</link><guid isPermaLink="true">https://blog.gonskicyber.com/a-real-world-analysis-of-security-risks-in-telephony-systems</guid><category><![CDATA[hacking]]></category><category><![CDATA[offensive-security]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[securityawareness]]></category><category><![CDATA[Security]]></category><category><![CDATA[SIP]]></category><category><![CDATA[voip]]></category><category><![CDATA[security testing ]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Tue, 04 Feb 2025 02:19:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738635959681/d98fbcd7-a0ef-4863-a20e-fddac3d41199.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Follow along as I recount a real-world toll fraud attack which targeted corporate VoIP infrastructure and unfortunately led to serious monetary damages. In this blog, I share my investigation process, some interesting findings, and lessons learned. This was my first exposure to Toll Fraud as a security professional and I enjoyed learning about this lesser-known attack surface.</p>
<h1 id="heading-what-is-a-toll-fraud-attack">What is a Toll Fraud Attack?</h1>
<p>To put it simply, Toll fraud attacks involve hackers exploiting vulnerabilities or weak configurations in a telephony or VoIP system to route calls through the victim’s infrastructure, often to premium-rate numbers, or high-cost locations around the globe while generating revenue for the attacker at the victim's expense.</p>
<p><a target="_blank" href="https://assertion.cloud/blog/toll-fraud-what-it-is-and-how-it-works-3-minutes-and-20-weeks-week-2/"><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738629540534/21a69996-4660-4b9c-965e-9cca2e01abd0.webp" alt class="image--center mx-auto" /></a></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">The image above was taken from a fantastic article written on Toll Fraud attacks. If you want an in-depth overview of Toll Fraud Attacks, be sure to check article <a target="_self" href="https://assertion.cloud/blog/toll-fraud-what-it-is-and-how-it-works-3-minutes-and-20-weeks-week-2/">here</a>.</div>
</div>

<p>To put this in more technical terms, I learned that these attacks typically can occur when hackers identify a weakness and/or a misconfiguration in an internet facing asset which exposes Port 5060 TCP/UDP or 5061 TCP/UDP. Many of these attacks start with simple SIP requests such as <code>INVITE, REGISTER, OPTIONS, METHOD</code> to observe how the SIP server responds. After attackers identify a viable victim SIP server to interact with, attackers can perform some of the following to further their access:</p>
<ul>
<li><p><strong>Extension brute forcing</strong> - Attacker try's to send SIP <code>REGISTER</code> requests to every possible extension to find valid extensions.</p>
</li>
<li><p><strong>Password Guessing</strong> - With a list of valid extensions attackers can fuzz for known combinations of easily guessable/default user:pass combinations</p>
</li>
<li><p><strong>Password Spraying</strong> - Trying a small list of common passwords against a large list of valid extensions</p>
</li>
<li><p><strong>Denial-of-Service</strong> - Can be performed by sending large amounts of <code>INVITE</code> requests to the SIP server</p>
</li>
<li><p><strong>VLAN Hopping</strong> - In an improperly configured network, it is possible for an attacker to jump from a VoIP network into the internal 'office' network.</p>
</li>
</ul>
<h1 id="heading-key-terms">Key Terms</h1>
<p>Since the world of VoIP and SIP was brand new to me in this exercise, I bet it’s likely new to a lot of folks reading. To help, I’ve tried to highlight some of the basic terminology here for you:</p>
<ul>
<li><p><strong>SIP (Session Initiation Protocol)</strong>: SIP is basically a <strong>communication protocol</strong> used for initiating, maintaining, and terminating voice and video calls, over the internet. SIP is a key component of VoIP systems.</p>
</li>
<li><p><strong>VoIP (Voice over Internet Protocol)</strong>: VoIP is a <strong>technology</strong> that allows voice communication to be delivered over the internet instead of traditional phone lines. Think about a product like Google Voice here.</p>
</li>
<li><p><strong>SoftPhone</strong> - You might have heard of “softphones” before. A SoftPhone is just a software application that lets you make calls over the internet, likely from your computer. Think of something like Zoiper or Cisco Jabber</p>
<ul>
<li><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738631479203/924bdb67-810e-4647-adfa-54c718723810.webp" alt class="image--center mx-auto" /></li>
</ul>
</li>
</ul>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Above is an example of a SoftPhone application called Zoiper</div>
</div>

<ul>
<li><p><strong>PBX (Private Branch Exchange)</strong>: A PBX (or PBX system) is essentially a private telephone network used within a company or organization. A PBX system manages internal and external calls, enabling features like voicemail, call forwarding, and conferencing. Modern PBX systems often use VoIP technologies, making them vulnerable to toll fraud if not secured properly.</p>
</li>
<li><p><strong>Asterisk -</strong> Commonly referred to as an “Asterisk Server”, Asterisk itself is an open-source <strong>software framework</strong> often bundled or integrated into various telephony solutions. Some examples of PBX solutions include <a target="_blank" href="https://www.freepbx.org/">FreePBX</a>, <a target="_blank" href="https://www.3cx.com/">3CX</a> and <a target="_blank" href="https://www.vicidial.com/">Vicidial</a>. For additional clarity - an <strong>Asterisk server</strong> <em>runs</em> <strong>PBX software</strong> (it can be configured to be a PBX), but not all PBX systems are Asterisk-based.</p>
</li>
</ul>
<hr />
<h1 id="heading-analysis">Analysis</h1>
<p>With some background out of the way, lets dive into the analysis. I was provided a packet capture file which was collected as the security incident occurred. I did some research into some common SIP-focused exploitation tools, their use case, and ultimately routed my reading back into the types of attacks performed - which helped me understand what I was looking for within the Wireshark capture.</p>
<h2 id="heading-call-flow-1">Call Flow 1</h2>
<p>Opening our Wireshark capture, we started by simply filtering for SIP specific traffic - since that’s most likely where we would find information regarding authentication flow and recurring activity.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738648593586/6bfa4693-f1e7-4593-8786-e10647ebab01.png" alt class="image--center mx-auto" /></p>
<p>Above we can see various SIP requests, some 200 OK’s, some 403 forbidden’s and even some INVITE requests.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">An INVITE request is sent by the client (often a softphone or VoIP application) to propose a communication session with another party (recipient).</div>
</div>

<p>There’s a lot going on in this capture file, so we first tried zeroing in on a specific conversation to get our bearings, lets take this specific SIP call flow for example</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738648942664/3f57ad9f-26a4-4bcc-99e2-0ebbad452be1.png" alt class="image--center mx-auto" /></p>
<p>Above we can see one specific call (or rather attempted call that was placed). We see the conversation was initiated with an <code>INVITE</code> request, followed by both a <code>Trying</code> and <code>Ringing</code> packet. I’m no SIP expert, but I imagine this is quite literally what it looks like when a call is made. Ultimately we can see the call failed.</p>
<p>Was this an attacker making a call and failing? Or was this an employee making a standard business call and the user on the other end just didn’t pick up…lets look closer. By expanding the <code>503 Service Unavailable</code> packets we can actually see the call was rejected based on data in the <code>X-Asterisk-HangupCause</code> header.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738649225048/a51a33e1-3880-48f0-a8d2-69d68cb3aae6.png" alt class="image--center mx-auto" /></p>
<p>Cool cool, okay we can follow a call flow at least, but what in here can we look for that helps us find security issues? Well as we previously mentioned, SIP authentication uses <strong>extensions</strong> as usernames. And where there are usernames…there are passwords…and where there are passwords…well we can guess em!</p>
<p>Think of an <strong>extension</strong> like a phone number inside a company’s phone system. For example:</p>
<ul>
<li><p><strong>Extension 1001</strong> could be Bob’s phone.</p>
</li>
<li><p><strong>Extension 1002</strong> could be Sally’s phone.</p>
</li>
</ul>
<p><strong>SIP authentication</strong> is how SIP/PBX servers (like Asterisk) <strong>verify that a user (or phone/softphone) is who they say they are</strong> before letting them make or receive calls. In the SIP <code>INVITE</code> packet below, we can see the username/extension making the call, extension 700.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738649982491/cc0e51a5-af97-4b6c-a7ec-9903f26be222.png" alt class="image--center mx-auto" /></p>
<p>In order to find the password that is being sent back and forth in these SIP conversations we need to look for a SIP <code>REGISTER</code> packet. Unfortunately there was no <code>REGISTER</code> packet in this call flow so two things likely happened here:</p>
<ol>
<li><p>Either the SIP server doesn’t require authentication for this INVITE. (maybe the packet capture was started after authentication?)</p>
</li>
<li><p>Authentication may have already occurred during <strong>SIP registration</strong>, and the system considers <strong>extension 700 authenticated</strong>.</p>
</li>
</ol>
<p>Lets take a look at another call flow</p>
<h2 id="heading-call-flow-2">Call Flow 2</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738650584228/27e72cfd-150c-4a62-88d9-cd5779af3f30.png" alt class="image--center mx-auto" /></p>
<p>In this call flow we have a little more going on, we see the conversation is initiated by an <code>INVITE</code> once again, Lets take a look at the first <code>INVITE</code> request to see who is making the call.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738650696245/623d6b01-09f8-4238-b8d1-81b18053fe8a.png" alt class="image--center mx-auto" /></p>
<p>Inside of the <code>INVITE</code> packet we see the user or extension <code>701</code> initiating this call. Looking back at the call flow, we see an <code>INVITE</code>, followed by a <code>401 Unauthorized</code>.</p>
<p>The SIP server responds with a <strong>401 Unauthorized</strong> message. This doesn’t yet mean the call is denied — it's actually part of a normal process called <strong>digest authentication</strong>. The server is essentially asking extension <strong>701</strong> to prove it has the correct credentials before continuing.</p>
<p>To do this, the server sends a unique code (called a <strong>nonce</strong>) that the client must use to create a hashed password response. We can see this information passed inside of the <code>401 Unauthorized</code> packet.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738650961096/0c3a18ab-53ab-4c0b-b971-481c5dcdee55.png" alt class="image--center mx-auto" /></p>
<p>Extension <strong>701</strong> acknowledges (as we can see by the <code>ACK</code> response in the call flow) the challenge and sends another INVITE request, this time including the <strong>Authorization header</strong>. The header contains the username, nonce, and a hashed version of the password. This is the client’s way of proving its identity.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738651064671/d5fd9a32-1972-49c5-8300-5787c9b1e6e9.png" alt class="image--center mx-auto" /></p>
<p>Ultimately, as we look at the call flow above, we know that this call ends in a series of <code>403 Forbidden</code> errors. While I wasn’t able to get to the root cause of why this specific call failed, a few possible reasons include:</p>
<ul>
<li><p><strong>Authentication Failure:</strong></p>
<ul>
<li>Even though the client responded to the challenge, the server may be rejecting the hashed password due to incorrect credentials or a mismatch with what it expects.</li>
</ul>
</li>
<li><p><strong>Dial Plan Restrictions:</strong></p>
<ul>
<li>The server may have rules in place that block calls to specific destinations, such as international or premium-rate numbers.</li>
</ul>
</li>
<li><p><strong>Blacklisting:</strong></p>
<ul>
<li>The server could have blacklisted either the calling extension (701) or the destination number (**********0344).</li>
</ul>
</li>
</ul>
<p>Regardless, this is good information and brings us to the next step in our analysis. Extracting SIP Digest Authentication messages with SIPDump.</p>
<h2 id="heading-identification-of-weak-extensionuser-passwords-used-for-sip-authentication">Identification of Weak Extension/User passwords Used for SIP Authentication</h2>
<p>As we’ve already covered, In the world of VoIP and SIP, every user that requires access to telephony systems are likely assigned a SIP account which contains the extension (username), password and address of the SIP server.</p>
<p>Thinking critically here, we can already start to formulate a potential attack vector (looking at you password guessing/spraying). Say an attacker successfully identifies an exposed SIP sever, given the usage of usernames (AKA extensions) and passwords as an authentication mechanism, it could be possible for an attacker to find default/weak username and password configurations.</p>
<p>A common misconfiguration here involves SIP usernames configured with no password at all (null password) or configured to have the username and password match. Both of these examples are easily discoverable.</p>
<p>With the provided Wireshark packet capture file confirmed to have contained multiple call flows with multiple authentication attempts, I used the tool <a target="_blank" href="https://manpages.ubuntu.com/manpages/bionic/man1/sipdump.1.html">sipdump</a> to extract SIP digest authentications that occurred during the attack. By extracting the Digest authentications that were captured in the Wireshark data, we were able to obtain the MD5 Password Hashes for various SIP users. (Look there’s that user <code>701</code> again).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733948714734/1375c0cb-d972-4957-97c1-c2343e400348.png" alt class="image--center mx-auto" /></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Pictured above is the output from running SIPCrack. We can see columns indicating the IP address of the client, server, username AKA extension and the user’s password hashes.</div>
</div>

<p>With these MD5 hashes collected, we then used the tool <a target="_blank" href="https://manpages.ubuntu.com/manpages/jammy/man1/sipcrack.1.html">sipcrack</a>  to crack these MD5 Password hashes. It was actually possible to extract the <strong>clear text password</strong> for three SIP users. The passwords <strong>were the same as their respective SIP user,</strong> thus indicating weak and/or default configurations were in use which could be abused by an attacker.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1733949059027/fe349891-30e9-49fd-adf7-047058475cdf.png" alt class="image--center mx-auto" /></p>
<p>We could confirm at least a few SIP accounts were simply configured to have the username/extension match the password. With this singular finding, it’s a fair bet to make that this might’ve been evidence of a larger problem within this SIP environment. From here we could already start to formulate some remediation tasks specifically targeting username and password combinations configured within this SIP environment.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738632468443/affae626-ba08-40af-a832-9edf0d3a6e01.jpeg" alt class="image--center mx-auto" /></p>
<p>Moving on, I also investigated the some traffic I saw going back and forth to the web application I could only assume was used to interact with or manage the SIP/PBX environment as a whole. References to this now-defunct software (DragonSuite) can be seen below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738632701995/2416c0f7-6b32-44f8-b920-87e4fda0ffc1.png" alt class="image--center mx-auto" /></p>
<p>Looking even further, we managed to find some unencrypted authentication requests where a user was logging into the application. Since the traffic wasn’t encrypted, we were easily able to pluck out the hashed password.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738633760535/827c2751-7631-43f8-8835-3691e3e37eda.png" alt class="image--center mx-auto" /></p>
<p>Throwing this hash into our trusty friend John the Ripper we quickly see that this user had a password of 1234.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1738633960012/44883951-d702-4eae-bfc6-610d782d72ab.png" alt class="image--center mx-auto" /></p>
<p>So at this point we found that there were most definitely weak configurations regarding SIP usernames and passwords, and we also found weak passwords in use to access the application used to manage the SIP/PBX environment. Food for thought.</p>
<h1 id="heading-lessons-learned">Lessons Learned</h1>
<p>While my findings here didn’t necessarily halt the active attacks or indicate a definite root cause, the data within Wireshark definitely indicated that there were security concerns within this PBX system that needed to be addressed. While yes, default username/password combos were identified - using a defunct PBX solution likely didn’t help the situation. Ultimately, this exercise not only brought awareness to how some PBX systems could be misconfigured but also gave me a new and interesting learning experience.</p>
]]></content:encoded></item><item><title><![CDATA[CVE-2023-5830: Critical Security Vulnerability  in ColumbiaSoft Document Locator]]></title><description><![CDATA[Disclaimer: This information is being published for educational purposes only

Background
With the help of my colleague @micahvandeusen, in the late-summer of 2022 we identified and exploited a critical security vulnerability present within ColumbiaS...]]></description><link>https://blog.gonskicyber.com/cve-2023-5830-critical-security-vulnerability-in-columbiasoft-document-locator</link><guid isPermaLink="true">https://blog.gonskicyber.com/cve-2023-5830-critical-security-vulnerability-in-columbiasoft-document-locator</guid><category><![CDATA[CVE-2023-583]]></category><category><![CDATA[cve-2023-5830]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[offensive-security]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Application Security]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Thu, 29 Feb 2024 18:23:46 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709228674950/695f0f00-830a-43c2-a123-9bc8ef34afdf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Disclaimer: This information is being published for educational purposes only</p>
</blockquote>
<h2 id="heading-background">Background</h2>
<p>With the help of my colleague <a target="_blank" href="https://x.com/micahvandeusen?s=20">@micahvandeusen</a>, in the late-summer of 2022 we identified and exploited a critical security vulnerability present within ColumbiaSoft's Document Locator application. This vulnerability specifically targets the client-side <code>Server:</code> parameter of the <code>/api/authentication/login</code> endpoint within the WebTools component. The nature of this flaw allows attackers to manipulate the <code>Server:</code> argument and effectively perform an SSRF-style attack where it is possible to receive administrative credentials to the Document Locator application instance resulting in full compromise of the data stored within.</p>
<h2 id="heading-description-of-the-vulnerability">Description of the Vulnerability</h2>
<p>As mentioned previously, This vulnerability specifically targets the client-side <code>Server:</code> parameter of the <code>/api/authentication/login</code> endpoint within the WebTools component. By manipulating this parameter it is possible to confirm out-of-band interactions such as external DNS interactions with an arbitrary domain.</p>
<p>Furthermore, in conjunction with manipulating the <code>Server:</code> parameter, modifying the <code>LoginType:</code> parameter to a value of <code>"differentwindows"</code> can lead to a properly positioned attacker receiving <strong>clear-text administrative</strong> credentials over the MSSQL protocol. More details on exploitation can be found below.</p>
<h2 id="heading-risk-and-impact">Risk and Impact</h2>
<p>The risk associated with <a target="_blank" href="https://nvd.nist.gov/vuln/detail/CVE-2023-5830">CVE-2023-5830</a> is classified as critical with a CVSS 3.0 Base score of <strong>9.8</strong> due to the potential for trivial unauthorized access. Exploitation of this vulnerability can be carried out remotely, from an unauthenticated perspective and is trivial to exploit with standard tooling such as Burp Suite, <a target="_blank" href="https://github.com/projectdiscovery/interactsh">Interactsh</a> (Or burp collaborator) and Responder.</p>
<p>The impact of exploitation is significant as it can lead to a compromise of the integrity and confidentiality of the data managed by ColumbiaSoft Document Locator application. Given the application's role in managing sensitive documents, the exploitation of this vulnerability could have far-reaching implications for affected organizations, including data breaches and unauthorized access to confidential information.</p>
<h2 id="heading-mitigation-strategies">Mitigation Strategies</h2>
<p>In response to the discovery of CVE-2023-5830, ColumbiaSoft has released updates to mitigate this vulnerability. Specifically, upgrading to version 7.2 SP4 or 2021.1 of the Document Locator is recommended to address the security flaw effectively.</p>
<h3 id="heading-detection">Detection</h3>
<p>Security engineers and penetration testers can test for this vulnerability by leveraging a <a target="_blank" href="https://github.com/projectdiscovery/nuclei">Nuclei</a> template I've created <a target="_blank" href="https://gist.github.com/mbb5546/70a9299f2dc3b0d232a16e5e9b8ff223">here</a>. Example execution of this template is seen below</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709225690326/da51ed39-579b-4dcb-89a5-b7ce4d3b2ebf.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-recommendations-for-users">Recommendations for Users</h3>
<p>For organizations and individuals utilizing ColumbiaSoft Document Locator, it is imperative to promptly apply the recommended updates to mitigate the risks associated with CVE-2023-5830. Upgrading to the specified versions not only addresses this critical vulnerability but also enhances the overall security posture of the document management system.</p>
<h2 id="heading-exploitation">Exploitation</h2>
<p>Exploitation of this vulnerability is fairly simple. After identification of an application instance, capture an HTTP POST request submitted to the application in Burp suite from the login page as shown below..</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709226589150/3bbc86f4-224b-4f85-8b95-6cf9632024ae.png" alt class="image--center mx-auto" /></p>
<p>After capturing the authentication request using Burp Suite's intercept module, modify the <code>Server:</code> parameter and paste in either a Burp Collaborator payload or an <a target="_blank" href="https://github.com/projectdiscovery/interactsh">interactsh</a> payload (in this case interactsh was used) to test for OOB DNS interaction.</p>
<p>Interactsh can be used to generate a URL for observing OOB interaction.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709226916639/84acd865-9ccc-46f3-90e0-c6791bf5cf17.png" alt class="image--center mx-auto" /></p>
<p>Change the <code>Server:</code> parameter in the request to contain the interactsh payload.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709226566748/e12c90a2-5ec5-4122-a4ea-c63a555185a5.png" alt class="image--center mx-auto" /></p>
<p>With the payload set, submit the authentication request in Burp Suite. Seen below are two DNS interactions received after submission of the authentication request.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709226849559/4a2f7573-0b37-402f-814b-939aaacfed6f.png" alt class="image--center mx-auto" /></p>
<p>With external DNS interaction confirmed, compromise of the application can be achieved by configuring a publicly accessible machine/VM. Services such as an AWS EC2 or Google Cloud Compute Engine can be used for this. On the publicly accessible system, ensure that an ingress firewall rule allowing TCP 1433/MSSQL traffic is enabled. Additionally, to capture the authentication request, the tool <a target="_blank" href="https://github.com/lgandx/Responder">Responder</a> should be installed.</p>
<p>After configuring a publicly available system, run Responder in analyze mode</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709227340283/30ba5f29-3b41-4462-b7c6-a6ff1ce29729.png" alt class="image--center mx-auto" /></p>
<p>With Responder running, make note of the Public IPv4 address of your system and replace the value of the <code>Server:</code> parameter with the IP of your system.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709227455756/aa6737c7-98b9-437f-8dbc-631f37b4e0c1.png" alt class="image--center mx-auto" /></p>
<p>Now submit the authentication and you should receive <strong>cleartext</strong> administrative credentials that can be used to login to the application</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709227497183/8e53715e-2481-4a86-9b68-55a4cd419e03.png" alt class="image--center mx-auto" /></p>
<p>As you can see, this is a pretty critical vulnerability that warrants a CVSS score of 9.8. At the time of this writing no public PoC is known aside from the Nuclei template created for detection opportunities.</p>
]]></content:encoded></item><item><title><![CDATA[Efficient Penetration Testing: A Guide to Tool Installation (Python Virtual Environments)]]></title><description><![CDATA[In this blog I aim to cover some of the methods I use as a penetration tester to install and manage tools that I use during my testing. The goal here is to provide a basic explanation of tool management I wish I had when I was starting out.


Please ...]]></description><link>https://blog.gonskicyber.com/guide-to-tool-installation</link><guid isPermaLink="true">https://blog.gonskicyber.com/guide-to-tool-installation</guid><category><![CDATA[pentesting]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[offensive-security]]></category><category><![CDATA[oscp]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Security]]></category><category><![CDATA[consulting]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Tue, 23 Jan 2024 23:25:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1706049039546/33a3269b-ab55-4ac8-ba2f-b30e807c3e40.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this blog I aim to cover some of the methods I use as a penetration tester to install and manage tools that I use during my testing. The goal here is to provide a basic explanation of tool management I wish I had when I was starting out.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705973016464/140662bc-4081-4ef0-b242-2b0961b6afab.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>Please note: This is simply an overview of the methods I use to install python-based tools based on the lessons I've learned over the years and from muscle memory. This is not a definitive or exhaustive guide on installing every single tool possible or a deep dive into the depths of package management or how to troubleshoot the plethora of errors you may encounter - just things I wish someone explained to me when I was new</p>
<p>If you do find any information incorrect or would like to share additional tips with me - feel free to reach out on socials - Happy Hacking</p>
</blockquote>
<hr />
<h1 id="heading-synopsis">Synopsis</h1>
<p>As a penetration tester you will generally be using a wide variety of tools written in various languages (such as python, bash, C#, C and Go) meant to be executed on different operating systems for different purposes. Learning the when, why, and how to use all these tools is another lesson in itself - for the purposes of this blog we will be covering basic tool management from the perspective of a penetration tester who uses Kali Linux in standard penetration testing scenarios and installs primarily python-based testing tools (much like myself).</p>
<h1 id="heading-method-1-using-apt-not-recommended">Method 1: Using APT (not recommended)</h1>
<p>The Advanced Package Tool (APT) is a package management system used primarily in Debian-based Linux distributions like Debian, Ubuntu, and their derivatives (such as Kali Linux). APT is a command-line tool that helps users install, update, and manage software packages on their Linux systems and is the default package manager for Kali Linux.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705976438376/a56fbaf7-aefb-40a2-bc28-7b8f8847ebb9.png" alt class="image--center mx-auto" /></p>
<p>I won't be covering APT usage here as it's generally pretty easy to figure out how to install needed packages with APT. When you are new to pen-testing you may find yourself using <code>apt</code> to install stuff - and that's fine, I did too.</p>
<p>However, as I gained more experience I found that it's generally <strong>not recommended to use</strong><code>apt</code> for installing <em>python based tools</em>. From my personal experience I found that using the <code>apt</code> package manager to install python tooling often lead me to "dependency hell" and caused me lot of frustration when trying to install and use tools (most likely because I didn't know what I was doing but I guess that's how you learn).</p>
<p>In fairness to <code>apt</code>, it does have it's uses from time to time such as using <code>apt</code> to install <code>pipx</code> - which we will talk more about below. Since I am writing this as if I was writing to myself three years ago, I would simply advise myself to avoid <code>apt</code> for things outside of simply updating your machine and base packages. That is all.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">I want to note that APT <em>can</em> still be used to install tools in certain scenarios - in fact the Kali team does a great job of ensuring packages are up to date and 'safe' to install nowadays. Simply put, in my early experience I found that using APT to install python tooling often led to confusion, frustration and broken tools.</div>
</div>

<hr />
<h1 id="heading-method-2-the-classic-github-clone-method-also-not-recommended">Method 2: The classic GitHub clone method (<em>also not recommended</em>)</h1>
<p>In this method I will cover how I installed tools the majority of the time when I was new. For my seasoned pen-testing colleagues, the fact that this is how I installed the majority of my tools may sound alarming - and it is. However again, my goal in this blog is to simply share what I've learned over the years..including the things NOT to do.</p>
<blockquote>
<p>Note: Upfront I will say that you likely <strong>shouldn't</strong> blindly clone a tool from GitHub and try to install it and run it right away - as cloning and installing right from GitHub means you are installing packages into your system-wide installation. we'll see what this means below.</p>
</blockquote>
<p>If there's a tool you want to use, and you find it lives in a GitHub repository you can simply clone the repository to your machine and run it. Lets look at the tool <code>SCCMHunter</code> as an example.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705977652224/3966b7b3-cc7c-4307-b177-385ac48bfca4.png" alt class="image--center mx-auto" /></p>
<p>As the description states, <code>SCCMHunter</code> is a post-ex tool built to streamline identifying, profiling, and attacking SCCM related assets in an Active Directory domain. This is a great tool written by a former colleague of mine - shout out to <a target="_blank" href="https://x.com/garrfoster">Garrett</a>!</p>
<p>Let's install this tool using what I am calling the classic "Git Clone method" (which again you probably should avoid doing unless you are familiar with python package management). First we navigate to the repository where this tool lives (<a target="_blank" href="https://github.com/garrettfoster13/sccmhunter">here</a>) and copy the HTTPS URL to clone it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705977532374/eaebd9e9-1aa0-488e-87f5-007b14e21fc3.png" alt class="image--center mx-auto" /></p>
<p>With the URL in our clipboard we can simply open a terminal on our Kali machine (our testing machine) and clone the repository with <code>git clone &lt;URL&gt;</code></p>
<p>Once the repository is cloned to our machine we can enter the directory of the repository where we see one file of note (The <code>requirements.txt</code> file)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705978010086/427d3626-a2c1-49d3-906f-089d0c817219.png" alt class="image--center mx-auto" /></p>
<p>With the repository cloned - lets go back to the tool's repository to take a look at the README for any installation instructions.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705978062649/903f395d-b62a-4099-a224-5f9735264556.png" alt class="image--center mx-auto" /></p>
<p>Here we see a set of neatly provided installation commands. For the sake of demonstration, let's just try running the tool <em>before</em> following the installation instructions (not recommended).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705978153818/67d7bc4d-8f1f-41ef-a7f8-5cc34dd50b82.png" alt class="image--center mx-auto" /></p>
<p>As expected the tool doesn't execute successfully and we see an error presented - not fun, but OK lets actually follow the installation instructions this time.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705979483185/9b04cc8e-cdd3-45ae-a19e-9e55fcfbf525.png" alt class="image--center mx-auto" /></p>
<p>We run <code>pip3 install -r requirements.txt</code> as the installation notes state - but wait, whats this?</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705979608532/38703d7b-c812-4d7d-b314-554499235cbe.png" alt class="image--center mx-auto" /></p>
<p>Numerous errors are displayed and in our frustrated stupor we decide, "eh lets just try to run it anyway."</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705979672792/c63ec8fe-0e37-4c4a-aeac-918741291215.png" alt class="image--center mx-auto" /></p>
<p>Congrats! You've now just found yourself facing the same notorious collection of traceback errors I fought with for many many months as a new penetration tester. And better yet, your tool still doesn't work.....</p>
<p>So while you may find that you can sometimes successfully install and use tools using this method, understand that because you are installing into your system-wide python installation with this method, this is where you can, and will likely run into issues with overlapping dependencies or mis-matched versioning on specific modules.</p>
<p>So how <em>should</em> we go about installing our tools then?</p>
<p>You <em>should</em> always try to install your tools in a virtual environment to keep installation and dependencies <strong>isolated</strong> from your system-wide installation for the sake of 'cleanliness' and to ensure you don't find your self with broken packages on a pen-test.</p>
<p>Which is a perfect segway into the the third method of tool management - how to install tools using Virtual Environments!</p>
<hr />
<h1 id="heading-method-3-the-use-a-virtual-environment-method-much-better-and-recommended">Method 3: The "Use a virtual Environment" Method (much better and recommended)</h1>
<p>This method of installing tools involves using a virtual environment to install the desired tool and subsequent dependencies/packages. The pros to a virtual environment are simply that you can install packages/tools without worrying about breaking things in your testing machine/environment since a virtual environment is isolated from your system-wide installation.</p>
<p>Back when I was brand new to pen-testing and someone told me to install a tool using a virtual environment, I really didn't know what that meant or how to go about it so let's dive into it.</p>
<blockquote>
<p>For this third method I'll be demonstrating the use of Virtualenv. If you want to learn more about the differences between Virtualenv and it's alternatives check out this link: <a target="_blank" href="https://pythonhow.com/what/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrapper-pipenv/">https://pythonhow.com/what/what-is-the-difference-between-venv-pyvenv-pyenv-virtualenv-virtualenvwrapper-pipenv/</a></p>
</blockquote>
<h2 id="heading-using-virtualenv">Using <code>Virtualenv</code></h2>
<p><code>virtualenv</code> is a third-party tool used in the Python programming language to create <em>isolated</em>, <em>self-contained</em> Python environments. These isolated environments allow you to install, manage, and isolate Python packages (tools) and dependencies.</p>
<p>(which means you can install tools and dependencies without worrying about breaking stuff)</p>
<p>Let's use <code>SCCMHunter</code> again in this example - but this time lets "install it in a virtual environment" - the right way.</p>
<p>Similarly to how we began the 2nd method of tool installation with <code>SCCMHunter</code> let's</p>
<ol>
<li><p>Copy the repository URL and clone the tool to our system</p>
</li>
<li><p>Change directories into the <code>SCCMHunter</code> directory</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705980662544/4b94e132-4ce9-42c7-a66e-0d16c881ec54.png" alt class="image--center mx-auto" /></p>
<p>Cool, here we are once again. To install this tool "in a virtual environment" (you can use this method for virtually any python based tools/packages) Let's start by creating a virtual environment within the <code>SCCMHunter</code> directory.</p>
<pre><code class="lang-bash">virtualenv --python=python3 /path/to/tool/directory
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705980813979/0b2a852a-2e3a-42f9-8a45-8c5402678e59.png" alt class="image--center mx-auto" /></p>
<p>The previous command creates a new virtual environment placed in the <code>~/tools/sccmhunter</code> directory and specifies that it should use Python 3 as the base interpreter. This means that the virtual environment will be isolated and configured to use Python 3 for running Python scripts and managing packages.</p>
<p>Great, now our virtual environment has been created. Continuing on, we now need to <em>activate</em> or <em>enter</em> our virtual environment. We can do this by executing</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Execute from within the desired tool's directory</span>
<span class="hljs-built_in">source</span> bin/activate
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705981024418/3423b5e8-8bf0-4acf-9b4b-4f4a78690459.png" alt class="image--center mx-auto" /></p>
<p>After activating, you should see the name of your virtual environment in the terminal prompt, indicating that you are now working within the virtual environment. Now, any Python packages you install or Python scripts you run will be isolated <strong>within this environment</strong>, separate from your system-wide Python installation. Lets continue with installation of <code>SCCMHunter</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705981301666/a743520a-7ebb-45ce-a0e6-84ea770c45db.png" alt class="image--center mx-auto" /></p>
<p>Referencing the original installation instructions, we are instructed to install any dependencies housed in the <code>requirements.txt</code> (this file just contains the required python modules and dependencies needed for the tool to run) file by executing</p>
<pre><code class="lang-bash">pip3 install -r requirements.txt
</code></pre>
<p>Previously when we tried to install all the required dependencies, we were met with an ugly series of errors - likely because our system wide installation was missing modules. However since we are now completely isolated within our <code>sccmhunter</code> virtual environment, the installation of dependencies executes successfully! Now we can run the tool safely from within our virtual environment.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705981439644/66a65856-0027-42a7-bdc0-1e5904eeb0a9.png" alt class="image--center mx-auto" /></p>
<p>In conclusion - when someone says to "install it in a virtual environment" this is how you can do it. Now you can take this procedure and apply it to all the various python-based tools to avoid the frustrations that come with dependency hell. When you are done with the virtual environment or need to exit one particular virtual environment before activating another simply type <code>deactivate</code>.</p>
<p>Here's a collection of the commands needed to spin up a virtual environment.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Method 1</span>
git <span class="hljs-built_in">clone</span> &lt;URL to GitHub Repo of your desired tool&gt; /path/to/<span class="hljs-built_in">clone</span>/repo/<span class="hljs-keyword">in</span> 
<span class="hljs-built_in">cd</span> /path/to/your/tool 
virtualenv --python=python3 . 
<span class="hljs-built_in">source</span> bin/activate  
pip3 install -r requirements.txt 

<span class="hljs-comment">#Method 2 (if there is a setup.py file present)</span>
git <span class="hljs-built_in">clone</span> &lt;URL to GitHub Repo of your desired tool&gt; /path/to/<span class="hljs-built_in">clone</span>/repo/<span class="hljs-keyword">in</span> 
<span class="hljs-built_in">cd</span> /path/to/your/tool 
virtualenv --python=python3 . 
<span class="hljs-built_in">source</span> bin/activate
pip3 install .  
<span class="hljs-comment">#OR </span>
python3 setup.py install  
<span class="hljs-comment">#Now run your tool! </span>

<span class="hljs-comment"># To deactivate/leave your virtual environment</span>
deactivate
</code></pre>
<p><a target="_blank" href="https://pythonbasics.org/virtualenv/">Read more about virtualenv here!</a></p>
<hr />
<h2 id="heading-using-pythons-venv-module">Using Python's <code>venv</code> module</h2>
<p>Virtualenv isn't the only tool you can use to install and manage python packages and python-based tools in a virtual environment. In fact python3 also contains a module called <code>venv</code> that can do the very same thing as <code>virtualenv</code> (although I just prefer <code>virtualenv</code>).</p>
<p><a target="_blank" href="https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/">Using Python's venv module</a></p>
<p>See the steps below for using the python module for creating virtual environments to safely install your tools - the process is basically the same.</p>
<ol>
<li><p>To create a virtual environment, go to your tool's directory and run the following command. This will create a new virtual environment in the folder where you cloned your tool to</p>
<ol>
<li><pre><code class="lang-bash">       python3 -m venv /path/to/tool/directory
</code></pre>
</li>
</ol>
</li>
<li><p>Before you can start installing or using packages in your virtual environment you’ll need to <code>activate</code> it (just how we did it previously). To install and setup the tool simply follow the same steps we covered with virtualenv above.</p>
</li>
</ol>
<hr />
<h1 id="heading-method-4-using-pipx-a-slight-variation-of-method-3-the-best-method">Method 4: Using Pipx - <em>A Slight variation of method 3 (The best method)</em></h1>
<p>This brings us to Method 4 of tool management: Using pipx</p>
<p><code>pipx</code> is a Python package that allows you to install and manage Python tools in isolated environments separate from your system-wide Python environment (similarly to <code>virtualenv</code>. It enables you to install and run Python tools as if they were standalone executables, making it easier to manage and update them.</p>
<p>Using <code>pipx</code> to install and manage tools has become my personal favorite method by far. This method eliminates the manual process of creating and then activating a virtual environment and instead, <code>pipx</code> takes care of it all automatically.</p>
<p>To install <code>pipx</code> we will need to use our old friend, the <code>apt</code> package manager. You can install <code>pipx</code> using these commands:</p>
<pre><code class="lang-bash">sudo apt install pipx
python3 -m pip install --user pipx
python3 -m pipx ensurepath
<span class="hljs-comment"># After running the 3rd command here, you may need to re-source your path with</span>
<span class="hljs-built_in">source</span> ~/.zshrc
</code></pre>
<p>Once installed, you can confirm <code>pipx</code> is ready to use by running <code>pipx -h</code></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1705983726019/7196a44b-49d2-4b0f-ba36-8e89f522b2c8.png" alt class="image--center mx-auto" /></p>
<p>With <code>pipx</code> installed, lets install Certipy-AD as an example.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706045595205/abea8832-5a0c-43f5-a1e3-6af49746da46.png" alt class="image--center mx-auto" /></p>
<p>As the README states - <a target="_blank" href="https://github.com/ly4k/Certipy">Certipy</a> is a <em>fantastic</em> offensive tool for enumerating and abusing Active Directory Certificate Services (AD CS). I have used this tool on multiple occasions to successfully compromise enterprise networks.</p>
<p>If you haven't already - you should read <a target="_blank" href="https://posts.specterops.io/certified-pre-owned-d95910965cd2">Certified Pre-Owned</a> by <a target="_blank" href="https://twitter.com/harmj0y">Will Schroeder</a> and <a target="_blank" href="https://twitter.com/tifkin_">Lee Christensen</a>.</p>
<p>The nice thing about pipx is that it uses the PyPI (Python package index) so any package (or tool) that exists within this package index can be easily installed with ONE command. You can access the Python Package index <a target="_blank" href="https://pypi.org/">here</a> to see if your tool is already present.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Understand that sometimes the tool listed in the PyPI index <em>might</em> be slightly behind in updates in comparison to the tool's primary GitHub. Always be sure to check that you are installing the version you want.</div>
</div>

<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046176392/754b3668-a2e5-40b2-b2a5-13f135cb4ab1.png" alt class="image--center mx-auto" /></p>
<p>First we confirm that <code>certipy-ad</code> is available for download in the PyPI index. From here installation is as easy as running a single command:</p>
<pre><code class="lang-bash">pipx install certipy-ad
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046249364/fe04746a-8cb2-4e54-a3d9-44de24dbacaf.png" alt class="image--center mx-auto" /></p>
<p>Our new tool is safely and successfully installed and now we can start attacking ADCS with <code>certipy-ad</code>!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046291670/66905f04-74bd-4ba9-998f-29d048b5930f.png" alt class="image--center mx-auto" /></p>
<p>If you're wondering if it's really that easy - yes, yes it is. While this might not be news to some - I wish I would have known about this years ago.</p>
<blockquote>
<p>"But what if the tool I want isn't listed in the PyPI index?"</p>
</blockquote>
<p>That's a great question - and thankfully pipx is also able to install packages via source control (from GitHub). Lets install the same tool from Certipy's GitHub Repository.</p>
<p>To install a tool with pipx from Github, simply navigate to the repository and copy the repository's URL</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046490321/bb722ce9-03c9-454e-9e61-57452cf8ccd0.png" alt class="image--center mx-auto" /></p>
<p>Now we can install with pipx by running</p>
<pre><code class="lang-bash">pipx install <span class="hljs-string">"git+https://github.com/ly4k/Certipy.git"</span>
</code></pre>
<p>And boom, just like that we have again installed certipy-ad with pipx from GitHub - and the best part of it all is that the tool gets installed into a virtual environment so we don't break anything on our machine.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046587389/9d04acb2-4dff-421e-8535-5b0574819809.png" alt class="image--center mx-auto" /></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">One caveat to the "pipx method" is that the package or tool needs to either be present in the PyPI index OR the repository for the tool must have a <code>setup.py</code> or <code>pyproject.toml</code> file . If neither of these requirements are present you can simply fall back to the 3rd method covered here and install it "manually" using <code>virtualenv</code></div>
</div>

<p>Read more about using pipx <a target="_blank" href="https://github.com/pypa/pipx">here</a> and <a target="_blank" href="https://linuxtldr.com/installing-pipx/">here</a>!</p>
<hr />
<h1 id="heading-method-5-using-pre-compiled-binaries">Method 5: Using Pre-Compiled Binaries</h1>
<p>Occasionally there will be times where the author of a tool has conveniently provided us with pre-compiled, standalone executable binaries of a tool. In this case all we need to do is download the pre-compiled binary for our system and we can run the tool.</p>
<p>As an example, lets take a look at <a target="_blank" href="https://github.com/ropnop/kerbrute">Kerbrute</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046881844/f8de37db-7599-42cf-8969-75f733704778.png" alt class="image--center mx-auto" /></p>
<p>Navigating to the 'Releases' section of this repository we can see multiple pre-compiled binaries that we can simply download and run. Since we are running this tool from a Linux machine lets select the <code>kerbrute_linux_amd64</code> executable.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706046962846/09d5718d-0502-4982-9974-bdc9511ca05b.png" alt class="image--center mx-auto" /></p>
<p>After downloading the executable/binary, we can use <code>chmod +x kerbrute_linux_amd64</code> to make the file executable so that we can simply run it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1706047100022/d32a2e32-4a47-449d-927b-defcbf2ddff4.png" alt class="image--center mx-auto" /></p>
<p>Now we can use Kerbrute to do Kerbrute-things.</p>
<p>Pre-compiled binaries are a great alternative to 'installing' tools <em>if they are provided and available</em> since all the necessary dependencies are already packaged into the file. This is especially the case with windows based tooling such as Mimikatz, Rubeus and others.</p>
<hr />
<h1 id="heading-great-references">Great References</h1>
<p>Below are some great references on this topic - check them out for further reading!</p>
<ul>
<li><p><a target="_blank" href="https://www.blackhillsinfosec.com/wp-content/uploads/2020/08/SLIDES_PrettyLittlePythonSecretsEpisode1.pdf">Pretty Little Python Secrets - PDF Slides</a></p>
</li>
<li><p><a target="_blank" href="https://www.youtube.com/watch?v=ieyRV9zQd2U">Pretty Little Python Secrets—EP 1—Installing Python Tools/ Libraries the Right Way- Marcello Salvati</a></p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Success Tips for Aspiring Penetration Testers: Your Guide to Excelling in the Field]]></title><description><![CDATA[Since graduating from college and embarking on my career as a penetration tester, I've learned quite a bit about the world of penetration testing and offensive security. While I'm certainly no expert - I feel that I've learned some valuable lessons t...]]></description><link>https://blog.gonskicyber.com/success-tips-for-aspiring-penetration-testers-your-guide-to-excelling-in-the-field</link><guid isPermaLink="true">https://blog.gonskicyber.com/success-tips-for-aspiring-penetration-testers-your-guide-to-excelling-in-the-field</guid><category><![CDATA[penetration testing]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Career]]></category><category><![CDATA[Linux]]></category><category><![CDATA[hacking]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Tue, 27 Jun 2023 00:50:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1687827480337/1aa6fd18-e434-43a8-8b8b-e39931b97bc1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Since graduating from college and embarking on my career as a penetration tester, I've learned quite a bit about the world of penetration testing and offensive security. While I'm certainly no expert - I feel that I've learned some valuable lessons thus far that have helped me succeed as an offensive security professional.</p>
<p>In this article, I'll be sharing some of my top advice for success if you are aspiring to be a penetration tester or aspire to work in the offensive cybersecurity space. This won't be a technical piece - but an outline of broader tips for success. Let's get started!</p>
<h2 id="heading-you-dont-need-to-know-everything-and-you-wont">You don't need to know everything (and you won't)</h2>
<p>Cybersecurity in general is a vast sphere of knowledge that encompasses everything from general IT skills (helpdesk and tech support) to advanced threat emulation and exploitation skills (red teaming and malware development). It can be so easy to feel overwhelmed, lost, and frustrated. It's easy to get down on yourself in this field when you find yourself surrounded by people who know all the ins and outs of all the crazy technologies we work with every day. New exploits are constantly being exposed, new technologies are constantly popping up and being implemented. It can often feel like you are fighting a losing battle trying to keep up when everyone around you seems like they are firing on all cylinders. I know I felt this way (and still do from time to time).</p>
<p>The reality here is that you simply don't need to be an expert at everything - and you very likely won't (and that's ok!). Find your groove, study the material YOU need/want to learn and don't worry about looking to the left and right of you.</p>
<p>Learning in this field is a <strong>long-distance race</strong>, some people can run it fast, and some will run it slow. Some can run fast without breaking a sweat, and some run slower with all they've got. All that matters is that <strong>you</strong> run at your own pace!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687826823738/0e559ee5-1365-4fc6-b490-e5ecf1d7dd13.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-stay-patient-with-yourself"><strong>Stay Patient with Yourself</strong></h2>
<p>I often found myself frustrated and angry with myself because I didn't know something and felt I wasn't able to hang with some of my more technical peers. This frustration severely hurt my ability to simply just....learn. I was constantly trying to chase the knowledge that <em>someone else</em> possessed instead of simply pursuing the skills and techniques <em>I</em> needed to succeed. After some time I realized I just needed to have a little patience with myself in my studies and my growth, one day at a time.</p>
<p>No matter your skill level or experience level in this field I feel it's crucial to have patience with yourself. Instead of comparing yourself to folks who have worked very hard to get to their level - focus on the things <em>you</em> need to be doing to be where <em>you</em> want to be.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687824496745/48104aa9-801f-40ce-a8cc-af363b448862.jpeg" alt class="image--center mx-auto" /></p>
<p>Stay patient with yourself and stay consistent in your work and study. Small amounts of consistent work and study will pay dividends over the longer race.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687824505503/8c1a3060-b3fa-4539-9a0c-419385964c14.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-find-a-groupnetwork"><strong>Find a Group/Network</strong></h2>
<p>This one is super important, and luckily for you - it's likely the easiest! The proliferation of social media such as Reddit, discord and Twitter makes this super easy!</p>
<p>Finding a network or a group of friends is CRUCIAL for success in this field. Especially in a world that is largely remote - being able to casually chat, ask questions and learn from others in this field is the BEST way to learn. Here's how to get started:</p>
<ul>
<li><p>Find 1 or 2 primary discord servers and call them "home".</p>
<ul>
<li><p>Here are a few of my favorite Cybersecurity Discord communities:</p>
<ul>
<li><p>0xPSec - <a target="_blank" href="https://discord.gg/sAmpvaGzf5">https://discord.gg/sAmpvaGzf5</a></p>
</li>
<li><p>Republic of Hackers - <a target="_blank" href="https://discord.gg/RWM4uU4Xab">https://discord.gg/RWM4uU4Xab</a></p>
</li>
</ul>
</li>
</ul>
</li>
<li><p>Introduce yourself!</p>
</li>
<li><p>Become a "regular", check in, say 'hi' and share resources!</p>
</li>
<li><p>Be a sponge! Ask questions and let others know what you are working on.</p>
</li>
</ul>
<p>Committing to an online community allows you to soak up new knowledge and resources and also opens a door for you to give back and spark some great connections.</p>
<h2 id="heading-practice-practice-practice"><strong>Practice Practice Practice</strong></h2>
<p>Dedication to practice is what makes elite athlete's the best in their sport! It's the same with penetration testing.</p>
<p>Consistent practice is a non-negotiable when it comes to this field. Admittedly it can be exhausting, draining and frustrating at times, but getting yourself in a terminal, tackling a certification or messing around in a lab is the absolute best way to advance your skills. The hardest part is simply getting started.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687826138856/e5e1a41a-7d02-43c0-ac0a-a38c973d072e.jpeg" alt class="image--center mx-auto" /></p>
<p>Some of my favorite platforms to practice on include:</p>
<ul>
<li><p>TryHackMe - <a target="_blank" href="https://tryhackme.com/">https://tryhackme.com/</a></p>
</li>
<li><p>HackTheBox - <a target="_blank" href="https://www.hackthebox.com/">https://www.hackthebox.com/</a></p>
</li>
<li><p>TCM Security - <a target="_blank" href="https://tcm-sec.com/">https://tcm-sec.com/</a></p>
</li>
</ul>
<p>TCM Security's PNPT certification is a fantastic introduction to the skills needed for a penetration testing role - when you are ready to dive into certifications, check them out!</p>
<p>As you navigate the various online learning platforms and communities you will slowly find yourself moving quicker in a terminal, troubleshooting issues quicker, asking better questions and holding valuable conversations with community members. This is a tell-tale sign you are on the right path!</p>
<h2 id="heading-commit-yourself-to-the-craft"><strong>Commit Yourself to the "Craft"</strong></h2>
<p>This may sound silly but to be successful in this field you must commit yourself to the craft and take on the persona of an eternal learner. Going back to my first point - you will never know everything, and as such, you will <strong>always</strong> be learning. The quicker you find comfort in constantly being challenged, the quicker you will be able to progress and grow and tackle more complex problems.</p>
<p>As you begin or progress thru your journey to a career in penetration testing know this:</p>
<ul>
<li><p>There <strong>will</strong> be long nights.</p>
</li>
<li><p>There <strong>will</strong> be long hours.</p>
</li>
<li><p>There <strong>will</strong> be times you are tired and confused.</p>
</li>
<li><p>There <strong>will</strong> be things you do not know.</p>
</li>
<li><p>There <strong>will</strong> be times you just need to step away from the terminal for a weekend (or longer)</p>
</li>
</ul>
<p>While this might not sound super appealing, it's the feeling you get when you <strong>do</strong> start getting it and you <strong>do</strong> start firing on all cylinders and <strong>pwning</strong> real networks that really makes it all worth it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1687826435667/e8386e1e-f7bb-415f-b857-aac5af1d1e0a.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-closing-thoughts">Closing Thoughts</h2>
<p>While I am no expert in this field - I wanted to reflect on my current journey and provide some key pieces of advice that I found crucial to my success thus far.</p>
<p>If you are aspiring to be a professional in this field I hope you found this advice helpful to some degree. Feel free to connect with me and reach out if you'd like to talk about what you can do to push yourself into a career in Offensive Security!</p>
]]></content:encoded></item><item><title><![CDATA[Snookums - Proving Grounds]]></title><description><![CDATA[In this article we cover the steps to exploit the box Snookums from Proving Grounds!

Snookums is an Intermediate rated Linux challenge on the Proving Grounds platform.

Enumeration
To kick this off we started this box with initial port enumeration u...]]></description><link>https://blog.gonskicyber.com/snookums-proving-grounds</link><guid isPermaLink="true">https://blog.gonskicyber.com/snookums-proving-grounds</guid><category><![CDATA[oscp]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[CTF Writeup]]></category><category><![CDATA[htb]]></category><category><![CDATA[Kali Linux]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Sat, 10 Jun 2023 02:08:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686364754601/94ebb7f6-153e-4aec-81de-7e8da7db0b70.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article we cover the steps to exploit the box Snookums from <a target="_blank" href="https://www.offsec.com/labs/">Proving Grounds!</a></p>
<blockquote>
<p>Snookums is an Intermediate rated Linux challenge on the Proving Grounds platform.</p>
</blockquote>
<h1 id="heading-enumeration">Enumeration</h1>
<p>To kick this off we started this box with initial port enumeration using both Autorecon and Nmap to identify open ports. Below are the commands I use to kick off port-enumeration with <a target="_blank" href="https://github.com/Tib3rius/AutoRecon">Autorecon</a> and Nmap</p>
<pre><code class="lang-bash"><span class="hljs-comment">#Autorecon</span>
sudo $(<span class="hljs-built_in">which</span> autorecon) &lt;Target-IP&gt; --only-scans-dir -o autorecon --single-target --exclude-tags dirbuster

<span class="hljs-comment">#Quick Nmap full port scan</span>
nmap &lt;Target-IP&gt; -sV -p- -T4 -oN all-ports-scan
</code></pre>
<blockquote>
<p>Note the --exclude-tags flag in the Autorecon command above, this will tell Autorecon to skip automatically running dirbuster when it finds http services or web applications! I recommend using this flag otherwise you might be waiting awhile!</p>
</blockquote>
<p>After running our enumeration here are the ports we find ourselves faced with:</p>
<pre><code class="lang-bash">map scan report <span class="hljs-keyword">for</span> 192.168.156.58
Host is up (0.023s latency).
Not shown: 65520 filtered tcp ports (no-response)
PORT      STATE  SERVICE     VERSION
21/tcp    open   ftp         vsftpd 3.0.2
22/tcp    open   ssh         OpenSSH 7.4 (protocol 2.0)
80/tcp    open   http        Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)
111/tcp   open   rpcbind     2-4 (RPC <span class="hljs-comment">#100000)</span>
139/tcp   open   netbios-ssn Samba smbd 3.X - 4.X (workgroup: SAMBA)
445/tcp   open   netbios-ssn Samba smbd 3.X - 4.X (workgroup: SAMBA)
1696/tcp  closed rrifmm
3306/tcp  open   mysql       MySQL (unauthorized)
12673/tcp closed unknown
29589/tcp closed unknown
32831/tcp closed unknown
33060/tcp open   mysqlx?
41319/tcp closed unknown
41490/tcp closed unknown
45888/tcp closed unknown
</code></pre>
<p>We see a good number of ports here but lets not panic! We let Autorecon do most of the work so once our Autorecon scan is finished we can quickly browse the results looking for version numbers and low-hanging fruit (example below).</p>
<p>Of these ports, I'd be most interested in 21, 80, 139/445 and 3306 off the bat as they have the greatest chance of having misconfiguration's that may lead to credentials to use in initial access.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686359826354/d87e7c21-554d-4b74-bb8b-449fe5e596d3.png" alt="Viewing Autorecon output in Sublime" class="image--center mx-auto" /></p>
<blockquote>
<p>Above is what it looks like when reviewing the output from Autorecon - you can see it splits individual port information into their own folders for easy analysis</p>
</blockquote>
<p>Lets take a look at port 80 - navigating to Port 80 we instantly see this web app is running <strong>Simple PHP Photo Gallery v0.8</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360074925/4b566a20-e60f-42cd-9aa1-2dd834b8b455.png" alt class="image--center mx-auto" /></p>
<p>Perfect! This is a great breadcrumb to run with. After some googling we find that this application has a public PoC for an RFI vulnerability (<a target="_blank" href="https://www.exploit-db.com/exploits/48424">https://www.exploit-db.com/exploits/48424</a>).</p>
<p>RFI will allow us to force the web-server (this machine) to reach out to us (our kali machine) and grab a file/payload from us.</p>
<p>Reading thru the PoC we see at the bottom they mention the vulnerable parameter is <code>/image.php?img=</code></p>
<p>We can test to see if RFI was actually possible by spinning up a simple python server on our Kali box and then putting our IP in the vulnerable parameter to see if we get a hit.</p>
<p>To spin up a simple Python HTTP server use:</p>
<pre><code class="lang-bash">python3 -m http.server &lt;port&gt;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360231358/e5782a72-a830-4461-b070-17eb1503db83.png" alt class="image--center mx-auto" /></p>
<p>After submitting the request to the web server as seen above, lets check on our python webserver to see if we received any connections.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360343460/8302eae3-a31c-49fb-bf79-d3d8afbc69fa.png" alt class="image--center mx-auto" /></p>
<p>We see we get a connection request from the target! - RFI Confirmed</p>
<h1 id="heading-initial-access">Initial Access</h1>
<p>To get our shell on the box we grabbed a copy of Ivan Sinceck's PHP reverse shell found <a target="_blank" href="https://github.com/ivan-sincek/php-reverse-shell">here</a>. We changed the ports and IP values that came hard coded into <code>php_reverse_shell.php</code> to the IP of our Kali IP and the port which we will server our python web server on. After starting a simple python web server we then pointed the target to our web server and specified the modified reverse shell php file in the URL.</p>
<p>Making a new request to the web server and providing the name of our modified reverse shell file:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360549206/774ce2dd-a39f-45db-ad13-ac69ecf5a979.png" alt class="image--center mx-auto" /></p>
<p>Now before we hit enter here - lets make sure we have BOTH a python web server running to *serve* our file from AND and Netcat listener ready to catch our shell.</p>
<p>Upon submitting our request in the web browser above we see a request for <code>shell.php</code> (good)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360715448/3e5c7d77-936d-4bc6-bbed-22ffaca8c7c3.png" alt class="image--center mx-auto" /></p>
<p>And in our Netcat listener window we receive our reverse shell connection!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686360788106/d5b83f99-2553-4972-9ac0-0523bff852b4.png" alt class="image--center mx-auto" /></p>
<blockquote>
<p>We've obtained initial access as the user apache</p>
</blockquote>
<p>Initial access achieved! Lets move onto privilege escalation.</p>
<h1 id="heading-privilege-escalation">Privilege Escalation</h1>
<p>With our initial access achieved - lets first stabilize our shell.</p>
<p>We can stabilize our shell by running the following commands:</p>
<pre><code class="lang-bash">python3 -c <span class="hljs-string">'import pty; pty.spawn("/bin/bash")'</span>
<span class="hljs-built_in">export</span> PATH=/usr/<span class="hljs-built_in">local</span>/sbin:/usr/<span class="hljs-built_in">local</span>/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/tmp
<span class="hljs-built_in">export</span> TERM=xterm-256color
<span class="hljs-built_in">alias</span> ll=<span class="hljs-string">'ls -lsaht --color=auto'</span>

<span class="hljs-comment">#Run the following two steps in your KALI terminal</span>
Ctrl + Z [To Background the Process]
stty raw -<span class="hljs-built_in">echo</span> ; <span class="hljs-built_in">fg</span> ; reset

<span class="hljs-comment">#Run this final command back in our reverse shell</span>
stty columns 200 rows 200
</code></pre>
<p>With our initial shell stabilized lets begin - before throwing linpeas on this box lets just take a look around. I always like to browse the <code>/var/www/html</code> directory - especially if there is a web application running. You can often find credentials or config files in this area.</p>
<p>So looking around we find a <code>db.php</code> file in <code>/var/www/html</code> which actually contains creds!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686361340424/23a82af4-3742-438c-be4b-09623edf73ec.png" alt class="image--center mx-auto" /></p>
<p>With these creds lets think about what other services we originally found on the box and where we could potentially try to login or authenticate to a service. After reviewing our port scan again we know the box is running MySQL so try to access the MySql service running on the server!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686361417826/a0c55f1c-2585-4d0d-afd7-a4bc5a46276c.png" alt class="image--center mx-auto" /></p>
<p>We see the credentials are valid and let us access the MySQL DB. After doing some basic MySQL DB looting we grab a hash for three users in the DB; josh, michael and serna.</p>
<p>After taking a second glance at the "Password Hashes" we notice that these "hashes" are simply Base64 encoded so we can use an online decoder to decode them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686361535739/4d398b0a-3aaa-47f8-804d-484afc2c36ce.png" alt class="image--center mx-auto" /></p>
<p>After decoding - we see we get a new password!</p>
<blockquote>
<p>Note that I am only showing one passwords being decoded above here - be sure to be thorough and decode all three</p>
</blockquote>
<p>After decoding we ended up with clear text passwords for 3 users. Using our shell on the box we can read the <code>/etc/passwd</code> file. From reading this file the only user listed we recognize is michael...now that we know that michael is the only other user on the box they will be our target!</p>
<blockquote>
<p>Sorry no screenshot here - but just check the /etc/passwd file and you will see</p>
</blockquote>
<p>With Michael's password - we can simply login as the michael user from the shell we had as <code>apache</code> .</p>
<p>To switch users and login as michael we can run</p>
<pre><code class="lang-bash">su michael
</code></pre>
<p>It worked! The screenshot below confirms we've switched to the michael user.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686361797680/28933838-ab32-44cc-9628-6e9a5ec8977f.png" alt class="image--center mx-auto" /></p>
<p>Now with access as a <em>new</em> user - lets restart the whole process of privilege escalation.</p>
<blockquote>
<p>For every new user we get access to it's important to start the post-exploitation/privilege escalation phase from square 0 again.</p>
</blockquote>
<p>So we transfer ole-reliable Linpeas to the box and run it as the michael user! The output shows us we can write to <code>/etc/paswd</code>! This is a good potential Privilege-escalation vector</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686361947012/6f1302a4-6c75-4ed2-a545-43db55c95adc.png" alt class="image--center mx-auto" /></p>
<p>Great so now we've enumerated a likely privilege-escalation vector. <a target="_blank" href="https://steflan-security.com/linux-privilege-escalation-writable-passwd-file/">Here</a> is a great resource that covers how to exploit a writable <code>/etc/passwd</code> file.</p>
<h2 id="heading-exploitation">Exploitation</h2>
<p>First we need to generate a new password.</p>
<pre><code class="lang-bash"><span class="hljs-comment">#Run this on the target box</span>
openssl passwd -1 -salt root &lt;password you make&gt;
</code></pre>
<p>Then we simply write this line of text to the end of /etc/passwd, effectively creating a new user on the box with the id of the root user</p>
<pre><code class="lang-bash"><span class="hljs-comment">#Run this on the target box</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">'gonski:$1$test$gQpSrL2WMpgVYyf4ALPAJ/:0:0:root:/root:/bin/bash'</span> &gt;&gt; /etc/passwd
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686362154269/719bad74-26e5-4064-af3f-fdfbbc736b39.png" alt class="image--center mx-auto" /></p>
<p>We see our new user entry at the bottom of <code>/etc/passwd</code> (yes there are multiple gonski users...I messed up, disregard).</p>
<p>Now that our entry is in <code>/etc/passwd</code> we can just switch to the gonski user!!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686362219557/51f9a51e-4239-4a0b-bc4e-add422750618.png" alt class="image--center mx-auto" /></p>
<p>Checking our group we see we have root level privileges - Snookums ROOTED.</p>
]]></content:encoded></item><item><title><![CDATA[OSCP 2023 - How I passed in 30 days]]></title><description><![CDATA[In this article I want to share my OSCP journey and talk about how I was able to achieve a passing score on my 2nd OSCP attempt in May of 2023. I will briefly touch on my professional background in Offensive Security and share tips and advice that I ...]]></description><link>https://blog.gonskicyber.com/oscp-2023-how-i-passed-in-30-days</link><guid isPermaLink="true">https://blog.gonskicyber.com/oscp-2023-how-i-passed-in-30-days</guid><category><![CDATA[oscp]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[information security]]></category><category><![CDATA[penetration testing]]></category><category><![CDATA[offensive-security]]></category><dc:creator><![CDATA[Matt Biedronski]]></dc:creator><pubDate>Tue, 06 Jun 2023 00:34:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1686011601747/bf5532a0-6d78-41fa-9232-f4479ca4b78b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article I want to share my OSCP journey and talk about how I was able to achieve a passing score on my 2nd OSCP attempt in May of 2023. I will briefly touch on my professional background in Offensive Security and share tips and advice that I picked up during my preparation process. To anyone studying for this exam I hope you find this beneficial in your studies and good luck!</p>
<h1 id="heading-background">Background</h1>
<p>So before we get into this - I feel that it's important to touch on my background to set the scene for where in the imaginary penetration testing "skill ladder" I was when I took my exam. Not everyone starts from the same place.</p>
<h2 id="heading-the-beginning">The Beginning</h2>
<p>Upon entering the Cybersecurity industry in August of 2021 I knew next to nothing about 'pentesting'. I was very <strong>very</strong> new to everything, including even just using a terminal for basic tasks. After about 7-8 months of learning on the job and an announcement from Offsec stating Active Directory would now hold a huge role in the exam, I sat down for my first OSCP attempt in April of 2022 feeling naively confident.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://tenor.com/view/typing-pepe-the-frog-on-the-computer-working-busy-gif-17435402">https://tenor.com/view/typing-pepe-the-frog-on-the-computer-working-busy-gif-17435402</a></div>
<p> </p>
<p>I will spare you the details but in short, my first exam attempt was a total wash - I was utterly unprepared in almost every aspect and struggled beyond belief with simple things - like file transferring and even getting reverse shells for example. I had only completed 4 boxes in the old-style OSCP labs. Since I spent so much time reading the course PDF and didn't get as much practice as I wanted to, I really can't count my first attempt as a 'real' attempt. Needless to say no passing score was achieved that day. however, it was at that moment that I knew one day I would be back, and this time there would be no chance of failure.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685931812099/8eee5559-f654-407e-a56f-782d17395855.jpeg" alt class="image--center mx-auto" /></p>
<p>So fast forward to when I sat down for my 2nd OSCP attempt. I was no longer brand new to pentesting at this point, and I was lucky enough to already work as a penetration tester in my day job. I know most students or folks aiming for this exam won't have the luxury of the 'accelerated' learning environment I was in, so it should be noted that working as a penetration tester obviously helped me in my preparation for the OSCP. Despite this, I still spent a considerable amount of effort in preparing for my second attempt.</p>
<p>At this point I had almost 2 years of real penetration testing experience spanning everything from your typical external penetration test to performing physical penetration tests. It was also at this point that I had confidently conducted numerous Internal/Active Directory penetration tests and felt roughly comfortable when compromising a typical enterprise network environment. Furthermore I had completed numerous modules on TryHackMe including the Jr. Penetration Tester Path and the Offensive Pentesting path as well as passed both the PNPT and Sec+. This being said</p>
<ul>
<li><p>I was comfortable in a terminal</p>
</li>
<li><p>I had a good idea of the key things one would do when trying to compromise both a single machine and network</p>
</li>
<li><p>I had a general idea of the flow and progression when completing a "Box"</p>
</li>
<li><p>I had spent enough time struggling that I now understood <em>how</em> I needed to study in order to fully prepare for the exam</p>
</li>
<li><p>I understood what information was important in a penetration testing report and how to explain an attack chain</p>
</li>
</ul>
<p>With the stage set about where I was when I took my second attempt, lets talk about how I confidently passed after 30 days of focused preparation.</p>
<hr />
<h1 id="heading-preparation">Preparation</h1>
<p>So 30 days..how did we do it? Well background experience aside, it came down to 30 days of <strong>intensely focused</strong> studying. What do I mean by this? Well</p>
<ul>
<li><p>The very day I obtained access to the PWK-2023 course I scheduled my exam for 30 days away and that very night I was working on the first challenge lab</p>
</li>
<li><p>My days (where allowed) and evenings were spent studying</p>
</li>
<li><p>My weekend's were largely spent studying</p>
</li>
</ul>
<p>When I started the course I set myself on a path and told myself it was going to be done. Simple as that. I remained disciplined and focused throughout the whole time. I was going to study for 30 days and we were going to pass and that was final.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://tenor.com/view/is-has-been-decided-decided-it-is-decided-its-final-august-burns-red-gif-14311224">https://tenor.com/view/is-has-been-decided-decided-it-is-decided-its-final-august-burns-red-gif-14311224</a></div>
<p> </p>
<p>From a high level I broke down the big scary evil "OSCP Exam" into the core pieces and compartmentalized my learning into specific skills I needed to work on. I was already largely confident in my AD skills so I focused on things like</p>
<ul>
<li><p><strong>Initial access -</strong> Understanding what ports/services could be used for access and how to enumerate them</p>
</li>
<li><p><strong>Privilege escalation -</strong> what tools do I use once I actually get a shell</p>
<ul>
<li>What are the main "collection" of priv-esc vectors I need to be familiar with and how do I exploit them</li>
</ul>
</li>
<li><p><strong>Post-Exploitation -</strong> Once I had administrative privileges what things should I be looking for and what tools do I run at this point</p>
</li>
</ul>
<p>Prior to obtaining the actual course material I had been casually working thru various platforms seen below:</p>
<ul>
<li><p><strong>TryHackMe</strong></p>
<ul>
<li><p>Jr. Pentester Path</p>
</li>
<li><p>Offensive Pentesting Path</p>
</li>
<li><p><strong>Wreath - DO THIS ROOM</strong></p>
</li>
<li><p>Linux/Windows Priv-Esc Arenas</p>
</li>
</ul>
</li>
<li><p><strong>Proving Grounds</strong></p>
<ul>
<li>I focused on the TJ Null List found <a target="_blank" href="https://docs.google.com/spreadsheets/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/edit#gid=1839402159">here</a></li>
</ul>
</li>
<li><p><strong>TCM Security</strong></p>
<ul>
<li><p>PEH Course</p>
</li>
<li><p>External Pen-Test Playbook</p>
</li>
<li><p>Linux/Windows Priv Esc Courses</p>
</li>
</ul>
</li>
</ul>
<p>    If there is one module you do from this list it should be the Wreath room on TryHackMe. Wreath is a fantastic room that will teach you the basics of network pivoting with various tools - a key technique you must be familiar with for the OSCP exam.</p>
<p>    I also want to note that you don't <em>need</em> to have done all of these modules/courses in order to be prepped for the exam. These were just resources I worked on in-between my 1st and 2nd OSCP attempt.</p>
<h1 id="heading-the-course">The Course</h1>
<p>The new and improved OSCP/PWK-2023 course brought a good mix up upgrades to the course material and the labs provided to students. You can read more about specific changes made <a target="_blank" href="https://www.offsec.com/offsec/pen-200-2023/">here</a>.</p>
<p>Given my background and previous knowledge of the PDF/exercises I was able to gloss over most of the content in the PDF except for a few key chapters. I will say the content in the privilege escalation chapters was great and really beneficial when working on the labs and on the exam.</p>
<p>Overall, I think the changes made to the course and content were beneficial and if you are lacking in a certain skill in your exam prep the course PDF serves as a great root of learning.</p>
<h2 id="heading-the-labs">The Labs</h2>
<p>If there's one thing you read in this article...it's <strong>DO THE LABS</strong>.</p>
<p>I strongly believe the labs are now the <strong>BEST</strong> resource you can use in your preparation. With the addition of 3 practice exams you now have the ability to take a real practice exam that mimics not only the difficulty of the actual exam but the format of the exam as well (3 standalones + 1 AD set).</p>
<p>The new and improved "challenge labs" were fantastic practice and really made up the bulk of my prep. The addition of an isolated lab environment which allowed the student to freely practice without the worry of suddenly losing connection because another student decided to revert a machine was a long overdue and welcome upgrade.</p>
<p>I felt that the labs were straightforward but reasonably challenging. The labs allow you to get plenty of repetitions and practice with important skills you <em>need</em> to know in order to pass but doesn't force you to endure an endless cycle of banging your head on a keyboard.</p>
<p>Key skills you'll run thru in the labs are:</p>
<ul>
<li><p>Typical port scanning and enumeration</p>
</li>
<li><p>Practice with obtaining initial access and stabilizing your initial shells</p>
</li>
<li><p>Enumerating privilege escalation vectors and exploiting them</p>
</li>
<li><p>The concept of post-exploitation looting. Getting admin is great but what do you do once you are an admin?</p>
</li>
<li><p>File transferring - you should be completely familiar with general file transferring by the end of the labs</p>
</li>
<li><p>Pivoting Pivoting Pivoting</p>
</li>
</ul>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://tenor.com/view/if-you-think-of-an-gif-20132469">https://tenor.com/view/if-you-think-of-an-gif-20132469</a></div>
<p> </p>
<p>Of particular importance for success on the exam is the concept of <strong>pivoting</strong> and being able to leverage a compromised machine to obtain access to a new network of machines via your access as an attacker. If you are already familiar with pivoting via the classic proxychains + chisel method, I highly suggest you give <a target="_blank" href="https://github.com/nicocha30/ligolo-ng">Ligolo-NG</a> a shot. You can read more about using Ligolo-NG <a target="_blank" href="https://4pfsec.com/ligolo">here</a>.</p>
<p>Luckily for you I've also created a simple video demonstration on how to use Ligolo-NG <em>specifically</em> for the folks who might want to use it in the PWK labs. You can watch it here:</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/DM1B8S80EvQ">https://youtu.be/DM1B8S80EvQ</a></div>
<p> </p>
<p>Another Important thing to note is that I placed a considerable amount of effort on my note-taking and organization. While I am a normal Obsidian user, I found that cherry-tree was just better as a "live" note taking platform as I worked thru the labs. Below is a snippet of how I setup my cherry-tree notes during the labs.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1685936337306/319bdd4a-c979-4391-869b-700336e48cca.png" alt class="image--center mx-auto" /></p>
<p>Overall, if you are a student taking the course now I would recommend you primarily focus on completing the labs and getting in those reps. Repetitions will build muscle memory and strengthen your methodology.</p>
<p>Throughout my time in the labs I had to use various tools for Privilege Escalation. One tip I'll emphasize is build a folder dedicated to storing all of the priv-esc tools you use and encounter in your prep. Below is the contents of both my Linux and Windows priv-esc tool folders. All of the tools below I used at one point or another in my preparation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1686007339704/95a64cba-72df-44dc-aa38-ced6560e2970.png" alt class="image--center mx-auto" /></p>
<p>A couple I will highlight as my favorite are:</p>
<ul>
<li><p>Linpeas &amp; Winpeas</p>
</li>
<li><p>ADPeas - Useful for AD enumeration</p>
</li>
<li><p>PrivescCheck.ps1 - My go-to once I obtained initial access on a Windows target</p>
</li>
</ul>
<h3 id="heading-active-directory">Active Directory</h3>
<p>Active Directory (AD) is a huge sphere of knowledge and there are just are so many attacks, tools and techniques to talk about that I couldn't possibly give them a proper overview here. I know a lot of folks are interested in the AD set so I'll briefly touch on AD skills necessary for success.</p>
<p>In AD, full compromise of a domain rests almost solely on one thing - initial access.</p>
<p>Initial access in the context of an AD pentest or and AD lab environment simply means that you have the credentials for a domain-joined user/computer account. In order to properly enumerate an AD domain and stage further attacks (kerberoasting) you <em>need</em> to have valid domain crededntials to do so.</p>
<p>Examples of valid domain creds can be having a user's username and clear-text password, or even having a user's username and their NT password hash for use in pass-the-hash attacks.</p>
<p>Some tools and techniques I recommend you learn and focus on practicing in the labs are</p>
<ul>
<li><p><strong>CrackMapExec -</strong> Your go-to all-in-one AD tool. Great for passing-the-hash.</p>
</li>
<li><p><strong>Impacket -</strong> Impacket is not one tool but rather a collection of fantastic tools.</p>
<ul>
<li><p>Impacket-secretsdump</p>
</li>
<li><p>Impacket-smb/ps/wmiexec</p>
</li>
<li><p>Impacket-mssql</p>
</li>
<li><p>Impacket-smbclient</p>
</li>
<li><p>Impacket-GetUsersSPNs</p>
</li>
<li><p>And many more</p>
</li>
</ul>
</li>
<li><p><strong>LDAP/SMB Enumeration</strong></p>
<ul>
<li>LDAPDomainDump &amp; CME are great tools for this</li>
</ul>
</li>
<li><p><strong>Kerberos Attacks</strong></p>
<ul>
<li>Kerberoasting &amp; ASREP Roasting</li>
</ul>
</li>
</ul>
<p>This isn't an exhaustive list of tools/techniques but you should definitely be familiar with the tools and attacks above.</p>
<h1 id="heading-exam-day">Exam Day</h1>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://tenor.com/view/guerra-war-ready-to-fight-gear-up-arnold-schwarzenegger-gif-13809686">https://tenor.com/view/guerra-war-ready-to-fight-gear-up-arnold-schwarzenegger-gif-13809686</a></div>
<p> </p>
<p>The morning of my exam day arrived and I took a seat at my desk 30 minutes before my scheduled start time at 9AM. I hooked up to the proctoring software, turned on my camera and waved at the proctor with a smile. I was confident and ready to go.</p>
<p>With VPN access into the lab environment I kicked off <a target="_blank" href="https://github.com/Tib3rius/AutoRecon">AutoRecon</a> scans on the 3 standalone boxes in the background and began on attacking the Active Directory set.</p>
<p>The AD set was conquered in 3 hours. Onto the standalones I went. After reviewing the output of my AutoRecon scans I went after a juicy target and in an hour flat rooted my first standalone.</p>
<p>I targeted the next standalone and obtained my first shell pretty quickly - I now had my 70 points. Even with 70 points I continued on. After a few hours and couple of unsuccessful priv-esc attempts I took about an hour dinner break.</p>
<p>After my 60 minute break I was refreshed and jumped right back into it. Shortly after I had rooted the 2nd standalone - 80 points! At this point I was feeling good - everything, all the exploits, shells and attacks had worked as intended! Everything worked just like it was documented in my notes!</p>
<p>For the next few hours I attempted to get initial access on the final standalone to no avail. Eventually I made the decision to review my documentation and begin on writing my report. I submitted my 80 point report shortly after midnight feeling relieved that the exam had finally been conquered.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://tenor.com/view/lit-baby-cute-adorable-cheering-gif-17449868">https://tenor.com/view/lit-baby-cute-adorable-cheering-gif-17449868</a></div>
<p> </p>
<h1 id="heading-closing-thoughts">Closing Thoughts</h1>
<p>In conclusion, with proper discipline and time anyone can pass this exam. Everyone's path will be different and that's alright. All that matters is you focus on running your own race.</p>
<p>While I was able to spend 30 days in the labs and comfortably pass it's important to note that my journey to get to this level took roughly 1.5 years in total. It took many many long nights and quiet weekends to get to this point but with proper practice anyone can really do this - especially if I can.</p>
<p>If you've made it to the end of this article I hope you were able to get something out of reading my experience. Best of luck and feel free to reach out should you have any questions!</p>
]]></content:encoded></item></channel></rss>