diff options
Diffstat (limited to 'cron-sh/promisc_check.sh')
-rwxr-xr-x | cron-sh/promisc_check.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cron-sh/promisc_check.sh b/cron-sh/promisc_check.sh new file mode 100755 index 0000000..fa5b538 --- /dev/null +++ b/cron-sh/promisc_check.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +if [ -f /etc/security/msec/security.conf ]; then + . /etc/security/msec/security.conf +else + exit 1 +fi + +PROMISC_CHECK="/usr/bin/promisc_check -q" +# +# Check if a network interface is in promisc check... +# Written by Vandoorselaere Yoann, <yoann@mandrakesoft.com> +# + +LogPromisc() { + Syslog "Security warning : $1 is in promiscuous mode. (sniffer running ?)" + Ttylog "\\033[1;31mSecurity warning : $1 is in promiscuous mode.\\033[0;39m" + Ttylog "\\033[1;31mA sniffer is probably running on your system.\\033[0;39m +} + +if [ -f /etc/security/msec/security.conf ]; then + . /etc/security/msec/security.conf +else + exit 1 +fi + +if [ CHECK_PROMISC == "no" ]; then + exit 0; +fi + +for INTERFACE in `$PROMISC_CHECK`; do + LogPromisc $INTERFACE +done + + + + + + + |