Make parsing easier
parent
0cc7be0138
commit
c50e7c73b6
|
@ -115,37 +115,31 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
def parse_system_info(body)
|
def parse_system_info(body)
|
||||||
vprint_status("#{peer} - Getting useful information from systemInfo")
|
vprint_status("#{peer} - Getting useful information from systemInfo")
|
||||||
infos = {
|
infos = {
|
||||||
"os.name" => nil,
|
"os.name" => nil,
|
||||||
"os.version" => nil,
|
"os.version" => nil,
|
||||||
"sun.os.patch.level" => nil,
|
"sun.os.patch.level" => nil,
|
||||||
"os.arch" => nil,
|
"os.arch" => nil,
|
||||||
"user.name" => nil,
|
"user.name" => nil,
|
||||||
"USERDOMAIN" => nil,
|
"USERDOMAIN" => nil,
|
||||||
"user.home" => nil,
|
"user.home" => nil,
|
||||||
"user.language" => nil,
|
"user.language" => nil,
|
||||||
"user.country" => nil,
|
"user.country" => nil,
|
||||||
"user.timezone" => nil,
|
"user.timezone" => nil,
|
||||||
"COMPUTERNAME" => nil,
|
"COMPUTERNAME" => nil,
|
||||||
"SystemDrive" => nil,
|
"SystemDrive" => nil,
|
||||||
"TEMP" => nil,
|
"TEMP" => nil,
|
||||||
"TMP" => nil,
|
"TMP" => nil,
|
||||||
"SHELL" => nil
|
"SHELL" => nil
|
||||||
}
|
}
|
||||||
|
|
||||||
# remove unclosed tags for REXML
|
# remove unclosed tags for REXML
|
||||||
body = body.gsub('<wbr>', '')
|
body.gsub!('<wbr>', '')
|
||||||
body = body.gsub('<br>', '')
|
body.gsub!('<br>', '')
|
||||||
doc = REXML::Document.new(body)
|
doc = REXML::Document.new(body)
|
||||||
tds = doc.get_elements("//td")
|
tds = doc.get_elements("//td")
|
||||||
td_counter = 0
|
tds.each_index do |idx|
|
||||||
tds.each do |td|
|
td = tds[idx].get_text.to_s.strip
|
||||||
td = td.get_text.to_s.strip
|
infos[td] = tds[idx+1].get_text.to_s.strip if infos.has_key?(td)
|
||||||
infos.each do |k, v|
|
|
||||||
if td == k
|
|
||||||
infos[k] = tds[td_counter+1].get_text.to_s.strip
|
|
||||||
end
|
|
||||||
end
|
|
||||||
td_counter +=1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# print out the goodies
|
# print out the goodies
|
||||||
|
|
Loading…
Reference in New Issue