Skip to content

Feature/ldap password never expires - #1529

Merged
NeffIsBack merged 3 commits into
Pennyw0rth:mainfrom
CSpanias:feature/ldap-password-never-expires
Nov 17, 2026
Merged

NeffIsBack merged 3 commits into
Pennyw0rth:mainfrom
CSpanias:feature/ldap-password-never-expires

Conversation

@CSpanias

Copy link
Copy Markdown
Contributor

Description

New LDAP option --password-never-expires. As the name suggests, it searches for accounts with the DONT_EXPIRE_PASSWORD UserAccountControl flag.

AI Assistance

Copilot SDK in VS Code and that it assisted with the implementation and e2e command. The model name is Copilot Fusion.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Deprecation of feature or functionality
  • This change requires a documentation update (I have created the corresponding docs in the Wiki; see below)
  • This requires a third party update (such as Impacket, Dploot, lsassy, etc)
  • This PR was created with the assistance of AI (list what type of assistance, tool(s)/model(s) in the description)

Setup guide for the review

  • A reachable AD domain controller and an account with LDAP read access.
  • At least one account with Password never expires (DONT_EXPIRE_PASSWORD) enabled.

No GPO change is needed; you can enable it in the account’s Account properties in AD Users and Computers, as shown below:

image

The command to run, for example:

netexec ldap <DC_HOST> -u <DOMAIN_USER> -p '<PASSWORD>' --password-never-expires

Expected result: the flagged account(s) are listed with their enabled/disabled status.

Screenshots

Tested against my lab DC filled with BadBlood data:

image

Checklist:

  • I have ran Ruff against my changes (poetry: poetry run ruff check ., use --fix to automatically fix what it can)
  • I have added or updated the tests/e2e_commands.txt file if necessary (new modules or features are required to be added to the e2e tests)
  • If reliant on changes of third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects (no dependencies)
  • [] I have linked relevant sources that describes the added technique (blog posts, documentation, etc)
  • I have performed a self-review of my own code (not an AI review)
  • I have commented my code, particularly in hard-to-understand areas (mimics the existing password_not_required function which is pretty straightforward)
  • I have made corresponding changes to the documentation (PR here: Added documentation for the LDAP --password-never-expires option. NetExec-Wiki#132)

P.S. Sorry for the line ending changes before!

@NeffIsBack NeffIsBack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Please just filter out disabled accounts via the search filter and also display the pw last change timestamp (see --users for example)

@NeffIsBack NeffIsBack added the enhancement New feature or request label Nov 16, 2026
@CSpanias

Copy link
Copy Markdown
Contributor Author

Hi @NeffIsBack,

Thanks for reviewing the PR; changes implemented as requested:

image

Let me know if anything else is needed!

@NeffIsBack NeffIsBack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM:

image

@NeffIsBack
NeffIsBack merged commit ca2ccda into Pennyw0rth:main Nov 17, 2026
5 checks passed
@CSpanias
CSpanias deleted the feature/ldap-password-never-expires branch November 17, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants