Add timeout option
This commit is contained in:
parent
cff91ee096
commit
73371e9f9c
3
msfvenom
3
msfvenom
|
@ -168,7 +168,7 @@ def parse_args(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
opt.on('-t', '--timeout <second>', Integer, "The number of seconds to timeout when reading payload from STDIN (30s as default).") do |x|
|
opt.on('-t', '--timeout <second>', Integer, "The number of seconds to timeout when reading payload from STDIN (30s as default).") do |x|
|
||||||
opts[:timeout] = x || 30
|
opts[:timeout] = x
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,6 +206,7 @@ def parse_args(args)
|
||||||
if opts[:payload] == 'stdin' and not opts[:list]
|
if opts[:payload] == 'stdin' and not opts[:list]
|
||||||
$stderr.puts "Attempting to read payload from STDIN..."
|
$stderr.puts "Attempting to read payload from STDIN..."
|
||||||
begin
|
begin
|
||||||
|
opts[:timeout] ||= 30
|
||||||
::Timeout.timeout(opts[:timeout]) do
|
::Timeout.timeout(opts[:timeout]) do
|
||||||
opts[:stdin] = payload_stdin
|
opts[:stdin] = payload_stdin
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue