Clean up some code, get CMD working.
parent
140d8ae42f
commit
3cdc6abec6
|
@ -153,20 +153,12 @@ class Metasploit3 < Msf::Exploit::Local
|
|||
end
|
||||
|
||||
def cleanup
|
||||
print_status("cleanup callback")
|
||||
if not @_cleaning_up
|
||||
@_cleaning_up = true
|
||||
do_cleanup
|
||||
end
|
||||
do_cleanup_once
|
||||
super
|
||||
end
|
||||
|
||||
def on_new_session(session)
|
||||
print_status("on_new_session callback")
|
||||
if not @_cleaning_up
|
||||
@_cleaning_up = true
|
||||
do_cleanup
|
||||
end
|
||||
do_cleanup_once
|
||||
super
|
||||
end
|
||||
|
||||
|
@ -201,26 +193,23 @@ class Metasploit3 < Msf::Exploit::Local
|
|||
print_good output
|
||||
end
|
||||
|
||||
def do_cleanup
|
||||
def do_cleanup_once
|
||||
return if @_cleaned_up
|
||||
@_cleaned_up = true
|
||||
|
||||
print_status("Resetting system clock to original values") if @time
|
||||
|
||||
print_status("Executing: #{SYSTEMSETUP_PATH} -settimezone #{[@zone].shelljoin}")
|
||||
cmd_exec("#{SYSTEMSETUP_PATH} -settimezone #{[@zone].shelljoin}") unless @zone.nil?
|
||||
|
||||
print_status("Executing: #{SYSTEMSETUP_PATH} -setdate #{[@date].shelljoin}")
|
||||
cmd_exec("#{SYSTEMSETUP_PATH} -setdate #{[@date].shelljoin}") unless @date.nil?
|
||||
|
||||
print_status("Executing: #{SYSTEMSETUP_PATH} -settime #{[@time].shelljoin}")
|
||||
cmd_exec("#{SYSTEMSETUP_PATH} -settime #{[@time].shelljoin}") unless @time.nil?
|
||||
|
||||
if @networked
|
||||
print_status("Executing: #{SYSTEMSETUP_PATH} -setusingnetworktime On")
|
||||
cmd_exec("#{SYSTEMSETUP_PATH} -setusingnetworktime On")
|
||||
unless @network_server.nil?
|
||||
print_status("Executing: #{SYSTEMSETUP_PATH} -setnetworktimeserver #{[@network_server].shelljoin}")
|
||||
cmd_exec("#{SYSTEMSETUP_PATH} -setnetworktimeserver #{[@network_server].shelljoin}")
|
||||
end
|
||||
end
|
||||
|
||||
print_success("Completed clock reset.") if @time
|
||||
end
|
||||
|
||||
# helper methods for accessing datastore
|
||||
|
|
Loading…
Reference in New Issue