Skip to content

Add AD DNS management tool - #1994

Open
lodos2005 wants to merge 1 commit into
fortra:masterfrom
lodos2005:master
Open

lodos2005 wants to merge 1 commit into
fortra:masterfrom
lodos2005:master

Conversation

@lodos2005

Copy link
Copy Markdown

This PR adds LDAP-based DNS record management capabilities for Active Directory integrated DNS zones, enabling DNS manipulation during penetration testing. It provides perform various DNS operations, from creating and deleting records to querying existing zones. This module is inspired by the functionality of dnstool.py from krbrelayx by @dirkjanm

@lodos2005 lodos2005 mentioned this pull request Jul 5, 2025
8 of 12 tasks
@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Jul 17, 2025
lodos2005 pushed a commit to lodos2005/NetExec that referenced this pull request Sep 12, 2026
- Use impacket.dnsp.ADIDNSManager for the full record lifecycle instead
  of a hand-rolled LDAP layer, dropping the ldap3 dependency and all
  locally defined MS-DNSP structures (requires fortra/impacket#1994)
- Reuse the already authenticated connection.ldap_connection so
  hash and Kerberos logins work like every other module
- Replace the built-in help screen with a concise options docstring
  including usage examples, short aliases are parsed via a single map
- Derive the default action before validation so RECORD+DATA adds,
  RECORD queries and no options lists zones as documented
- Add the required CATEGORY attribute

Signed-off-by: Hakan Yavuz <lodos05@gmail.com>
Introduces impacket/dnsp.py with the DNS protocol structures from
[MS-DNSP] and ADIDNSManager, a high level class managing DNS records of
Active Directory integrated DNS zones over LDAP, built on impacket's own
LDAP connection (using the CRUD methods added in fortra#2097). The SOA serial
is queried with a dependency-free raw-socket DNS query.

examples/adidns.py is a thin CLI over ADIDNSManager supporting zone
enumeration and the full record lifecycle (query, add, modify, remove,
ldap-delete, resurrect) with password, NTLM hash and Kerberos auth.

Based on dnstool.py by Dirk-jan Mollema (@_dirkjan).

Signed-off-by: Hakan Yavuz <lodos05@gmail.com>
@lodos2005

Copy link
Copy Markdown
Author

Restructured per the direction in #2097 so all record handling now lives in the importable impacket.dnsp.ADIDNSManager built LDAP CRUD

lodos2005 pushed a commit to lodos2005/NetExec that referenced this pull request Sep 13, 2026
- Use impacket.dnsp.ADIDNSManager for the full record lifecycle instead
  of a hand-rolled LDAP layer, dropping the ldap3 dependency and all
  locally defined MS-DNSP structures (requires fortra/impacket#1994)
- Reuse the already authenticated connection.ldap_connection so
  hash and Kerberos logins work like every other module
- Replace the built-in help screen with a concise options docstring
  including usage examples, short aliases are parsed via a single map
- Derive the default action before validation so RECORD+DATA adds,
  RECORD queries and no options lists zones as documented
- Add the required CATEGORY attribute

Signed-off-by: Hakan Yavuz <lodos05@gmail.com>
godylockz pushed a commit to godylockz/impacket that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants