File: chkrootkit-scalper.patch

package info (click to toggle)
chkrootkit 0.58b-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,796 kB
  • sloc: sh: 187,095; ansic: 3,779; makefile: 103
file content (53 lines) | stat: -rw-r--r-- 1,427 bytes parent folder | download
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
From: Lorenzo 'Palinuro' Faletra <palinuro@parrotsec.org>
Date: Thu, 19 Apr 2018 22:57:12 +0200
Subject: chkrootkit: scalper

 Add exception for ser2net in scalper()

Forwarded: yes
 (Forwarded by email: 21 Dec 2024)
---
 chkrootkit | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/chkrootkit b/chkrootkit
index 9284934..955a0c2 100755
--- a/chkrootkit
+++ b/chkrootkit
@@ -132,24 +132,26 @@ slapper (){
 scalper (){
    SCALPER_FILES="${ROOTDIR}tmp/.uua ${ROOTDIR}tmp/.a"
    SCALPER_PORT=2001
-   OPT="-an" 
-   _chk_netstat_or_ss; 
-   [ "$netstat" = "ss" ] && OPT="-a" 
+   OPT="-an"
+   _chk_netstat_or_ss;
    STATUS=0
 
-   if ${netstat} "${OPT}" | ${egrep} "0.0:${SCALPER_PORT} "> /dev/null 2>&1; then
-      STATUS=1
+   if ${netstat} "${OPT}" 2>/dev/null | ${egrep} -q "0.0:${SCALPER_PORT}"; then
+      if ! [ -e /usr/sbin/ser2net ]; then
+        STATUS=1
+      fi
    fi
    for i in ${SCALPER_FILES}; do
-      if [ -f ${i} ]; then
+      if [ -f "${i}" ]; then
          STATUS=1
       fi
    done
-   if [ ${STATUS} -eq 1 ] ;then
-      echo "Warning: Possible Scalper Worm installed"
+   if [ "${STATUS}" -eq 1 ] ;then
+       _warn "Possible Scalper Worm installed\n"
+       return "${INFECTED}"
    else
-      if [ "${QUIET}" != "t" ]; then echo "not infected"; fi
-         return ${NOT_INFECTED}
+      _not_found
+      return "${NOT_INFECTED}"
    fi
 }