From dbd5937dc7221a944ec30378e121fcf5c7e075e2 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 11 Nov 2014 13:21:09 -0600 Subject: [PATCH] Limit threads to 1 when CPORT is set, closes #4170 This issue also applies to TCP scanner modules. --- lib/msf/core/auxiliary/scanner.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/auxiliary/scanner.rb b/lib/msf/core/auxiliary/scanner.rb index d428daa6a1..856b7bfddc 100644 --- a/lib/msf/core/auxiliary/scanner.rb +++ b/lib/msf/core/auxiliary/scanner.rb @@ -59,9 +59,15 @@ def run @tl = [] # - # Sanity check threading on different platforms + # Sanity check threading given different conditions # + if datastore['CPORT'].to_i != 0 && threads_max > 1 + print_error("Warning: A maximum of one thread is possible when a source port is set (CPORT)") + print_error("Thread count has been adjusted to 1") + threads_max = 1 + end + if(Rex::Compat.is_windows) if(threads_max > 16) print_error("Warning: The Windows platform cannot reliably support more than 16 threads")