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

Win10 doesn't support SMB1 functionality in lib/rex/proto/smb/simpleclient.rb #9890

Closed
1 of 4 tasks
asoto-r7 opened this issue Apr 18, 2018 · 3 comments
Closed
1 of 4 tasks
Labels
attic Older submissions that we still want to work on again bug not-stale Label to stop an issue from being auto closed rubysmb

Comments

@asoto-r7
Copy link
Contributor

Windows 10 appears to completely ignore our attempts to connect with our existing Rex::Proto::SMB login() method. In fact, it will immediately respond with a TCP RST if we try to use something like the windows/x64/meterpreter_bind_named_pipe payload.

This problem is likely present in other new versions of Windows, but I have not tested it.

Steps to reproduce

  1. Build a meterpreter_bind_named_pipe payload:
./msfvenom -p windows/x64/meterpreter_bind_named_pipe -f exe -o bind_named_pipe_x64.exe
  1. Deploy the above payload on a Windows 10 x64 target (fully patched, in my case).

  2. Configure a handler for meterpreter_bind_named_pipe:

use exploit/multi/handler
set PAYLOAD windows/x64/meterpreter_bind_named_pipe
set RHOST 127.0.0.1
run
  1. (Optional, set up a packet capture to see the immediate SMB failure.)

Expected behavior

The payload should connect successfully, or at least progress past SMB Session Negotiation.

Current behavior

The SMB session is aborted by the target when it realizes that SMB2 isn't possible. Surprisingly, there is no response packet indicating an error. The TCP connection is just forcibly reset.

See below for a side-by-side comparison of current vs expected behavior. Left is Metasploit's simpleclient::login(). Right is known-good OS X SMB implementation:

screen shot 2018-04-18 at 2 28 34 pm

We get a traceback in the case of either error, but because of over-zealous exception handling, we get back a 'login failed' error, but not enough information to know why:

[-] SMB login Failure .\USERNAME:PASSWORD 192.168.108.217:445

Modifying metasploit-framework/lib/msf/core/handler/bind_named_pipe.rb:317 to not catch every exception gives us a more helpful traceback:

#<Thread:0x00007fb3062c28b8@/Users/asoto/git/r7/metasploit-framework/lib/msf/core/thread_manager.rb:93 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
	3: from /Users/asoto/git/r7/metasploit-framework/lib/msf/core/thread_manager.rb:100:in `block in spawn'
	2: from /Users/asoto/git/r7/metasploit-framework/lib/msf/core/handler/bind_named_pipe.rb:313:in `block in start_handler'
	1: from /Users/asoto/git/r7/metasploit-framework/lib/rex/proto/smb/simpleclient.rb:45:in `login'
/Users/asoto/git/r7/metasploit-framework/lib/rex/proto/smb/simpleclient.rb:85:in `rescue in login': Login Failed: Connection reset by peer (Rex::Proto::SMB::Exceptions::LoginError)

System stuff

Metasploit version

msf5 exploit(multi/handler) > version
Framework: 5.0.0-dev-b83bcf2d3d
Console  : 5.0.0-dev-b83bcf2d3d
msf5 exploit(multi/handler) > ruby -v
[*] exec: ruby -v

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

I installed Metasploit with:

OS

Mac OS X 10.13.4 (fully patched) against a Windows 10 x64 target.

@UserExistsError
Copy link
Contributor

The TCP reset is expected behavior when SMB1 is not supported and no SMB2 dialects are requested. See #9365.

@github-actions
Copy link

github-actions bot commented Dec 2, 2020

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Dec 2, 2020
@dwelch-r7 dwelch-r7 added not-stale Label to stop an issue from being auto closed and removed Stale Marks an issue as stale, to be closed if no action is taken labels Dec 2, 2020
@adfoster-r7 adfoster-r7 added the attic Older submissions that we still want to work on again label Apr 26, 2023
@github-actions
Copy link

Thanks for your contribution to Metasploit Framework! We've looked at this issue, and unfortunately we do not currently have the bandwidth to prioritize this issue.

We've labeled this as attic and closed it for now. If you believe this issue has been closed in error, or that it should be prioritized, please comment with additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attic Older submissions that we still want to work on again bug not-stale Label to stop an issue from being auto closed rubysmb
Projects
Archived in project
Development

No branches or pull requests

4 participants