Objectivo
Instalar o pacote rkhunter, um sistema de detecção de rootkits que avisa por email o administrador do sistema se detectar alterações no sistema que indiciem a presença de um rootkit.
Instalação
root@server:~# aptitude install rkhunter
Configuração
A configuração por omissão do pacote rkhunter é normalmente suficiente: o ficheiro /etc/default/rkhunter define que a actualização da base de dados é feita semanalmente, a verificação da existência de rootkits é feita diariamente, e os resultados são enviados por email para o administrador de sistema (root).
Deverá, no entanto ser feita a actualização da base de dados de propriedades de ficheiros do rkhunter:
root@server:~# rkhunter --propupd
[ Rootkit Hunter version 1.3.6 ]
File updated: searched for 162 files, found 127
Utilização
O rkhunter pode ser executado na linha de comandos:
root@server:~# rkhunter --check
[ Rootkit Hunter version 1.3.6 ]
Checking system commands...
Performing 'strings' command checks
Checking 'strings' command [ OK ]
Performing 'shared libraries' checks
Checking for preloading variables [ None found ]
Checking for preloaded libraries [ None found ]
Checking LD_LIBRARY_PATH variable [ Not found ]
Performing file properties checks
Checking for prerequisites [ OK ]
/bin/bash [ OK ]
/bin/cat [ OK ]
/bin/chmod [ OK ]
/bin/chown [ OK ]
/bin/cp [ OK ]
/bin/date [ OK ]
/bin/df [ OK ]
/bin/dmesg [ OK ]
/bin/echo [ OK ]
/bin/egrep [ OK ]
# [...]
System checks summary
=====================
File properties checks...
Files checked: 127
Suspect files: 0
Rootkit checks...
Rootkits checked : 243
Possible rootkits: 0
Applications checks...
All checks skipped
The system checks took: 2 minutes and 37 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)
Actualização da base de dados
A base de dados do rkhunter é actualizada semanal e automaticamente. No entanto, é possível proceder à sua actualização sempre que se quiser:
root@server:~# rkhunter --update
[ Rootkit Hunter version 1.3.6 ]
Checking rkhunter data files...
Checking file mirrors.dat [ No update ]
Checking file programs_bad.dat [ Updated ]
Checking file backdoorports.dat [ Updated ]
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/zh [ No update ]
Checking file i18n/zh.utf8 [ No update ]
Referências
- The Rootkit Hunter project (http://rkhunter.sourceforge.net/)


