Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
certcc-ghbot committed Dec 23, 2024
2 parents 6cd0751 + 66f6cac commit b9eef6c
Show file tree
Hide file tree
Showing 17 changed files with 240 additions and 218 deletions.
28 changes: 14 additions & 14 deletions db/modules_metadata_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-10-22 14:41:02 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/dcerpc/icpr_cert.rb",
"is_install_path": true,
"ref_name": "admin/dcerpc/icpr_cert",
Expand Down Expand Up @@ -904,7 +904,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-12-09 08:49:04 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/dcerpc/samr_account.rb",
"is_install_path": true,
"ref_name": "admin/dcerpc/samr_account",
Expand Down Expand Up @@ -9680,7 +9680,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-05-13 12:01:54 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/registry_security_descriptor.rb",
"is_install_path": true,
"ref_name": "admin/registry_security_descriptor",
Expand Down Expand Up @@ -10579,7 +10579,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-12-06 14:36:05 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/smb/change_password.rb",
"is_install_path": true,
"ref_name": "admin/smb/change_password",
Expand Down Expand Up @@ -10692,7 +10692,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/smb/delete_file.rb",
"is_install_path": true,
"ref_name": "admin/smb/delete_file",
Expand Down Expand Up @@ -10737,7 +10737,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/smb/download_file.rb",
"is_install_path": true,
"ref_name": "admin/smb/download_file",
Expand Down Expand Up @@ -10885,7 +10885,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/smb/psexec_ntdsgrab.rb",
"is_install_path": true,
"ref_name": "admin/smb/psexec_ntdsgrab",
Expand Down Expand Up @@ -10976,7 +10976,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/admin/smb/upload_file.rb",
"is_install_path": true,
"ref_name": "admin/smb/upload_file",
Expand Down Expand Up @@ -27649,7 +27649,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-11-15 11:11:41 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/gather/windows_secrets_dump.rb",
"is_install_path": true,
"ref_name": "gather/windows_secrets_dump",
Expand Down Expand Up @@ -55759,7 +55759,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-09-26 01:57:32 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/scanner/smb/pipe_auditor.rb",
"is_install_path": true,
"ref_name": "scanner/smb/pipe_auditor",
Expand Down Expand Up @@ -55804,7 +55804,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-10-13 13:38:05 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/scanner/smb/pipe_dcerpc_auditor.rb",
"is_install_path": true,
"ref_name": "scanner/smb/pipe_dcerpc_auditor",
Expand Down Expand Up @@ -55900,7 +55900,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/scanner/smb/smb_enum_gpp.rb",
"is_install_path": true,
"ref_name": "scanner/smb/smb_enum_gpp",
Expand Down Expand Up @@ -55950,7 +55950,7 @@
"microsoft-ds"
],
"targets": null,
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/auxiliary/scanner/smb/smb_enumshares.rb",
"is_install_path": true,
"ref_name": "scanner/smb/smb_enumshares",
Expand Down Expand Up @@ -193629,7 +193629,7 @@
"MOF upload",
"Command"
],
"mod_time": "2024-02-02 14:26:43 +0000",
"mod_time": "2024-12-16 14:55:10 +0000",
"path": "/modules/exploits/windows/smb/psexec.rb",
"is_install_path": true,
"ref_name": "windows/smb/psexec",
Expand Down
10 changes: 8 additions & 2 deletions lib/msf/base/sessions/smb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Msf::Sessions::SMB
# @option opts [RubySMB::Client] :client
def initialize(rstream, opts = {})
@client = opts.fetch(:client)
@simple_client = ::Rex::Proto::SMB::SimpleClient.new(client.dispatcher.tcp_socket, client: client)
@simple_client = ::Rex::Proto::SMB::SimpleClient.new(client.dispatcher.tcp_socket, client: client, msf_session: self)
self.console = Rex::Post::SMB::Ui::Console.new(self)
super(rstream, opts)
end
Expand Down Expand Up @@ -53,6 +53,13 @@ def process_autoruns(datastore)
end
end

def verify_connectivity
@client.dispatcher.tcp_socket.peerinfo
rescue Errno::ENOTCONN
self.kill
raise
end

def type
self.class.type
end
Expand Down Expand Up @@ -140,5 +147,4 @@ def _interact_stream
# the EOFError so we can drop this handle like a bad habit.
raise EOFError if (console.stopped? == true)
end

end
Loading

0 comments on commit b9eef6c

Please sign in to comment.