PowEnum

October 7, 2017 · View on GitHub

Penetration testers commonly enumerate AD data – providing domain situational awareness and helping to identify soft targets. PowEnum helps automate the cartological view of your target domain.

PowEnum executes common PowerSploit Powerview functions and combines the output into a spreadsheet for easy analysis. All network traffic is only sent to the DC(s). PowEnum also leverages PowerSploit Get-GPPPassword and Harmj0y's ASREPRoast.

Syntax Examples:

  • Invoke-PowEnum
  • Invoke-PowEnum -FQDN test.domain.com
  • Invoke-PowEnum -Mode SYSVOL
  • Invoke-PowEnum -Credential test.domain.com\username -FQDN test.domain.com -Mode Special

Running PowEnum From Non-Domain Joined System

There are two choices. The first uses the runas command (this must be executed prior to using PowEnum). The second leverages the Invoke-UserImpersonation function in Powerview.

  1. runas /netonly /user:test.domain.com\username powershell.exe
  2. Invoke-PowEnum -Credential test.domain.com\username -FQDN test.domain.com

Modes

ModeEnumerates
BasicDomain Admins
Enterprise Admins
Built-In Admins
DC Local Admins
Domain Users
Domain Groups
Schema Admin
Account Operators
Backup Operators
Print Operators
Server Operators
Group Policy Creators Owners
Cryptographic Operators
AD Group Managers
AdminCount=1

All [DC Aware] Net Sessions
Domain Controllers
Domain Computer IPs
Domain Computers
Subnets
DNSRecords
WinRM Enabled Hosts
Potential Fileservers
RoastingKerberoast Service Accounts (Accounts w/ SPN)
ASREPRoast User Accounts (No Preauth Req)
SpecialDisabled Accounts
Password Not Required
Password Doesn't Expire
Password Doesn't Expire & Not Required
Smartcard Required
SYSVOLGroup Policy Passwords
SYSVOL Script Files (potential hardcoded credentials)
All Local Group Membership Modifications (GPO or GPP)
ForestDomain Trusts
Foreign [Domain] Users
Foreign [Domain] Group Members
LargeEnvBasic Enumeration without:
Get-DomainUser
Get-DomainGroup
Get-DomainComputer

*DC Local Admins might be different from built-in Administrators when an RODC is in use or there are replication issues.

Detection

Mitigations

ModeMitigations
BasicNet Cease - Hardening Net Session Enumeration
https://gallery.technet.microsoft.com/Net-Cease-Blocking-Net-1e8dcb5
SAMRi10 - Hardening SAM Remote Access in Windows 10/Server 2016
https://gallery.technet.microsoft.com/SAMRi10-Hardening-Remote-48d94b5b
Active Directory: Controlling Object Visibility
https://social.technet.microsoft.com/wiki/contents/articles/29558.active-directory-controlling-object-visibility-list-object-mode.aspx
http://windowsitpro.com/active-directory/hiding-active-directory-objects-and-attributes
RoastingKerberoasst mitigations revolve around using strong passwords or GMSA for affected accounts
https://adsecurity.org/?p=2293
ASREPRoast mitigations revolve around using strong passwords or not checking "‘Do Not Require Kerberos Preauthentication"
SpecialSee Basic
SYSVOLGPP Password Files - Install KB2962486 and remove affected xml files (https://adsecurity.org/?p=2288)
SYSVOL Scripts - Monitor for changes to SYSVOL and remove affected files
ForestSee Basic
LargeEnvSee Basic