uTaNG
16.05.03, 12:07
hi, also ich experimentiere derzeit mit SNORT rum, und habe auch einiges an INFoS aus dem Netz gefischt... allerdings habe ich noch bei der Protokollierung im Output paar Probleme...
- sitze direkt am Router (2 Interfaces eth0 -> MODEM && eth1=192.168.99.1)
also meine bissherigen einstellungen...
nach der Installation habe ich eine Seperrate snort.conf erstellt...
snort.conf
# Snort-Konfigurationsdatei
#
var HOME_NET 192.168.99.0/10
var EXTERNAL_NET any
var INCLUDEPATH ./
# Verwende Interface eth0
config interface: eth0
# Verwende einen anderen Benutzerkontext
config set_gid: snort
config set_uid: snort
Preprocessor frag2
Preprocessor stream4
Preprocessor http_decode: 80 8080
Preprocessor portscan: $HOME_NET 4 2 portscan.log
Output log_tcpdump: binary.log
Output alert_syslog: LOG_AUTH LOG_ALERT
Include $INCLUDEPATH/rules.conf
und eine rules.conf um die Optionen zu testen.
rules.conf
alert icmp $EXTERNAL_NET any <> $HOME_NET any (msg: "PING-Paket";)
soweit so gut ... nun müsste er mir nach dieser rule ein Ping Packet protokolieren mit dieser MSG "PING-Paket" drin ... nun wollte ich das testen ...
habe fix 3 Consolen geöffnet:
Console_1 <<-- SNORT gestartet
root@LIAN idide # snort -dve -c /etc/snort/snort.conf
Running in IDS mode
Log directory = /var/log/snort
Initializing Network Interface eth0
--== Initializing Snort ==--
Initializing Output Plugins!
Decoding Ethernet on interface eth0
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /etc/snort/snort.conf
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Initializing rule chains...
Initializing Network Interface eth0
No arguments to frag2 directive, setting defaults to:
Fragment timeout: 60 seconds
Fragment memory cap: 4194304 bytes
Fragment min_ttl: 0
Fragment ttl_limit: 5
Fragment Problems: 0
Self preservation threshold: 500
Self preservation period: 90
Suspend threshold: 1000
Suspend period: 30
Stream4 config:
Stateful inspection: ACTIVE
Session statistics: INACTIVE
Session timeout: 30 seconds
Session memory cap: 8388608 bytes
State alerts: INACTIVE
Evasion alerts: ACTIVE
Scan alerts: INACTIVE
Log Flushed Streams: INACTIVE
MinTTL: 1
TTL Limit: 5
Async Link: 0
State Protection: 0
Self preservation threshold: 50
Self preservation period: 90
Suspend threshold: 200
Suspend period: 30
http_decode arguments:
Ports to decode http on: 80 8080
Using LOCAL time
1 Snort rules read...
1 Option Chains linked into 1 Chain Headers
0 Dynamic rules
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Rule application order: ->activation->dynamic->alert->pass->log
--== Initialization Complete ==--
-*> Snort! <*-
Version 2.0.0 (Build 72)
By Martin Roesch (roesch@sourcefire.com, www.snort.org)
<cut>
Console_2 <<-- tcpdump gestartet
tcpdump -n icmp -w pingpa
tcpdump: listening on eth0
Console_3 <<-- Einen PING test durch geführt
ping -c1 www.linuxforen.de
PING www.linuxforen.de (62.180.126.148): 56 octets data
--- www.linuxforen.de ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
ERGEBNIS:
Console_1 <<-- SNORT
05/16-12:55:55.031583 0:90:27:5A:44:C2 -> 0:90:1A:40:9:C4 type:0x8864 len:0x55
80.144.165.5:32834 -> 212.185.251.41:53 UDP TTL:64 TOS:0x0 ID:38805 IpLen:20 DgmLen:63 DF
Len: 35
D4 D0 01 00 00 01 00 00 00 00 00 00 03 77 77 77 .............www
0A 6C 69 6E 75 78 66 6F 72 65 6E 02 64 65 00 00 .linuxforen.de..
01 00 01 ...
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ =+=+=+=+=+=+=+=+=+=+=+=+
05/16-12:55:55.077886 0:90:1A:40:9:C4 -> 0:90:27:5A:44:C2 type:0x8864 len:0x89
212.185.251.41:53 -> 80.144.165.5:32834 UDP TTL:56 TOS:0x0 ID:212 IpLen:20 DgmLen:115
Len: 87
D4 D0 81 80 00 01 00 01 00 02 00 00 03 77 77 77 .............www
0A 6C 69 6E 75 78 66 6F 72 65 6E 02 64 65 00 00 .linuxforen.de..
01 00 01 C0 0C 00 01 00 01 00 00 37 55 00 04 3E ...........7U..>
B4 7E 94 C0 10 00 02 00 01 00 00 37 55 00 06 03 .~.........7U...
6E 73 32 C0 10 C0 10 00 02 00 01 00 00 37 55 00 ns2..........7U.
06 03 6E 73 31 C0 10 ..ns1..
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ =+=+=+=+=+=+=+=+=+=+=+=+
05/16-12:55:55.080408 0:90:27:5A:44:C2 -> 0:90:1A:40:9:C4 type:0x8864 len:0x6A
80.144.165.5 -> 62.180.126.148 ICMP TTL:64 TOS:0x0 ID:0 IpLen:20 DgmLen:84 DF
Type:8 Code:0 ID:43104 Seq:0 ECHO
BB C3 C4 3E 68 39 01 00 08 09 0A 0B 0C 0D 0E 0F ...>h9..........
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F !"#$%&'()*+,-./
30 31 32 33 34 35 36 37 01234567
schien ja noch gut auszusehen, aber...
Console_2 <<-- tcpdump gestopt und snort zum auslesen der tcpdump_logfile "pingpa" gestartet
snort -vdr pingpa
No run mode specified, defaulting to verbose mode
Running in packet dump mode
Log directory = /var/log/snort
TCPDUMP file reading mode.
Reading network traffic from "pingpa" file.
snaplen = 96
<cut>
es wurde nichts Prtokoliert...., selbst nicht in /var/log/snort/
ich hatte eigentlich erwartet das er mir genau das Protokolieren würde + MSG " PING-Paket" stimmt da irgendwas an meiner rule nicht ?
- sitze direkt am Router (2 Interfaces eth0 -> MODEM && eth1=192.168.99.1)
also meine bissherigen einstellungen...
nach der Installation habe ich eine Seperrate snort.conf erstellt...
snort.conf
# Snort-Konfigurationsdatei
#
var HOME_NET 192.168.99.0/10
var EXTERNAL_NET any
var INCLUDEPATH ./
# Verwende Interface eth0
config interface: eth0
# Verwende einen anderen Benutzerkontext
config set_gid: snort
config set_uid: snort
Preprocessor frag2
Preprocessor stream4
Preprocessor http_decode: 80 8080
Preprocessor portscan: $HOME_NET 4 2 portscan.log
Output log_tcpdump: binary.log
Output alert_syslog: LOG_AUTH LOG_ALERT
Include $INCLUDEPATH/rules.conf
und eine rules.conf um die Optionen zu testen.
rules.conf
alert icmp $EXTERNAL_NET any <> $HOME_NET any (msg: "PING-Paket";)
soweit so gut ... nun müsste er mir nach dieser rule ein Ping Packet protokolieren mit dieser MSG "PING-Paket" drin ... nun wollte ich das testen ...
habe fix 3 Consolen geöffnet:
Console_1 <<-- SNORT gestartet
root@LIAN idide # snort -dve -c /etc/snort/snort.conf
Running in IDS mode
Log directory = /var/log/snort
Initializing Network Interface eth0
--== Initializing Snort ==--
Initializing Output Plugins!
Decoding Ethernet on interface eth0
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /etc/snort/snort.conf
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Initializing rule chains...
Initializing Network Interface eth0
No arguments to frag2 directive, setting defaults to:
Fragment timeout: 60 seconds
Fragment memory cap: 4194304 bytes
Fragment min_ttl: 0
Fragment ttl_limit: 5
Fragment Problems: 0
Self preservation threshold: 500
Self preservation period: 90
Suspend threshold: 1000
Suspend period: 30
Stream4 config:
Stateful inspection: ACTIVE
Session statistics: INACTIVE
Session timeout: 30 seconds
Session memory cap: 8388608 bytes
State alerts: INACTIVE
Evasion alerts: ACTIVE
Scan alerts: INACTIVE
Log Flushed Streams: INACTIVE
MinTTL: 1
TTL Limit: 5
Async Link: 0
State Protection: 0
Self preservation threshold: 50
Self preservation period: 90
Suspend threshold: 200
Suspend period: 30
http_decode arguments:
Ports to decode http on: 80 8080
Using LOCAL time
1 Snort rules read...
1 Option Chains linked into 1 Chain Headers
0 Dynamic rules
++++++++++++++++++++++++++++++++++++++++++++++++++ +
Rule application order: ->activation->dynamic->alert->pass->log
--== Initialization Complete ==--
-*> Snort! <*-
Version 2.0.0 (Build 72)
By Martin Roesch (roesch@sourcefire.com, www.snort.org)
<cut>
Console_2 <<-- tcpdump gestartet
tcpdump -n icmp -w pingpa
tcpdump: listening on eth0
Console_3 <<-- Einen PING test durch geführt
ping -c1 www.linuxforen.de
PING www.linuxforen.de (62.180.126.148): 56 octets data
--- www.linuxforen.de ping statistics ---
1 packets transmitted, 0 packets received, 100% packet loss
ERGEBNIS:
Console_1 <<-- SNORT
05/16-12:55:55.031583 0:90:27:5A:44:C2 -> 0:90:1A:40:9:C4 type:0x8864 len:0x55
80.144.165.5:32834 -> 212.185.251.41:53 UDP TTL:64 TOS:0x0 ID:38805 IpLen:20 DgmLen:63 DF
Len: 35
D4 D0 01 00 00 01 00 00 00 00 00 00 03 77 77 77 .............www
0A 6C 69 6E 75 78 66 6F 72 65 6E 02 64 65 00 00 .linuxforen.de..
01 00 01 ...
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ =+=+=+=+=+=+=+=+=+=+=+=+
05/16-12:55:55.077886 0:90:1A:40:9:C4 -> 0:90:27:5A:44:C2 type:0x8864 len:0x89
212.185.251.41:53 -> 80.144.165.5:32834 UDP TTL:56 TOS:0x0 ID:212 IpLen:20 DgmLen:115
Len: 87
D4 D0 81 80 00 01 00 01 00 02 00 00 03 77 77 77 .............www
0A 6C 69 6E 75 78 66 6F 72 65 6E 02 64 65 00 00 .linuxforen.de..
01 00 01 C0 0C 00 01 00 01 00 00 37 55 00 04 3E ...........7U..>
B4 7E 94 C0 10 00 02 00 01 00 00 37 55 00 06 03 .~.........7U...
6E 73 32 C0 10 C0 10 00 02 00 01 00 00 37 55 00 ns2..........7U.
06 03 6E 73 31 C0 10 ..ns1..
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ =+=+=+=+=+=+=+=+=+=+=+=+
05/16-12:55:55.080408 0:90:27:5A:44:C2 -> 0:90:1A:40:9:C4 type:0x8864 len:0x6A
80.144.165.5 -> 62.180.126.148 ICMP TTL:64 TOS:0x0 ID:0 IpLen:20 DgmLen:84 DF
Type:8 Code:0 ID:43104 Seq:0 ECHO
BB C3 C4 3E 68 39 01 00 08 09 0A 0B 0C 0D 0E 0F ...>h9..........
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ................
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F !"#$%&'()*+,-./
30 31 32 33 34 35 36 37 01234567
schien ja noch gut auszusehen, aber...
Console_2 <<-- tcpdump gestopt und snort zum auslesen der tcpdump_logfile "pingpa" gestartet
snort -vdr pingpa
No run mode specified, defaulting to verbose mode
Running in packet dump mode
Log directory = /var/log/snort
TCPDUMP file reading mode.
Reading network traffic from "pingpa" file.
snaplen = 96
<cut>
es wurde nichts Prtokoliert...., selbst nicht in /var/log/snort/
ich hatte eigentlich erwartet das er mir genau das Protokolieren würde + MSG " PING-Paket" stimmt da irgendwas an meiner rule nicht ?