Skip to content

Commit 4028dce

Browse files
committed
Add an input check for datastore option PORTS
If Rex::Socket.portspec_crack returns an empty array, we assume there are no valid ports to test, so we raise an OptionValidateError to warn the user about it.
1 parent 24bc109 commit 4028dce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/auxiliary/scanner/misc/poisonivy_control_scanner.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def run_host(ip)
4141

4242
ports = Rex::Socket.portspec_crack(datastore['PORTS'])
4343

44+
if ports.empty?
45+
raise Msf::OptionValidateError.new(['PORTS'])
46+
end
47+
4448
while(ports.length > 0)
4549
t = []
4650
r = []

0 commit comments

Comments
 (0)