Updated print_error() for sqlite3's rescue

git-svn-id: file:///home/svn/framework3/trunk@12524 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Wei Chen 2011-05-03 05:23:51 +00:00
parent 93b0c5beb3
commit c0baf731f8
1 changed files with 12 additions and 9 deletions

View File

@ -73,12 +73,6 @@ class Metasploit3 < Msf::Post
end
def process_files(username)
begin
require 'sqlite3'
rescue ::Exception => e
print_error(e)
return
end
secrets = ""
decrypt_table = Rex::Ui::Text::Table.new(
"Header" => "Decrypted data",
@ -244,11 +238,20 @@ class Metasploit3 < Msf::Post
prepare_railgun
end
has_sqlite3 = true
begin
require 'sqlite3'
rescue
print_error("SQLite3 is not available, and we are not able to parse the database.")
has_sqlite3 = false
end
#Process files for each username
usernames.each do |u|
print_status("extracting data for user '#{u}'...")
print_status("Extracting data for user '#{u}'...")
success = extract_data(u)
process_files(u) if success
process_files(u) if success and has_sqlite3
end
# Migrate back to the original process