Update bourne.rb

bug/bundler_fix
Tom Sellers 2014-05-29 06:02:30 -05:00
parent 5e33de3e8f
commit 29fc2de39b
1 changed files with 9 additions and 1 deletions

View File

@ -85,7 +85,15 @@ class CmdStagerBourne < CmdStagerBase
def compress_commands(cmds, opts)
# Make it all happen
cmds << "chmod +x #{@tempdir}#{@var_decoded}.bin"
cmds << "#{@tempdir}#{@var_decoded}.bin & sleep 2"
# Background the process, allowing the cleanup code to continue and delete the data
# while allowing the original shell to continue to function since it isn't waiting
# on the payload to exit. The 'sleep' is required as '&' is a command terminator
# and having & and the cmds delimiter ';' next to each other is invalid.
if opts[:background]
cmds << "#{@tempdir}#{@var_decoded}.bin & sleep 2"
else
cmds << "#{@tempdir}#{@var_decoded}.bin"
end
# Clean up after unless requested not to..
if (not opts[:nodelete])