@@ -96,8 +96,8 @@ def run
96
96
end
97
97
98
98
99
- # Function for creating log folder and returning log path
100
- #-------------------------------------------------------------------------------
99
+ # Function for creating log folder and returning log path
100
+ #-------------------------------------------------------------------------------
101
101
def log_file ( log_path = nil )
102
102
103
103
#Get hostname
@@ -109,7 +109,7 @@ def log_file(log_path = nil)
109
109
# Create a directory for the logs
110
110
if log_path
111
111
logs = ::File . join ( log_path , 'logs' , 'persistence' , Rex ::FileUtils . clean_path ( host + filenameinfo ) )
112
- else
112
+ else
113
113
logs = ::File . join ( Msf ::Config . log_directory , 'persistence' , Rex ::FileUtils . clean_path ( host + filenameinfo ) )
114
114
end
115
115
@@ -143,7 +143,7 @@ def write_to_reg(key,script_on_target)
143
143
if ( key )
144
144
registry_setvaldata ( "#{ key } \\ Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Run" , nam , script_on_target , "REG_SZ" )
145
145
print_good ( "Installed into autorun as #{ key } \\ Software\\ Microsoft\\ Windows\\ CurrentVersion\\ Run\\ #{ nam } " )
146
- else
146
+ else
147
147
print_error ( "Error: failed to open the registry key for writing" )
148
148
end
149
149
@@ -159,7 +159,7 @@ def install_as_service(script_on_target)
159
159
print_status ( "Creating service #{ nam } " )
160
160
service_create ( nam , nam , "cmd /c \" #{ script_on_target } \" " )
161
161
@clean_up_rc << "execute -H -f sc -a \" delete #{ nam } \" \n "
162
- else
162
+ else
163
163
print_error ( "Insufficient privileges to create service" )
164
164
end
165
165
0 commit comments