diff --git a/lib/msf/ui/console/command_dispatcher/db.rb b/lib/msf/ui/console/command_dispatcher/db.rb index 1fc7d65b34..e37a16a350 100644 --- a/lib/msf/ui/console/command_dispatcher/db.rb +++ b/lib/msf/ui/console/command_dispatcher/db.rb @@ -1253,6 +1253,26 @@ class Db end end + # Handle hostless loot + if host_ranges.compact.empty? # Wasn't a host search + hostless_loot = framework.db.loots.where(host_id: nil) + hostless_loot.each do |loot| + row = [] + row.push("") + row.push("") + row.push(loot.ltype) + row.push(loot.name || "") + row.push(loot.content_type) + row.push(loot.info || "") + row.push(loot.path) + tbl << row + if (mode == :delete) + loot.destroy + delete_count += 1 + end + end + end + print_line print_line(tbl.to_s) print_status("Deleted #{delete_count} loots") if delete_count > 0