fastfire / deepdarkCTI

Collection of Cyber Threat Intelligence sources from the deep and dark web
GNU General Public License v3.0
4.07k stars 730 forks source link

Updated URLs STATUS #470

Closed okno closed 1 year ago

okno commented 1 year ago

Updated Search Engines URLs STATUS with bash script: #!/bin/bash

okno - Pawel Zorzan Urban - https://pawelzorzan.com

Controlla che TOR sia in esecuzione

tor_running=$(ps aux | grep -c "[t]or")

if [ $tor_running -eq 0 ]; then echo "TOR non è in esecuzione" exit 1 fi

Verifica la presenza del file di input e il suo contenuto if [ $# -eq 0 ]; then

echo "Usage: $0 " exit 1 fi

if [ ! -f $1 ]; then echo "Il file di input non esiste" exit 1 fi

Funzione per verificare se l'URL è raggiungibile function is_online {

curl --socks5-hostname 127.0.0.1:9050 --head --silent --fail $1 > /dev/null if [ $? -eq 0 ]; then echo "ONLINE" else echo "OFFLINE" fi }

Loop attraverso il file di input e verifica ogni URL while read url; do

title=$(curl --silent $url | grep -Eo "[^<]+" | sed -E 's/<(\/)?title>//g') status=$(is_online $url) echo "|$title|$status|" >> URL_ok.txt done < $1