Created
February 25, 2017 21:35
-
-
Save AkdM/df346b6ad4111e7d47fa33f87b982fda to your computer and use it in GitHub Desktop.
Not-perfect-at-all bash script to check if websites use Cloudflare (Cloudbleed) by providing a list
This file contains 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 | |
# | |
# To use: | |
# ./cloudflare_check.sh list.csv | |
# ./cloudflare_check.sh urls.txt | |
# | |
# I made this to check my 1Password logins. | |
# You can export all of your logins by going into | |
# File > Export > All Items | |
# http://i.imgur.com/orMuAob.jpg | |
filename="$1" | |
text_bold=$(tput bold) | |
text_red=$(tput setaf 1) | |
text_green=$(tput setaf 2) | |
text_normal=$(tput sgr0) | |
while read -r line | |
do | |
url=$(grep -oE '[[:alnum:]]+[.][[:alnum:]_.-]+' <<< $line | sed 's/www.//') | |
if ! [[ -z "$url" ]]; then | |
if $(dig $url +short | head -n1 | xargs -- whois | grep -m1 cloudflare > /dev/null); then | |
printf "$url ${text_bold}${text_red}uses Cloudflare.${text_normal} \n" | |
fi | |
fi | |
done < "$filename" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment