Windows
Index
/
Kerberos Checksum Vulnerability
This was a flaw in the Kerberos protocol, which could be leveraged along with standard domain user credentials to elevate privileges to Domain Admin. A Kerberos ticket contains information about a user, including the account name, ID, and group membership in the Privilege Attribute Certificate (PAC). The PAC is signed by the KDC using secret keys to validate that the PAC has not been tampered with after creation.The vulnerability allowed a forged PAC to be accepted by the KDC as legitimate. This can be leveraged to create a fake PAC, presenting a user as a member of the Domain Administrators or other privileged group. For more info see HERE.
Exploit to get TGT
Impacket-Exploit to open a privileged session using the obtained TGT and PsExec
PrinterBug or SpoolSample
The Printer Bug is a flaw in the MS-RPRN protocol (Print System Remote Protocol). This protocol defines the communication of print job processing and print system management between a client and a print server. To leverage this flaw, any domain user can connect to the spool's named pipe with the RpcOpenPrinter
method and use the RpcRemoteFindFirstPrinterChangeNotificationEx
method, and force the server to authenticate to any host provided by the client over SMB. The spooler service runs as SYSTEM and is installed by default in Windows servers running Desktop Experience.
Set responder
Using PowerShell, get a list of Windows boxes (servers are usually priority)
With rpcdump.py see if the Spooler Service is listening
Now, with dementor.py or printerbug.py, ask the service to authenticate against an arbitrary host
PetitPotam
The flaw allows an unauthenticated attacker to coerce a Domain Controller to authenticate against another host using NTLM over port 445 via the Local Security Authority Remote Protocol (LSARPC) by abusing Microsoft’s Encrypting File System Remote Protocol (MS-EFSRPC). This technique allows an unauthenticated attacker to take over a Windows domain where Active Directory Certificate Services (AD CS). For more info, see this link.
Use certi to attempt to locate the Web Enrollment URL for the CA host.
Start ntlmrelayx.py, specifying the Web Enrollment URL for the CA host and using either the KerberosAuthentication or DomainController AD CS template.
Attempt to coerce the Domain Controller to authenticate to our ntlmrelayx
Use PetitPotam.py
Or, if initial access has been established to a domain joined system, use PetitPotam.exe
Obtain the User and the Base64 encoded certificate for the Domain Controller from ntlmrelayx.
Use gettgtpkinit.py to request a TGT for the domain controller.
Set the KRB5CCNAME
environment variable, so our attack host uses this file for Kerberos authentication attempts
From krb5-user get TGT info with klist
command (default principal)
Now we can use the TGT to perform various attack
Then use impacket-secretsdump to perform DCSync
Alternatively, once we obtain the base64 certificate via ntlmrelayx, we could use the certificate with the Rubeus tool on a Windows attack host to request a TGT ticket and perform a pass-the-ticket (PTT) attack all at once.
SamAccountName Spoofing - NoPac
CVE-2021-42278 is a bypass vulnerability with the Security Account Manager (SAM). CVE-2021-42287 is a vulnerability within the Kerberos Privilege Attribute Certificate (PAC) in ADDS.
This exploit path takes advantage of being able to change the SamAccountName
of a computer account to that of a Domain Controller. By default, authenticated users can add up to 10 computers to a domain. When doing so, we change the name of the new host to match a Domain Controller's SamAccountName. Once done, we must request Kerberos tickets causing the service to issue us tickets under the DC's name instead of the new name. When a TGS is requested, it will issue the ticket with the closest matching name. Once done, we will have access as that service and can even be provided with a SYSTEM shell on a Domain Controller.
Install impacket
Use NoPac
Check if the system is vulnerable
Attack the target. (This could be "noisy" or may be blocked by AV or EDR)
Impersonate the built-in administrator account and drop into a semi-interactive shell session (smbexec.py
) on the target Domain Controller.
We could then use the TGT ccache file to perform a Pass-The-Ticket and perform further attacks such as DCSync. We can also use the tool with the -dump
flag to perform a DCSync using secretsdump.py.
PrintNightmare
Exploit-1 that execute a malicious DLL.
Install cube0x0's Version of Impacket
We can use rpcdump.py
to see if "Print System Asynchronous Protocol" and "Print System Remote Protocol" are exposed on the target.
After confirming this, we can crafting a DLL payload using msfvenom
We will then host this payload in an SMB share
Now we can use MSF to configure & start a multi handler.
With the share hosting our payload and our multi handler listening for a connection, we can attempt to run the exploit against the target.
Windows Kernel Elevation of Privilege Vulnerability
Exploit: Privilege Escalation with UsoDllLoader or diaghub, or with service that runs in the context of SYSTEM and is startable by unprivileged users.
ex: <PATH>
= C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice.exe
Check permission with icacls <PATH>
Get 2 malicious.exe
and renames with the name of the service exe.
Run exploit
Check permission with icacls <PATH>
(all F)
Since MaliciousExe1
is no longer a valid, exchange it with the second
Now run the malicious file as system
Windows Certificate Dialog Elevation of Privilege Vulnerability
Use hhupd.exe that contains a certificate with the SpcSpAgencyInfo field populated with a hyperlink.
Right Click on hhupd.exe
> Run as administrator
> Show information about the publisher's certificate
> General
> Link on "Issued by" and close
Now we have a browser open as system.
Right Click on browser
> Save as
> c:\windows\system32\cmd.exe in the path
Secondary Logon Elevation of Privilege Vulnerability
EternalBlue
SMB v1 vulnerability, Exploit
BlueKeep
RDP vulnerability, Exploit
Last updated
Was this helpful?