update from chlee

git-svn-id: file:///home/svn/framework3/trunk@12723 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Tod Beardsley 2011-05-25 19:26:41 +00:00
parent 3e3c32730c
commit 528e9e2b3a
1 changed files with 7 additions and 1 deletions

View File

@ -13,12 +13,18 @@ class NexposeXMLStreamParser
def reset_state
@state = :generic_state
@only_vuln_states_needed = true
@current_vuln_id = nil
@vulnerable_markers = ['vulnerable-exploited', 'vulnerable-version', 'potential']
@host = {"status" => nil, "endpoints" => [], "names" => [], "vulns" => {}}
@vuln = {"refs" => [], "description" => [], "solution" => []}
end
# If all vuln states are required set this to false
def parse_vulnerable_states_only only_vuln_states_needed
@only_vuln_states_needed = only_vuln_states_needed
end
def tag_start(name, attributes)
case name
when "node"
@ -51,7 +57,7 @@ class NexposeXMLStreamParser
@host["endpoints"].last.merge!(attributes)
end
when "test"
if @vulnerable_markers.include? attributes["status"].to_s.chomp
if (not @only_vuln_states_needed) or (@vulnerable_markers.include? attributes["status"].to_s.chomp and @only_vuln_states_needed)
@state = :in_test
@current_vuln_id = attributes["id"]
@host["vulns"][@current_vuln_id] = attributes.dup