-
Notifications
You must be signed in to change notification settings - Fork 80
Fixes and improvements from MSF code review #156
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Set the unicode flag on the Negotiate SMB Header request - Check if the Socket is closed before calling IO.select - Improve Socket#recv_packet exception handling
- Change :encryption_required parameter name to a more meaningful name according to the context: :session_encrypt_data and :tree_connect_encrypt_data. - #can_be_encrypted? now returns false with SMB1 packet. - Improve exception handling in #recv_encrypt in case an encryption error occurs on the server (this will help in detecting the unpatched Win8 bug). - Only enable session encryption if the server supports it. This only applies if session_encrypt_data was originally set (forced). If it is not set, session encryption will stay disabled even if the server supports encryption.
8261c5b
to
fec10fc
Compare
- Remove the `OEM` flag when initializing the `Net::NTLM::Client`. Unicode is the default now and `Net::NTLM::Client` does not handle OEM string correctly. - Improve error message when an SMB1 `NtCreateAndxResponse` is received without extended information
smcintyre-r7
approved these changes
Jun 18, 2020
I've finished testing this and I'm going to land it in a moment. I was able to reproduce the original issue and verify the patch for both bugs. Nice work @cdelafuente-r7 ! Windows 8.1Before
After
OS X 10.14Note that in addition to enabling file sharing via
Before
After
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is related to the comments left in rapid7/metasploit-framework#13417:
Socket#recv_packet
exception handling:encryption_required
parameter name to a more meaningful name accordingto the context:
:session_encrypt_data
and:tree_connect_encrypt_data
.#can_be_encrypted?
now returns false with SMB1 packet.recv_encrypt
in case an encryptionerror occurs on the server (this will help in detecting the unpatched Win8 bug).
if
session_encrypt_data
was originally set (forced). If it is not set, sessionencryption will stay disabled even if the server supports encryption.
Verification Steps
Follow the instructions in rapid7/metasploit-framework#13417 to setup the targets.
On Mac OS X, you can enable file sharing in
System Preferences
>Sharing
>File Sharing
.Mac OS X testing with MSF
These changes are needed: rapid7/metasploit-framework#13417
I set up a local share and a new test account for smb file sharing.
Windows 8 testing with MSF
These changes are needed: rapid7/metasploit-framework#13417
I set up a local share and a new test account for smb file sharing on a remote unpatched Windows 8 (fresh installation).
Make sure the error message is this one: