Skip to content

Commit

Permalink
guard for unknown host, fix processing of modules
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin-tech committed Feb 15, 2019
1 parent 32c0908 commit 6460180
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/msf/core/rpc/v10/rpc_db.rb
Expand Up @@ -699,6 +699,7 @@ def rpc_analyze_host(xopts)
ret[:host] = []
opts = fix_options(xopts)
h = self.framework.db.get_host(opts)
return ret unless h
h_result = self.framework.analyze.host(h)
host_detail = {}
host_detail[:address] = h.address
Expand All @@ -707,10 +708,10 @@ def rpc_analyze_host(xopts)
host_detail[:modules] = []
h_result[:modules].each do |mod|
mod_detail = {}
mod_detail[:mtype] = mod.mtype
mod_detail[:mtype] = mod.type
mod_detail[:mname] = mod.full_name
host_detail[:modules] << mod_detail
end
host_detail[:modules] = mod_detail
end
ret[:host] << host_detail
ret
Expand Down

0 comments on commit 6460180

Please sign in to comment.