Monday, May 11, 2020

List of Service Principal Names (SPNs) amongst AD Users

Here is a simple powershell script to list the service principal names 
among user accounts in a Windows domain. Understanding why the SPNs
exist and how they could be abused is important. $info = Get-ADUser -Filter * -Properties ServicePrincipalNames ForEach ($user in $info) { $samAccountName = $user.SamAccountName If ($user.ServicePrincipalNames -ne $null) { ForEach ($spn in $user.ServicePrincipalNames) { "$($samAccountName) $spn" } } }

No comments:

Post a Comment

Test Authentication from Linux Console using python3 pexpect

Working with the IT420 lab, you will discover that we need to discover a vulnerable user account.  The following python3 script uses the pex...