Skip to content

Commit 124a153

Browse files
author
RageLtMan
committed
Clean up powershell exec string
The scriptblock invocation is already coming from Rex, so there's no need to re-wrap the executed code in more of the same.
1 parent 9afdde2 commit 124a153

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/payload/windows/powershell.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def generate_powershell_code(conntype)
5151
executionpolicy: 'bypass'
5252
}
5353
cli = Rex::Powershell::Command.generate_psh_command_line(command_args)
54-
return "#{cli} '&([scriptblock]::create(#{script})'"
54+
return "#{cli} \"#{script}\""
5555
end
5656

5757
def generate

0 commit comments

Comments
 (0)