Giter VIP home page Giter VIP logo

adenum's Introduction

Active directory enumeration - ADEnum.py

ADEnum.py is a pentesting tool that allows to find misconfiguration through the protocol LDAP and exploit some of those weaknesses with Kerberos.


   █████╗ ██████╗     ███████╗███╗   ██╗██╗   ██╗███╗   ███╗
  ██╔══██╗██╔══██╗    ██╔════╝████╗  ██║██║   ██║████╗ ████║
  ███████║██║  ██║    █████╗  ██╔██╗ ██║██║   ██║██╔████╔██║
  ██╔══██║██║  ██║    ██╔══╝  ██║╚██╗██║██║   ██║██║╚██╔╝██║
  ██║  ██║██████╔╝    ███████╗██║ ╚████║╚██████╔╝██║ ╚═╝ ██║
  ╚═╝  ╚═╝╚═════╝     ╚══════╝╚═╝  ╚═══╝ ╚═════╝ ╚═╝     ╚═╝


usage: ADenum.py -d [domain] -u [username] -p [password]

Pentest tool that detect misconfig in AD with LDAP

options:
  -h, --help          show this help message and exit
  -d  [domain]        The name of domain (e.g. "test.local")
  -u  [username]      The user name
  -p  [password]      The user password
  -ip [ipAddress]     The IP address of the server (e.g. "1.1.1.1")
  -j                  Enable hash cracking (john)
  -jp [path]          John binary path
  -w  [wordList]      The path of the wordlist to be used john (Default: /usr/share/seclists/Passwords/Leaked-
                      Databases/rockyou.txt
  -v, --version       Show program's version number and exit
  -s                  Use LDAP with SSL
  -c, --NPUsersCheck  Check with GetNPUsers.py for ASREP Roastable

Requirement

Features and Functionality

LDAP

  • Enum Domain Admin users
  • Enum Domain Controllers
  • Enum Domain users with Password Not Expire
  • Enum Domain users with old password
  • Enum Domain users with interesting description
  • Enum Domain users with not the default encryption
  • Enum Domain users with Protecting Privileged Domain Accounts
  • Enum Domain users with not default object Attributes

Kerberos

  • AS-REP Roastable
  • Kerberoastable
  • Password cracking with john (krb5tgs and krb5asrep)

Demo

asciicast

Microsoft Advanced Threat Analytics

ATA detects two suspicious events but does not trigger an alert:

  • The connection with the protocol LDAP without SSL
  • The Kerberoastable attack

As shown in this screenshot:

image/ATAdetection.png

Source

Documentation:

Impacket:

Legal Disclaimer

This project is made for educational and ethical testing purposes only. Usage of this software for attacking targets without prior mutual consent is illegal.
It is the end user's responsibility to obey all applicable local, state and federal laws.
Developers assume no liability and are not responsible for any misuse or damage caused by this program.

adenum's People

Contributors

secuproject avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

adenum's Issues

LDAPError: Size limit exceeded

[-] Users with Password Not Expire
[-] LDAPError: {'msgtype': 100, 'msgid': 6, 'result': 4, 'desc': 'Size limit exceeded', 'ctrls': []}

Some kind of LDAP pagging may be needed for large results

Problem during installation (kali linux)

Hello, this morning I tried to install your tool on my kalilinux (version 2021.4), but I got some errors with the following depedancie :

  • python-ldap

So I found a solution :

link : https://www.python-ldap.org/en/python-ldap-3.3.0/installing.html#installing-from-source

apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev slapd ldap-utils tox lcov valgrind

afterthat :

pip3 install -r Requirement.txt

On ubuntu, your little tutorial work perfectly, so maybe update your README for kali linux distro.

Best regards,

Error message when script runs "OPERATIONS_ERROR"

Hello, i tried to run the script, but I received this error message:

[-] OPERATIONS_ERROR: {'msgtype': 100, 'msgid': 2, 'result': 1, 'desc': 'Operations error', 'ctrls': [], 'info': '000004DC: LdapErr: DSID-0C090A7D, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v3839'}

Please, could you help me.

Regards

Option for custom filter for description

When auditing active directory on languages other than english some filters are rarely useful, for example the filter on the description is looking for pwd and password but in french 🇫🇷 it will more likely be mdp or mot? de passe .

OBJECT_TO_SEARCH = '(&(objectCategory=user)(|(description=*pwd*)(description=*password*)))'

It results in false negative where juicy description are missed:

[-] Users with an interesting description                                                                                                                                                                            
[!] No entry found !

It would be nice to have an option --description-regexp where one can pass a custom LDAP regexp to filter for, eg. *mdp* that would be added in addition to the default one.

Suggestion: Add NPUsers ?

Hi, here have some suggect for the ADenum.py

$python3 ADenum.py -d htb.local -ip 10.129.95.210

<------ Omitted  ------>
[*] Domain name: htb.local
[*] Username:    Anonymous
[*] IP Address:  10.129.95.210
[*] SSL connect: FALSE

[-] Domain Controllers
[*] Computer: FOREST$                  CN=FOREST,OU=Domain Controllers,DC=htb,DC=local
    [V] Windows Server 2016 Standard 10.0 (14393)
<------ Omitted  ------>
[-] Users with Password Not Expire
[*] Username: Guest                    CN=Guest,CN=Users,DC=htb,DC=local
<------ Omitted  ------>
[*] Username: andy                     CN=Andy Hislip,OU=Helpdesk,OU=Information Technology,OU=Employees,DC=htb,DC=local
[*] Username: mark                     CN=Mark Brandt,OU=Sysadmins,OU=Information Technology,OU=Employees,DC=htb,DC=local
[*] Username: santi                    CN=Santi Rodriguez,OU=Developers,OU=Information Technology,OU=Employees,DC=htb,DC=local

====================================================
==================== Attack AD =====================
====================================================


[-] AS-REP Roastable Users
[!] No entry found !

[-] Kerberoastable Users
[!] No entry found !

In the Attack AD sesstion, Would you like to Add user which is Do not require Kerberos preauthentication in AD? This is a good script, also this information is important for attack AD?

GetNPUsers.py -dc-ip xxx.xxx.xxx.xxx htb.local/
Impacket v0.9.22 - Copyright 2020 SecureAuth Corporation

Name          MemberOf                                                PasswordLastSet             LastLogon                   UAC
------------  ------------------------------------------------------  --------------------------  --------------------------  --------
svc-alfresco  CN=Service Accounts,OU=Security Groups,DC=htb,DC=local  2022-07-11 14:17:30.619145  2019-09-23 12:09:47.931194  0x410200

You can test in the HTB machine: Forest.

Thank you for your ADenum.

About adminCount

Users who have AdminCount=1 are not necessarily domain admins (DA).

ADenum/ADenum.py

Lines 279 to 282 in fbbe14d

def GetDomainAdmin(self)->None:
printTitle("[-] Users who are Domain Admin")
OBJECT_TO_SEARCH = '(&(objectCategory=user)(adminCount=1))'

So this section should probably be renamed Privileged domain accounts.

The following table lists Active Directory’s default protected object sets, including the groups that may induce an update of the AdminCount attribute on its members:

image

I would be nice to do another query to find DA only. You can filter the DA group with (&(objectclass=group)(CN=Domain Admins)) and then get all users (&(objectclass=user)(MemberOf=$($_.DistinguishedName))) from that group.

Ref.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.