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:
Host Discovery HTML-Report:
Service Discovery HTML-Report:
Quelle: http://www.over-look.com
HowTo: Icinga und IDOUtils mit MySQL installieren
Die 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 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:~# http://sourceforge.net/projects/icinga/files/icinga/1.0/icinga-1.0.tar.gz.md5/download
validieren:
icinga-1.0.tar.gz: OK
entpacken:
III. Icinga Benutzer und Gruppe anlegen, Passwort definieren
Benutzer anlegen und Passwort definieren:
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:~# usermod -a -G icinga-cmd icinga
r-o-f:~# usermod -a -G icinga-cmd www-data
IV. Kompilieren und Installieren
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
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:
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:
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:
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:
IDOUtils Datenbank definieren:
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_port=3306
db_user=icinga
db_pass=<PASSWORT>
VIII. Nagios Plugins herunterladen, kompilieren und installieren
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:
....
....
Things look okay - No serious problems were detected during the pre-flight check
WICHTIG: IDOUtils muss vor Icinga gestartet werden!
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:
Regel prüfen:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:www
....
XI. Screenshots
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
(IN)SECURE Magazine – Ausgabe 24 veröffentlicht
- Writing a secure SOAP client with PHP: Field report from a real-world project
- How virtualized browsing shields against web-based attacks
- Review: 1Password 3
- Preparing a strategy for application vulnerability detection
- Threats 2.0: A glimpse into the near future
- Preventing malicious documents from compromising Windows machines
- Balancing productivity and security in a mixed environment
- AES and 3DES comparison analysis
- OSSEC: An introduction to open source log and event management
- Secure and differentiated access in enterprise wireless networks
Homepage: http://www.net-security.org
Netzwerk Pakete mit Nping generieren
Nping ist ein Open Source Tool mit dem man Netzwerk Pakete generieren, Antwort-Pakete analysieren und Antwort-Zeiten im Netzwerk messen kann. Nping kann Pakete verschiedene Protokolle generieren und sämtliche Werte bzw. Flags im Protokoll-Headers manipulieren.
Die Ziele werden bei Nping genau wie bei Nmap auf verschiedene Arten bestimmt, alles was keine Option ist wird automatisch als Ziel definiert. Details zu den verschiedenen Möglichkeiten findet man in meinem Blog Post:
Nmap 5.0 – Howto Teil 1: Ziele richtig definieren.
Nping unterstützt verschiedene Paket Typen bzw. Test Arten: TCP Connect, TCP, UDP, ICMP, ARP und Traceroute.
Die Man Page liefert eine genaue Übersicht der verschiedenen Test Arten und der zahlreichen möglichen Funktionen.
Nping ist auf der Downloadseite für Linux, MAX OS X und Windows erhältlich.
I. Installation unter Debian
r-o-f:~# tar -xzf nping-0.1BETA2.tar.gz
r-o-f:~# cd ./nping-0.1BETA2
r-o-f:~/nping-0.1BETA2# ./configure
r-o-f:~/nping-0.1BETA2# make
r-o-f:~/nping-0.1BETA2# make install
r-o-f:~# nping --version
Nping version 0.1BETA2 ( http://nmap.org/nping )
II. Beispiel
Die Option -c: definiert die Anzahl der Durchläufe (=3), mit --tcp: wird der TCP Mode aktiviert und mit -p: werden die Ziel-Ports (80 & 443) bestimmt.
Starting Nping 0.1BETA2 ( http://nmap.org/nping ) at 2010-02-02 21:19 CET
SENT (0.0000s) TCP 10.0.0.10:63125 > 64.13.134.52:80 S ttl=64 id=7602 iplen=40 seq=1933904507 win=1480
RCVD (0.2080s) TCP 64.13.134.52:80 > 10.0.0.10:63125 SA ttl=44 id=0 iplen=44 seq=330730089 win=5840 <mss 1380>
SENT (1.0010s) TCP 10.0.0.10:63125 > 64.13.134.52:433 S ttl=64 id=5124 iplen=40 seq=1933904507 win=1480
SENT (2.0010s) TCP 10.0.0.10:63125 > 64.13.134.52:80 S ttl=64 id=37991 iplen=40 seq=1933904507 win=1480
RCVD (2.2420s) TCP 64.13.134.52:80 >10.0.0.10:63125 SA ttl=44 id=0 iplen=44 seq=332764473 win=5840 <mss 1380>
SENT (3.0040s) TCP 10.0.0.10:63125 > 64.13.134.52:433 S ttl=64 id=22002 iplen=40 seq=1933904507 win=1480
SENT (4.0050s) TCP 10.0.0.10:63125 > 64.13.134.52:80 S ttl=64 id=37289 iplen=40 seq=1933904507 win=1480
RCVD (4.2630s) TCP 64.13.134.52:80 > 10.0.0.10:63125 SA ttl=44 id=0 iplen=44 seq=334783067 win=5840 <mss 1380>
SENT (5.0060s) TCP 10.0.0.10:63125 > 64.13.134.52:433 S ttl=64 id=62138 iplen=40 seq=1933904507 win=1480
Max rtt: 257.629ms | Min rtt: 207.723ms | Avg rtt: 235.445ms
Raw packets sent: 6 (240B) | Rcvd: 3 (138B) | Lost: 3 (50.00%)
Tx time: 5.00633s | Tx bytes/s: 47.94 | Tx pkts/s: 1.20
Rx time: 6.00893s | Rx bytes/s: 22.97 | Rx pkts/s: 0.50
Nping done: 1 IP address pinged in 6.01 seconds









