Created
October 22, 2014 13:38
-
-
Save Apkawa/c43427cfb17c8cc31f67 to your computer and use it in GitHub Desktop.
Проверка ip домена на некорректный сертификат. (бывает, что в cdn забанены несколько адресов)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true | |
do | |
ip_list=$(dig $1 A |grep -E "^${1}."|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") | |
for ip in $ip_list | |
do | |
check=$(echo -n $(echo "123" | openssl s_client -connect ${ip}:443 2>/dev/null |grep "issuer=/C=RU/ST=Moscow/O="|wc -l)) | |
if [ $check -eq 1 ] | |
then | |
echo $ip | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment