bin/nmap_ssh

17 lines
520 B
Plaintext
Raw Normal View History

2022-11-24 07:24:12 +01:00
#!/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