From 526538ecd66009dafcc748b058c322bfd0135f27 Mon Sep 17 00:00:00 2001 From: David Bloom Date: Tue, 15 Jul 2014 15:04:46 +0200 Subject: [PATCH] Added dbvis version find and print --- modules/post/multi/gather/dbvis_enum.rb | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/modules/post/multi/gather/dbvis_enum.rb b/modules/post/multi/gather/dbvis_enum.rb index c8ce1c9cbc..d9ea2c347e 100644 --- a/modules/post/multi/gather/dbvis_enum.rb +++ b/modules/post/multi/gather/dbvis_enum.rb @@ -70,6 +70,7 @@ class Metasploit3 < Msf::Post print_status("Reading: #{dbvis_file}") + print_line() raw_xml = "" begin raw_xml = read_file(dbvis_file) @@ -93,7 +94,7 @@ class Metasploit3 < Msf::Post print_line("\n") print_line(db_table.to_s) print_good("Try to query listed databases with dbviscmd.sh (or .bat) -connection -sql and have fun !") - print_good("") + print_line() # store found databases p = store_loot( "dbvis.databases", @@ -131,9 +132,14 @@ class Metasploit3 < Msf::Post dbs = [] db = {} dbfound = false - + versionFound = false # fetch config file raw_xml.each_line do |line| + + if versionFound == false + vesrionFound = findVersion(line) + end + if line =~ // @@ -217,9 +223,15 @@ class Metasploit3 < Msf::Post dbs = [] db = {} dbfound = false + versionFound = false # fetch config file raw_xml.each_line do |line| + + if versionFound == false + vesrionFound = findVersion(line) + end + if line =~ // @@ -266,4 +278,13 @@ class Metasploit3 < Msf::Post end + def findVersion(tag) + found=false + if (tag =~ /([\S+\s+]+)<\/Version>/i) + print_good("DbVisualizer version : #{$1} ") + found=true + end + return found + end + end