Skip to content

Commit b114058

Browse files
Land rapid7#18928, Don't close smb client when it comes from the session
2 parents c411802 + 936b311 commit b114058

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/auxiliary/gather/windows_secrets_dump.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,11 @@ def run
11841184
end
11851185
@winreg.close if @winreg
11861186
@tree.disconnect! if @tree
1187-
simple.client.disconnect! if simple&.client.is_a?(RubySMB::Client)
1188-
disconnect
1187+
# Don't disconnect the client if it's coming from the session so it can be reused
1188+
unless session
1189+
simple.client.disconnect! if simple&.client.is_a?(RubySMB::Client)
1190+
disconnect
1191+
end
11891192
end
11901193

11911194
private

0 commit comments

Comments
 (0)