ROOT ON FIRE Security, Monitoring, Networking, Linux

6Mrz/100

Google Street View in Bayern unterwegs

Gestern auf der A8 (Irschenberg) zwischen Rosenheim und München:



3Mrz/100

The State of The Internet



23Feb/100

Hakin9 – Ausgabe 2010-01 kostenlos downloaden

Hakin9 Magazin 2010-01Hakin9 bietet die aktuelle Ausgabe 2010-01 zum kostenlosen Download an.

Themen:
- Phishing, Pharming und Social Engineering
- Sicherheit durch Identity Management – Einführung
- IT-Sec mittels Reverse Code Engineering – Teil 1
- Sicheres Multihoming mit BGP
- Radix, Rootkit Detection and Removal Software
- Nagios im Dienst des Angreifers
- Metasploit – Fixing the framework
- Multikollisionen in iterierten Hashfunktionen
- Network Intrusion Detection System mittels Snort
- Hardware Keylogger – Eine ernsthafte Bedrohung

Homepage: hakin9.org
Forum: Hakin9 :: Forum
Ausgabe 2009-04 kostenlos downloaden

17Feb/100

Netzwerk und Service Discovery mit Fing

Fing ist ein kostenloses Kommandozeilen Tool zur Netzwerk und Service Discovery. Die Ausgabe kann auf verschiedene Arten erfolgen: CSV, XML, Text oder HTML. Zur Zeit gibt es noch keine GUI, es wird jedoch ein Step-by-Step Assistent mitgeliefert. Der Nachfolger von Look@LAN ist für Linux, Mac OS und Windows verfügbar.

Beispiel:

C:\>fing -n 192.168.1.0/24 -o table,html,C:\test.html

Host Discovery HTML-Report:

Bsp. HTML-Report

Service Discovery HTML-Report:

Quelle: http://www.over-look.com

16Feb/100

HowTo: Icinga und IDOUtils mit MySQL installieren

icinga logoDie Installation und Konfiguration von Icinga ohne IDOUtils habe ich hier erklärt.

I. Requirements

- Apache
- GCC-Compiler
- C/C++ development libraries
- GD-Development-Libraries für statusmap- und trends-CGIs
- libdbi & libdbi-Treiber

Installation unter Debian 5:

r-o-f:~# aptitude install apache2 build-essential libgd2-xpm-dev
r-o-f:~# aptitude install libjpeg62 libjpeg62-dev libpng12-0 libpng12-0-dev
r-o-f:~# aptitude install mysql-server mysql-client libdbi0 libdbi0-dev libdbd-mysql

II. Pakete herunterladen, validieren und entpacken

Download Icingia Core inkl. MD5 Sums:

r-o-f:~# wget http://downloads.sourceforge.net/project/icinga/icinga/1.0/icinga-1.0.tar.gz
r-o-f:~# http://sourceforge.net/projects/icinga/files/icinga/1.0/icinga-1.0.tar.gz.md5/download

validieren:

r-o-f:~# md5sum -c icinga-1.0.tar.gz.md5
icinga-1.0.tar.gz: OK

entpacken:

r-o-f:~# tar xvzf icinga-1.0.tar.gz

III. Icinga Benutzer und Gruppe anlegen, Passwort definieren

Benutzer anlegen und Passwort definieren:

r-o-f:~# useradd -m icinga
r-o-f:~# passwd icinga
Geben Sie ein neues UNIX-Passwort ein:
Geben Sie das neue UNIX-Passwort erneut ein:
passwd: Passwort erfolgreich geändert

Gruppe für Webinterface definieren und User hinzufügen:

r-o-f:~# groupadd icinga-cmd
r-o-f:~# usermod -a -G icinga-cmd icinga
r-o-f:~# usermod -a -G icinga-cmd www-data

IV. Kompilieren und Installieren

r-o-f:~# cd ./icinga-1.0
r-o-f:~# ./configure --with-command-group=icinga-cmd --enable-idoutils
...

*** Configuration summary for icinga-core 1.0 12-16-2009 ***:

 General Options:
 -------------------------
        Icinga executable:  icinga
        Icinga user/group:  icinga,icinga
       Command user/group:  icinga,icinga-cmd
            Embedded Perl:  no
             Event Broker:  yes
           Build IDOUtils:  yes
        Install ${prefix}:  /usr/local/icinga
                Lock file:  ${prefix}/var/icinga.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/init.d
  Apache conf.d directory:  /etc/apache2/conf.d
             Mail program:  /usr/bin/mail
                  Host OS:  linux-gnu

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/icinga/
                  CGI URL:  http://localhost/icinga/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.


!!! Please take care about the upgrade documentation !!!
...
r-o-f:~# make all
...
r-o-f:~/icinga-1.0# make fullinstall

Mit make fullinstall wird das Hauptprogramm, CGIs, API, HTML Files, Init-Scripte (/etc/init.d/) installiert und die Berechtigungen für das External-Command-Verzeichnis gesetzt.
Unter /usr/local/icinga/etc wird eine Beispielkonfiguration angelegt. Zusätzlich wird unter /etc/apache2/conf.d/icinga.conf die Konfiguration für das Web-Interface plaziert. Danach muss der Webserver neu gestartet werden.

V. User für Web-Interface definieren

r-o-f:~# htpasswd -c /usr/local/icinga/etc/htpasswd.users root-on-fire
New password:
Re-type new password:
Adding password for user root-on-fire

Mit dem -c Parameter legt htpasswd die htpasswd.users Datei neu an bzw. überschreibt ohne Nachfrage das alte File!
Weitere user können ganz einfach mit folgendem Befehl angelegt werden:

r-o-f:~# htpasswd /usr/local/icinga/etc/htpasswd.users admin

VI. Kontakt & Berechtigungen definieren

Icinga regelt die Benutzerberechtigung wie Nagios über die Kontaktgruppen. Der Web-User muss in einer der definierten Kontaktgruppen sein. Sonst kann er sich zwar einloggen, wird aber nichts sehen.
Ein neuer Kontakt kann in der /usr/local/icinga/etc/objects/contacts.cfg definiert werden:

define contact{
        contact_name                    root-on-fire
        use                             generic-contact  
        alias                           ROOT ON FIRE
        email                           icinga@root-on-fire.com
        }
....

define contactgroup{
        contactgroup_name               admins
        alias                           Icinga Administrators
        members                         icingaadmin,root-on-fire
        }

Detailierte Web-Berechtigungen werden in der /usr/local//icinga/etc/cgi.cfg definiert.

VII. MySQL Datenbank und IDOUtils konfigurieren

Datenbank, Benutzer und Berechtigungen definieren:

r-o-f:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 5.0.51a-24+lenny3 (Debian)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE icinga;
Query OK, 1 row affected (0.00 sec)

mysql>  GRANT USAGE ON *.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
Query OK, 0 rows affected (0.01 sec)

mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON icinga.* TO 'icinga'@'localhost';
Query OK, 0 rows affected (0.00 sec)

mysql>  FLUSH PRIVILEGES ;
Query OK, 0 rows affected (0.00 sec)

Datenbankstruktur importieren:

r-o-f:~# mysql -u root -p icinga < ./icinga-1.0/module/idoutils/db/mysql.sql

IDOUtils Datenbank definieren:

r-o-f:~# cd /usr/local/icinga/etc/
r-o-f:/usr/local/icinga/etc# cp ido2db.cfg-sample ido2db.cfg

Folgende Optionen müssen in der /usr/local/icinga/etc/ido2db.cfg evtl. angepasst werden:

 db_servertype=mysql
 db_port=3306
 db_user=icinga
 db_pass=<PASSWORT>


VIII. Nagios Plugins herunterladen, kompilieren und installieren

r-o-f:~# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
r-o-f:~# tar xvzf nagios-plugins-1.4.14.tar.gz
r-o-f:~# cd ./nagios-plugins-1.4.14
r-o-f:~/nagios-plugins-1.4.14# ./configure --prefix=/usr/local/icinga --with-nagios-user=icinga
r-o-f:~/nagios-plugins-1.4.14# make
r-o-f:~/nagios-plugins-1.4.14# make install

IX. Icinga & IDOUtils starten

Konfiguration überprüfen:

r-o-f:~# /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg
....
....
Things look okay - No serious problems were detected during the pre-flight check

WICHTIG: IDOUtils muss vor Icinga gestartet werden!

r-o-f:~# /etc/init.d/ido2db start
Starting ido2db: done.
...

r-o-f:~# /etc/init.d/icinga start
Starting icinga: done.

X. Firewalleinstellungen

Zugriff auf Web-Interface von außen ermöglichen:

r-o-f:~# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT

Regel prüfen:

r-o-f:~# iptables  -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
....

XI. Screenshots

icinga01

icinga02

Quellen und weiterführende Links

Icinga Homepage: http://www.icinga.org/
Icinga Dokumentation: http://docs.icinga.org/
Icinga Demo: http://www.icinga.org/
Deutsche Nagios & Icinga Community: http://www.nagios-portal.org
Nagios Homepage: http://nagios.org/
Nagios-Plugins: http://nagios.org/download/plugins

Get Adobe Flash playerPlugin by wpburn.com wordpress themes