Skip to content

Instantly share code, notes, and snippets.

@AkdM
Created February 25, 2017 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkdM/df346b6ad4111e7d47fa33f87b982fda to your computer and use it in GitHub Desktop.
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
#!/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