Skip to content

Instantly share code, notes, and snippets.

@guim1111
Created December 18, 2019 11:11
Show Gist options
  • Save guim1111/f6df24d35d9449845767186005bef0ec to your computer and use it in GitHub Desktop.
Save guim1111/f6df24d35d9449845767186005bef0ec to your computer and use it in GitHub Desktop.
Combined with my "checkUpIps.sh", not fully finished but work well (not performed "resume" function to restart nmap interrupted)
#!/bin/bash
#arguments are <ip range to set name to a folder> <csv (',' separator) with all ip you want>
#you can use this script with a csv generated by checkUpIps.sh
#organize nmap outputs inside a folder, show output console to know for what ip is going inside the csv
#./nmapAutomated.sh 192.158.2.0 example.csv
namefolder='nmap'$(echo $1 | tr . -)
mkdir -p $namefolder
while IFS="," read col1
do
namefile='result'$(echo $col1 | tr . -)'.txt'
echo "----Is performing a scan to "$col1
sudo nmap -sV -f -p- $col1 > $namefolder/$namefile
echo "----Scan ended for "$col1
done < $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment