diff --git a/modules/post/windows/gather/enum_chrome.rb b/modules/post/windows/gather/enum_chrome.rb index 4f21d338ba..0e2ae33b6c 100644 --- a/modules/post/windows/gather/enum_chrome.rb +++ b/modules/post/windows/gather/enum_chrome.rb @@ -12,10 +12,12 @@ require 'msf/core' require 'rex' require 'msf/core/post/file' +require 'msf/core/post/windows/accounts' class Metasploit3 < Msf::Post include Msf::Post::File + include Msf::Post::Priv def initialize(info={}) super(update_info(info, @@ -239,7 +241,8 @@ class Metasploit3 < Msf::Post #Get user(s) usernames = [] - if (uid = session.sys.config.getuid) == "NT AUTHORITY\\SYSTEM" + uid = session.sys.config.getuid + if is_system? print_status("running as SYSTEM, extracting user list...") print_error("(Automatic decryption will not be possible. You might want to manually migrate, or \"set MIGRATE true\")") session.fs.dir.foreach(@profiles_path) do |u| diff --git a/modules/post/windows/gather/enum_powershell_env.rb b/modules/post/windows/gather/enum_powershell_env.rb index 5b95a8ff42..a565126707 100644 --- a/modules/post/windows/gather/enum_powershell_env.rb +++ b/modules/post/windows/gather/enum_powershell_env.rb @@ -12,10 +12,12 @@ require 'msf/core' require 'rex' require 'msf/core/post/windows/registry' +require 'msf/core/post/windows/accounts' class Metasploit3 < Msf::Post include Msf::Post::Registry + include Msf::Post::Priv def initialize(info={}) super( update_info( info, @@ -45,7 +47,7 @@ class Metasploit3 < Msf::Post profilepath = "\\My Documents\\WindowsPowerShell\\" end - if user == "NT AUTHORITY\\SYSTEM" + if is_system? print_status("Running as SYSTEM extracting user list..") session.fs.dir.foreach(path4users) do |u| userinfo = {} diff --git a/modules/post/windows/gather/enum_shares.rb b/modules/post/windows/gather/enum_shares.rb index e69742af72..6198b9af5b 100644 --- a/modules/post/windows/gather/enum_shares.rb +++ b/modules/post/windows/gather/enum_shares.rb @@ -12,10 +12,12 @@ require 'msf/core' require 'rex' require 'msf/core/post/windows/registry' +require 'msf/core/post/windows/accounts' class Metasploit3 < Msf::Post include Msf::Post::Registry + include Msf::Post::Priv def initialize(info={}) super( update_info( info, @@ -132,8 +134,7 @@ class Metasploit3 < Msf::Post # Enumerate shares being offered enum_conf_shares() if datastore["CURRENT"] - user = session.sys.config.getuid - if user != "NT AUTHORITY\\SYSTEM" + if is_system? mount_history = enum_recent_mounts("HKEY_CURRENT_USER") run_history = enum_run_unc("HKEY_CURRENT_USER") else