Skip to content

Commit 4a13b09

Browse files
committed
Land rapid7#19719, Fix bug in fetch payload when FETCH_DELETE set to true
2 parents 703ed44 + 0334109 commit 4a13b09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ def _execute_win
202202
end
203203

204204
def _execute_nix
205-
cmds = "; chmod +x #{_remote_destination_nix}"
206-
cmds << "; #{_remote_destination_nix} &"
207-
cmds << ";rm -rf #{_remote_destination_nix}" if datastore['FETCH_DELETE']
205+
cmds = ";chmod +x #{_remote_destination_nix}"
206+
cmds << ";#{_remote_destination_nix}&"
207+
cmds << "sleep #{rand(3..7)};rm -rf #{_remote_destination_nix}" if datastore['FETCH_DELETE']
208208
cmds
209209
end
210210

0 commit comments

Comments
 (0)