Add support to scripts for Meterpreter Accounts Mixin and add new method is_system? for checking if sessions is running as SYSTEM, uses SID so as at to ensure compatibility with multiple language versions of windows.
git-svn-id: file:///home/svn/framework3/trunk@11997 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
5bfd574029
commit
e49ab08e21
|
@ -1,15 +1,27 @@
|
|||
|
||||
require 'msf/core/post/windows/accounts'
|
||||
|
||||
module Msf
|
||||
class Post
|
||||
|
||||
module Priv
|
||||
|
||||
|
||||
#Returns true if user is admin and false if not.
|
||||
include ::Msf::Post::Accounts
|
||||
# Returns true if user is admin and false if not.
|
||||
def is_admin?
|
||||
return session.railgun.shell32.IsUserAnAdmin()["return"]
|
||||
end
|
||||
|
||||
# Returns true if running as Local System
|
||||
def is_system?
|
||||
local_sys = resolve_sid("S-1-5-18")
|
||||
if session.sys.config.getuid == "#{local_sys[:domain]}\\#{local_sys[:name]}"
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
||||
end
|
||||
#
|
||||
# Returns true if UAC is enabled
|
||||
#
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'msf/scripts/meterpreter/common'
|
|||
require 'msf/scripts/meterpreter/registry'
|
||||
require 'msf/scripts/meterpreter/file'
|
||||
require 'msf/scripts/meterpreter/services'
|
||||
require 'msf/scripts/meterpreter/accounts'
|
||||
|
||||
module Msf
|
||||
module Scripts
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
require 'msf/core/post/windows/accounts'
|
||||
|
||||
module Msf
|
||||
module Scripts
|
||||
module Meterpreter
|
||||
module Common
|
||||
|
||||
include ::Msf::Post::Accounts
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue