Execute openssl using bash for loop -


i have list of ips need check if support tls1.2, , using openssl that. can't seem automate process within bash script. executes on first ip , waits input. read have either add < /dev/null or echo "x" not help. tried:

for in `cat scope`; openssl s_client -tls1_2 -connect $i:443 < /dev/null; done 

or:

for in `cat scope`; echo "x" | openssl s_client -tls1_2 -connect $i:443 < /dev/null; done 

edit: solved, port 443 not open on 2nd ip, that's why waiting.

i advise use nmap instead of s_client check tls handshake (and catch case when port not open).

for in `cat scope`;    if nmap --script ssl-enum-ciphers -p 443 "$i" | grep "tlsv1.2" >/dev/null;      echo "$i supports tlsv1.2"   else     echo "$i doesn't support tlsv1.2"   fi done 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -