Añadir 'adblock_test.sh'
This commit is contained in:
parent
1d7673d803
commit
7273512de4
41
adblock_test.sh
Normal file
41
adblock_test.sh
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/bash
|
||||||
|
RED='\033[1;31m'
|
||||||
|
GREEN='\033[1;32m'
|
||||||
|
BLUE='\033[1;35m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m'
|
||||||
|
ip_to_find="0.0.0.0"
|
||||||
|
blocked=0
|
||||||
|
rojo(){
|
||||||
|
echo -e "${RED}$1${NC}"
|
||||||
|
}
|
||||||
|
amarillo(){
|
||||||
|
echo -e "${YELLOW}$1${NC}"
|
||||||
|
}
|
||||||
|
verde(){
|
||||||
|
echo -e "${GREEN}$1${NC}"
|
||||||
|
}
|
||||||
|
azul(){
|
||||||
|
echo -e "${BLUE}$1${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
dns="127.0.0.1"
|
||||||
|
else
|
||||||
|
dns=$1
|
||||||
|
fi
|
||||||
|
domains=$(curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts | shuf -n 10 | cut -d" " -f2)
|
||||||
|
for j in $domains; do
|
||||||
|
echo -e "${YELLOW}$j${NC}:"
|
||||||
|
output=$(dig @$dns $j +short)
|
||||||
|
if [[ "$output" == *"$ip_to_find"* ]]; then
|
||||||
|
verde $output
|
||||||
|
((blocked++))
|
||||||
|
else
|
||||||
|
rojo $output
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
|
done;
|
||||||
|
porcentaje=$(( blocked * 10 ))
|
||||||
|
azul "$porcentaje % dominios bloqueados"
|
Loading…
Reference in New Issue
Block a user