Skip to content

Instantly share code, notes, and snippets.

@funsecurity
Created November 13, 2017 18:45
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 funsecurity/f7e6b5df844cb5407f30e81b33245ad9 to your computer and use it in GitHub Desktop.
Save funsecurity/f7e6b5df844cb5407f30e81b33245ad9 to your computer and use it in GitHub Desktop.
Monitoring and get all the IP's of a Fast Flux domain and scan with nmap
#!/bin/bash
# cd
# mkdir domain.com
# cd domain.com
# mkdir nmap
# add crontab job every minute:
# * * * * * /home/user/fast-flux-scanner.sh domain.com /home/user/domain.com >/dev/null 2>&1
domain=$1
path_job=$2
cd "$path_job"
hosts=$(host -t A "$domain" | awk '{print $4}')
echo "$hosts" >> hosts_history.txt
hosts_uniq=$(cat hosts_history.txt | sort | uniq)
echo "$hosts_uniq" > hosts_history.txt
while read line; do
ls "nmap/$line" &>/dev/null
if [ $? -eq 0 ] ; then
echo "nmap ok"
else
nohup nmap -v -sT -T4 -Pn -p- -A -oN "nmap/$line" "$line" &
fi
done <<< "$hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment