Skip to content

Commit dbd5937

Browse files
author
HD Moore
committed
Limit threads to 1 when CPORT is set, closes rapid7#4170
This issue also applies to TCP scanner modules.
1 parent 96ba6da commit dbd5937

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/msf/core/auxiliary/scanner.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,15 @@ def run
5959
@tl = []
6060

6161
#
62-
# Sanity check threading on different platforms
62+
# Sanity check threading given different conditions
6363
#
6464

65+
if datastore['CPORT'].to_i != 0 && threads_max > 1
66+
print_error("Warning: A maximum of one thread is possible when a source port is set (CPORT)")
67+
print_error("Thread count has been adjusted to 1")
68+
threads_max = 1
69+
end
70+
6571
if(Rex::Compat.is_windows)
6672
if(threads_max > 16)
6773
print_error("Warning: The Windows platform cannot reliably support more than 16 threads")

0 commit comments

Comments
 (0)