File tree Expand file tree Collapse file tree 8 files changed +14
-12
lines changed Expand file tree Collapse file tree 8 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ def run_host(ip)
77
77
78
78
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
79
79
80
+ if ports . empty?
81
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
82
+ end
83
+
80
84
ports . each_with_index do |port , i |
81
85
p . tcp_dst = port
82
86
p . tcp_src = rand ( 64511 ) +1024
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ def run_host(target_host)
56
56
dead = false
57
57
portlist = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
58
58
59
+ if portlist . empty?
60
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
61
+ end
62
+
59
63
vprint_status ( "[#{ rhost } ] Verifying manual testing is not required..." )
60
64
61
65
manual = false
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ def run_batch(hosts)
50
50
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
51
51
52
52
if ports . empty?
53
- print_error ( "Error: No valid ports specified" )
54
- return
53
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
55
54
end
56
55
57
56
to = ( datastore [ 'TIMEOUT' ] || 500 ) . to_f / 1000.0
Original file line number Diff line number Diff line change @@ -43,8 +43,7 @@ def run_host(ip)
43
43
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
44
44
45
45
if ports . empty?
46
- print_error ( "Error: No valid ports specified" )
47
- return
46
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
48
47
end
49
48
50
49
datastore [ 'RHOST' ] = datastore [ 'BOUNCEHOST' ]
Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ def run_batch(hosts)
48
48
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
49
49
50
50
if ports . empty?
51
- print_error ( "Error: No valid ports specified" )
52
- return
51
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
53
52
end
54
53
55
54
to = ( datastore [ 'TIMEOUT' ] || 500 ) . to_f / 1000.0
Original file line number Diff line number Diff line change @@ -41,8 +41,7 @@ def run_host(ip)
41
41
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
42
42
43
43
if ports . empty?
44
- print_error ( "Error: No valid ports specified" )
45
- return
44
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
46
45
end
47
46
48
47
while ( ports . length > 0 )
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ def run_batch(hosts)
50
50
ports = Rex ::Socket . portspec_crack ( datastore [ 'PORTS' ] )
51
51
52
52
if ports . empty?
53
- print_error ( "Error: No valid ports specified" )
54
- return
53
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
55
54
end
56
55
57
56
to = ( datastore [ 'TIMEOUT' ] || 500 ) . to_f / 1000.0
Original file line number Diff line number Diff line change @@ -282,8 +282,7 @@ def run_host(ip)
282
282
ports = build_sap_ports ( ports )
283
283
284
284
if ports . empty?
285
- print_error ( 'Error: No valid ports specified' )
286
- return
285
+ raise Msf ::OptionValidateError . new ( [ 'PORTS' ] )
287
286
end
288
287
289
288
print_status ( "Scanning #{ ip } " )
You can’t perform that action at this time.
0 commit comments