1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
From: Stefano Torricella <stetor@y2k.it>
Date: Thu, 6 May 2010 12:34:31 +0200
Subject: chkrootkit: sniffer
filter ifpromisc output (using -s option)
Other minor cleanups from Richard Lewis <richard.lewis.debian@googlemail.com>
Do not issue a 'WARNING' if sniffer/ifpromisc finds nothing
Date: Sat, 8 Jun 2024 20:26:05 +0100
Last-Updated: 2024-06-08
Forwarded: yes
(Forwarded by email: 21 Dec 2024)
---
chkrootkit | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/chkrootkit b/chkrootkit
index d1d84e4..9f2d0b4 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -186,12 +186,13 @@ asp (){
sniffer () {
if [ "${ROOTDIR}" != "/" ]; then
- echo "not tested"
- return ${NOT_TESTED}
+ _not_tested
+ return "${NOT_TESTED}"
fi
if [ "$SYSTEM" = "SunOS" ]; then
- return ${NOT_TESTED}
+ _not_tested
+ return "${NOT_TESTED}"
fi
if [ "${EXPERT}" = "t" ]; then
@@ -199,10 +200,25 @@ sniffer () {
return 5
fi
if [ ! -x ./ifpromisc ]; then
- echo "not tested: can't exec ./ifpromisc"
- return ${NOT_TESTED}
+ _warn "sniffer not tested: can't exec ./ifpromisc"
+ return "${NOT_TESTED}"
else
- [ "${QUIET}" != "t" ] && ./ifpromisc -v || ./ifpromisc -q
+ status=0
+ if [ "${QUIET}" != "t" ]; then
+ outmsg=$(./ifpromisc -v 2>&1)
+ status=$?
+ else
+ outmsg=$(./ifpromisc -q 2>&1)
+ status=$?
+ fi
+ if [ "$status" = 0 ]; then
+ _not_found
+ else
+ if [ -n "$EXCLUDES_SNIF" ]; then
+ outmsg=$(echo "$outmsg" | ${egrep} -v "$EXCLUDES_SNIF")
+ fi
+ _report "Output from ifpromisc" "$outmsg"
+ fi
fi
}
|