Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Credentialed Enumeration - from Windows

Enumeration from a Windows attack host using domain credentials. Tools include the ActiveDirectory PowerShell module, PowerView/SharpView, Snaffler, and SharpHound/BloodHound. Some findings may be informational (e.g., ability to run BloodHound freely, user account attributes) but still valuable for reporting. Focus on misconfigurations, permission issues, trust relationships, and sensitive data in file shares.

ActiveDirectory PowerShell Module

Built-in PowerShell module with 147+ cmdlets for AD administration. Stealthier than dropping tools since it’s a native Windows component.

Load the Module

Import-Module ActiveDirectory
Get-Module

Domain Information

Get-ADDomain

Key fields: DomainSID, DomainMode, ChildDomains, Forest, DomainControllersContainer, ReplicaDirectoryServers

Users with SPNs (Kerberoastable)

Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

Trust Relationships

Get-ADTrust -Filter *

Key fields to examine:

FieldMeaning
DirectionBidirectional, Inbound, or Outbound
IntraForestTrue = within same forest; False = external forest trust
ForestTransitiveWhether the trust extends across forests
TrustTypeUplevel (Windows 2000+), Downlevel, etc.

Group Enumeration

Get-ADGroup -Filter * | select name
Get-ADGroup -Identity "Backup Operators"
Get-ADGroupMember -Identity "Backup Operators"

Note groups of interest: Backup Operators, Domain Admins, Enterprise Admins, IT admin groups, any group with service accounts.

Useful AD Module Cmdlets

CmdletPurpose
Get-ADDomainDomain info (SID, mode, child domains, DCs)
Get-ADUserQuery users with filters
Get-ADGroupQuery groups
Get-ADGroupMemberList group members
Get-ADTrustDomain trust relationships
Get-ADComputerQuery computers

PowerView

PowerShell tool for AD situational awareness. More manual than BloodHound but can reveal subtle misconfigurations. Part of PowerSploit (deprecated) — maintained fork by BC-Security for Empire 4.

Key Functions Reference

CategoryFunctionDescription
UtilityExport-PowerViewCSVAppend results to CSV
ConvertTo-SIDConvert name to SID
Get-DomainSPNTicketRequest Kerberos ticket for SPN account
Domain/LDAPGet-DomainCurrent/specified domain object
Get-DomainControllerList domain controllers
Get-DomainUserAll/specific users
Get-DomainComputerAll/specific computers
Get-DomainGroupAll/specific groups
Get-DomainOUAll/specific OUs
Find-InterestingDomainAclACLs with modification rights for non-built-in objects
Get-DomainGroupMemberMembers of a group
Get-DomainFileServerLikely file servers
Get-DomainDFSShareDistributed file systems
GPOGet-DomainGPOAll/specific GPOs
Get-DomainPolicyDefault domain/DC policy
ComputerGet-NetLocalGroupLocal groups on machine
Get-NetLocalGroupMemberMembers of local group
Get-NetShareOpen shares
Get-NetSessionSession info
Test-AdminAccessTest local admin access
MetaFind-DomainUserLocationWhere users are logged in
Find-DomainShareReachable shares
Find-InterestingDomainShareFileInteresting files on readable shares
Find-LocalAdminAccessMachines where current user is local admin
TrustGet-DomainTrustDomain trusts
Get-ForestTrustForest trusts
Get-DomainForeignUserUsers in groups outside their domain
Get-DomainForeignGroupMemberGroups with external members
Get-DomainTrustMappingEnumerate all trusts for current domain

Detailed User Info

Get-DomainUser -Identity mmorgan -Domain inlanefreight.local | Select-Object -Property name,samaccountname,description,memberof,whencreated,pwdlastset,lastlogontimestamp,accountexpires,admincount,userprincipalname,serviceprincipalname,useraccountcontrol

Recursive Group Membership

Get-DomainGroupMember -Identity "Domain Admins" -Recurse

The -Recurse flag reveals nested group membership — if a group like Secadmins is a member of Domain Admins, all members of Secadmins inherit DA rights.

Trust Mapping

Get-DomainTrustMapping

Shows all trusts with source, target, type (WITHIN_FOREST, FOREST_TRANSITIVE), and direction.

Test Local Admin Access

Test-AdminAccess -ComputerName ACADEMY-EA-MS01

Users with SPNs (Kerberoastable)

Get-DomainUser -SPN -Properties samaccountname,ServicePrincipalName

SharpView

.NET port of PowerView for environments where PowerShell is restricted or blocked.

.\SharpView.exe Get-DomainUser -Identity forend
.\SharpView.exe Get-DomainUser -Help

Supports many of the same functions as PowerView with the same argument names.

Snaffler

Tool for hunting credentials and sensitive data across SMB shares in AD. Must be run from a domain-joined host or in a domain-user context.

Execution

.\Snaffler.exe -s -d inlanefreight.local -o snaffler.log -v data
FlagPurpose
-sPrint results to console
-dDomain to search
-oOutput log file
-vVerbosity level (data = results only, recommended)

What Snaffler Finds

  • Credential files (.kdb, .kwallet, .psafe3)
  • Key files (.key, .keypair, .ppk, .keychain)
  • Database dumps (.sqldump, .mdf)
  • Config files (.tblk, VPN configs)
  • Color-coded output: Red = high interest, Green = shares, Black = notable files

Tips

  • Output can be large — always write to a log file
  • Provide raw output to clients as supplemental data to help them prioritize share lockdown
  • Look for passwords, SSH keys, config files with hardcoded credentials

SharpHound / BloodHound (from Windows)

SharpHound is the C# data collector for BloodHound, run from domain-joined Windows hosts.

Run SharpHound

.\SharpHound.exe -c All --zipfilename ILFREIGHT

Key SharpHound Flags

FlagPurpose
-cCollection methods (Default, All, DCOnly, Session, LoggedOn, Group, ACL, etc.)
-dTarget domain
-s / --searchforestSearch all domains in the forest
--stealthStealth collection (prefer DCOnly)
--zipfilenameOutput zip file name
--computerfileFile with specific computer targets

Load Data into BloodHound

sudo neo4j start
bloodhound
  1. Click “Upload Data” button
  2. Select the zip file from SharpHound
  3. Wait for all JSON files to show 100% complete

Useful Built-in Queries

QueryWhat It Reveals
Find Shortest Paths to Domain AdminsAttack paths to DA
Find Computers with Unsupported OSLegacy systems (Win7, Server 2008) — validate if live
Find Computers where Domain Users are Local AdminOver-permissioned hosts — any domain user can access
Find Principals with DCSync RightsUsers that can perform DCSync
Find Kerberoastable AccountsSPNs set on user accounts
Shortest Paths from Owned PrincipalsPaths from compromised nodes

BloodHound Workflow Tips

  • Mark compromised users/computers as “Owned” to find paths from current position
  • Unsupported OS hosts may not be live — validate before reporting
  • Domain Users as local admin on any host = any account can be used for access
  • Always document files transferred to/from hosts and clean up at engagement end

Summary

ToolTypeBest For
AD PowerShell ModuleBuilt-inStealthy enumeration — blends with admin activity
PowerViewPowerShell scriptDeep AD enumeration — users, groups, ACLs, trusts, shares
SharpView.NET executableSame as PowerView when PowerShell is restricted
Snaffler.NET executableHunting credentials and sensitive files in shares
SharpHound.NET executableCollecting AD data for BloodHound visualization
BloodHoundGUIVisualizing attack paths and relationships