Un articolo per tutti i “maniaci” della sicurezza, per tutti quelli che sono ossessionati dalla privacy, per quelli che usano criptare il proprio FileSystem ed usare SHA-256 come checksum sui propri file… insomma, per qualcuno come me :D

Rkhunter è un potente tool OpenSource scritto in perl per scovare, a loro dire il 99.9% :P , l’eventuale presenza di RootKits sulla vostra macchina UNIX-Based.

Una volta effettuato il download e scompattato il tar.gz

$ wget http://sourceforge.net/projects/rkhunter/files/rkhunter/1.3.8/rkhunter-1.3.8.tar.gz

$ tar zxvf rkhunter-1.3.8.tar.gz ; cd rkhunter-1.3.8

Ci troviamo difronte ad un eseguibile bash che ci aiuterà nell’installazione dei file sorgenti.

L’installazione è molto semplice, possiamo scegliere i vari layout (inteso some percorso) in cui installare i sorgenti. Vediamo le varie opzione, in moda da scegliere quella più congeniale alle nostre esigenze

unicondor@iMac:rkhunter-1.3.8> sh installer.sh --examples
Rootkit Hunter installer

Examples:
1. Show layout, files in /usr:
installer.sh --layout /usr --show

2. Install in /usr/local:
installer.sh --layout /usr/local --install

3. Install in chosen (custom) directory /opt:
installer.sh --layout custom /opt --install

4. Install in temporary directory /tmp/rkhunter/usr/local,
with files in /usr/local (for package maintainers):
mkdir -p /tmp/rkhunter/usr/local
installer.sh --layout custom /tmp/rkhunter/usr/local \
--striproot /tmp/rkhunter --install

5. Remove files, layout /usr/local:
installer.sh --layout /usr/local --remove

Io ho usato l’installazione di default ( /usr/local )

 


# sh installer.sh --install

 

Prima di lanciare i vari test, assicuriamoci di avere l’ultima versione aggiornata

sh-3.2# rkhunter --update
[ Rootkit Hunter version 1.3.8 ]

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/zh [ No update ]
Checking file i18n/zh.utf8 [ No update ]

 

Una volta effettuata l’aggiornamento possiamo procedere con i vari test, eccovi la lista di quelli disponibili

sh-3.2# rkhunter --list test

Current test names:
additional_rkts all apps attributes avail_modules deleted_files
filesystem group_accounts group_changes hashes hidden_ports hidden_procs
immutable known_rkts loaded_modules local_host malware network
none os_specific other_malware packet_cap_apps passwd_changes ports
possible_rkt_files possible_rkt_strings possible_rkts promisc properties rootkits
running_procs scripts shared_libs shared_libs_path startup_files startup_malware
strings suspscan system_commands system_configs trojans

Grouped test names:
additional_rkts => possible_rkt_files possible_rkt_strings
group_accounts => group_changes passwd_changes
local_host => filesystem group_changes passwd_changes startup_malware system_configs
malware => deleted_files hidden_procs other_malware running_procs suspscan
network => hidden_ports packet_cap_apps ports promisc
os_specific => avail_modules loaded_modules
possible_rkts => possible_rkt_files possible_rkt_strings
properties => attributes hashes immutable scripts
rootkits => avail_modules deleted_files hidden_procs known_rkts loaded_modules other_malware possible_rkt_files possible_rkt_strings running_procs suspscan trojans
shared_libs => shared_libs_path
startup_files => startup_malware
system_commands => attributes hashes immutable scripts shared_libs_path strings

 

Ora non vi resta che lanciare il test che più vi aggrada, basta usare il flag –enable seguito dal nome del test che in questo esempio è network


sh-3.2# rkhunter --enable network
[ Rootkit Hunter version 1.3.8 ]

Checking the network...

Performing checks on the network ports
Checking for backdoor ports [ None found ]

Performing checks on the network interfaces
Checking for promiscuous interfaces [ None found ]

System checks summary
=====================

File properties checks...
All checks skipped

Rootkit checks...
All checks skipped

Applications checks...
All checks skipped

The system checks took: 4 seconds

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

No warnings were found while checking the system.

Oppure lanciarli tutti assieme


sh-3.2# rkhunter --enable all

Una volta completati i test, possiamo andare a scorrere il log file in /var/log/rkhunter.log, per vedere se abbiamo infezioni di qualche genere…

Buona caccia :D