Make parsing easier

bug/bundler_fix
jvazquez-r7 2013-10-22 10:29:30 -05:00
parent 0cc7be0138
commit c50e7c73b6
1 changed files with 20 additions and 26 deletions

View File

@ -133,19 +133,13 @@ class Metasploit3 < Msf::Auxiliary
}
# remove unclosed tags for REXML
body = body.gsub('<wbr>', '')
body = body.gsub('<br>', '')
body.gsub!('<wbr>', '')
body.gsub!('<br>', '')
doc = REXML::Document.new(body)
tds = doc.get_elements("//td")
td_counter = 0
tds.each do |td|
td = td.get_text.to_s.strip
infos.each do |k, v|
if td == k
infos[k] = tds[td_counter+1].get_text.to_s.strip
end
end
td_counter +=1
tds.each_index do |idx|
td = tds[idx].get_text.to_s.strip
infos[td] = tds[idx+1].get_text.to_s.strip if infos.has_key?(td)
end
# print out the goodies