Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2017 18:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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
# cd
# mkdir
# cd
# mkdir nmap
# add crontab job every minute:
# * * * * * /home/user/ /home/user/ >/dev/null 2>&1
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"
nohup nmap -v -sT -T4 -Pn -p- -A -oN "nmap/$line" "$line" &
done <<< "$hosts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment