PTH Fix for Group Enumeration with SMB #563
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a new function in connection.py.
Closes #562
Description
When using NetExec with the SMB protocol for enumeration, either a plaintext
password or a hash can be passed to authenticate to the target.
Attempting to enumerate groups with the --groups option and passing an NT hash
returns with errors. While passing a plaintext password will enumerate groups with
nxc smb <TARGET> -u "Administrator" -p <PASS> --groups
, attempting topass an NT hash does not:
nxc smb <TARGET> -u "Administrator" -H "<NTHASH>" --groups
The issue is in Pywerview's requester.py, however, a fix can be made
in
connection.py
. A function calledpad_lm()
was created to add theLM hash
aad3b435b51404eeaad3b435b51404ee
if only an NT hash is given.The issue can be read here:
#562
Type of change
How Has This Been Tested?
This was tested with NetExec 1.3.0 (NeedForSpeed - Kali Linux)
and PywerView 0.3.3 against a Windows Server 2022 box.
Various commands were used with the password and hash options, and all were
also used with the
--debug
option appended:Checklist: