aboutsummaryrefslogtreecommitdiffstats
path: root/cron-sh
diff options
context:
space:
mode:
authorYoann Vandoorselaere <yoann@mandriva.com>1999-12-08 17:16:13 +0000
committerYoann Vandoorselaere <yoann@mandriva.com>1999-12-08 17:16:13 +0000
commit7ed88ddf518e642fd4a95f6f0975ef0425b4bb04 (patch)
tree1e4d4be0539e5dd887e0845508fcd1f560749505 /cron-sh
parentbacd50d1eb33741af74727eb4f59fe39e1cbf523 (diff)
downloadmsec-7ed88ddf518e642fd4a95f6f0975ef0425b4bb04.tar
msec-7ed88ddf518e642fd4a95f6f0975ef0425b4bb04.tar.gz
msec-7ed88ddf518e642fd4a95f6f0975ef0425b4bb04.tar.bz2
msec-7ed88ddf518e642fd4a95f6f0975ef0425b4bb04.tar.xz
msec-7ed88ddf518e642fd4a95f6f0975ef0425b4bb04.zip
*** empty log message ***
Diffstat (limited to 'cron-sh')
-rwxr-xr-xcron-sh/diff_check.sh5
-rwxr-xr-xcron-sh/promisc_check.sh20
2 files changed, 23 insertions, 2 deletions
diff --git a/cron-sh/diff_check.sh b/cron-sh/diff_check.sh
index c69de85..bef14be 100755
--- a/cron-sh/diff_check.sh
+++ b/cron-sh/diff_check.sh
@@ -232,5 +232,8 @@ if [ -s ${TMP} ]; then
date=`date`
echo -n "\n\n*** ${date} ***\n" >> ${SECURITY_LOG}
cat ${TMP} >> ${SECURITY_LOG}
- rm -f ${TMP}
+fi
+
+if [ -f ${TMP} ]; then
+ rm -f ${TMP}
fi
diff --git a/cron-sh/promisc_check.sh b/cron-sh/promisc_check.sh
index 6caada9..10110b4 100755
--- a/cron-sh/promisc_check.sh
+++ b/cron-sh/promisc_check.sh
@@ -7,6 +7,20 @@ else
exit 1
fi
+Syslog() {
+ if [ "${SYSLOG_WARN}" == "yes" ]; then
+ /sbin/initlog --string="${1}"
+ fi
+}
+
+Ttylog() {
+ if [ "${TTYLOG_WARN}" == "yes" ]; then
+ w | grep -v "load\|TTY" | awk '{print $2}' | while read line; do
+ echo -e "${1}" > /dev/$i
+ done
+ fi
+}
+
PROMISC_CHECK="/usr/bin/promisc_check -q"
#
# Check if a network interface is in promisc check...
@@ -14,9 +28,13 @@ PROMISC_CHECK="/usr/bin/promisc_check -q"
#
LogPromisc() {
- Syslog "Security warning : $1 is in promiscuous mode. (sniffer running ?)"
+ Syslog "Security warning : $1 is in promiscuous mode."
+ Syslog " A sniffer is probably running on your system."
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"
+ echo "Security warning : $1 is in promiscuous mode." >> /var/log/security.log
+ echo " A sniffer is probably running on your system." >> /var/log/security.log
+
}
if [ -f /etc/security/msec/security.conf ]; then