Closed zeroSteiner closed 2 years ago
Alright so looks like this is working. For reference since no code uses this currently this is what I used to test it out. This is just a copy of the examples\file_server.rb
code however I added in a thread_factory
variable that mimicks the expected behavior, but also prints out the recieved client_server
's details r.e the connecting clients host and port number they are connecting from.
Here is the code looks:
And here is the resulting output from my tests:
And finally we can see this worked successfully on the Windows 11 target:
This adds support to the RubySMB server to use a custom thread factory. This allows Metasploit to use its preferred
Rex::ThreadFactory
method to allow framework users to identify and kill threads as desired. The thread factory block is passed theServerClient
instance. At this point, it's not set up yet, but it does expose the connection information.Testing is probably most easily done with PR 16481 from Metasploit Framework. The example server should continue to work as intended. See https://github.com/rapid7/metasploit-framework/pull/16481#discussion_r854657538 for context.