Az rkhunter alkalmazás LMDE2 alatt jelentkező frissítési hibájának javítása

kimarite képe

A Debian Stretch kiadásban elérhető rkhunter csomag úgy néz ki, jelenleg bugos.

A frissítési kísérlet alkalmával

sudo rkhunter --update

ez a hiba tapasztalható.

Invalid WEB_CMD configuration option: Relative pathname: "/bin/false"

A megoldás a -jelenleg- legfrissebb verzió
https://sourceforge.net/projects/rkhunter/files/
beállításainak használata az alábbi módszerrel, azaz parancsokkal:

-- letöltés

wget -c https://10gbps-io.dl.sourceforge.net/project/rkhunter/rkhunter/1.4.4/rkhunter-1.4.4.tar.gz

-- kibontás

tar -zxvf rkhunter-1.4.4.tar.gz

-- belépés a kibontott könyvtárba

cd rkhunter-1.4.4/

-- a javítás

sudo bash ./installer.sh  --layout /usr --install --overwrite

Így már az update is sikeres:

sudo rkhunter --update
[ Rootkit Hunter version 1.4.4 ]

Checking rkhunter data files...
  Checking file mirrors.dat                                  [ No update ]
  Checking file programs_bad.dat                             [ No update ]
  Checking file backdoorports.dat                            [ No update ]
  Checking file suspscan.dat                                 [ No update ]
  Checking file i18n/cn                                      [ No update ]
  Checking file i18n/de                                      [ No update ]
  Checking file i18n/en                                      [ No update ]
  Checking file i18n/tr                                      [ Updated ]
  Checking file i18n/tr.utf8                                 [ Updated ]
  Checking file i18n/zh                                      [ No update ]
  Checking file i18n/zh.utf8                                 [ No update ]
  Checking file i18n/ja                                      [ No update ]

A hiba tudtommal, csak a Debian GNU/Linux kiadásra épülő Linux mint Debian Edition (LMDE2) kiadásra vonatkozik, a Linux Mint 17+ és 18+ verzióira nyilván nem. De ha nem tapasztalsz frissítési problémát az LMDE2 alatt, akkor nincs semmilyen teendőd.

A leírás értelmezésekor vedd figyelembe, hogy én a Debian alatt használom a 'sudo'-t.

Forrás
https://debianforum.de/forum/viewtopic.php?t=166137

-----

A Rootkit Hunter alkalmazás telepítése:

sudo apt-get install rkhunter

Az rkhunter (Rootkit Hunter) alkalmazásról magyar nyelvű leírás például itt olvasható:
https://logout.hu/cikk/kicsit_nagyobb_biztonsagban/teljes.html
!Megjegyzés: a leírásban szereplő '--propupd' használata csak haladó felhasználóknak javasolt (vagy inkább egyáltalán nem), mert a korábbi hibákat elrejti, úgy, hogy alapértelmezettre (a hibákkal együtt) frissíti az adatbázist, azaz éppen tapasztalható hibákat is figyelembe véve, azokat egy újabb futtatáskor (vizsgálat alkalmával)

sudo rkhunter -c

már nem mutatja. A fenti parancs kimenete csak tájékoztató jellegű, a részleteket (pl. 'Warning'-ok, amelyek lehetnek hamis riasztások is) a '/var/log/rkhunter.log' log fájlban találod meg, mint ahogy jelzi az alkalmazás is:

[...]
The system checks took: 16 minutes and 50 seconds

All results have been written to the log file: /var/log/rkhunter.log

One or more warnings have been found while checking the system.
Please check the log file (/var/log/rkhunter.log)

Megnyitása például a less szöveg megjelenítővel:

sudo less /var/log/rkhunter.log

-- lapozás: Space
-- kilépés: Q billentyű
-- kézikönyv: man less (less - a `more'-hoz hasonló megjelenítő)

Miért ne használd a propupd paramétert?
Magyarázat (fentebb, és) az rkhunter kézikönyvében:

man rkhunter

       --propupd [{filename | directory | package name},...]
              One of the checks rkhunter performs is to compare  various  cur‐
              rent  file  properties of various commands, against those it has
              previously stored. This command option causes rkhunter to update
              its data file of stored values with the current values.

              If  the  filename  option is used, then it must either be a full
              pathname, or a plain file name (for example, 'awk'). When  used,
              then  only  the  entry  in the file properties database for that
              file will be updated. If the directory option is used, then only
              those  files listed in the database that are in the given direc‐
              tory will be updated. Similarly, if the package name  option  is
              used,  then  only  those files in the database which are part of
              the specified package will be updated. The package name must  be
              the base part of the name, no version numbers should be included
              - for example, 'coreutils'. Package names will, of course,  only
              be  stored  in the file properties database if a package manager
              is being used. If a package name is the same as a  file  name  -
              for  example, 'file' could refer to the 'file' command or to the
              RPM 'file' package (which contains the  'file'  command)  -  the
              package name will be used.  If no specific option is given, then
              the entire database is updated.

              WARNING: It is the users responsibility to ensure that the files
              on  the  system are genuine and from a reliable source. rkhunter
              can only report if a file has  changed,  but  not  on  what  has
              caused the change. Hence, if a file has changed, and the --prop‐
              upd command option is used, then rkhunter will assume  that  the
              file is genuine.

Enjoy!

Hozzászólások

köszi :)

Mivel menetközben áttértetek az Avatárok nyelvére, ezért csak azon részeire tudok válaszolni, amit még értettem :) Szóval az rkhunter nálam valóban rendben van, frissítéskor is, tehát a Sarah-ra nem vonatkozik a "bug". :) A comodót meg hagyom, felrakok majd valami miást, ami valós időben fut. :) Így is elképesztően gyors a rendszer, csak-csak nem fog lassítani rajta egy valós időben futó virus scanner, és én is jobban érzem magam :) Az anyagokat át fogom tanulmányozni. :) KÖSZÖNÖM! :)

Értékelés: 

5
Átlag: 5 (1 szavazat)
kimarite képe

köszi :)

#1 Szívesen. :-)

Értékelés: 

0
Még nincs értékelve
kimarite képe

Invalid WEB_CMD configuration..: Relative pathname: "/bin/false"

Másik módszer. A hiba (ha tapasztalod, akkor javítsd!):

sudo rkhunter --update
Invalid WEB_CMD configuration option: Relative pathname: "/bin/false"

Az etc könyvtárban található rkhunter.conf fájlt kell szerkeszteni (adminként), három sort.
Az eredeti beállítást kommenteltem (#), azaz kikapcsoltam, az új beállítást új sorba tettem:

#UPDATE_MIRRORS=0
UPDATE_MIRRORS=1

#MIRRORS_MODE=1
MIRRORS_MODE=0

#WEB_CMD="/bin/false"
WEB_CMD=""

Forrás: https://churchill.ddns.me.uk/post/rkhunter-invalid-web-cmd-configuration-option/
(https://debianforum.de/forum/viewtopic.php?t=166137 )

Magyarázat (a beállítások magyarázata az rkhunter.conf fájlban is elolvasható, a bejegyzéseknél):

Open /etc/rkhunter.conf. Uncomment (remove the # to the left) and change the following three variables:

MIRRORS_MODE=1 ---> MIRRORS_MODE=0

UPDATE_MIRRORS=0 ---> UPDATE_MIRRORS=1

WEB_CMD="/bin/false" ---> WEB_CMD=""

--versioncheck and --update should now work.

I believe the well-written comments in /etc/rkhunter.conf explain each variable clearly, but, in the tl;dr spirit, here's my quick interpretation of what is happening:

The default MIRRORS_MODE=1 tells rkhunter to only use local mirrors, but you have to define them in the mirrors file for this setting to work. Switching to MIRRORS_MODE=0 allows rkhunter to use any mirror.

The default UPDATE_MIRRORS=0 only allows the mirrors file to be updated manually. Switching to UPDATE_MIRRORS=1 allows rkhunter to update the file during the --update operation.

The default WEB_CMD="/bin/false" purposely blocks rkhunter from connecting to mirrors for security reasons. Switching to WEB_CMD="" re-enables rkhunter's ability to do mirror updates.

However, considering this function was purposely disabled for security reasons, it's seems like it may be best to update rkhunter using the package manager. That's what I plan to do. Hope this was helpful.

Forrás: https://unix.stackexchange.com/questions/562560/nvalid-web-cmd-configuration-option-relative-pathname-bin-false/586954#586954

-----

Túl sok minden nem frissül (teszt):

sudo rkhunter --versioncheck
[ Rootkit Hunter version 1.4.6 ]

Checking rkhunter version...
  This version  : 1.4.6
  Latest version: 1.4.6
sudo rkhunter --update
[ Rootkit Hunter version 1.4.6 ]

Checking rkhunter data files...
  Checking file mirrors.dat                                  [ Updated ]
  Checking file programs_bad.dat                             [ No update ]
  Checking file backdoorports.dat                            [ No update ]
  Checking file suspscan.dat                                 [ No update ]
  Checking file i18n/cn                                      [ Skipped ]
  Checking file i18n/de                                      [ Skipped ]
  Checking file i18n/en                                      [ No update ]
  Checking file i18n/tr                                      [ Skipped ]
  Checking file i18n/tr.utf8                                 [ Skipped ]
  Checking file i18n/zh                                      [ Skipped ]
  Checking file i18n/zh.utf8                                 [ Skipped ]
  Checking file i18n/ja                                      [ Skipped ]

Értékelés: 

0
Még nincs értékelve
kimarite képe

A legfrissebb leírás: Invalid WEB_CMD configuration option

#2 Valójában az van, hogy az --update kapcsoló biztonsági okból ki van kapcsolva, mert a Linux terjesztés frissíti az adatbázisokat (ha az szükséges), és nem maga az rkhunter (és nem te). :)

Jelen esetben a vizsgált terjesztés most: Debian 10 Buster!

És a fentiek miatt ezt állítottam be:

# *BSD users may want to use the 'ftp' command, provided that it supports the
# HTTP protocol:
#
#     WEB_CMD="ftp -o -"
#
# This option has no default value.
#
WEB_CMD="/usr/bin/false"

Mert, volt egy figyelmeztetés,

sudo rkhunter --update
Invalid WEB_CMD configuration option: Relative pathname: "/bin/false"

és a false bináris itt van,

which false
/usr/bin/false

azaz javítottam az elérési utat erre a beálításokban (lásd fentebb).

Ezek a beállítások maradtak így:

# If this option is set to '1', it specifies that when the '--update' option is
# used, then the mirrors file is to be checked for updates as well. If the
# current mirrors file contains any local mirrors, these will be prepended to
# the updated file. If this option is set to '0', the mirrors file can only be
# updated manually. This may be useful if only using local mirrors.
#
# The default value is '1'.
#
UPDATE_MIRRORS=0

Hagytam eredeti beállításon:

# The MIRRORS_MODE option tells rkhunter which mirrors are to be used when
# the '--update' or '--versioncheck' command-line options are given.
# Possible values are:
#     0 - use any mirror
#     1 - only use local mirrors
#     2 - only use remote mirrors
#
# Local and remote mirrors can be defined in the mirrors file by using the
# 'local=' and 'remote=' keywords respectively.
#
# The default value is '0'.
#
MIRRORS_MODE=1

... nem számít, mert nem engedélyezett a frissítés amúgy sem. De a saját tükör biztonságosabb (lenne) amúgy is.

Ha szerkeszted a fájlt, ne felejtsd el első lépésben menteni,

sudo cp /etc/rkhunter.conf /etc/rkhunter.conf.ORIG

és csak ezután szerkeszt az eredetit.
Példa a nano szerkesztővel (használata máshol leírva).

sudo nano /etc/rkhunter.conf

Ismétlem, a fenti beállítások a Debian 10 Buster terjesztésre jellemzőek.
Remélem, azért a logika érthető. A rendszer (Linux) frissít, ne te tedd... ;)

És nem is tudod megtenni,mert, ha kijavítod a false elérési útját, akkor nem enged frissíteni:

sudo rkhunter --update
Invalid WEB_CMD configuration option: Relative pathname: "/usr/bin/false

Ez a lényege a false binárisnak, nem enged valamit futni, ami be van állítva rá. Nem „invalid” (nem helytelen), csak ez a jelenség, ezt látod. És így helyes. Remélem, mindent tisztáztam, fény ... https://www.youtube.com/watch?v=7yqqidO0FLw (https://videa.hu/videok/zene/barbaro-fenyrepules-a38-etno-vilagzene-wCrN... )

Ez a legfrissebb leírás. ;)

Értékelés: 

0
Még nincs értékelve