Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New change-password module. #512

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

KriyosArcane
Copy link

@KriyosArcane KriyosArcane commented Dec 20, 2024

Description

This new module is for changing the password of current user or a target user that is given as option. This is netexec implementation of impacket script changepasswd. No libraries are required except sys for exit.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I have tested this again a homelab and hackthebox DACL1 Attacks module for ForceChangePassword privilege. Had no issues with any of them.

If you are using poetry, you can easily run tests via:
poetry run python tests/e2e_tests.py -t $TARGET -u $USER -p $PASSWORD
There are additional options like --errors to display ALL errors (some may not be failures), --poetry (output will include the poetry run prepended), --line-num $START-$END $SINGLE for only running a subset

Screenshots (if appropriate):

Leveraging ForceChangePassword.

Checklist:

  • I have ran Ruff against my changes (via poetry: poetry run python -m ruff check . --preview, use --fix to automatically fix what it can)
  • I have added or updated the tests/e2e_commands.txt file if necessary
  • New and existing e2e tests pass locally with my changes
  • My code follows the style guidelines of this project (should be covered by Ruff above)
  • If reliant on third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)

Only thing left is to edit the wiki.

@termanix
Copy link
Contributor

Thanks for the PR and editting! I had such a module in mind too. But I think we can develop it in a more effective and versatile way. I think it would be much better if we add impacket's passwd tool, especially in cases of STATUS_PASSWORD_MUST_CHANGE and STATUS_PASSWORD_EXPIRED in SMB. I can help with this if you want.

@termanix
Copy link
Contributor

termanix commented Dec 20, 2024

Does FaganAfandiyev your other account?

termanix and others added 4 commits December 29, 2024 15:22
Signed-off-by: termanix <50464194+termanix@users.noreply.github.com>
Improvements on STATUS_PASSWORD_MUST_CHANGE and STATUS_PASSWORD_EXPIRED
@termanix
Copy link
Contributor

termanix commented Jan 6, 2025

I'm not sure for smb.py for now but we'll see 😁

@KriyosArcane
Copy link
Author

Module is ready to be reviewed :)

@NeffIsBack
Copy link
Contributor

Thanks for the work! We'll review the PR when someone has the time to do so :)

Signed-off-by: Fagan Afandiyev <kriyosthearcane@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants