original in de Klaus Müller
--------------------------------
| Internet |
--------------------------------
|
|
----------------------------------
| Firewall |
----------------------------------
|
-------------
| Sensor |
-------------
|
-----------------
| LAN |
-----------------
Diese Darstellung ist nur eine mögliche und soll nur
verdeutlichen, dass die Sensoren nicht zwischen DMZ und Firewall
stehen. Sollte euch der Begriff DMZ unbekannt sein, er steht
für Demiltarized Zone und ist ein Bereich, der von allen
Seiten geschützt wird.
--------------------------------
| Internet |
--------------------------------
|
----------------------------
| Sensor |
----------------------------
|
----------------------------
| Firewall |
----------------------------
|
-----------------
| LAN |
-----------------
Sensoren werden häufig, wie in der Darstellung gezeigt,
außerhalb der externen Firewall platziert. Der Grund
hierfür liegt darin, dass der Sensor so den ganzen Verkehr
aus dem Internet empfängt und analysieren kann. Wenn man
den Sensor hier platziert, ist noch nicht garantiert, dass
wirklich alle Angriffe gefiltert und erkannt werden, z.B. bei
TCP-Attacken. In diesem Fall würde man versuchen, die
Attacke zu erkennen, indem man sogenannte Signatures verwendet (mehr
dazu siehe in dem Teil über Signaturen). Nichtsdestotrotz
wird von vielen Experten dieser Standort bevorzugt, da er den
Vorteil hat, die Attacken (die auf die Firewall...) ausgeübt
werden, zu protokollieren und analysieren, dadurch kann der
Admin sehen, wo er eventuell die Konfiguration der Firewall
umstellen sollte.
-------------------
| Application |
-------------------
|
-------------------
| IDS |
-------------------
|
-------------------
| User |
-------------------
-------------------------
| Internet |
-------------------------
|
-------------------------
| ext. Firewall |
-------------------------
|
-------------------------
| Honeypot | <---- in DMZ
-------------------------
|
-------------------------
| int. Firewall |
-------------------------
...
Host (192.168.0.0) seems to be a subnet broadcast address (returned 1
extra pings).
Skipping host. Interesting ports on playground.yuma.net 192.168.0.1):
Port State Protocol Service
22 open tcp ssh
111 open tcp sunrpc
635 open tcp unknown
1024 open tcp unknown
2049 open tcp nfs
TCP Sequence Prediction: Class = random positive increments
Difficulty=3916950 (Good luck!)
Remote operating system guess:
Linux 2.1.122 - 2.1.132; 2.2.0-pre1 - 2.2.2
Interesting ports on vectra.yuma.net (192.168.0.5):
Port State Protocol Service
13 open tcp daytime
21 open tcp ftp
22 open tcp ssh
23 open tcp telnet
37 open tcp time
79 open tcp finger
111 open tcp sunrpc
113 open tcp auth
513 open tcp login
514 open tcp shell
TCP Sequence Prediction: Class = random positive increments
Difficulty = 17719 (Worthy challenge)
Remote operating system guess: OpenBSD 2.2. - 2.3
Nmap run completed -- 256 IP addresses (2 hosts up) scanned in 6 seconds
Hauptsächlich kann man vor allem also folgendes herausfinden:
[Socma]$ nmap -sT localhost Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ ) Interesting ports on Diablo (127.0.0.1): (The 1552 ports scanned but not shown below are in state: closed) Port State Service 21/tcp open ftp 23/tcp open telnet 80/tcp open http 111/tcp open sunrpc 113/tcp open auth 6000/tcp open X11 Nmap run completed -- 1 IP address (1 host up) scanned in 1 second
02:10:15.804704 Diablo > Diablo: icmp: echo request
4500 001c 2db8 0000 3501 5a27 7f00 0001
7f00 0001 0800 fc95 fb69 0000
02:10:15.814704 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 0496 fb69 0000
02:10:15.814704 Diablo.58725 > Diablo.http: . ack 110306597 win 3072
4500 0028 d223 0000 2a06 c0aa 7f00 0001
7f00 0001 e565 0050 ad48 0003 0693 2525
5010 0c00 e718 0000
02:10:15.814704 Diablo.http > Diablo.58725: R 110306597:110306597(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 e565 0693 2525 0000 0000
5004 0000 a070 0000
02:10:16.114704 Diablo.1727 > Diablo.821: S 196002918:196002918(0)
win 32767 <mss 16396,sackOK,timestamp 213509[|tcp]> (DF)
4500 003c 8663 4000 4006 b656 7f00 0001
7f00 0001 06bf 0335 0bae c466 0000 0000
a002 7fff 739c 0000 0204 400c 0402 080a
0003 4205
02:10:16.114704 Diablo.821 > Diablo.1727: R 0:0(0) ack 196002919
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0335 06bf 0000 0000 0bae c467
5014 0000 d7c4 0000
02:10:16.114704 Diablo.1728 > Diablo.440: S 195504823:195504823(0)
win 32767 <mss 16396,sackOK,timestamp 213509[|tcp]> (DF)
4500 003c 68b2 4000 4006 d407 7f00 0001
7f00 0001 06c0 01b8 0ba7 2ab7 0000 0000
a002 7fff 0ecf 0000 0204 400c 0402 080a
0003 4205
[Socma]$ nmap -sU localhost Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ ) Interesting ports on Diablo (127.0.0.1): (The 1459 ports scanned but not shown below are in state: closed) Port State Service 111/udp open sunrpc Nmap run completed -- 1 IP address (1 host up) scanned in 4 seconds
10:41:55.954397 Diablo > Diablo: icmp: echo request
4500 001c cc8f 0000 2801 c84f 7f00 0001
7f00 0001 0800 8471 738e 0000
10:41:55.954397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 8c71 738e 0000
10:41:55.964397 Diablo.63793 > Diablo.http: . ack 994287972 win 2048
4500 0028 79e3 0000 2506 1deb 7f00 0001
7f00 0001 f931 0050 06d8 0003 3b43 a164
5010 0800 cccd 0000
10:41:55.964397 Diablo.http > Diablo.63793: R 994287972:994287972(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 f931 3b43 a164 0000 0000
5004 0000 dbb4 0000
10:41:56.274397 Diablo.63773 > Diablo.15: udp 0
4500 001c 8a0b 0000 3011 02c4 7f00 0001
7f00 0001 f91d 000f 0008 08af
10:41:56.274397 Diablo > Diablo: icmp: Diablo udp port 15
unreachable (DF) [tos 0xc0]
45c0 0038 0000 4000 ff01 7d02 7f00 0001
7f00 0001 0303 fb18 0000 0000 4500 001c
8a0b 0000 3011 02c4 7f00 0001 7f00 0001
f91d 000f
10:41:56.274397 Diablo.63773 > Diablo.1459: udp 0
4500 001c 6c2f 0000 3011 20a0 7f00 0001
7f00 0001 f91d 05b3 0008 030b
10:41:56.274397 Diablo > Diablo: icmp: Diablo udp port 1459
unreachable (DF) [tos 0xc0]
45c0 0038 0100 4000 ff01 7c02 7f00 0001
7f00 0001 0303 fb18 0000 0000 4500 001c
6c2f 0000 3011 20a0 7f00 0001 7f00 0001
f91d 05b3
Eine etwas andere Variante eines UDP Scans (UDP recvfrom() and
write() Scan) besteht darin, jeden Port zweimal zu scannen. Die
eben besprochene Methode benutzt ICMP mit "Port Unreachable",
allerdings erhält nur root diese Meldung. Scant man zwei
mal einen geschlossenen Port erhält man nach dem zweiten
Scan ein "Error 13 : Try Again"...
[Socma]$ nmap -sA localhost
Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ )
All 1558 scanned ports on Diablo (127.0.0.1) are: UNfiltered
Nmap run completed -- 1 IP address (1 host up) scanned in 6 seconds
Der Tcpdump-Trace:
10:45:51.864397 Diablo > Diablo: icmp: echo request
4500 001c 1617 0000 3901 6dc8 7f00 0001
7f00 0001 0800 113d e6c2 0000
10:45:51.864397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 193d e6c2 0000
10:45:51.864397 Diablo.53119 > Diablo.http: . ack 2682022466 win 3072
4500 0028 0dda 0000 3206 7cf4 7f00 0001
7f00 0001 cf7f 0050 0650 0003 9fdc 6a42
5010 0c00 c590 0000
10:45:51.864397 Diablo.http > Diablo.53119: R 2682022466:2682022466(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 cf7f 9fdc 6a42 0000 0000
5004 0000 d7ef 0000
10:45:52.164397 Diablo.53099 > Diablo.14: . ack 2457451592 win 3072
4500 0028 218d 0000 3206 6941 7f00 0001
7f00 0001 cf6b 000e 5938 4710 9279 bc48
5010 0c00 e74d 0000
10:45:52.164397 Diablo.14 > Diablo.53099: R 2457451592:2457451592(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 000e cf6b 9279 bc48 0000 0000
5004 0000 93a2 0000
10:45:52.164397 Diablo.53099 > Diablo.imap3: . ack 2457451592 win 3072
4500 0028 a075 0000 3206 ea58 7f00 0001
7f00 0001 cf6b 00dc 5938 4710 9279 bc48
5010 0c00 e67f 0000
------------------ SYN ------------- | Rechner A | ---------------------------- > | Rechner B | ------------------ ------------- ------------------ ACK/SYN ------------- | Rechner A | <----------------------------| Rechner B | ------------------ ------------- ------------------ ACK ------------- | Rechner A | ---------------------------- > | Rechner B | ------------------ -------------
------------------ SYN ------------- | Rechner A | ---------------------------- > | Rechner B | ------------------ ------------- ------------------ ACK/SYN ------------- | Rechner A | <----------------------------| Rechner B | ------------------ -------------Diese Darstellung sieht zwar so aus wie beim Three-Way-Handshake, allerdings mit einem wesentlichen Unterschied: In der hier gezeigten Darstellung würde keine Verbindung zwischen A und B bestehen, bzw. Rechner B würde denken, die Verbindung würde stehen, obwohl die Verbindung erst dann steht, wenn A ein weiteres ACK an B schickt (man spricht hier auch von einem "half-open" Port). Der oben gezeigte SYN Scan impliziert, dass der Port auf dem Zielrechner offen ist (aufgrund des ACK/SYN), wäre er geschlossen, so würde man ein RST/ACK zurückerhalten.
[Socma]$ nmap -sS localhost
Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ )
Interesting ports on Diablo (127.0.0.1):
(The 1552 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
23/tcp open telnet
80/tcp open http
111/tcp open sunrpc
113/tcp open auth
6000/tcp open X11
Nmap run completed -- 1 IP address (1 host up) scanned in 3 seconds
Tcpdump-Trace:
10:47:41.674397 Diablo > Diablo: icmp: echo request
4500 001c 8f08 0000 3501 f8d6 7f00 0001
7f00 0001 0800 99a9 5e56 0000
10:47:41.674397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 a1a9 5e56 0000
10:47:41.674397 Diablo.58038 > Diablo.http: . ack 1561498752 win 3072
4500 0028 afe5 0000 3206 dae8 7f00 0001
7f00 0001 e2b6 0050 82b0 0003 5d12 9480
5010 0c00 4e85 0000
10:47:41.674397 Diablo.http > Diablo.58038: R 1561498752:1561498752(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 e2b6 5d12 9480 0000 0000
5004 0000 dd44 0000
10:47:41.984397 Diablo.58018 > Diablo.1488: S 2803535203:2803535203(0)
win 3072
4500 0028 a4f5 0000 3206 e5d8 7f00 0001
7f00 0001 e2a2 05d0 a71a 8d63 0000 0000
5002 0c00 88ef 0000
10:47:41.984397 Diablo.1488 > Diablo.58018: R 0:0(0) ack 2803535204
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 05d0 e2a2 0000 0000 a71a 8d64
5014 0000 94dc 0000
Nun kommen weitere Scans ins Spiel: FIN Scanning, NULL
Scanning und XMAS Scanning. Beim FIN Scanning wird lediglich
dem "Ziel-Rechner" eine FIN-Message geschickt, obwohl keine
Verbindung zwischen beiden besteht. Bei einem geschlossenen
Port wird nun RST zurückgegeben, ansonsten passiert
nichts.
[Socma]$ nmap -sF localhost
Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ )
Interesting ports on Diablo (127.0.0.1):
(The 1552 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
23/tcp open telnet
80/tcp open http
111/tcp open sunrpc
113/tcp open auth
6000/tcp open X11
Nmap run completed -- 1 IP address (1 host up) scanned in 6 seconds
Tcpdump-Trace:
10:48:28.704397 Diablo > Diablo: icmp: echo request
4500 001c b29d 0000 3401 d641 7f00 0001
7f00 0001 0800 a1a7 5658 0000
10:48:28.704397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 a9a7 5658 0000
10:48:28.704397 Diablo.52201 > Diablo.http: . ack 2873378189 win 4096
4500 0028 cbeb 0000 2b06 c5e2 7f00 0001
7f00 0001 cbe9 0050 9020 0003 ab44 458d
5010 1000 54a3 0000
10:48:28.704397 Diablo.http > Diablo.52201: R 2873378189:2873378189(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 cbe9 ab44 458d 0000 0000
5004 0000 f4d2 0000
10:48:29.004397 Diablo.52181 > Diablo.233: F 0:0(0) win 4096
4500 0028 10c6 0000 2b06 8108 7f00 0001
7f00 0001 cbd5 00e9 0000 0000 0000 0000
5001 1000 d522 0000
10:48:29.004397 Diablo.233 > Diablo.52181: R 0:0(0) ack 1 win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 00e9 cbd5 0000 0000 0000 0001
5014 0000 e50e 0000
Besonders interessant (vor allem bei der praktischen Umsetzung einer
Protocol Anomaly Detection) sind die NULL und Xmas Scans. Der
Xmas Scan trägt seinen Namen, aufgrund der Tatsache das
dort alle Flags gesetzt sind, also: SYN, ACK, FIN, URG, PUSH. Wie
beim FIN Scanning wird auch hier RST zurückgegeben, wenn
der Port geschlossen ist.
[Socma]$ nmap -sX localhost
Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ )
Interesting ports on Diablo (127.0.0.1):
(The 1552 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
23/tcp open telnet
80/tcp open http
111/tcp open sunrpc
113/tcp open auth
6000/tcp open X11
Nmap run completed -- 1 IP address (1 host up) scanned in 5 seconds
Tcpdump-Trace:
10:44:24.004397 Diablo > Diablo: icmp: echo request
4500 001c ffcc 0000 2a01 9312 7f00 0001
7f00 0001 0800 103d e7c2 0000
10:44:24.004397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 183d e7c2 0000
10:44:24.004397 Diablo.36398 > Diablo.http: . ack 718216305 win 2048
4500 0028 2e28 0000 2906 65a6 7f00 0001
7f00 0001 8e2e 0050 9220 0003 2acf 1c71
5010 0800 41f0 0000
10:44:24.004397 Diablo.http > Diablo.36398: R 718216305:718216305(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 8e2e 2acf 1c71 0000 0000
5004 0000 dc1f 0000
10:44:24.304397 Diablo.36378 > Diablo.1996: FP 0:0(0) win 2048 urg 0
4500 0028 7651 0000 2906 1d7d 7f00 0001
7f00 0001 8e1a 07cc 0000 0000 0000 0000
5029 0800 13d3 0000
10:44:24.304397 Diablo.1996 > Diablo.36378: R 0:0(0) ack 1 win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 07cc 8e1a 0000 0000 0000 0001
5014 0000 1be7 0000
Die andere Möglichkeit, der NULL Scan, bedeutet, dass kein
Flag gesetzt ist. Sollte der Port geschlossen sein, wird
wiederum RST zurückgesendet.
[Socma]$ nmap -sN localhost
Starting nmap V. 2.54BETA36 ( www.insecure.org/nmap/ )
Interesting ports on Diablo (127.0.0.1):
(The 1552 ports scanned but not shown below are in state: closed)
Port State Service
21/tcp open ftp
23/tcp open telnet
80/tcp open http
111/tcp open sunrpc
113/tcp open auth
6000/tcp open X11
Nmap run completed -- 1 IP address (1 host up) scanned in 5 seconds
Tcpdump-Trace:
10:43:37.594397 Diablo > Diablo: icmp: echo request
4500 001c 2ecf 0000 2c01 6210 7f00 0001
7f00 0001 0800 8f87 6878 0000
10:43:37.594397 Diablo > Diablo: icmp: echo reply (DF)
4500 001c 0000 4000 ff01 7dde 7f00 0001
7f00 0001 0000 9787 6878 0000
10:43:37.604397 Diablo.34607 > Diablo.http: . ack 1932747046 win 4096
4500 0028 ee0f 0000 3706 97be 7f00 0001
7f00 0001 872f 0050 5b20 0003 7333 6126
5010 1000 ead5 0000
10:43:37.604397 Diablo.http > Diablo.34607: R 1932747046:1932747046(0)
win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0050 872f 7333 6126 0000 0000
5004 0000 5605 0000
10:43:37.904397 Diablo.34587 > Diablo.408: . win 4096
4500 0028 e3bb 0000 3706 a212 7f00 0001
7f00 0001 871b 0198 0000 0000 0000 0000
5000 1000 192f 0000
10:43:37.904397 Diablo.408 > Diablo.34587: R 0:0(0) ack 0 win 0 (DF)
4500 0028 0000 4000 ff06 7dcd 7f00 0001
7f00 0001 0198 871b 0000 0000 0000 0000
5014 0000 291b 0000
Man benötigt also nicht den kompletten
Three-Way-Handshake, dadurch ist Stealth Scanning (wie schon
gesagt) "unauffälliger" als TCP Scanning. IDS sollten auf
jeden Fall in der Lage sein, diese Anormalitäten (Xmas und
NULL) zu erkennen... ---------- -------------- ---------- | YOU | <------------> | Dumb Host | <---------->| TARGET | ---------- -------------- ----------Hierbei gilt, dass der Dumb Host möglichst wenig Traffic haben sollte, warum, wird am Ende sicherlich deutlicher. Nur wie wird jetzt der Dumb Host genutzt, bzw. warum brauchen wir überhaupt einen? Ok, diese Frage führt zur eigentlichen Attacke und somit auch der Erklärung, warum ein Dumb Host notwendig ist. Damit man später herausfinden kann, ob bei TARGET ein Port offen oder geschlossen ist, muss man das IP ID-Feld des Dumb Hosts untersuchen. Dafür wird dem Dumb Host erst einmal ein Paket zugesendet (Echo Request), anhand seines Replys kann man das ID-Feld, bzw. den Wert, den das ID-Feld hat, auslesen. Anschließend kann man TARGET ein Paket schicken, wobei die Source Address die vom Dumb Host ist. Die Antwort von TARGET erhält daraufhin unser Dumb Host. Sollte er SYN/ACK von TARGET erhalten, so bedeutet das, dass der Port offen ist. Als Antwort wird unser Dumb Host dann ein Paket zurückschicken, in dem RST gesetzt ist. Sollte der Dumb Host allerdings ein RST/ACK von der Target Machine erhalten, schickt er keine Antwort mehr an TARGET. Um nun herausfinden zu können, welche Antwort der Dumb Host vom TARGET bekam, schicken wir dem Dumb Host nochmals ein Ping. Wenn der Port des Targets offen war und somit ein RST zurückgesendet wurde, wird auch das IP ID-Feld des Dumb Hosts inkrementiert, bei geschlossenem Port passiert nichts. Durch Auslesen des neuen IP ID-Wertes des Dumb Host kann man also erkennen, ob die Ports offen oder geschlossen waren. Nun ist hoffentlich auch klarer, warum wir einen Dumb Host verwenden, also einen Host mit möglichst wenig Traffic. Wenn zuviel Traffic auf dem Host herrscht, wäre es schwieriger zu spezifizieren, welche Ports offen sind (bei TARGET), die Wahrscheinlichkeit, dass man sich vertun würde, wäre bei größerem Traffic natürlich dadurch auch höher.
--------------------------------------------------- | Typ | Code | Pruefsumme | --------------------------------------------------- | Bezeichner | Sequenz | --------------------------------------------------- | Absendezeit | --------------------------------------------------- | Empfangszeit | --------------------------------------------------- | Ruecksendezeit | ---------------------------------------------------Bevor ich auf den Nutzen eines Time Stamp Request für einen Angreifer komme, erst einmal grundsätzlich etwas zum Time Stamp. Für uns sind eigentlich nur die letzten drei "Felder" von Interesse. Hier aber erstmal die entsprechende Stelle im RFC:
The Originate Timestamp is the time the sender last touched the message before sending it, the Receive Timestamp is the time the echoer first touched it on receipt, and the Transmit Timestamp is the time the echoer last touched the message on sending it."
11:38:37.898253 Diablo > Diablo: icmp: time stamp query id 53763 seq 64548
(ttl 254, id 13170, len 40)
4500 0028 3372 0000 fe01 8b60 7f00 0001
7f00 0001 0d00 61fb d203 fc24 0211 c0ca
0000 0000 0000 0000
11:38:37.898253 Diablo > Diablo: icmp: time stamp reply id 53763 seq 64548 :
org 0x211c0ca recv 0x211c0ca xmit 0x211c0ca (DF) (ttl 255, id 0, len 40)
4500 0028 0000 4000 ff01 7dd2 7f00 0001
7f00 0001 0e00 db43 d203 fc24 0211 c0ca
0211 c0ca 0211 c0ca
ICMP Information Request / Reply (RFC792): "This message may
be sent with the source network in the IP header source and
destination address fields zero (which means "this" network).
The replying IP module should send the reply with the addresses
fully specified. This message is a way for a host to find out
the number of the network it is on. " The address of the source in a information request message will be the destination of the information reply message. To form a information reply message, the source and destination addresses are simply reversed, ..."
------------------------------------------------------------------ | Typ | Code | Pruefsumme | ------------------------------------------------------------------ | Bezeichner | Sequenz | ------------------------------------------------------------------Es scheint, als könnte man nur innerhalb des Netzwerks einen Information Request versenden (s.o.), doch dies muss nicht zwangsläufig so sein. Einige Betriebssysteme antworten auch auf einen Information Request, bei dem die Destination IP nicht im selben Netzwerk liegt. In einem solchen Information Reply würden wir dann die IP des Hosts erhalten (und nicht die Netznummer).
11:42:35.608253 Diablo > Diablo: icmp: information request (ttl 255,
id 13170, len 28)
4500 001c 3372 0000 ff01 8a6c 7f00 0001
7f00 0001 0f00 1afc d603 0000
11:42:36.608253 Diablo > Diablo: icmp: information request (ttl 255,
id 13170, len 28)
4500 001c 3372 0000 ff01 8a6c 7f00 0001
7f00 0001 0f00 19fc d603 0100
ICMP Address Mask Request / Reply (RFC 950): Der Address Mask
Request (Typ 17) ist in einem anderen RFC beschrieben worden,
schaut für nähere Infos also im RFC 950 und nicht im RFC 792
nach. Sinn und Zweck eines Address Mask Request ist es, die
Subnetmask des verbundenen Netzes zu ermitteln. Wenn ein
Gateway einen solchen Request empfängt, sollte er die
entsprechenden Informationen an den entsprechenden Knoten
zurücksenden (Address Mask Reply - Typ 18)
------------------------------------------------------------ | Typ | Code | Pruefsumme | ------------------------------------------------------------ | Bezeichner | Sequenz | ------------------------------------------------------------ | Address Mask | ------------------------------------------------------------Ihr könnt somit nicht nur Hosts im Netzwerk entdecken (die online sind), ihr könntet anhand weiterer Tests auch mehr über die Netzwerk-Konfiguration erfahren ....
11:45:26.678253 Diablo > Diablo: icmp: address mask request (ttl 254, id
13170, len 32)
4500 0020 3372 0000 fe01 8b68 7f00 0001
7f00 0001 1100 edd7 dc03 2524 0000 0000
Ich hoffe, dieser Abschnitt hat euch gezeigt, dass man weitaus
mehr Möglichkeiten hat, Informationen über ein Netzwerk zu
erhalten, und dass man nicht immer auf das "normale" ping
zurückgreifen muss... In den entsprechenden RFC sind
meistens auch Hinweise enthalten, die beschreiben, was man
beachten sollte, wenn man die verschiedenen Requests
"unterstützen" möchte. Entwickler von ("richtigen") IDS
müssen solche Dinge natürlich auch beachten, wenn sie
unterstützt werden sollen, muss darauf geachtet werden, dass
dies richtig geschieht (s. RFC). Doch auch hier ist noch
nicht Schluss, wie ihr im nächsten Abschnitt nachlesen
könnt... If the gateway or host processing a datagram finds a problem with the header parameters such that it cannot complete processing the datagram it must discard the datagram. One potential source of such a problem is with incorrect arguments in an option. The gateway or host may also notify the source host via the parameter problem message. This message is only sent if the error caused the datagram to be discarded."
A host SHOULD generate Parameter Problem messages. An incoming Parameter Problem message MUST be passed to the transport layer, and it MAY be reported to the user. DISCUSSION: The ICMP Parameter Problem message is sent to the source host for any problem not specifically covered by another ICMP message. Receipt of a Parameter Problem message generally indicates some local or remote implementation error."Insgesamt betrachtet, ist dies eine sehr gute Möglichkeit, Hosts im Netzwerk zu erkennen (aus genannten Gründen)...
4.3.3.5 Parameter Problem A router MUST generate a Parameter Problem message for any error not specifically covered by another ICMP message. The IP header field or IP option including the byte indicated by the pointer field MUST be included unchanged in the IP header returned with this ICMP message. Section [4.3.2] defines an exception to this requirement. "Nichtsdestotrotz interpretieren verschiedene Router diese Stelle (und auch weitere) auch unterschiedlich, wodurch nicht wirklich sicher gestellt ist, dass ein Parameter Problem gemeldet wird...
The ICMP Destination Unreachable message is sent by a router in
response to a packet which it cannot forward because the destination
(or next hop) is unreachable or a service is unavailable. Examples
of such cases include a message addressed to a host which is not
there and therefore does not respond to ARP requests, and messages
addressed to network prefixes for which the router has no valid
route.
A router MUST be able to generate ICMP Destination Unreachable
messages and SHOULD choose a response code that most closely matches
the reason the message is being generated.
0 = Network Unreachable - generated by a router if a forwarding path
(route) to the destination network is not available;
1 = Host Unreachable - generated by a router if a forwarding path
(route) to the destination host on a directly connected network
is not available (does not respond to ARP);
2 = Protocol Unreachable - generated if the transport protocol
designated in a datagram is not supported in the transport layer
of the final destination;
3 = Port Unreachable - generated if the designated transport protocol
(e.g., UDP) is unable to demultiplex the datagram in the
transport layer of the final destination but has no protocol
mechanism to inform the sender;
4 = Fragmentation Needed and DF Set - generated if a router needs to
fragment a datagram but cannot since the DF flag is set;
5 = Source Route Failed - generated if a router cannot forward a
packet to the next hop in a source route option;
6 = Destination Network Unknown - This code SHOULD NOT be generated
since it would imply on the part of the router that the
destination network does not exist (net unreachable code 0
SHOULD be used in place of code 6);
7 = Destination Host Unknown - generated only when a router can
determine (from link layer advice) that the destination host
does not exist;
11 = Network Unreachable For Type Of Service - generated by a router
if a forwarding path (route) to the destination network with the
requested or default TOS is not available;
12 = Host Unreachable For Type Of Service - generated if a router
cannot forward a packet because its route(s) to the destination
do not match either the TOS requested in the datagram or the
default TOS (0). "
Wenn wir nun z.B. probieren, an irgendeinen Port ein Paket zu
senden, das ein Protokoll verwendet, das gar nicht existiert,
sollte eigentlich Destination Unreachable mit Code - Wert 2
(Protocol Unreachable) gemeldet werden. Um bei diesem Beispiel
zu bleiben, müsst ihr erst einmal wissen, welche Protokolle
"zulässig" sind, dies könnt ihr rausfinden, indem ihr eure
/etc/protocols öffnet. Nach der Installation auf einem meiner
Rechner, sah die /etc/protocols z.B. so aus:
-------------- /etc/protocols ----------------
# /etc/protocols:
# $Id: protocols,v 1.2 2001/01/29 17:29:30 notting Exp $
#
# Internet (IP) protocols
#
# from: @(#)protocols 5.1 (Berkeley) 4/17/89
#
# Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).
#
# See also http://www.isi.edu/in-notes/iana/assignments/protocol-numbers
ip 0 IP # internet protocol, pseudo protocol number
#hopopt 0 HOPOPT # hop-by-hop options for ipv6
icmp 1 ICMP # internet control message protocol
igmp 2 IGMP # internet group management protocol
ggp 3 GGP # gateway-gateway protocol
ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
st 5 ST # ST datagram mode
tcp 6 TCP # transmission control protocol
cbt 7 CBT # CBT, Tony Ballardie
egp 8 EGP # exterior gateway protocol
igp 9 IGP # any private interior gateway
# (Cisco: for IGRP)
bbn-rcc 10 BBN-RCC-MON # BBN RCC Monitoring
nvp 11 NVP-II # Network Voice Protocol
pup 12 PUP # PARC universal packet protocol
argus 13 ARGUS # ARGUS
emcon 14 EMCON # EMCON
xnet 15 XNET # Cross Net Debugger
chaos 16 CHAOS # Chaos
udp 17 UDP # user datagram protocol
mux 18 MUX # Multiplexing protocol
dcn 19 DCN-MEAS # DCN Measurement Subsystems
hmp 20 HMP # host monitoring protocol
prm 21 PRM # packet radio measurement protocol
xns-idp 22 XNS-IDP # Xerox NS IDP
trunk-1 23 TRUNK-1 # Trunk-1
trunk-2 24 TRUNK-2 # Trunk-2
leaf-1 25 LEAF-1 # Leaf-1
leaf-2 26 LEAF-2 # Leaf-2
rdp 27 RDP # "reliable datagram" protocol
irtp 28 IRTP # Internet Reliable Transaction Protocol
iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4
netblt 30 NETBLT # Bulk Data Transfer Protocol
mfe-nsp 31 MFE-NSP # MFE Network Services Protocol
merit-inp 32 MERIT-INP # MERIT Internodal Protocol
sep 33 SEP # Sequential Exchange Protocol
3pc 34 3PC # Third Party Connect Protocol
idpr 35 IDPR # Inter-Domain Policy Routing Protocol
xtp 36 XTP # Xpress Tranfer Protocol
ddp 37 DDP # Datagram Delivery Protocol
idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto
tp++ 39 TP++ # TP++ Transport Protocol
il 40 IL # IL Transport Protocol
ipv6 41 IPv6 # IPv6
sdrp 42 SDRP # Source Demand Routing Protocol
ipv6-route 43 IPv6-Route # Routing Header for IPv6
ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6
idrp 45 IDRP # Inter-Domain Routing Protocol
rsvp 46 RSVP # Resource ReSerVation Protocol
gre 47 GRE # Generic Routing Encapsulation
mhrp 48 MHRP # Mobile Host Routing Protocol
bna 49 BNA # BNA
ipv6-crypt 50 IPv6-Crypt # Encryption Header for IPv6
ipv6-auth 51 IPv6-Auth # Authentication Header for IPv6
i-nlsp 52 I-NLSP # Integrated Net Layer Security TUBA
swipe 53 SWIPE # IP with Encryption
narp 54 NARP # NBMA Address Resolution Protocol
mobile 55 MOBILE # IP Mobility
tlsp 56 TLSP # Transport Layer Security Protocol
skip 57 SKIP # SKIP
ipv6-icmp 58 IPv6-ICMP # ICMP for IPv6
ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6
ipv6-opts 60 IPv6-Opts # Destination Options for IPv6
# 61 # any host internal protocol
cftp 62 CFTP # CFTP
# 63 # any local network
sat-expak 64 SAT-EXPAK # SATNET and Backroom EXPAK
kryptolan 65 KRYPTOLAN # Kryptolan
rvd 66 RVD # MIT Remote Virtual Disk Protocol
ippc 67 IPPC # Internet Pluribus Packet Core
# 68 # any distributed file system
sat-mon 69 SAT-MON # SATNET Monitoring
visa 70 VISA # VISA Protocol
ipcv 71 IPCV # Internet Packet Core Utility
cpnx 72 CPNX # Computer Protocol Network Executive
cphb 73 CPHB # Computer Protocol Heart Beat
wsn 74 WSN # Wang Span Network
pvp 75 PVP # Packet Video Protocol
br-sat-mon 76 BR-SAT-MON # Backroom SATNET Monitoring
sun-nd 77 SUN-ND # SUN ND PROTOCOL-Temporary
wb-mon 78 WB-MON # WIDEBAND Monitoring
wb-expak 79 WB-EXPAK # WIDEBAND EXPAK
iso-ip 80 ISO-IP # ISO Internet Protocol
vmtp 81 VMTP # Versatile Message Transport
secure-vmtp 82 SECURE-VMTP # SECURE-VMTP
vines 83 VINES # VINES
ttp 84 TTP # TTP
nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP
dgp 86 DGP # Dissimilar Gateway Protocol
tcf 87 TCF # TCF
eigrp 88 EIGRP # Enhanced Interi
Was, wenn der Host aber kein Protocol Unreachable zurückgibt
(obwohl man ein Protokoll verwendet hat, das es eigentlich
nicht gibt)? Dies kann nun zwei Ursachen haben, zum einen
könnte es sein, dass ihr eine AIX, HP-UX oder Digital Unix
Maschine erwischt habt oder aber das Ruleset des Rechners
erlaubt den Zugriff auf diese Ports nicht. Stellt also erst mal
sicher, was für einen Rechner ihr scant (u.a. mit OS Fingerprint
Detection), ansonsten könnt ihr davon ausgehen, dass eben
gefiltert/geblockt wird. ------------------ SYN ------------- | Rechner A | ------------------------------------ > | Rechner B | ------------------ ------------- ------------------ ACK/SYN ------------- | Rechner A | <------------------------------------| Rechner B | ------------------ ------------- ------------------ ACK ------------- | Rechner A | ------------------------------------ > | Rechner B | ------------------ -------------Rechner A schickt also Rechner B ein SYN, um zu sagen, dass er eine Verbindung haben will, B antwortet mit ACK/SYN und wartet nun auf das abschließende ACK, womit die Verbindung vollständig wäre. Doch was ist, wenn das letzte ACK gar nicht erst gesendet wird? Wenn B sein SYN/ACK zurückschickt, wartet er (wie bereits gesagt) schließlich noch auf das ACK von A, solange wird diese noch nicht vollständige Verbindung in die sogenannte Connection Queue von "B" aufgenommen. Sollte der Verbindungsaufbau abgeschlossen sein (also A hat B noch ACK geschickt), wird sie wieder aus der Connection Queue entfernt. Da meist noch die IP-Adresse gespoofed ist, erhält B niemals ein ACK zurück (sollte zumindest so sein). Man kann also einfach die Connection Queue "füllen", jeder weitere Verbindungsversuch würde scheitern, da der Rechner keine weiteren Verbindungen aufnehmen kann.
23/06/02 23:12:48 194.157.1.1 80 -> 194.157.1.1 23/06/02 23:14:57 194.157.1.1 31337 -> 194.157.1.1Wie ihr hier nochmals sehen könnt, sind Source IP und Destination IP gleich. Damit Svoern seine Tcpdump-Traces bekommt, hier noch ein Tcpdump-Trace ;) :
12:35:26.916369 192.168.38.110.135>192.168.38.110.135: udp 46[tos0x3,ECT,CE]
4503 004a 96ac 0000 4011 15c7 c0a8 266e
c0a8 266e 0087 0087 0036 8433 6920 616d
206c 616d 6520 646f 7320 6b69 6420 6275
7420 6920 7265
12:35:26.916566 192.168.38.110.135>192.168.38.110.135: udp 46[tos0x3,ECT,CE]
4503 004a 2923 0000 4011 8350 c0a8 266e
c0a8 266e 0087 0087 0036 8433 6920 616d
206c 616d 6520 646f 7320 6b69 6420 6275
7420 6920 7265
12:35:26.916682 192.168.38.110.135>192.168.38.110.135:udp 46[tos0x3,ECT,CE]
4503 004a 50a0 0000 4011 5bd3 c0a8 266e
c0a8 266e 0087 0087 0036 8433 6920 616d
206c 616d 6520 646f 7320 6b69 6420 6275
7420 6920 7265
Die Attacke, die ihr hier sehen könnt, wird übrigens
auch Snork genannt.
10:13:32.104203 10.10.10.10.53>192.168.1.3.53: udp 28(frag 242:36@0+)(ttl64)
4500 0038 00f2 2000 4011 8404 0a0a 0a0a
c0a8 0103 0035 0035 0024 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000
10:13:32.104272 10.10.10.10 >192.168.1.3: udp 28(frag 242:4@24)(ttl 64)
4500 0018 00f2 0003 4011 a421 0a0a 0a0a
c0a8 0103 0035 0035 0024 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000
Ping of Death: 17:43:58.431 pinger > target: icmp echo request (frag 4321: 380@0+) 17:43:58.431 pinger > target: (frag 4321: 380@2656+) 17:43:58.431 pinger > target: (frag 4321: 380@3040+) 17:43:58.431 pinger > target: (frag 4321: 380@3416+)
09:28:28.666073 179.135.168.43>256.256.30.255: icmp: echo request (DF)
4500 001c c014 4000 1e01 6172 b387 a82b
c0a8 1eff 0800 f7ff 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000
09:28:28.696073 68.90.226.250>256.256.30.255: icmp: echo request (DF)
4500 001c c015 4000 1e01 95cf 445a e2fa
c0a8 1eff 0800 f7ff 0000 0000 3136 3803
3133 3503 3137 3907 696e 2d61 6464
09:28:28.726073 138.98.10.247>256.256.30.255: icmp: echo request (DF)
4500 001c c016 4000 1e01 27ca 8a62 0af7
c0a8 1eff 0800 f7ff 0000 0000 0332 3236
3938 0331 3638 0769 6e2d 6164 6472
09:28:28.756073 130.113.202.100 > 256.256.30.255: icmp: echo request (DF)
4500 001c c017 4000 1e01 704c 8271ca64
c0a8 1eff 0800 f7ff 0000 0000 0231 3002
3938 0331 3338 0769 6e2d 6164 6472
...
Seit längerer Zeit gibt es auch noch DDoS-Attacken
(Distributed Denial of Service). Wie der Name schon sagt,
handelt es sich hier um verteilte/vernetzte DoS-Attacken. Der
Angreifer (Client) sucht sich andere Rechner/Netzwerke, die
man leicht exploiten kann, diese ersten infizierten Rechner
sind dann die sogenannten Handler. Von den Handlern aus werden weitere
Rechner / Netzwerke infiziert, diese infizierten Rechner werden
dann Agenten genannt, d.h. bildlich dargestellt:
---------
| YOU |
---------
|
---------------------------------
| | |
Handler Handler Handler
| | |
------ ------------------- ------------
| | | | | |
Agent Agent Agent Agent Agent Agent
Später können dann die Angriffe von den Agenten...aus,
ausgeführt werden.
Das war der erste Teil dieser Serie. Es geht weiter in der nächsten Ausgabe von LinuxFocus.