diff --git a/scan_lists.cc b/scan_lists.cc index a9b8993cc..e9092b3e9 100644 --- a/scan_lists.cc +++ b/scan_lists.cc @@ -409,21 +409,33 @@ static void getpts_aux(const char *origexpr, int nested, u8 *porttbl, int range_ if (*current_range == 'T' && *(current_range+1) == ':') { current_range += 2; range_type = SCAN_TCP_PORT; + if (!o.TCPScan()) { + error("WARNING: Your ports include \"T:\" but you haven't specified any TCP scan type."); + } continue; } if (*current_range == 'U' && *(current_range+1) == ':') { current_range += 2; range_type = SCAN_UDP_PORT; + if (!o.UDPScan()) { + error("WARNING: Your ports include \"U:\" but you haven't specified UDP scan with -sU."); + } continue; } if (*current_range == 'S' && *(current_range+1) == ':') { current_range += 2; range_type = SCAN_SCTP_PORT; + if (!o.SCTPScan()) { + error("WARNING: Your ports include \"S:\" but you haven't specified any SCTP scan type."); + } continue; } if (*current_range == 'P' && *(current_range+1) == ':') { current_range += 2; range_type = SCAN_PROTOCOLS; + if (!o.ipprotscan) { + error("WARNING: Your ports include \"P:\" but you haven't specified IP Protocol scan with -sO."); + } continue; } }