Add Startup Manual to Check method
parent
6b0c3eadb2
commit
90dd90a304
|
@ -8,6 +8,7 @@
|
||||||
require 'msf/core'
|
require 'msf/core'
|
||||||
require 'msf/core/post/common'
|
require 'msf/core/post/common'
|
||||||
require 'msf/core/post/windows/services'
|
require 'msf/core/post/windows/services'
|
||||||
|
require 'msf/core/post/windows/priv'
|
||||||
|
|
||||||
class Metasploit3 < Msf::Exploit::Local
|
class Metasploit3 < Msf::Exploit::Local
|
||||||
Rank = ExcellentRanking
|
Rank = ExcellentRanking
|
||||||
|
@ -15,7 +16,7 @@ class Metasploit3 < Msf::Exploit::Local
|
||||||
include Msf::Exploit::EXE
|
include Msf::Exploit::EXE
|
||||||
include Msf::Post::File
|
include Msf::Post::File
|
||||||
include Msf::Post::Windows::Priv
|
include Msf::Post::Windows::Priv
|
||||||
include Msf::Post::Windows::WindowsServices
|
include Msf::Post::Windows::Services
|
||||||
|
|
||||||
def initialize(info={})
|
def initialize(info={})
|
||||||
super( update_info( info,
|
super( update_info( info,
|
||||||
|
@ -81,9 +82,17 @@ class Metasploit3 < Msf::Exploit::Local
|
||||||
if !check_service_exists?(@service_name)
|
if !check_service_exists?(@service_name)
|
||||||
return Exploit::CheckCode::Safe
|
return Exploit::CheckCode::Safe
|
||||||
else
|
else
|
||||||
if service_info['Startup'] == 'Disabled'
|
vprint_status(service_info)
|
||||||
print_error("Service is Disabled, so will be unable to exploit unless account has correct permissions...")
|
|
||||||
|
case service_info['Startup']
|
||||||
|
when 'Disabled'
|
||||||
|
print_error("Service startup is Disabled, so will be unable to exploit unless account has correct permissions...")
|
||||||
return Exploit::CheckCode::Safe
|
return Exploit::CheckCode::Safe
|
||||||
|
when 'Manual'
|
||||||
|
print_error("Service startup is Manual, so will be unable to exploit unless account has correct permissions...")
|
||||||
|
return Exploit::CheckCode::Safe
|
||||||
|
when 'Auto'
|
||||||
|
print_good("Service is set to Automatically start...")
|
||||||
end
|
end
|
||||||
|
|
||||||
if check_search_path
|
if check_search_path
|
||||||
|
@ -111,11 +120,11 @@ class Metasploit3 < Msf::Exploit::Local
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_system_path
|
def check_system_path
|
||||||
print_status("Checking SYSTEM PATH folders for write access...")
|
print_status("Checking %PATH% folders for write access...")
|
||||||
result = registry_getvaldata('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path')
|
result = registry_getvaldata('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path')
|
||||||
|
|
||||||
if result.nil?
|
if result.nil?
|
||||||
print_error("Unable to retrieve SYSTEM PATH from registry.")
|
print_error("Unable to retrieve %PATH% from registry.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -299,5 +308,4 @@ class Metasploit3 < Msf::Exploit::Local
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue