-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Review of NTLM reflection attack over network #451
Comments
What I know about this:
|
Well, for the "rotten" part it is possible to split the various components (rpc end point mapper and dedicated listener - the one who listens by default on port 6666 ) but why would you need that? |
"NTLM auth reflect back to SMB (like HTTP => SMB) is patched since 2016" <- I don't think this is actually true. It's been a while since I've looked at this, but I don't think this is how they patched the original Potato exploit. From what I remember from the testing I did after the patch, HTTP=>SMB on the same machine with an AD account still worked. |
As far as I know, only SMB->SMB reflect back is patched. |
I think the issue still persists if you enable WPAD and LLMNR |
Well, thanks for your replies.
|
Great discussion guys. I'm also hesitating all the scenarios that were patched so looking forward to seeing the results.
Here's some data that could be useful to understand that scenario. |
@remi-cc , some time ago I did a test splitting the "lonelypoato" in two parts, the rpc end point client (connecting to port 135 on a different host ) and the custom listener on localhost and as far as rememeber it worked. |
@decoder-it, thanks for your remembers. If i well understand, you are talking about relay attack but not a reflection attack. Can you process another trial with custom listener on another host in the same local network, reflecting NTLM on the victim RPC end point? |
Just did some tests:
So cross-protocol reflection seems definitely patched in Server 2016 / Windows 10 (which share the same codebase). I'm confused about the Server 2012R2 results, with my Exchange server (latest May 2018 patches installed) allowing cross-protocol relaying but my Server 2012R2 DC not allowing it. |
Your results for Server2012R2 are probably explained by the fact that SMB
signing is enabled automatically on domain controllers. SMB signing will
block any sort of relay attack against the SMB service. This may also be
why it is failing on Windows 10/Server2k16. You should test with SMB
signing disabled, this setting is sometimes explicitly disabled even in
newer windows versions.
…On Mon, May 14, 2018 at 12:37 PM Dirk-jan ***@***.***> wrote:
Just did some tests:
- HTTP -> SMB
- Windows 10 1803: *Fail*
- Server 2016 1607: *Fail*
- Server 2012R2 *(Exchange server)*: *Success*
- Server 2012R2 *(Domain controller)*: *Fail*
- HTTP -> LDAP
- Server 2016 1607: *Fail*
- Server 2012R2 *(Domain controller)*: *Fail*
- HTTP -> HTTP
- Server 2012R2 *(Exchange server)*: *Success*
- SMB -> LDAP (though it is in impossible attack type due to signing
incompatibilities)
- Server 2016 1607: *Fail*
- Server 2012R2 *(Domain controller)*: *Fail*
- HTTP -> IMAP
- Server 2012R2 *(Exchange server)*: *Success*
- HTTP -> SMTP
- Server 2012R2 *(Exchange server)*: *Success*
So cross-protocol reflection seems definitely patched in Server 2016 /
Windows 10 (which share the same codebase). I'm confused about the Server
2012R2 results, with my Exchange server (latest May 2018 patches installed)
allowing cross-protocol relaying but my Server 2012R2 DC not allowing it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#451 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGazc721MD9QZaJHnAxXsVQlPEwH0df0ks5tybLFgaJpZM4T9XsF>
.
|
I'll test it with SMB signing disabled but there is a difference between authentication not being accepted and the attack not working. For example my Server 2016 DC (signing enabled) accepts authentication from a different host just fine, but attacks won't work:
|
Just disabled SMB signing on the S2012 DC, rebooted, verified with nmap SMB signing is disabled. Did not change the results, relaying to the same host still does not work. |
Thank @dirkjanm for yours results, very usefull. My opinion :
PS : i found an another usefull link from MS about SMB : https://blogs.msdn.microsoft.com/openspecification/2017/05/26/smb-2-and-smb-3-security-in-windows-10-the-anatomy-of-signing-and-cryptographic-keys/ |
I just tried HTTP->SMB on a new Server 2012 server as well, did not work (both with local and domain accounts). |
Thanks for the info guys, very useful, I referenced it at a recent blogpost I wrote. Closing this one now, feel free to keep including any extra data that could be useful to better understand these scenarios. |
@dirkjanm In HTTP->SMB, whether all clients that send http requests use the WinHTTP library? |
@dirkjanm There is a vulnerability of exchange server that use HTTP->HTTP (EWS) NTLM replay attack. Exchange set the registry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\DisableLoopbackCheck = 1 by default. Microsoft fix this vulnerablity by remove that registry key. So enable loopback check. I don't understand the purpose of that key. Does anyone know it, please? |
@rskvp93 If this value does not exist or is dword 0, Windows will check if the ntlm type3 message cache in memory is the same as the other type3 messages sent to this machine. If the same, Windows will think that someone is trying to make an ntlm reflection attack. |
Disclaimer: @asolino, sorry to hijack this issue, I'm trying to learn more about these kind of attacks and the EWS vulnreability is a nice excuse. If this question doesn't belong here please feel free to delete my comment. What I'm seeing in the Exchange vulnerability is that the HTTP -> HTTP reflection is in fact a local authentication, not a relay of signed challenges by the same machine (classic reflection), which is weird given that this is authentication over the network, not via loopback. When the EWS server receives the relayed NTLM_NEGOTIATE from the attacker, it answers with For example: Type 1:
Type 2:
Type 3:
My questions are:
Thank you |
@lean0x2F For your first question, I don't think this is a normal http-> http reflection behavior. The 0x00004000 flag is set by the server. After receiving this flag, the client usually chooses to send null credentials (at least I know that java will do this), but that doesn't mean the client can successfully authenticate to the server, which I think depends on how the server handles it. As for whether it can be extralated to other protocols, I think it is not possible (in most cases). If I really understand what you mean, let me give you an example: in http->smb reflection, specify the client as the java client, the service is the windows smb service, in the test, the smb service sets the 0x00004000 flag, java sends a null credential, and the smb service returns a login failure. For the second question, my answer comes from Microsoft's description of the patch ms08-068. You can find it Here. In fact, I don't know. I am trying to do some reverse engineering, which takes some time. |
Regarding the Local Auth. I know it is negotiated by the server and the client. If local auth is possible, the client sends his wokstation and domain name in the type 1 message and if the server agrees , he sets the Negotiate Local Call flag. Again if the client agrees , the type 3 message is empty and local auth via security buffers will take place. My question is: is it possible to trick the client/server to force local auth? |
@decoder-it @lean0x2F Interesting ideas, but at the moment I don't think this is possible in most cases. This is not based on some rigorous reasons, just my personal opinion, because I did not find any way to force the server to perform local auth. The Local Auth flag is set by the server, but even if it is set in the test, the server may not recognize the null credentials sent by the client. I will continue to study your thoughts. If there are any new discoveries, please let me know. |
I did some tests because my idea was trying to bypass the "OXID resolver" fix MS implemented in latest version of win 10 & server 2019. In order to get the rotten/juicy potato work (local aurh NTLM reflection), I need to set a remote address for the RPC server and then rdirect it back to my machine listening on a non standard port. I "forged" the NTLM type 1 2 3 packets but the aximum I obtained was a token from ANONYMOUS user (https://decoder.cloud/2018/10/29/no-more-rotten-juicy-potato/) |
As this thread keeps serving (at least to me) as some sort of inspiration for new variants and techniques, wanted to leave this excellent piece from @decoder-it on the saga: https://labs.sentinelone.com/relaying-potatoes-dce-rpc-ntlm-relay-eop/ . Kudos @decoder-it and Antonio! |
Thanks! we just managed to get i work outside session 0 too |
HI all,
I'm a little bit confused of what are the options for a reflection attack (NTLM auth back to the victim which is different from a general relay attack) on an up-to-date W10 host.
Let me explain what i have understand :
Ok, but demo of these attacks is always done on the victim's host (loopback @ip). Well, my questions are:
I know that @asolino and @dirkjanm discussed about it in an 2 years old issue (NTLMRelayX SMB->MSSQL Failure #188 (comment)) but conclusion was quite unclear for me.
Regards,
Rémi
The text was updated successfully, but these errors were encountered: