Skip to content

Commit 4c87b1b

Browse files
committed
escape ticks and spaces in paths
1 parent d79a3c8 commit 4c87b1b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/msf/core/exploit/mixins.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: binary -*-
2-
# $Id: mixins.rb 16142 2012-11-30 19:45:04Z rapid7 $
2+
# $Id$
33
#
44
# All exploit mixins should be added to the list below
55
#

lib/rex/exploitation/cmdstager/bourne.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def initialize(exe)
2121

2222
def generate(opts = {})
2323
opts[:temp] = opts[:temp] || '/tmp/'
24+
opts[:temp] = opts[:temp].gsub(/'/, "\\\\'")
25+
opts[:temp] = opts[:temp].gsub(/ /, "\\ ")
2426
super
2527
end
2628

0 commit comments

Comments
 (0)