Blazorized

Recon

nmap_scan.log
└─$ grep bla /etc/hosts
10.10.11.22     blazorized.htb  admin.blazorized.htb    api.blazorized.htb

HTTP (80)

Writeup.png

Since dns exists I first did DNS enumeration:

The Check for Updates page makes request to api subdomain

Writeup-1.png

In the API request we see an Authorization Token, but we are not yet logged in.

Writeup-2.png

Nice, we have superadmin session token

Writeup-3.png

Blazor DLLs

I tried using token to login into the admin panel but was unlucky. If we look at traffic when visiting admin subdomain some odd requests are made. Backend seems to be based on .NET C#... Yeap!Blazor is a free and open-source web framework that enables developers to create web user interfaces based on components, using C# and HTML. It is being developed by Microsoft, as part of the ASP.NET Core web app framework. Wikipediaarrow-up-right

Writeup-4.png

App is built with wasm and Blazor. If you visit the website for the first time you'll notice it's saying Loading, but that's fine nothing unusual. But if you're monitoring the traffic you see a lot of interesting things! Reference: Just Blazor Programming: Hack A Blazor WASM Apparrow-up-right

Writeup-5.png

Copy the dll endpoint links into endpoints_burp.log and download all of them.

Leaked JWT Secret

We don't need System.* or Microsoft.* dll so we can skip them. Usually we need projectname.*. The Helpers dll reveals information about JWT signing and we have a key.

Writeup-6.png

Code which created admin token:

Forge the token:

Writeup-7.png

The admin subdomain first tries to authenticate by JWT Token. There was LocalStorage dll so it must be taking value from that. After a lot of fuzzing jwt was the key it used for auth...

Writeup-8.png

Admin Panel

Writeup-9.png

SQLi

Testing for SQL injection we get True or False, so Blind Injection.

Writeup-11.png
Writeup-10.png

In the nmap scan we saw MSSQL used, it allows Command Executionarrow-up-right:

Verify if we can execute commands:

Writeup-12.png

Reverse Shell (nu_1055)

User.txt

Privilege Escalation (RSA_4810)

Writeup-13.png
Writeup-14.png
Writeup-15.png
Writeup-16.png

web.config files also had nothing.

We are part of custom group so It's worth enumerating Groups.

Exfiltrate the zip

Writeup-17.png

As I thought, the exfiltration was not successful because of piping zip directly to nc. To bypass this we can encode the file using Base64, easiest way being certutil.exearrow-up-right

Note: certutil.exe is used for certificates, make sure to remove First and Last line for valid Base64!

Note: I removed the password for Base64.

Unfortunately the Bloodhound app cannot digest the collected information because of Sharphound 5.x BloodHoundAD: Zip File not loading #700arrow-up-right Community Edition Bloodhound is required for setup: https://github.com/SpecterOps/BloodHoundarrow-up-right

BloodHound

Owned user is part of following groups

Writeup-19.png

We have Outbound Object Control: WriteSPN on RSA_4810 account.

The user NU_1055@BLAZORIZED.HTB has the ability to write to the "serviceprincipalname" attribute to the user RSA_4810@BLAZORIZED.HTB.

Writeup-18.png

If we click on WriteSPN we get some juicy details!

Writeup-20.png

TheHackerRecipies > DACL abuse > BloodHound ACE edgesarrow-up-rightTheHackerRecipies > DACL abuse > BloodHound ACE edges > Targeted Kerberoastingarrow-up-right

Writeup-21.png

Creds: RSA_4810:(Ni7856Do9854Ki05Ng0005 #)

Privilege Escalation (SSA_6010)

Writeup-22.png
Writeup-23.png

The Bloodhound doesn't give any more information about PrivEsc. Upload PowerView and explore system manually.

After invoking Get-DomainUser and looking over the result one field stands out, logoncount. 3984 logon time seems line an automated task.

Logon scripts are usually found in C:\WINDOWS\SYSVOL\domain\scripts srcarrow-up-right

Logon Script

Check what's in the logon scripts directory:

Get permissions:

Im not sure why, but Villain payload kept failing to get connection from logon script. Using Powershell #3 (Base64) made the connection... Meanwhile I was trying different things and ended up using the following path. The domain directory would have probably also worked, but not gonna test it since I have shell......

Privilege Escalation (Administrator)

Gather data as ssa_6010 user and exfiltrate it.

Writeup-24.png

Since mimikatz is interactive I upgraded the netcat to ConPtyShell.

Go over to crackstationarrow-up-right

Writeup-25.png

Trying admin with cracked password failed.

Using the pass the hash method we are able to login.

Flags


Writeup referenced:https://blog.csdn.net/m0_52742680/article/details/140102307arrow-up-right

Last updated