File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed
metasploit/framework/data_service/proxy
ui/console/command_dispatcher Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,10 @@ def report_loot(opts)
9
9
end
10
10
end
11
11
12
- def loots ( wspace , non_dead = false , addresses = nil )
12
+ def loots ( wspace , opts = { } )
13
13
begin
14
14
data_service = self . get_data_service
15
- opts = { }
16
15
opts [ :wspace ] = wspace
17
- opts [ :non_dead ] = non_dead
18
- opts [ :addresses ] = addresses
19
16
data_service . loot ( opts )
20
17
rescue Exception => e
21
18
puts "Call to #{ data_service . class } #loots threw exception: #{ e . message } "
Original file line number Diff line number Diff line change @@ -25,13 +25,13 @@ def find_or_create_loot(opts)
25
25
# This methods returns a list of all loot in the database
26
26
#
27
27
def loots ( opts )
28
- wspace = opts [ :workspace ] || opts [ :wspace ] || workspace
28
+ wspace = opts . delete ( :workspace ) || opts . delete ( :wspace ) || workspace
29
29
if wspace . kind_of? String
30
30
wspace = find_workspace ( wspace )
31
31
end
32
32
33
33
::ActiveRecord ::Base . connection_pool . with_connection {
34
- wspace . loots
34
+ wspace . loots . where ( opts )
35
35
}
36
36
end
37
37
alias_method :loot , :loots
Original file line number Diff line number Diff line change @@ -1272,8 +1272,9 @@ def cmd_loot(*args)
1272
1272
1273
1273
each_host_range_chunk ( host_ranges ) do |host_search |
1274
1274
framework . db . hosts ( framework . db . workspace , false , host_search ) . each do |host |
1275
- if host . loots
1276
- host . loots . each do |loot |
1275
+ loots = framework . db . loots ( framework . db . workspace , { :host_id => host . id } )
1276
+ if loots
1277
+ loots . each do |loot |
1277
1278
next if ( types and types . index ( loot . ltype ) . nil? )
1278
1279
if search_term
1279
1280
next unless (
@@ -1307,9 +1308,8 @@ def cmd_loot(*args)
1307
1308
1308
1309
# Handle hostless loot
1309
1310
if host_ranges . compact . empty? # Wasn't a host search
1310
- hostless_loot = framework . db . loot ( framework . db . workspace )
1311
+ hostless_loot = framework . db . loots ( framework . db . workspace , { :host_id => nil } )
1311
1312
hostless_loot . each do |loot |
1312
- next unless loot . host_id = nil
1313
1313
row = [ ]
1314
1314
row . push ( "" )
1315
1315
row . push ( "" )
You can’t perform that action at this time.
0 commit comments