The Cyber Threat Perspective artwork

The Cyber Threat Perspective · SecurIT360

Service Accounts: The Shortest Path to Domain Admin | Ep 194

Service accounts are one of the easiest paths to domain admin on an internal pen test, and one of the most neglected accounts in Active Directory. In this episode, Spencer and Tyler break down why service accounts keep falling: Kerberoasting every service account (not just the privileged ones), cracking the hashes offline, and spraying what cracks across the environment. Tyler shares a recent engagement where a non-administrative service account shared its password with a domain admin. Same password, one "SVC_" prefix apart. That spray handed over the domain. He's also seen the built-in RID 500 administrator account used as a service account on three separate engagements this year. They also get into where these credentials actually live: web.config files on open file shares, plaintext password files (present on roughly 90% of their pen tests), and one .eml attachment with the credentials sitting inside a screenshot. Then the fix list, in the order they'd actually do it: - Inventory the accounts and document where each one is used, before you touch a password - Delete the service accounts that don't need to exist - Strip privileges and restrict interactive logon rights - Get a password vault or PAM solution, and make every password long and unique - Alert on service accounts logging on interactively - Move to group managed service accounts (gMSA) where you can - Enforce 20-25 character minimums in the meantime. They've cracked 20+ character passphrases with a gaming rig, a 180 GB wordlist, and mutation rules producing roughly four quadrillion permutations Plus the three cleanup mistakes that cause the most damage, including the story of a $70 billion enterprise where one undocumented password reset turned into a 10-hour troubleshooting call. Work with Us: https://securit360.com Blog: https://offsec.blog/ Youtube: https://www.youtube.com/@cyberthreatpov Twitter: https://x.com/cyberthreatpov Follow Spencer on social ⬇ Spencer's Links: https://spenceralessi.com

Aug 272026
32 minlength
62transcript lines
Publishertranscript source

Transcript first 15 of 62 lines

0:06SpencerService accounts are ripe for abuse in Active Directory. It's one of the things that we probably compromise the most in the context of like accounts, you know. And a service account, really, the way I describe it is just-it's a service. It's an account that's used for some sort of automation or a task or scheduled job. It's not something that is typically used by a human or an IT admin to like interactively log in with, and it's oftentimes forgot about, and nobody knows what it's for. They're often left there, and you know, because of tribal knowledge and people leaving the organization, a lot of times these service accounts get kind of set by the wayside and forgotten about, and then that's how you end up with some technical debt and these accounts being having weak passwords and all sorts of stuff that we're going to dig into more in this episode, so before we get started, Tyler, what's kind of like your biggest, what's your biggest risk when you see service accounts? Like, what's the most common thing you're looking for? And then we'll get into some more specifics of like what makes them dangerous.

1:21TylerWhenever I see service accounts, obviously Kerberosting is just a free way to get, you know, a hash of that account's password. And after we Kerberos, we're not just looking for service accounts that are in administrative groups. We Kerberos all service accounts, and I have an interesting story about that that I can tell here in a minute. But once we kerberos those accounts, then we're trying to crack the passwords. So load up Hashcat and then try and crack the passwords, and that's just-it's a very, very quick and easy win because kerberosting does not take very long. I guess the longest part would be cracking hashes, but still, to get an elevated level of access from such an easy technique to abuse versus some of the others that we see in Active Directory.

2:08TylerService accounts are definitely one of my favorite avenues of attack.

2:11SpencerYeah, and Kerberos thing is heavily used by ransomware groups. It's a very common technique to get access to privileged accounts, service accounts, administrative accounts, and unfortunately, many times IT admins create service accounts that are used interactively for like daily IT admin use, or they inadvertently set up or configure services, or SQL databases, or things like that with their domain admin account, or even worse, we've seen service built-in administrative accounts, B service accounts as well, which is a big no-no. But we've kind of seen it all when it comes to service accounts. So we're going to dig into in the rest of this episode. So we're going to talk about what makes them dangerous.

2:59SpencerWe're going to share some stories about real life internal append tests, how are they abused, and then we're going to talk about kind of mitigations, what we think you should do or could do to mitigate account compromise of these service accounts, how to protect them, and that kind of thing. So before we get started on the rest of that, quick shout out to Secure IT360. They're the ones who kind of produce this podcast. They support it, and we wouldn't be anywhere without them, so to speak. So if you are interested in a pen test, if you need a pen test, especially internal, because that's the best, right? You know, I'm I'm not biased at all. Go check us out at secureit360.com. We'd love to talk to you about your next pen test. So, what makes an account, a service account, dangerous? So I'm going to tee this off, and then I want you to share the story that you have, Tyler, about a recent pen test.

3:54SpencerSo one of the reasons why service accounts are dangerous is because many times they're overprivileged. Many times they're a member of the domain admins group or some built-in administrative group. Many times they have local admin on servers. They might be used to run SQL databases. Service accounts, kind of by their nature, are barely privileged in Active Directory. And to kind of articulate where this can kind of go wrong, Tyler. Why don't you share the story about a recent pen test we had?

4:27TylerI was on an internal pen test, and I looked in the domain admins group, and I took note of you know kind of their administrative name format, and then also the names of the administrators that were in that group, just as kind of an antidote to put in my head to take further into the engagement, and later that day, I kerberosted probably 12 or 15 accounts, took those offline, formatted them, and then was cracking hashes. And one of the service accounts that ended up cracking a hash. For I looked at and its name, the only difference between its name and then one of the administrators in the environment's name was SBC underscore, so that was present at the front for the service account, not for the domain administrator. So I'm kind of sitting here and I'm like, well, these look very very similar. What are the odds? What are the odds that these accounts have the same password? Instead of just trying it for the domain admin, I sprayed it across the environment. Obviously, I want to get a wide net search. See, is this in use for any other service accounts or users in the environment? And then I got the domain admin off of that. They were using the same password for this service account that was not administrative for the administrative user, and I think that's the first time I've seen that on one of my pentests. But I wouldn't say it's something that's uncommon. Not sure how many times you've run into that, but that was definitely probably one of the more fun engagements.

5:59TylerJust finding these little Easter eggs like that.

6:04SpencerYeah, it's very it's very common for service accounts to reuse passwords, right?

6:09SpencerBetween service accounts and even between administrative accounts, and it's just you know, for lack of a better word, it's out of laziness, right? Not wanting to have unique passwords for each account, being able to remember them easily, but that is a very big it's a very big risk reusing passwords because if one of those accounts gets compromised, if a service gets compromised, if a database gets compromised, or a web application, you have underlying service accounts that are running behind those, and they get compromised. They could then use an attacker could then use those to discover other accounts, right? So the shared credential kind of situation is is fairly common. The other issue with service accounts and what makes them dangerous is they're quite broad in their access, so like I mentioned a few minutes ago, many times they are given local admin on servers. So it's very common to see, you know, we see this a lot with law firms, right? Like they have Equitrack or they have Coppatrack. They have these different solutions that are network based. They run on the network. You install them on on your environment, but they run across the network. So multiple services, multiple departments even need to access them. So they give them broad access on a number of different servers because they have to run certain things. Well, if you compromise that account, well, now you have local admin or administrative rights in some way across a number of of different servers.

7:45SpencerSo this broad access issue is also very common with service accounts. And I don't know if you've seen this too, Tyler, but you know this path is very common from cracking a service account to getting local admin on a server, to then you know compromising something else like a scheduled task that's running as a domain admin, like that's a very typical path.

8:08TylerYep. Yeah, I feel like the other problem with service accounts is because there's more scrutiny around them, just in the industry as a whole. They typically have better password policies than your regular users. That's kind of a double-edged sword, though. The better the password assigned to the account, the more likely that password is going to get written down somewhere, or that password is going to be in plain text somewhere that we can enumerate and see. And I feel like that holds very true for service accounts. The other thing that we typically see with service account password policies, their passwords never expire, and I understand why.

8:48TylerYou know, some organizations, it's a set it and forget it type of account. It does X, Y, and Z thing. The password never changes, so the account always does its task without fail. So from that standpoint, maybe a password that doesn't expire makes sense. However, you do run the risk of that password getting compromised or being written down somewhere six years ago, right, and being forgotten about, and then that password still being true when if that actor gets in your environment and now they're running as that service account,

9:22Spencerexactly, and you know that's one of the reasons why people don't change service count passwords is because they fear that it's going to break things. They fear that it's going to interrupt critical business operations. You know, and and the fear you know is warranted. Obviously, they don't want to take down their environment because they change the password. The other reason why folks don't change their service account passwords is because they don't know where that account is being used, or they don't know everywhere that account is being used. So we'll get into more of mitigation and kind of like how to control this risk in a little bit. But the other place that we kind of. Use service accounts from, or we actually kind of identify service accounts from, is file shares, document repositories, document management systems, wikis, ticketing systems, SharePoint, in application configuration files like web configs, all sorts of places where either IT admins or developers or end users, vendors store credentials, and this is a very common location to find service accounts during internal pentas because, like I said, one web dot config file could have like a SQL account that's you know running SQL services across all of your SQL servers, and more often than not, that account probably has local admin on all those servers. And if you have those web configs out on a file share that's readable by all users, I could potentially discover them, find that credential, use that credential, and kind of pivot my way through the environment.

11:02TylerYeah, and I would say that's one of the most common scenarios that we see on internal pen test. I have a specific PowerShell script that I've written that looks for.config files, web .config files, because it's so so common for us to see all these servers sitting out there that we have you know file share access to that we can read these files from, and they are very very fruitful across multiple engagements. So I would definitely make sure that you guys are checking those if you haven't already.

More The Cyber Threat Perspective episodes →