Skip to content

Commit 205276c

Browse files
committed
Update modules/auxiliary/admin/smb/psexec_command.rb
Fixed static path to Windows directory. This causes problems with directory is 'WINNT' for example.
1 parent e7c80b9 commit 205276c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/auxiliary/admin/smb/psexec_command.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ def initialize(info = {})
4545
OptString.new('SMBSHARE', [true, 'The name of a writeable share on the server', 'C$']),
4646
OptString.new('COMMAND', [true, 'The command you want to execute on the remote host', 'net group "Domain Admins" /domain']),
4747
OptString.new('RPORT', [true, 'The Target port', 445]),
48+
OptString.new('WINPATH', [true, 'The name of the remote Windows directory', 'WINDOWS']),
4849
], self.class)
4950

5051
deregister_options('RHOST')
5152
end
5253

5354
# This is the main controle method
5455
def run_host(ip)
55-
text = "\\WINDOWS\\Temp\\#{Rex::Text.rand_text_alpha(16)}.txt"
56+
text = "\\#{datastore['WINPATH']}\\Temp\\#{Rex::Text.rand_text_alpha(16)}.txt"
5657
bat = "%WINDIR%\\Temp\\#{Rex::Text.rand_text_alpha(16)}.bat"
5758
smbshare = datastore['SMBSHARE']
5859

0 commit comments

Comments
 (0)