Skip to content

Commit f9b4971

Browse files
Royce DavisRoyce Davis
authored andcommitted
Fixed hard coded paths in psexec on command.rb
1 parent 683bcd4 commit f9b4971

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/auxiliary/admin/smb/command.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def psexec(smbshare, command)
246246
vprint_status("Removing the service...")
247247
stubdata =
248248
svc_handle +
249-
NDR.wstring("C:\\WINDOWS\\Temp\\msfcommandoutput.txt")
249+
NDR.wstring("%WINDIR%\\Temp\\msfcommandoutput.txt")
250250
begin
251251
response = dcerpc.call(0x02, stubdata)
252252
if (dcerpc.last_response != nil and dcerpc.last_response.stub_data != nil)
@@ -268,10 +268,10 @@ def psexec(smbshare, command)
268268
#This is not really useful but will prevent double \\ on the wire :)
269269
if datastore['SHARE'] =~ /.[\\\/]/
270270
simple.connect(smbshare)
271-
simple.delete("C:\\WINDOWS\\Temp\\msfcommandoutput.txt")
271+
simple.delete("%WINDIR%\\Temp\\msfcommandoutput.txt")
272272
else
273273
simple.connect(smbshare)
274-
simple.delete("C:\\WINDOWS\\Temp\\msfcommandoutput.txt")
274+
simple.delete("%WINDIR%\\Temp\\msfcommandoutput.txt")
275275
end
276276

277277
rescue ::Interrupt

0 commit comments

Comments
 (0)