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
|
From: Richard Lewis <richard.lewis.debian@googlemail.com>
Date: Thu, 17 Oct 2024 22:14:49 +0100
Subject: chkrootkit: chk_ps
Forwarded: yes
(Forwarded by email: 21 Dec 2024)
---
chkrootkit | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/chkrootkit b/chkrootkit
index 5cac4e3..f6d8ad4 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -1812,18 +1812,21 @@ chk_ps () {
STATUS=${NOT_INFECTED}
PS_I_L="/dev/xmx|\.1proc|/dev/ttyop|/dev/pty[pqrsx]|/dev/cui|/dev/hda[0-7]|\
/dev/hdp|/dev/cui220|/dev/dsx|w0rm|/dev/hdaa|duarawkz|/dev/tux|/security|^proc\.h|ARRRGH\.so"
- CMD=`loc ps ps $pth`
+ CMD=$(loc ps ps "$pth")
+ if [ "${?}" -ne 0 ]; then
+ return "${NOT_FOUND}"
+ fi
if [ "${EXPERT}" = "t" ]; then
expertmode_output "${strings} -a ${CMD}"
return 5
fi
- if ${strings} -a ${CMD} | ${egrep} "${PS_I_L}" >/dev/null 2>&1
+ if "${strings}" -a "${CMD}" | ${egrep} "${PS_I_L}" >/dev/null 2>&1
then
STATUS=${INFECTED}
fi
- return ${STATUS}
+ return "${STATUS}"
}
chk_pstree () {
|