Fixes #1990. Turns out, we were counting on resolved hostnames, and skipping anything with an unresolved IP address.

git-svn-id: file:///home/svn/framework3/trunk@9327 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Tod Beardsley 2010-05-20 14:08:29 +00:00
parent 8e648dc7e0
commit 87ba4a9594
1 changed files with 7 additions and 1 deletions

View File

@ -1722,6 +1722,7 @@ class DBManager
data = f.read(f.stat.size) data = f.read(f.stat.size)
import_nessus_nbe(data, wspace) import_nessus_nbe(data, wspace)
end end
def import_nessus_nbe(nbe_data, wspace=workspace) def import_nessus_nbe(nbe_data, wspace=workspace)
nbe_copy = nbe_data.dup nbe_copy = nbe_data.dup
# First pass, just to build the address map. # First pass, just to build the address map.
@ -1740,12 +1741,17 @@ class DBManager
r = line.split('|') r = line.split('|')
next if r[0] != 'results' next if r[0] != 'results'
hname = r[2] hname = r[2]
addr = addr_map[hname] if addr_map[hname]
addr = addr_map[hname]
else
addr = hname # Must be unresolved, probably an IP address.
end
port = r[3] port = r[3]
nasl = r[4] nasl = r[4]
type = r[5] type = r[5]
data = r[6] data = r[6]
# If there's no resolution, or if it's malformed, skip it.
next unless ipv4_validator(addr) next unless ipv4_validator(addr)
# Match the NBE types with the XML severity ratings # Match the NBE types with the XML severity ratings