Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Python3 script to perform LDAP queries and enumerate users, groups, and computers from Windows Domains. Ldap_Search can also perform brute force/password spraying to identify valid accounts via LDAP.

License

m8sec/ldap_search

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

LDAP_Search

     

UPDATE: Ldap_search has been integrated into ActiveReign. Please check HERE for the latest on the project!

Overview

LDAP_Search can be used to enumerate Users, Groups, Computers, Domain Policies, and Domain Trusts within a Windows environment. Authentication can be performed using traditional username and password, or NTLM hash. In addition, this tool has been modified to allow brute force/password-spraying via LDAP.

Ldap_Search is compatible with Python 2.7 / 3.6+ and makes use of the Impacket library to perform the main operations.

Installation

git clone --recursive https://github.com/m8r0wn/ldap_search
cd ldap_search
sudo python3 setup.py install

Usage

Password spray with LDAP:

ldap_search -U users.txt -P 'Summer2019!' -d demo.local

Enumerate all active users on a domain:

ldap_search users -u user1 -p Password1 -d demo.local

Lookup a single user and display attributes:

ldap_search users -q AdminUser -u user1 -p Password1 -d demo.local

Enumerate all computers on a domain and resolve IP addresses:

ldap_search computers -r -u user1 -p Password1 -d demo.local

Search for end of life systems on the domain:

ldap_search computers -q eol -u user1 -p Password1 -d demo.local -s DC01.demo.local

Query group members:

ldap_search groups -q "Domain Admins" -u user1 -p Password1 -d demo.local

Domain password policy:

ldap_search domain -u user1 -p Password1 -d demo.local

Write a custom query:

ldap_search custom -q '(objectClass=*)' -a 'objectName' -u user1 -p Password1 -d demo.local

Query Types

User
  active / [None] - All active users (Default)
  all - All users, even disabled
  [specific account or email] - lookup user, ex. "m8r0wn"
  
group
  [None] - All domain groups
  [Specific group name] - lookup group members, ex. "Domain Admins"
 
computer
  [None] - All Domain Computers
  eol - look for all end of life systems on domain

Domain
    [None] - Domain's password policy

Trust
    [none] - Domain Trust information

Options

  -q QUERY          Specify user or group to query
  -a ATTRS          Specify attrs to query
  -u USER           Single username
  -U USER           Users.txt file
  -p PASSWD         Single password
  -P PASSWD         Password.txt file
  -H HASH           Use Hash for Authentication
  -d DOMAIN         Domain (Ex. demo.local)
  -s SRV, -srv SRV  LDAP Server (optional)
  -r                Use DNS to resolve records
  -t TIMEOUT        Connection Timeout (Default: 4)
  -v                Show attribute fields and values
  -vv               Show connection attempts and errors

About

Python3 script to perform LDAP queries and enumerate users, groups, and computers from Windows Domains. Ldap_Search can also perform brute force/password spraying to identify valid accounts via LDAP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published