@@ -18988,7 +18988,7 @@ nmap_to_plain_file() {
1898818988 local target_fname=""
1898918989 local oneline=""
1899018990 local ip hostdontcare round_brackets ports_specs starttls
18991- local tmp port host_spec protocol dontcare dontcare1
18991+ local tmp port host_spec protocol ssl_hint dontcare dontcare1
1899218992 #FIXME: IPv6 is missing here
1899318993
1899418994 # Ok, since we are here we are sure to have an nmap file. To avoid questions we make sure it's the right format too
@@ -19029,11 +19029,15 @@ nmap_to_plain_file() {
1902919029 while read -r oneline; do
1903019030 # 25/open/tcp//smtp//<banner>/,
1903119031 [[ "$oneline" =~ '/open/tcp/' ]] || continue # no open tcp for this port on this IP --> move on
19032- IFS=/ read -r port dontcare protocol dontcare1 <<< "$oneline"
19033- starttls="$(ports2starttls $port)"
19034- [[ $? -eq 1 ]] && continue # nmap got a port but we don't know how to speak to
19035- [[ "$DEBUG" -ge 1 ]] && echo "${starttls}$host_spec:$port"
19036- echo "${starttls}${host_spec}:${port}" >>"$target_fname"
19032+ IFS=/ read -r port dontcare protocol ssl_hint dontcare1 <<< "$oneline"
19033+ if [[ "$ssl_hint" =~ ^(ssl|https) ]] || [[ "$dontcare1" =~ ^(ssl|https) ]]; then
19034+ echo "${host_spec}:${port}" >>"$target_fname"
19035+ else
19036+ starttls="$(ports2starttls $port)"
19037+ [[ $? -eq 1 ]] && continue # nmap got a port but we don't know how to speak to
19038+ [[ "$DEBUG" -ge 1 ]] && echo "${starttls}$host_spec:$port"
19039+ echo "${starttls}${host_spec}:${port}" >>"$target_fname"
19040+ fi
1903719041 done < <(tr ',' '\n' <<< "$ports_specs")
1903819042 done < "$FNAME"
1903919043 [[ "$DEBUG" -ge 1 ]] && echo
0 commit comments