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

Recognise broken SMB sessions and close them #19731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smashery
Copy link
Contributor

If an SMB session is forcibly closed or inoperative, the session remained in the list of open sessions (until forcibly closed). This recognises certain errors and shuts the SMB sessions down.

Verification

  • Start msfconsole
  • Create several sessions with the smb_login module onto the one host
  • Shut down the server (this won't cause the sessions to terminate yet)
  • Run a module with an SMB session (any of the ones that use SMB optional sessions)
  • Verify that it is terminated, and removed from the list of active sessions

Demo

msf6 auxiliary(scanner/smb/pipe_auditor) > run session=3
[*] Using existing session 3
[*] 192.168.20.99 - SMB session 3 closed.
[*] Error: 192.168.20.99: RubySMB::Error::CommunicationError An error occurred writing to the Socket: Connection reset by peer
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

@msutovsky-r7 msutovsky-r7 self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants