Important Tools

Enumerating Security Controls

Defender

powershell
Get-MpComputerStatus
RealTimeProtectionEnabled: True and AntivirusEnabled: True indicate active protection.

AppLocker

Implements whitelisting to control which applications can run. It blocks cmd.exe, PowerShell.exe, and critical directories; alternative paths are not always blocked (%SysWOW64%).
powershell
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections

PowerShell Constrained Language Mode

powershell
$ExecutionContext.SessionState.LanguageMode

LAPS

  • Find-LAPSDelegatedGroups: groups that can read LAPS passwords.
  • Find-AdmPwdExtendedRights: users/groups with extended rights.
  • Get-LAPSComputers: computers with LAPS and cleartext passwords (if access is available).

Credential Enumeration (Linux)

NetExec / CrackMapExec

terminal
$ sudo crackmapexec smb 172.16.5.5 -u forend -p Klmcargo2 --users$ sudo crackmapexec smb 172.16.5.5 -u forend -p Klmcargo2 --groups$ sudo crackmapexec smb 172.16.5.130 -u forend -p Klmcargo2 --loggedon-users$ sudo crackmapexec smb 172.16.5.5 -u forend -p Klmcargo2 --shares

SMBMap

terminal
$ smbmap -u forend -p Klmcargo2 -d INLANEFREIGHT.LOCAL -H 172.16.5.5$ smbmap -u forend -p Klmcargo2 -d INLANEFREIGHT.LOCAL -H 172.16.5.5 -r 'Department Shares' --dir-only

Rpcclient

terminal
rpcclient -U "" -N 172.16.5.5rpcclient $> enumdomusersrpcclient $> queryuser 0x457

PsExec / Wmiexec

terminal
$ psexec.py inlanefreight.local/wley:'transporter@4'@172.16.5.125wmiexec.py inlanefreight.local/wley:'transporter@4'@172.16.5.5

Windapsearch

terminal
windapsearch.py --dc-ip 172.16.5.5 -u forend@inlanefreight.local -p Klmcargo2 --da

BloodHound

terminal
sudo bloodhound-python -u 'forend' -p 'Klmcargo2' -ns 172.16.5.5 -d inlanefreight.local -c all
Generates data (users, etc.) that we import into BloodHound to visualize AD graphically.

Credential Enumeration (Windows)

PowerShell (ActiveDirectory)

powershell
Import-Module ActiveDirectory
Get-ADDomain
Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName
Get-ADGroup -Filter * | select name
Get-ADGroup -Identity "Backup Operators"

PowerView

  • Command: Description
  • Export-PowerViewCSV: Add results to a CSV.
  • ConvertTo-SID: Converts a username or group name to its SID.
  • Get-DomainSPNTicket: Requests the Kerberos ticket for an SPN account.
  • Get-Domain: AD object for the current domain.
  • Get-DomainController: List of Domain Controllers.
  • Get-DomainUser: All users or specific user objects.
  • Get-DomainComputer: All computers or specific computer objects.
  • Get-DomainGroup: All groups or specific group objects.
  • Find-InterestingDomainAcl: ACLs of objects with modification rights over non-built-in objects.
  • Get-DomainGPO: All GPOs or specific GPO objects.
  • Get-NetSession: Session information for the local/remote machine.
  • Test-AdminAccess: Checks whether the current user has admin access to the machine.
  • Find-DomainUserLocation: Machines where specific users have logged in.
  • Find-LocalAdminAccess: Machines where the current user has local admin.
  • Get-DomainTrust: Trusts for the current or specified domain.
  • Get-DomainTrustMapping: Enumerates and maps all trusts for the current domain.

Snaffler

terminal
Snaffler.exe -s -d inlanefreight.local -o snaffler.log -v data
Searches AD for configuration files, shares, and interesting things.

SharpHound

terminal
.\SharpHound.exe -c All --zipfilename ILFREIGHT
It is the same tool as BloodHound but for Windows.