From 3c133a1415321ec428783d3de3783ad462f23370 Mon Sep 17 00:00:00 2001 From: David Rude Date: Thu, 12 May 2011 17:56:18 +0000 Subject: [PATCH] added some more verbosity so its clear things are happening, moved the session.type check to be more immediate git-svn-id: file:///home/svn/framework3/trunk@12594 4d416f70-5f16-0410-b530-b9f4589650da --- modules/post/multi/gather/firefox_creds.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/post/multi/gather/firefox_creds.rb b/modules/post/multi/gather/firefox_creds.rb index ce30a985b9..3bf8dc4912 100644 --- a/modules/post/multi/gather/firefox_creds.rb +++ b/modules/post/multi/gather/firefox_creds.rb @@ -43,6 +43,7 @@ class Metasploit3 < Msf::Post end def run + print_status("Determining session platform and type...") case session.platform when /unix|linux|bsd/ @platform = :unix @@ -52,9 +53,14 @@ class Metasploit3 < Msf::Post paths = enum_users_unix when /win/ @platform = :windows - drive = session.fs.file.expand_path("%SystemDrive%") - os = session.sys.config.sysinfo['OS'] - + if session.type == "shell" + print_error "Only meterpreter sessions are supported on Windows hosts" + print_error "Try upgrading the session to a Meterpreter session via \"sessions -u \"" + return + else + drive = session.fs.file.expand_path("%SystemDrive%") + os = session.sys.config.sysinfo['OS'] + end if os =~ /Windows 7|Vista|2008/ @appdata = '\\AppData\\Roaming' @users = drive + '\\Users' @@ -63,10 +69,7 @@ class Metasploit3 < Msf::Post @users = drive + '\\Documents and Settings' end - if session.type != "meterpreter" - print_error "Only meterpreter sessions are supported on windows hosts" - return - end + print_status("Enumerating users checking for Firefox installs...") paths = enum_users_windows else print_error("Unsupported platform #{session.platform}")