Pass a host object into the nse parser from a host object cache.
git-svn-id: file:///home/svn/framework3/trunk@12416 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
5918e6c0ac
commit
25971ff2ac
|
@ -3980,6 +3980,9 @@ class DBManager
|
|||
# First pass, just to build the address map.
|
||||
addr_map = {}
|
||||
|
||||
# Cache host objects before passing into handle_nessus()
|
||||
hobj_map = {]
|
||||
|
||||
nbe_copy.each_line do |line|
|
||||
r = line.split('|')
|
||||
next if r[0] != 'results'
|
||||
|
@ -4012,6 +4015,8 @@ class DBManager
|
|||
yield(:address,addr) if block
|
||||
end
|
||||
|
||||
hobj_map[ addr ] ||= report_host(:host => addr, :workspace => wspace)
|
||||
|
||||
# Match the NBE types with the XML severity ratings
|
||||
case type
|
||||
# log messages don't actually have any data, they are just
|
||||
|
@ -4028,14 +4033,14 @@ class DBManager
|
|||
os = data.match(/The remote host is running (.*)\\n/)[1]
|
||||
report_note(
|
||||
:workspace => wspace,
|
||||
:host => addr,
|
||||
:host => hobj_map[ addr ],
|
||||
:type => 'host.os.nessus_fingerprint',
|
||||
:data => {
|
||||
:os => os.to_s.strip
|
||||
}
|
||||
)
|
||||
end
|
||||
handle_nessus(wspace, addr, port, nasl, severity, data)
|
||||
handle_nessus(wspace, hobj_map[ addr ], port, nasl, severity, data)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue