Very simple single port scanner
This commit is contained in:
parent
4085bd8a4c
commit
46c57f4ac1
23
port.sh
Normal file → Executable file
23
port.sh
Normal file → Executable file
|
@ -1 +1,22 @@
|
|||
#
|
||||
#!/bin/bash
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "You must specify a filename to read from"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f "$1" ]
|
||||
then
|
||||
echo "File $1 does not exist or is not a file"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
echo "Please, specify a port"
|
||||
exit 1
|
||||
fi
|
||||
while read ip n
|
||||
do
|
||||
nc -z -v -w1 "$ip" "$2"
|
||||
|
||||
# [[ -z "$resolvedIP" ]] && echo "$ip" lookup failure || echo "$ip" resolved to "$resolvedIP"
|
||||
done < $1
|
||||
|
|
Loading…
Reference in New Issue
Block a user