Active Directory (Part 10.2)
Enumeration
Some of the methods that can be used to enumerate AD are as follows:
- Command Prompt: Many situations requires quick information gathering of an AD environment via Command Prompt. It may be because RDP access to a system is not available, if PowerShell use is being monitored by defenders, or if the penetration tester is using a Remote Access Trojan (RAT) for the access. The Command Prompt (CMD) tool contains an in-built command called net. This command is used to gather information about the local system and AD. It can also be useful for quick enumeration of AD information or even be included in phishing payloads to hep gather information to stage a final attack. Hence, it allows the gathering of a variety of information on an AD environment.
Information gathered via net command can be used in planning additional password spraying attacks against other enumerated user accounts. The only problem a tester might face is that the net commands must be executed from a domain-joined machine. If it is is not joined, then it will default to the WORKGROUP domain. Also, sometimes the net commands may not show all the information.
- PowerShell: It is an upgrade of Command Prompt, first released in 2006. It offers access to cmdlets (pronounced command-lets), which are ,NET classes to perform specific functions, along with the standard functionalities. There are 50+ build-in cmdlets listed in AD-RSAT. These PowerShell cmdlets can enumerate more information than the net commands. They allow the user to specify the server and domain to execute these commands using runas from a non-domain-joined machine. Own cmdlets can also be created for enumeration. Additionally, penetration testers can also use the AD-RSAT cmdlets to directly change AD objects, like reset password or add a user to a specific group.
Its main disadvantage is that PowerShell is more often monitored by blue teams than command prompt. This complicates things for the attackers, making the evasion harder. Also, the required installation of AD-RSAT tool may lead to detection.
- Bloodhound- It is an excellent tool widely used by the penetration testers to gather and analyze information of an AD environments. It allows the quick gathering and visualization of data about the relationship between different AD objects and users, helping in easy identification of potential vulnerabilities and attack paths within the environment. It uses graph theory, making it much easier to identify the privilege escalation paths and other weaknesses. It also includes a wide variety of built-in queries and reports, along with the ability to create custom queries reports to gather more targeted data.
However, users often confuse Sharphound with Bloodhound. Sharphound is a tool that is used in conjunction with Bloodhound. It is specially designed to be run a system within the AD environment and collect data about it. That data can be imported into Bloodhound for analysis and visualization.
AD enumeration is a massive task. Its accurate enumeration is very much necessary for better understanding of the domain's structure and identify potential exploitation paths to gain increased system privileges or access of other resources. So, some other enumerating techniques include:
- LDAP Enumeration- Any valid AD credential pair should be able to bind to a Domain Controller's LDAP interface. It allows the penetration tester to write LDAP search queries to enumerate information regarding the AD objects in the domain.
- PowerView- It is a recon script part of the PowerSploit project. The PowerView scripts can prove incredibly useful in performing semi-manual enumeration of AD objects.
- Windows Management Instrumentation (WMI)- It can be used to enumerate information from Windows hosts and has a provider that can be used to interact with AD.
Comments
Post a Comment