Skip to content

Commit c66777d

Browse files
committed
Merge branch 'command' of git://github.com/R3dy/metasploit-framework into R3dy-command
2 parents bf47eaa + 205276c commit c66777d

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,6 +45,7 @@ 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')
@@ -56,7 +57,7 @@ def peer
5657

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

0 commit comments

Comments
 (0)