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

CVE-2019-1019: Bypass SMB singing for unpatched machines #635

Merged
merged 1 commit into from
Jun 13, 2019

Conversation

msimakov
Copy link
Contributor

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1019

Bypassing SMB singing by removing the target in NTLMSSP_CHALLENGE messages

@asolino
Copy link
Collaborator

asolino commented Jun 13, 2019

Hey @msimakov

Thanks for the PR.. Was very much looking forward for you to add your discoveries ;). Clever addition to the previous one (CVE-2015-0005), congrats.

I'll be testing it today. Windows SMB Clients still not working? (throwing INVALID_PARAMETER on your side?)

@msimakov
Copy link
Contributor Author

Hi @asolino

Thanks, glad to contribute ;) Let me know if you run into any issues.
Windows SMB Clients still not working, they respond with a TCP RST and re-negotiate the SMB connection.

@asolino
Copy link
Collaborator

asolino commented Jun 13, 2019

Having some problems making it work @msimakov
Running it this way:

ntlmrelayx.py -machine-account FREEFLY.NET/machine\$ -machine-hashes LM:NT -domain FREEFLY.NET -t target -debug -remove-target -smb2support

I'm adding some comments in your code

res = NTLMAuthChallengeResponse()
res.fromString(authenticateMessageBlob)

new_auth_blob = hexlify(authenticateMessageBlob)[0:144] + b'00000000000000000000000000000000' + hexlify(authenticateMessageBlob)[176:]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This just doesn't sound right. Are you trying to clear the previous MIC in order to calculate the HMAC_MD5 or something else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm clearing the previous MIC in order to calculate the new one (take a look at the next line - the relay_MIC)

Copy link

Choose a reason for hiding this comment

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

hi @msimakov , i am trying to use the script by myself and i am getting some errors. Basically i can see that i am able to retrieve the session key, but for some reason i cannot connect, i am using the following command just like @asolino said to use it in order to perform some tests.
by looking at wireshark on the relay endpoint i can see that, everything goes just like the article you published, but at the last message ( the one wit the new mic) i am getting Error:STATUS_INVALID_PARAMETER and the final login is failing.
Any ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @zur250. Make sure to run the updated version, the file has been updated after this commit

Copy link

Choose a reason for hiding this comment

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

Thanks @msimakov for the quick answer. i am runnig Impacket v0.9.21-dev, is it the version you are talking about?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @zur250. I think you have a mix of impacket versions installed. What is the banner you get when you run ntlmrelayx.py? (at the very beginning of its execution)

Copy link

Choose a reason for hiding this comment

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

@asolino hi, the banner is the following :
Impacket v0.9.21-dev - Copyright 2019 SecureAuth Corporation

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok.. so it has nothing to do with this commit commit we're writing in. It has to be a separate issue.

@asolino asolino merged commit 5257b9d into fortra:master Jun 13, 2019
@asolino
Copy link
Collaborator

asolino commented Jun 13, 2019

Merged! Thanks a lot @msimakov !

For those testing this, it can be run this way:

./ntlmrelayx.py -machine-account domain/machineAccountName -machine-hashes LM:NT -domain DOMAIN -t targetIP -remove-target -smb2support

Don't forget it will work only for victims connecting thru HTTP (SMB to SMB not yet supported)

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.

None yet

3 participants