diff --git a/modules/exploits/windows/local/persistence_service.rb b/modules/exploits/windows/local/persistence_service.rb index 06cb8f6004..c3272f76e5 100644 --- a/modules/exploits/windows/local/persistence_service.rb +++ b/modules/exploits/windows/local/persistence_service.rb @@ -152,7 +152,7 @@ class MetasploitModule < Msf::Exploit::Local # Function for creating log folder and returning log path #------------------------------------------------------------------------------- - def log_file(log_path = nil) + def log_file # Get hostname host = session.sys.config.sysinfo["Computer"] @@ -160,18 +160,12 @@ class MetasploitModule < Msf::Exploit::Local filenameinfo = "_" + ::Time.now.strftime("%Y%m%d.%M%S") # Create a directory for the logs - logs = if log_path - ::File.join(log_path, 'logs', 'persistence', Rex::FileUtils.clean_path(host + filenameinfo)) - else - ::File.join(Msf::Config.log_directory, 'persistence', Rex::FileUtils.clean_path(host + filenameinfo)) - end + logs = ::File.join(Msf::Config.log_directory, 'persistence', Rex::FileUtils.clean_path(host + filenameinfo)) # Create the log directory ::FileUtils.mkdir_p(logs) - # logfile name - logfile = logs + ::File::Separator + Rex::FileUtils.clean_path(host + filenameinfo) + ".rc" - logfile + logs + ::File::Separator + Rex::FileUtils.clean_path(host + filenameinfo) + ".rc" end # Function to install payload as a service