Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LDAPDomainDump (C#)

This is a C# port/packaging of ldapdomaindump adapted to build as a .NET Framework 4.5 executable.

This repository was adapted from the original project by dirkjan: https://github.com/dirkjanm/ldapdomaindump Thanks to the original author and contributors.

Requirements

  • .NET Framework 4.5 Developer Pack (to compile)
  • Visual Studio (or MSBuild) for building
  • PowerShell 5+ (for Compress-Archive used by the tool to create ZIP archives)

Notes about ILMerge

The project includes support for ILMerge via ILMerge.MSBuild.Task. The task requires a native ILMerge.exe to be available. Configure the path in LDAPDomainDump.csproj using the AlternativeILMergePath MSBuild property, for example:

<AlternativeILMergePath>$(MSBuildProjectDirectory)\\tools\\ilmerge\\ILMerge.exe</AlternativeILMergePath>

If you don't need ILMerge, you may remove the ILMerge.MSBuild.Task PackageReference from the project file.

Build

From a Developer Command Prompt (Visual Studio) in the project directory:

  • Build (Release):
msbuild /p:Configuration=Release LDAPDomainDump.csproj

Or open the project in Visual Studio and build the solution.

Running

After building, run the produced LDAPDomainDump.exe from the command line. It uses the current Windows user's credentials to bind to LDAP.

Usage:

LDAPDomainDump.exe [options]

Options:
  --outdir <path>, -o <path>    Directory where generated reports will be written (default: current directory)
  --archive <name>, -a <name>   Archive filename for generated reports (default: ldapdomaindump_reports.zip)
  --no-compress, -n             Don't compress the generated reports
  --dc <ip|host>, -dc <ip|host> Use this domain controller (IP or hostname) instead of doing DNS discovery

Examples:

  • Dump domain and write reports to C:\reports:
LDAPDomainDump.exe -o C:\reports
  • Dump and create myreports.zip, remove original files after compression:
LDAPDomainDump.exe -o C:\reports -a myreports.zip
  • Use a specific domain controller:
LDAPDomainDump.exe --dc 192.168.1.10

Output

The tool generates these files (in the output directory):

  • domain_users.html, domain_users.json, domain_users.grep
  • domain_groups.html, domain_groups.json, domain_groups.grep
  • domain_computers.html, domain_computers.json, domain_computers.grep
  • domain_policy.html, domain_policy.json, domain_policy.grep
  • domain_trusts.html, domain_trusts.json, domain_trusts.grep
  • domain_users_by_group.html
  • domain_computers_by_os.html

If compression is enabled the generated files will be archived into the ZIP file you specified and the original files deleted.

License & Attribution

This repository is provided under the MIT License (see LICENSE if included). The original ldapdomaindump project by Dirk-jan is available at: https://github.com/dirkjanm/ldapdomaindump

Acknowledgements

Thanks to Dirk-jan and contributors for the original ldapdomaindump project which inspired and provided the base functionality.

If you want the README adjusted (add more build details, CI, or packaging instructions), tell me what to include.

About

C# ldapdomaindump

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages