diff --git a/tests/p_nmap/nmap_test_eth0.sh b/tests/p_nmap/nmap_test_eth0.sh new file mode 100755 index 0000000..df24b90 --- /dev/null +++ b/tests/p_nmap/nmap_test_eth0.sh @@ -0,0 +1,15 @@ +#!/bin/sh +# Author: Christoph Galuschka + +t_Log "Running $0 - nmap querys eth0 and checks for open ssh-port" + +# Grabing IP of eth0 +IP=$(ip -f inet addr list eth0 | grep 'inet ') +regex='.*inet\ (.*)\/.*' +if [[ $IP =~ $regex ]] + then + t_Log "Found eth0 IP - starting nmap test" + nmap ${BASH_REMATCH[1]} | grep -iq ssh +fi + +t_CheckExitStatus $?