MSFConsole should display hostless loot, also typo fix.

Fixes the console to display loot not associated with a host, as when
the CorpWatch modules save loot. Also fixes a typo on
corpwatch_lookup_id.rb

Fixes #6177
This commit is contained in:
Tod Beardsley 2011-12-29 15:06:38 -06:00
parent 78da15ed15
commit bc22b7de99
2 changed files with 22 additions and 1 deletions

View File

@ -948,6 +948,27 @@ class Db
end
end
end
# Handle hostless loot
if host_ranges.compact.empty? # Wasn't a host search
hostless_loot = framework.db.loots.find_all_by_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

View File

@ -520,7 +520,7 @@ class Metasploit3 < Msf::Auxiliary
end
end
p = store_loot("corpwatch_api.#{datastore['CW_ID']}_info","text/plain",nil,loot,"company_#{datastore['CWID']}.txt","#{datastore["CW_ID"]} Specific Information")
p = store_loot("corpwatch_api.#{datastore['CW_ID']}_info","text/plain",nil,loot,"company_#{datastore['CW_ID']}.txt","#{datastore["CW_ID"]} Specific Information")
print_line()
print_status("Saved in: #{p}")