You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
440 B
Bash

#!/bin/sh
ip="$1"
if [ -z "$ip" ]; then
echo "usage: scan <ip>"
exit 1
fi
ports=$(nmap -p- --min-rate=1000 -T4 "$ip" | \
grep ^[0-9] | \
cut -d '/' -f 1 | \
tr '\n' ',' | \
sed s/,$// \
)
if [ -z "$ports" ]; then
echo "No host (or ports) found."
exit 0
fi
# For a full list of all script run by -sC:
# <https://nmap.org/nsedoc/categories/default.html>
nmap -v -sC -sV -p$ports "$ip" | tee nmap.out