1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Add more normalization to temporary directory

This commit is contained in:
William Vu 2015-12-03 11:37:02 -06:00
parent 98b3919e94
commit aa9969c81a

View File

@ -18,6 +18,8 @@ class CmdStagerBourne < CmdStagerBase
def generate(opts = {})
opts[:temp] = opts[:temp] || '/tmp/'
opts[:temp] = opts[:temp].empty?? opts[:temp] : opts[:temp] + '/'
opts[:temp] = opts[:temp].gsub(/\/{2,}/, '/')
opts[:temp] = opts[:temp].gsub(/'/, "\\\\'")
opts[:temp] = opts[:temp].gsub(/ /, "\\ ")
if (opts[:file])