Come installare rkhunter su Ubuntu

Cloud Compute

Rkhunterè un software che trova rootkit su un server Linux. I rootkit sono installati dagli hacker in modo che possano sempre accedere al server. In questo documento, sarai in grado di vedere come puoi impedire i rootkit usando rkhuntersu Ubuntu.

Passaggio 1: installazione dei prerequisiti

Dobbiamo installare una serie di prerequisiti per utilizzare correttamente rkhunter:

apt-get install binutils libreadline5 libruby ruby ruby ssl-cert unhide.rb mailutils

Al termine dell'installazione, è possibile procedere al passaggio successivo.

Passaggio 2: installazione rkhunter

Scaricheremo rkhunterusando wget. Se wgetnon è stato ancora installato sul tuo sistema, esegui:

apt-get install wget

Ora scarica rkhunter:

wget http://downloads.sourceforge.net/project/rkhunter/rkhunter/1.4.2/rkhunter-1.4.2.tar.gz

Annulla il download:

tar xzvf rkhunter*

Passare alla rkhunterdirectory:

cd rkhunter*

Installa rkhunter:

./installer.sh --layout /usr --install

L'output dell'installazione dovrebbe essere simile a questo:

Checking system for:
 Rootkit Hunter installer files: found
 A web file download command: wget found
Starting installation:
 Checking installation directory "/usr": it exists and is writable.
 Checking installation directories:
  Directory /usr/share/doc/rkhunter-1.4.2: creating: OK
  Directory /usr/share/man/man8: exists and is writable.
  Directory /etc: exists and is writable.
  Directory /usr/bin: exists and is writable.
  Directory /usr/lib: exists and is writable.
  Directory /var/lib: exists and is writable.
  Directory /usr/lib/rkhunter/scripts: creating: OK
  Directory /var/lib/rkhunter/db: creating: OK
  Directory /var/lib/rkhunter/tmp: creating: OK
  Directory /var/lib/rkhunter/db/i18n: creating: OK
  Directory /var/lib/rkhunter/db/signatures: creating: OK
 Installing check_modules.pl: OK
 Installing filehashsha.pl: OK
 Installing stat.pl: OK
 Installing readlink.sh: OK
 Installing backdoorports.dat: OK
 Installing mirrors.dat: OK
 Installing programs_bad.dat: OK
 Installing suspscan.dat: OK
 Installing rkhunter.8: OK
 Installing ACKNOWLEDGMENTS: OK
 Installing CHANGELOG: OK
 Installing FAQ: OK
 Installing LICENSE: OK
 Installing README: OK
 Installing language support files: OK
 Installing ClamAV signatures: OK
 Installing rkhunter: OK
 Installing rkhunter.conf: OK
Installation complete

Passaggio 3: utilizzo rkhunter

I file di dati contengono informazioni su possibili minacce.

L'aggiornamento regolare dei file di dati è necessario per un sistema aggiornato. Puoi aggiornarli usando il rkhuntercomando:

rkhunter --update

Questo produrrà un elenco con i file di dati che sono stati aggiornati e quelli che non sono stati aggiornati:

[ Rootkit Hunter version 1.4.2 ]

Checking rkhunter data files...
  Checking file mirrors.dat                                  [ No update ]
  Checking file programs_bad.dat                             [ Updated ]
  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                                      [ No update ]
  Checking file i18n/tr.utf8                                 [ No update ]
  Checking file i18n/zh                                      [ No update ]
  Checking file i18n/zh.utf8                                 [ No update ]

Ora siamo pronti per eseguire il nostro primo test. Il test cercherà rootkit noti e problemi di sicurezza generici (come l'accesso root su SSH) e registrerà i risultati. Sarà necessario premere manualmente "Invio" per continuare dopo i controlli.

Dopo il test, possiamo vedere errori e avvisi:

cat /var/log/rkhunter.log

Passaggio 4: abilitazione delle notifiche e-mail

Rkhunterpuò essere configurato per inviare un'e-mail quando viene rilevata una minaccia. Per configurare questa funzione, inizia aprendo il rkhunter.conffile:

vi /etc/rkhunter.conf

Cerca MAIL-ON-WARNING, quindi aggiungi un indirizzo email.

È possibile facoltativamente scorrere la configurazione per ulteriori opzioni, tuttavia, per impostazione predefinita, dovrebbe funzionare correttamente. Puoi controllare il tuo file di configurazione:

rkhunter -C

Se non è presente alcun output, il file di configurazione è valido.

Lascia un commento