random

- collection of un-sorted bollocks
git clone git://git.acid.vegas/random.git
Log | Files | Refs | Archive

httpxify (1057B)

      1 #!/bin/sh
      2 # httpx gotify alert - developed by acidvegas (https://git.acid.vegas)
      3 
      4 GOTIFY_URL="https://push.change.me:5000"
      5 GOTIFY_TOKEN="cHaNgEmE"
      6 
      7 send_notification() {
      8 	result=$1
      9 	title=$2
     10 	data=$3
     11 
     12 	HOST=$(cat /etc/hostname)
     13 
     14 	if [ $result -eq 0 ]; then
     15 		status="completed"
     16 	elif [ $result -eq 69 ]; then
     17 		status="initiated"
     18 	elif [ $result -gt 128 ]; then
     19 		status="killed"
     20 	else
     21 		status="error"
     22 	fi
     23 
     24 	message="$title scan on $HOST for $data has changed to $status"
     25 
     26 	curl -X POST "$GOTIFY_URL/message?token=$GOTIFY_TOKEN" -F "title=$title" -F "message=$message" -F "priority=1"
     27 }
     28 
     29 for zone in $(find /mnt/slab/zones -name "*.txt" | shuf); do
     30 	tld=$(basename "$zone" .txt)
     31 	if [ ! -f "/mnt/slab/json/zone.$tld.txt" ]; then
     32 		echo "$tld" > $SCAN_DIR/.last-zone # For debugging purposes
     33 		send_notification 69 "httpx" $tld
     34 		httpx -l "$zone" -t 300 -rl 300 -sc -location -favicon -title -bp -td -ip -cname -mc 200,201,301,302,303,307,308 -fr -stream -sd -j -o "/mnt/slab/json/zone.$tld.txt" -v
     35 		result=$?
     36 		handle_result $result "httpx" $tld
     37 	fi
     38 done