Skip to content

Commit abd4ab5

Browse files
committed
Edit spaces within the powershell session command
1 parent 20ad2a8 commit abd4ab5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/base/sessions/powershell.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def shell_command(cmd)
5858
buff << res
5959
if buff.match(/#{endm}/)
6060
# if you see the end marker, read the buffer from the start marker to the end and then display back to screen
61-
buff = buff.split(/#{strm}/)[-1]
62-
buff.gsub!(/PS .*>/, '')
61+
buff = buff.split(/#{strm}\r\n/)[-1]
62+
buff.gsub!(/\nPS .*>/, '')
6363
buff.gsub!(/#{endm}/, '')
6464
return buff
6565
end

0 commit comments

Comments
 (0)