AFICK (Another File Integrity Checker) – Host IDS
Afick ist ein Open Source Programm, das zur Familie der Host-IDS zu zählen ist, dass Veränderungen und Manipulation in der Filesystem Struktur erkennen kann. Je nach Konfiguration läuft Afick in regelmäßigen Zeitabständen und macht einen Snapshot der definierten Ordner bzw. Dateien, dieser wird dann mit einem vorher erstellten Snapshot verglichen. Bei sensiblen Systemen, macht es Sinn diesen Referenz Snapshot z.B. auf einer extern read-only Flobby Disk zu speichern. Natürlich muss man nach jedem Update, Installation oder Veränderung der Konfiguration einen neuen Referenz Snapshot machen. Je nach Sensibilität und Security Anforderung kann man das Zeitintervall verkürzen. Systeme die mit dem Internet verbunden sind. bzw. sensible Systeme sollten stündlich oder noch öfter überprüft werden. Das in Perl geschriebene AFICK benötigt auch bei größeren File Systemen sehr wenig Ressourcen. Das Entwicklerteam um Eric Gerbier arbeitet an einem Dämon / Service, um die Überprüfung in Echtzeit zu machen.
Afick eignet sich auch hervorragend, wenn man überprüfen will, welche Dateien bestimmte Pakete bei der Installation verändern bzw. erstellen. Dazu macht man einen Snapshot vor der Installation und einen danach, anschließend kann man beide vergleichen und überprüfen.
Afick gibt es für alle gängigen Linux Distributionen und Windows.
Installation unter Debian Lenny
1. Paket downloaden
2. Entpacken
3. Makefile.pl aufrufen und Abhängigkeiten überprüfen
4. Installieren
r-o-f:~# tar xvzf afick-2.14-1.tgz
r-o-f:~# cd ./afick-2.14-1
r-o-f:~/afick-2.14-1# perl Makefile.pl
search required perl modules for afick core (afick.pl) :
OK : found perl module strict
OK : found perl module warnings
OK : found perl module English
OK : found perl module Pod::Usage
OK : found perl module Digest::MD5
OK : found perl module MIME::Base64
OK : found perl module Fcntl
OK : found perl module FileHandle
OK : found perl module Getopt::Long
OK : found perl module Cwd
OK : found perl module File::Glob
OK : found perl module File::Basename
OK : found perl module constant
OK : found perl module vars
OK : you can install afick core
----------------------------------------
search required perl modules for afick gui (afick-tk.pl) :
OK : found perl module Carp
OK : found perl module Tk
OK : found perl module Tk::Balloon
OK : found perl module Tk::Checkbutton
OK : found perl module Tk::Entry
OK : found perl module Tk::HList
OK : found perl module Tk::ItemStyle
OK : found perl module Tk::LabFrame
OK : found perl module Tk::Label
OK : found perl module Tk::ProgressBar
OK : found perl module Tk::ROText
OK : found perl module Tk::Text
OK : found perl module Tk::Tree
OK : found perl module POSIX
OK : you can install afick gui
----------------------------------------
you can run 'make all' to install afick core and gui
r-o-f:~/afick-2.14-1# make all
Beim ersten Start muss man das File System initialisieren und einen Referenz Snapshot erstellen.
Dazu ruft man Afick einfach mit der Option -i auf.
Die Option -C überprüft die Konfigurationsdatei (default: /etc/afick.conf).
# config file /etc/afick.conf ok
r-o-f:~# afick -i
# Afick (2.14-1) init at 2009/12/03 21:43:58 with options (/etc/afick.conf):
# database:=/var/lib/afick/afick
# history:=/var/lib/afick/history
# archive:=/var/lib/afick/archive
# report_url:=stdout
# allow_overload:=1
# running_files:=1
# timing:=1
# exclude_suffix:= log LOG html htm HTM txt TXT xml hlp pod chm tmp old bak fon ttf TTF bmp BMP jpg JPG gif png ico wav WAV mp3 avi
# max_checksum_size:=10000000
# dbm:=GDBM_File
# Dangling file : /usr/lib/python2.4/site-packages/python-support.pth
# Hash database created successfully. 10325 files entered.
# #################################################################
# MD5 hash of /var/lib/afick/afick => WJNGxPrGQ2JyHahsDao2zA
# user time : 1.71; system time : 14.06; real time : 42
Eine händische Überprüfung kann man mit -k machen.
# Afick (2.14-1) compare at 2009/12/03 21:47:03 with options (/etc/afick.conf):
# database:=/var/lib/afick/afick
# history:=/var/lib/afick/history
# archive:=/var/lib/afick/archive
# report_url:=stdout
# allow_overload:=1
# running_files:=1
# timing:=1
# exclude_suffix:= log LOG html htm HTM txt TXT xml hlp pod chm tmp old bak fon ttf TTF bmp BMP jpg JPG gif png ico wav WAV mp3 avi
# max_checksum_size:=10000000
# dbm:=GDBM_File
# last run on 2009/12/03 21:43:58 with afick version 2.14-1
changed file : /etc/nagios/nagios.cfg
changed file : /root/.nano_history
# detailed changes
changed file : /etc/nagios/nagios.cfg
md5 : adeba80a78175f852c2c38e55b51d51f 8bd76d59ffcb364a7515171461deb806
filesize : 1989 1999
changed file : /root/.nano_history
mtime : Thu Dec 3 21:41:47 2009 Thu Dec 3 21:47:01 2009
# Dangling file : /usr/lib/python2.4/site-packages/python-support.pth
# Hash database : 10325 files scanned, 2 changed (new : 0; delete : 0; changed : 2; dangling : 1; exclude_suffix : 217; exclude_prefix : 0; exclude_re : 0; degraded : 1)
# #################################################################
# MD5 hash of /var/lib/afick/afick => WJNGxPrGQ2JyHahsDao2zA
# user time : 2.02; system time : 6.24; real time : 10
Fazit: Afick ist ein ressourcensparendes Tool, dass die Sicherheit eines Systems ohne großen Konfigurationsaufwand deutlich erhöht und hilft, Einbrüche und Manipulationsversuche schnell zu erkennen.
Quelle: http://afick.sourceforge.net/




