Module: Msf::Payload::Adapter::Fetch::SMB
  
  
  
  Constant Summary
  
  
  CachedSize
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  
  #_check_tftp_file, #_check_tftp_port, #_determine_server_comm, #_download_pipe, #_execute_add, #_execute_nix, #_execute_win, #_generate_certutil_command, #_generate_curl_command, #_generate_curl_pipe, #_generate_fileless, #_generate_fileless_python, #_generate_ftp_command, #_generate_get_command, #_generate_get_pipe, #_generate_tftp_command, #_generate_tnftp_command, #_generate_wget_command, #_generate_wget_pipe, #_remote_destination, #_remote_destination_nix, #_remote_destination_win, #default_srvuri, #download_uri, #fetch_bindhost, #fetch_bindnetloc, #fetch_bindport, #generate, #generate_fetch_commands, #generate_payload_uuid, #generate_pipe_command, #generate_stage, #handle_connection, #linux?, #pipe_srvuri, #pipe_supported_binaries, #srvhost, #srvnetloc, #srvport, #srvuri, #windows?
  
  
  
  
  
  
  
  
  
  #compatible?, #merge_info_adapted, #merge_info_arch, #merge_info_platform, #payload_type
  
  
  
  
  
  
  
  
  
  #exe_init_options, #exe_post_generation, #generate_payload_dccw_gdiplus_dll, #generate_payload_dll, #generate_payload_exe, #generate_payload_exe_service, #generate_payload_msi, #get_custom_exe, #get_eicar_exe
  
    Instance Method Details
    
      
  
  
    #cleanup_handler  ⇒ Object 
  
  
  
  
    
      
22
23
24
25
26
27
28
29 
     | 
    
      # File 'lib/msf/core/payload/adapter/fetch/smb.rb', line 22
def cleanup_handler
  if @fetch_service
    cleanup_smb_fetch_service(@fetch_service)
    @fetch_service = nil
  end
  super
end
     | 
  
 
    
      
  
  
    #fetch_protocol  ⇒ Object 
  
  
  
  
    
      
18
19
20 
     | 
    
      # File 'lib/msf/core/payload/adapter/fetch/smb.rb', line 18
def fetch_protocol
  'SMB'
end 
     | 
  
 
    
      
  
  
    #initialize(*args)  ⇒ Object 
  
  
  
  
    
      
9
10
11
12
13
14
15
16 
     | 
    
      # File 'lib/msf/core/payload/adapter/fetch/smb.rb', line 9
def initialize(*args)
  super
  register_options(
    [
      Msf::OptString.new('FETCH_FILENAME', [ true, 'Payload file name to fetch; cannot contain spaces or slashes.', 'test.dll'], regex: /^[^\s\/\\]*$/),
    ]
  )
end
     | 
  
 
    
      
  
  
    #setup_handler  ⇒ Object 
  
  
  
  
    
      
31
32
33
34 
     | 
    
      # File 'lib/msf/core/payload/adapter/fetch/smb.rb', line 31
def setup_handler
  @fetch_service = start_smb_fetch_handler(fetch_bindport, fetch_bindhost, srvuri + "\\#{datastore['FETCH_FILENAME']}", @srvexe)
  super
end
     | 
  
 
    
      
  
  
    #unc  ⇒ Object 
  
  
  
  
    
      
36
37
38
39
40
41 
     | 
    
      # File 'lib/msf/core/payload/adapter/fetch/smb.rb', line 36
def unc
  path = "\\\\#{srvhost}"
  path << "\\#{srvuri.gsub('/', "\\").chomp("\\")}"
  path << "\\#{datastore['FETCH_FILENAME']}" if datastore['FETCH_FILENAME'].present?
  path
end
     |