don't store less accurate nmap fingerprints, see #4099

git-svn-id: file:///home/svn/framework3/trunk@12302 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2011-04-11 23:05:07 +00:00
parent e5068838ff
commit 857b5c786b
1 changed files with 12 additions and 4 deletions

View File

@ -70,10 +70,18 @@ class NmapXMLStreamParser
@host["addr"] = attributes["addr"] @host["addr"] = attributes["addr"]
end end
when "osclass" when "osclass"
# If there is more than one, take the highest accuracy. In case of
# a tie, this will have the effect of taking the last one in the
# list. Last is really no better than first but nmap appears to
# put OSes in chronological order, at least for Windows.
# Accordingly, this will report XP instead of 2000, 7 instead of
# Vista, etc, when each has the same accuracy.
if (@host["os_accuracy"].to_i <= attributes["accuracy"].to_i)
@host["os_vendor"] = attributes["vendor"] @host["os_vendor"] = attributes["vendor"]
@host["os_family"] = attributes["osfamily"] @host["os_family"] = attributes["osfamily"]
@host["os_version"] = attributes["osgen"] @host["os_version"] = attributes["osgen"]
@host["os_accuracy"] = attributes["accuracy"] @host["os_accuracy"] = attributes["accuracy"]
end
when "osmatch" when "osmatch"
if(attributes["accuracy"].to_i == 100) if(attributes["accuracy"].to_i == 100)
@host["os_match"] = attributes["name"] @host["os_match"] = attributes["name"]