metasploit-runner 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: ed708546d491150bc795b5633b9359043c960ce3
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: cfeda943c27e25482178e6d466ec539e1da30f19
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9f01160bb2c7fcb6ba1e5d4893f094ef2c7c204c8647c19a98e40d976674884d3c36590fe31ffc1f8554c0b73a2d082f9bdb159ae729417089a23c08e6ff747c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3e0c5d8f5b832d482f97bf3721f6a157d2100123a5d18d7aace600a39866c29c4217b47ebf606e97b06aa3f2bc2803a3ad60d1ca423bb1cf524d087eec57b6f3
         
     | 
    
        data/lib/metasploit/exploit.rb
    CHANGED
    
    | 
         @@ -50,17 +50,13 @@ module Metasploit 
     | 
|
| 
       50 
50 
     | 
    
         
             
                end
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
                def self.do_metasploit_audit(rpc_client, run_details)
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
53 
     | 
    
         
             
                  audit = rpc_client.call('pro.start_webaudit', run_details.get_audit_options)
         
     | 
| 
       55 
54 
     | 
    
         | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
55 
     | 
    
         
             
                  wait_for_task_to_stop_running(rpc_client, CONSTANTS::AUDIT_MESSAGE, audit['task_id'])
         
     | 
| 
       58 
56 
     | 
    
         
             
                end
         
     | 
| 
       59 
57 
     | 
    
         | 
| 
       60 
58 
     | 
    
         
             
                def self.do_metasploit_exploit(rpc_client, run_details)
         
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
                  if run_details.use_os_filter == true
         
     | 
| 
      
 59 
     | 
    
         
            +
                  if run_details.use_os_filter
         
     | 
| 
       64 
60 
     | 
    
         
             
                    puts CONSTANTS::USING_OS_FILTER_MESSAGE
         
     | 
| 
       65 
61 
     | 
    
         
             
                  else
         
     | 
| 
       66 
62 
     | 
    
         
             
                    puts CONSTANTS::NO_OS_FILTER
         
     | 
| 
         @@ -15,7 +15,7 @@ class ExploitRunDescription 
     | 
|
| 
       15 
15 
     | 
    
         
             
                self.workspace_name = workspace_name
         
     | 
| 
       16 
16 
     | 
    
         
             
                self.nexpose_console_name = nexpose_console_name
         
     | 
| 
       17 
17 
     | 
    
         
             
                @@device_ip_to_scan_value = device_ip_to_scan
         
     | 
| 
       18 
     | 
    
         
            -
                 
     | 
| 
      
 18 
     | 
    
         
            +
                self.use_os_filter = use_os_filter
         
     | 
| 
       19 
19 
     | 
    
         
             
              end
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
              def verify
         
     | 
| 
         @@ -91,7 +91,7 @@ class ExploitRunDescription 
     | 
|
| 
       91 
91 
     | 
    
         
             
              end
         
     | 
| 
       92 
92 
     | 
    
         | 
| 
       93 
93 
     | 
    
         
             
              def use_os_filter
         
     | 
| 
       94 
     | 
    
         
            -
                (@@use_os_filter_value 
     | 
| 
      
 94 
     | 
    
         
            +
                self.to_bool(@@use_os_filter_value)
         
     | 
| 
       95 
95 
     | 
    
         
             
              end
         
     | 
| 
       96 
96 
     | 
    
         | 
| 
       97 
97 
     | 
    
         | 
| 
         @@ -99,4 +99,8 @@ class ExploitRunDescription 
     | 
|
| 
       99 
99 
     | 
    
         
             
                (value_to_check.nil? || value_to_check.empty?) ? default : value_to_check
         
     | 
| 
       100 
100 
     | 
    
         
             
              end
         
     | 
| 
       101 
101 
     | 
    
         | 
| 
      
 102 
     | 
    
         
            +
              def to_bool(str)
         
     | 
| 
      
 103 
     | 
    
         
            +
                str == 'true'
         
     | 
| 
      
 104 
     | 
    
         
            +
              end
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
       102 
106 
     | 
    
         
             
            end
         
     | 
| 
         @@ -8,7 +8,7 @@ describe 'exploit_run_description' do 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  @expected_port = '3791'
         
     | 
| 
       9 
9 
     | 
    
         
             
                  @expected_uri = '/api/1.1'
         
     | 
| 
       10 
10 
     | 
    
         
             
                  @expected_ssl = false
         
     | 
| 
       11 
     | 
    
         
            -
                  @expected_os_filter =  
     | 
| 
      
 11 
     | 
    
         
            +
                  @expected_os_filter = false
         
     | 
| 
       12 
12 
     | 
    
         
             
                  @expected_workspace_name = 'workspacename'
         
     | 
| 
       13 
13 
     | 
    
         
             
                  @expected_nexpose_console_name = 'nexpose_console_name'
         
     | 
| 
       14 
14 
     | 
    
         
             
                  @expected_webscan_task_id = '12'
         
     | 
    
        data/spec/exploit_spec.rb
    CHANGED
    
    | 
         @@ -12,8 +12,8 @@ describe 'exploit' do 
     | 
|
| 
       12 
12 
     | 
    
         
             
                  @expected_port = '3791'
         
     | 
| 
       13 
13 
     | 
    
         
             
                  @expected_uri = '/api/1.1'
         
     | 
| 
       14 
14 
     | 
    
         
             
                  @expected_ssl = false
         
     | 
| 
       15 
     | 
    
         
            -
                  @expected_use_os_filter =  
     | 
| 
       16 
     | 
    
         
            -
                  @expected_no_os_filter =  
     | 
| 
      
 15 
     | 
    
         
            +
                  @expected_use_os_filter = false
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @expected_no_os_filter = true
         
     | 
| 
       17 
17 
     | 
    
         
             
                  @expected_workspace_name = 'workspacename'
         
     | 
| 
       18 
18 
     | 
    
         
             
                  @expected_nexpose_console_name = 'nexpose_console_name'
         
     | 
| 
       19 
19 
     | 
    
         
             
                  @expected_webscan_task_id = '12'
         
     | 
| 
         @@ -319,7 +319,7 @@ describe 'exploit' do 
     | 
|
| 
       319 
319 
     | 
    
         
             
                                                                            "DS_LimitSessions" => @expected_session_limit,
         
     | 
| 
       320 
320 
     | 
    
         
             
                                                                            "DS_MATCH_VULNS" => @expected_match_vulns,
         
     | 
| 
       321 
321 
     | 
    
         
             
                                                                            "DS_MATCH_PORTS" => @expected_match_ports,
         
     | 
| 
       322 
     | 
    
         
            -
                                                                            "DS_FilterByOS" =>   
     | 
| 
      
 322 
     | 
    
         
            +
                                                                            "DS_FilterByOS" =>  @expected_use_os_filter})
         
     | 
| 
       323 
323 
     | 
    
         | 
| 
       324 
324 
     | 
    
         
             
                    Metasploit::Exploit.start(@expected_connection, @expected_port, @expected_uri, @expected_ssl,  @expected_token, @expected_workspace_name, @expected_nexpose_console_name, @mock_device_ip_to_scan, true)
         
     | 
| 
       325 
325 
     | 
    
         
             
                  end
         
     |