From 8f72ef87fe26049b1edbc51e5f3154272891eee9 Mon Sep 17 00:00:00 2001 From: Athmane Madjoudj Date: Jul 15 2012 19:53:09 +0000 Subject: Readd nmap test on eth0 --- 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 $?