├── README.md ├── cloudcheck.png ├── cloudcheck.sh └── custom.ans /README.md: -------------------------------------------------------------------------------- 1 | # Cloudcheck 2 | 3 | Cloudcheck is made to be used in the same folder as [CloudFail](https://github.com/m0rtem/CloudFail "CloudFail"). Make sure all files in this repo are in the same folder before using. 4 | 5 | Also create a empty text file called none.txt in the data folder, that way it doesn't do a subdomain brute when testing. 6 | 7 | Cloudcheck will automatically change your hosts file, using entries from CloudFail and test for a specified string to detect if said entry can be used to bypass Cloudflare. 8 | 9 | If output comes out to be "True", you can use the IP address to bypass Cloudflare in your hosts file. (Later automating this process) 10 | 11 | Example: 12 | ![](https://raw.githubusercontent.com/ANK1036Official/Cloudcheck/master/cloudcheck.png) 13 | -------------------------------------------------------------------------------- /cloudcheck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ANK1036Official/Cloudcheck/84ab13543c68d3c925335cc1f3e9c45f9129c685/cloudcheck.png -------------------------------------------------------------------------------- /cloudcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -eq 0 ]]; then 4 | scriptname=$(basename "$0") 5 | echo "Usage: $scriptname 'http://target.site/' 'This text is on the webpage'" 6 | exit 1 7 | fi 8 | 9 | 10 | 11 | ## TOOL CHECK ## 12 | command -v python3 >/dev/null 2>&1 || { echo >&2 "I require python3 but it's not installed. Aborting."; exit 1; } 13 | command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; } 14 | command -v grep >/dev/null 2>&1 || { echo >&2 "I require grep but it's not installed. Aborting."; exit 1; } 15 | command -v gethostip >/dev/null 2>&1 || { echo >&2 "I require syslinux-utils but it's not installed. Aborting."; exit 1; } 16 | command -v sed >/dev/null 2>&1 || { echo >&2 "I require sed but it's not installed. Aborting."; exit 1; } 17 | ################## 18 | 19 | 20 | 21 | cat custom.ans 22 | echo 'Cloudcheck V1' 23 | echo '' ; echo "Reminder: Make sure your /etc/hosts file has a extra empty line at the end, else this tool may not work!" ; echo '' 24 | TARGET_UNSTRIPPED=$1 25 | COMPARESTRING=$2 26 | STRIPPED_TARGET=$(echo $TARGET_UNSTRIPPED | sed 's/^http\(\|s\):\/\///g' | sed 's#/*$##;s#^/*##') 27 | TESTSTRING="__cf" 28 | echo -e "Original cookies: \e[1;49;37m"$(curl -A 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' -k --max-time 10 -s -c - "$TARGET_UNSTRIPPED" | grep -E -iao "#HTTPONLY.*")"\e[0m" 29 | for check in $(python3 cloudfail.py -t $STRIPPED_TARGET -s none.txt | grep -F -a "FOUND:" | grep -F -iav "ON CLOUDFLARE" | cut -d ' ' -f 3 | grep -E -ia "([0-9]{1,3}[\.]){3}[0-9]{1,3}"); do 30 | echo "$check $STRIPPED_TARGET" >> /etc/hosts 31 | trap ctrl_c INT 32 | function ctrl_c() { 33 | echo "CTRL_C caught, removing last check from hosts..." 34 | sed -i '$d' /etc/hosts 35 | echo "Stopping..." 36 | exit 1 37 | } 38 | HOSTCHECK=$(gethostip -d $STRIPPED_TARGET) 39 | if [[ $HOSTCHECK == $check ]]; then 40 | echo -e "\e[1;49;37mHost check: $STRIPPED_TARGET = \e[1;49;33m$check\e[0m" 41 | DATA=$(curl -A 'Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0' -k --max-time 10 -s -c - "$TARGET_UNSTRIPPED") 42 | COOKIEDATA=$(echo $DATA | grep -E -iao "#HTTPONLY.*") 43 | if [[ $DATA =~ ^"# Netscape HTTP Cookie File" ]]; then 44 | echo -e "\e[1;49;33m$check \e[1;49;37m-- \e[1;49;91mFalse\e[0m" 45 | else 46 | grep -aiq "$COMPARESTRING" <<< $DATA && printf "\e[1;49;33m$check\e[1;49;37m contains comparestring -- \e[0m" 47 | if $(echo "$COOKIEDATA" | grep -iaq "$TESTSTRING"); then 48 | printf "\e[1;49;91mFalse\e[0m\n" 49 | else 50 | printf "\e[1;49;96mTrue\e[0m\n" 51 | fi 52 | fi 53 | sed -i '$d' /etc/hosts 54 | else 55 | exit 1 56 | fi 57 | done 58 | -------------------------------------------------------------------------------- /custom.ans: -------------------------------------------------------------------------------- 1 |                                          ..',;;;;,,..                                  2 |                                     ..',::::::::::::::;'.                               3 |                                   .';::::::::::::::::::::::;.                           4 |                                .,::::::::::::::::::::::::::::'                          5 |                              '::::::::::::::::::::::::::::::::'                        6 |                              .;::::::::::::::::::::::::::::::::::;.                      7 |                 ....... .;::::::::::::::::::::::::::::::::::::;                       8 |                .,::::::::;,;::::::::::::::::::::::::::::::::::::::;                     9 |              .:::::::::::::::::::::::::::::::::::::::::::::::::::::.               10 |              ':::::::::::::::::::::::::::::::::::::::::::::::::::::,  '''''....         11 |             :::::::::::::::::::::::::::::::::::::::::::::::::::::; .''''''''''..      12 |            ::::::::::::::::::::::::::::::::::::::::::::::::::::;. .''''''''''''''.     13 |       ..'',:::::::::::::::::::::::::::::::::::::::::::::::::::'  .''''''''''''''''.    14 |    .;::::::::::::::::::::::::::::::::::::::::::::::::::::::,.     .''''''''''''''''. 15 |   '::::::::::::::::::::;,''''''''''''''''''................        ..........''''''. 16 | .;:::::::::::::::::::::'..................................         ........'''''''. 17 | .;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::;.    ..'''''''''''''''''''. 18 | ,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::. .''''''''''''''''''''''' 19 | ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::.  .'''''''''''''''''''''''. 20 | ,;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::, '''''''''''''''''''''''''. 21 |  ,lll,.  :oooc. .;ooooooooc,,;lo:...':oooc;,,coooooooo;.   'lol'   'loooo, 22 |              loo.     co;.loo,     .      ..     ;oo. :oo      ;o,     .ooo;            23 |              'ol      co, :o:                     .o:  .:;      ,o.      ...              24 |              .o:      .'  ;o.                      l,           ,o.                       25 |               o:          :l                       l;           ,o.                       26 |               l:         cl                      .oc           co.                      27 |               lc         lo.                      ,'           oo;                      28 |              .oo.                                               ..                        29 |              .oo'                                                                         30 |               lo.                                                                         31 | --------------------------------------------------------------------------------