Module: Msf::Exploit::Remote::SMB::Client::Ipc

Includes:
Auxiliary::Report, Authenticated
Included in:
MsIcpr, MsLsad, MsSamr, MsWkst
Defined in:
lib/msf/core/exploit/remote/smb/client/ipc.rb

Defined Under Namespace

Classes: SmbIpcAuthenticationError, SmbIpcConnectionError, SmbIpcError

Constant Summary

Constants included from Msf::Exploit::Remote::SMB::Client

CONST, DCERPCClient, DCERPCPacket, DCERPCResponse, DCERPCUUID, NDR, SIMPLE, XCEPT

Instance Attribute Summary

Attributes included from Msf::Exploit::Remote::SMB::Client

#simple

Attributes included from Tcp

#sock

Class Method Summary collapse

Methods included from Auxiliary::Report

#active_db?, #create_cracked_credential, #create_credential, #create_credential_and_login, #create_credential_login, #db, #db_warning_given?, #get_client, #get_host, #inside_workspace_boundary?, #invalidate_login, #mytask, #myworkspace, #myworkspace_id, #report_auth_info, #report_client, #report_exploit, #report_host, #report_loot, #report_note, #report_service, #report_vuln, #report_web_form, #report_web_page, #report_web_site, #report_web_vuln, #store_cred, #store_local, #store_loot

Methods included from Metasploit::Framework::Require

optionally, optionally_active_record_railtie, optionally_include_metasploit_credential_creation, #optionally_include_metasploit_credential_creation, optionally_require_metasploit_db_gem_engines

Methods included from Authenticated

#initialize

Methods included from Kerberos::ServiceAuthenticator::Options

#kerberos_auth_options

Methods included from Kerberos::Ticket::Storage

#initialize, #kerberos_storage_options, #kerberos_ticket_storage, store_ccache

Methods included from Msf::Exploit::Remote::SMB::Client

#connect, #domain, #domain_username_split, #initialize, #smb_create, #smb_direct, #smb_enumprinters, #smb_enumprintproviders, #smb_file_exist?, #smb_file_rm, #smb_fingerprint, #smb_fingerprint_windows_lang, #smb_fingerprint_windows_sp, #smb_hostname, #smb_lanman_netshareenumall, #smb_login, #smb_lookup_share_type, #smb_netshareenumall, #smb_netsharegetinfo, #smb_open, #smb_peer_lm, #smb_peer_os, #smb_srvsvc_netshareenumall, #smb_srvsvc_netsharegetinfo, #smbhost, #splitname, #unicode

Methods included from Tcp

#chost, #cleanup, #connect, #connect_timeout, #cport, #disconnect, #handler, #initialize, #lhost, #lport, #peer, #print_prefix, #proxies, #rhost, #rport, #set_tcp_evasions, #shutdown, #ssl, #ssl_cipher, #ssl_verify_mode, #ssl_version

Class Method Details

.connect_ipcObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/msf/core/exploit/remote/smb/client/ipc.rb', line 20

def connect_ipc
  begin
    if session
      self.simple = session.simple_client
      ipc_tree = simple.client.tree_connect("\\\\#{simple.peerhost}\\IPC$")
    else
      connect
      # smb_login does a tree_connect to the IPC share already.
      ipc_tree = 
    end
  rescue Rex::ConnectionError => e
    raise SmbIpcConnectionError, e.message
  rescue Rex::Proto::SMB::Exceptions::Error, RubySMB::Error::RubySMBError => e
    raise SmbIpcAuthenticationError, "Unable to authenticate ([#{e.class}] #{e})."
  end

  report_service(
    host: simple.peerhost,
    port: simple.peerport,
    host_name: simple.client.default_name,
    proto: 'tcp',
    name: 'smb',
    info: "Module: #{fullname}, last negotiated version: SMBv#{simple.client.negotiated_smb_version} (dialect = #{simple.client.dialect})"
  )

  ipc_tree
end

.disconnect_ipc(ipc_tree) ⇒ Object



48
49
50
# File 'lib/msf/core/exploit/remote/smb/client/ipc.rb', line 48

def disconnect_ipc(ipc_tree)
  ipc_tree.disconnect! if ipc_tree
end