Skip to content

Commit dc81711

Browse files
committed
Make timeout user configurable
1 parent afb8c6c commit dc81711

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

documentation/modules/exploit/linux/local/cve_2023_0386_overlayfs_priv_esc.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ compilation on target, False will upload a precompiled binary. AUTO will favor
4848
but will fall back to the precompiled option if a compiler cannot be found.
4949
The default value is `Auto`
5050

51+
### TIMEOUT (required)
52+
53+
This is the amount of time (in seconds) that the module will wait for the payload to be
54+
executed. Defaults to 60 seconds.
55+
5156
### WritableDir (required)
5257
This indicates the location where you would like the payload and exploit binary stored, as well
5358
as serving as a location to store the various files and directories created by the exploit itself.

modules/exploits/linux/local/cve_2023_0386_overlayfs_priv_esc.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def initialize(info = {})
6767
)
6868
)
6969
register_options([
70-
OptEnum.new('COMPILE', [ true, 'Compile on target', 'Auto', ['Auto', 'True', 'False']])
70+
OptEnum.new('COMPILE', [ true, 'Compile on target', 'Auto', ['Auto', 'True', 'False']]),
71+
OptInt.new('TIMEOUT', [ true, 'Timeout for exploit (seconds)', '60' ])
7172
])
7273
register_advanced_options([
7374
OptString.new('WritableDir', [ true, 'A directory where we can write files', '/tmp' ])
@@ -137,9 +138,8 @@ def exploit
137138
register_file_for_cleanup(payload_path)
138139

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

145145
def get_exploit(exploit_dir)

0 commit comments

Comments
 (0)