Skip to content

Commit

Permalink
Make timeout user configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Takahiro-Yoko committed Sep 5, 2024
1 parent afb8c6c commit dc81711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ compilation on target, False will upload a precompiled binary. AUTO will favor
but will fall back to the precompiled option if a compiler cannot be found.
The default value is `Auto`

### TIMEOUT (required)

This is the amount of time (in seconds) that the module will wait for the payload to be
executed. Defaults to 60 seconds.

### WritableDir (required)
This indicates the location where you would like the payload and exploit binary stored, as well
as serving as a location to store the various files and directories created by the exploit itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def initialize(info = {})
)
)
register_options([
OptEnum.new('COMPILE', [ true, 'Compile on target', 'Auto', ['Auto', 'True', 'False']])
OptEnum.new('COMPILE', [ true, 'Compile on target', 'Auto', ['Auto', 'True', 'False']]),
OptInt.new('TIMEOUT', [ true, 'Timeout for exploit (seconds)', '60' ])
])
register_advanced_options([
OptString.new('WritableDir', [ true, 'A directory where we can write files', '/tmp' ])
Expand Down Expand Up @@ -137,9 +138,8 @@ def exploit
register_file_for_cleanup(payload_path)

# Launch exploit
timeout = 30
print_status('Launching exploit...')
cmd_exec("echo '#{payload_path} & exit' | #{exploit_dir}/cve-2023-0386", nil, timeout)
cmd_exec("echo '#{payload_path} & exit' | #{exploit_dir}/cve-2023-0386", nil, datastore['TIMEOUT'])
end

def get_exploit(exploit_dir)
Expand Down

0 comments on commit dc81711

Please sign in to comment.