Last active
June 7, 2019 10:56
-
-
Save caveatlector/1273d5095dc05e77cb916abea7c0c08e to your computer and use it in GitHub Desktop.
nmap: TCP/UDP port scan array of IPs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Requires: nmap | |
TIMESTAMP=$(date +"%Y%m%d%M") | |
TARGETS=( ) # E.g. TARGETS=( 1.0.0.1 1.1.1.1 ) | |
for TARGET in "${TARGETS[@]}" | |
do | |
echo "Begin scan: ${TARGET}" | tee -a nmap_${TIMESTAMP}.log | |
# -sT: scan TCP, -sU: scan UDP, -p0-65535: scan ports 0-65535, -v: verbose; -Pn can be added to scan even when unresponsive to nmap "ping" | |
nmap -p0-65535 -sT -sU -v ${TARGET} | tee -a nmap_${TIMESTAMP}.log | |
echo "End scan: ${TARGET}" | tee -a nmap_${TIMESTAMP}.log | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment