You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
469 B
21 lines
469 B
12 months ago
|
#!/bin/sh
|
||
|
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
|
||
|
|
||
|
t_Log "Running $0 - nmap querys eth0 and checks for open ssh-port"
|
||
|
|
||
|
if [ "$CONTAINERTEST" -eq "1" ]; then
|
||
|
t_Log "Running in container -> SKIP"
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
# 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 $?
|