bin/nmap_ssh
2022-11-24 00:24:12 -06:00

17 lines
520 B
Bash
Executable File

#!/usr/bin/env bash
# Use nmap from podman to check for open SSH ports on local subnet.
if test -x "$(command -v podman)"; then
if sudo podman image exists localhost/nmap; then
sudo podman run -it --rm \
--cap-add=NET_RAW \
--cap-add=NET_ADMIN \
--network host \
--name nmap \
nmap -sV -p 22 -open 10.0.0.0/24
else
echo "localhost/nmap image does not exist"
echo "Build it from github.com/hyperreal64/containerfiles"
fi
fi