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

Pipe Auditor - add support to SMBv2 #12995

Merged
merged 2 commits into from
Feb 26, 2020

Conversation

cdelafuente-r7
Copy link
Contributor

pipe_auditor auxiliary module only support SMB1 and fails with modern Windows, which only support SMBv2.

This PR add support to SMBv2.

Verification

Use a Windows 10 as a target with default configuration (SMBv1 disabled).

  • Start msfconsole
  • use auxiliary/scanner/smb/pipe_auditor
  • set RHOSTS <host>
  • set SMBUser <username>
  • set SMBPass <password>
  • run
  • Verify the accessible named pipes are listed

@dwelch-r7
Copy link
Contributor

dwelch-r7 commented Feb 26, 2020

Gave this a test against windows 10
got this:

[+] 172.16.128.162:445    - Pipes: \netlogon, \lsarpc, \samr, \atsvc, \epmapper, \eventlog, \InitShutdown, \lsass, \LSM_API_service, \ntsvcs, \protected_storage, \scerpc, \srvsvc, \trkwks, \wkssvc
[*] 172.16.128.162:       - Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

I presume that's what you'd expect? Can't say I'm overly familiar with the module...

@cdelafuente-r7
Copy link
Contributor Author

Yes, exactly, it is the expected result. The accessible named pipes are listed and no errors showed up.
Thanks for testing!

@dwelch-r7 dwelch-r7 self-assigned this Feb 26, 2020
@dwelch-r7
Copy link
Contributor

Fantastic, I'll fire ahead and land it

@dwelch-r7 dwelch-r7 merged commit 40d068c into rapid7:master Feb 26, 2020
@dwelch-r7
Copy link
Contributor

dwelch-r7 commented Feb 26, 2020

Release Notes

Adds support for SMBv2 to the pipe auditor auxiliary module.

@cdelafuente-r7
Copy link
Contributor Author

Thanks @dwelch-r7 !

@wvu
Copy link
Contributor

wvu commented Feb 26, 2020

Cool, the mixin still works. 😎

@cdelafuente-r7
Copy link
Contributor Author

I've found these references to check_named_pipes:

  • lib/msf/core/exploit/smb/client/psexec_ms17_010.rb, used by:
    • modules/exploits/windows/smb/ms17_010_psexec.rb
    • modules/auxiliary/admin/smb/ms17_010_command.rb
  • modules/auxiliary/scanner/smb/smb_ms17_010.rb

These should work better with SMBv2 now, since the RubySMB exception is correctly handled now. I think, before this fix, an exception was raised on the first non-accessible named pipe with SMBv2, which breaks everything. It could be interesting to run some tests with these modules to compare.

@tperry-r7 tperry-r7 added the rn-enhancement release notes enhancement label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants