Documento in formato pdf 219Kb

Transcript

Documento in formato pdf 219Kb
Strumenti
Strumenti per
per la
la raccolta
raccolta di
di
informazioni
informazioni sulla
sulla rete
rete
-- Information
Information gathering
gathering -Stefano Suin <[email protected]>
Centro di Servizi per la rete di Ateneo
Università
Università di Pisa
AIPA, 14/01/2000
Stefano Suin - Information gathering -1
Metodologie classiche di
attacco alle reti informatiche
AIPA, 14/01/2000
Stefano Suin - Information gathering -2
1
Le IV fasi dell
’attacco
dell’attacco
ÒAzioni di scan della rete
Per
individuare reti o porzioni di reti che
possono essere vulnerabili agli attacchi
Per individuare i singoli host e le loro
caratteristiche: sistema operativo, server
running daemon, porte TCP aperte
ÒAzione intrusiva
acquisizione
dei diritti di super-utente
(root)
Installazione di una backdoor
Patch al sistema operativo per nascondere le
successive intrusioni
AIPA, 14/01/2000
Stefano Suin - Information gathering -3
Le IV fasi dell
’attacco
dell’attacco
ÒAzione protettiva
patch
al sistema operativo per rendere
inaccessibile il sistema ad altri hacker. (gli
hacker sono i maggiori esperti di sicurezza!)
installazione di backdoor
ÒAzione intercettiva
in
base all’obiettivo:
Sniffer
password cracker
Back Orifice
………...
………...
AIPA, 14/01/2000
Stefano Suin - Information gathering -4
2
Metodologie di recupero di
informazioni
AIPA, 14/01/2000
Stefano Suin - Information gathering -5
Identificazione degli obiettivi
Òla fase di recupero informazioni è la più
delicata
Òl’hacker sceglie le sue “vittime” sulla
base dei risultati della fase di
information gathering
I siti che risultano più debolmente protetti
diventano i primi potenziali obiettivi
AIPA, 14/01/2000
Stefano Suin - Information gathering -6
3
Network scanning
ÒE’ di importanza strategica conoscere i
tool di scanning e le tecnologie adottate
da questi tool per il recupero delle
informazioni
Cosa
sono?
Come si manifesta il loro utilizzo contro la nostra rete?
Quali informazioni sono in grado di recuperare
Qual è la loro pericolosità
pericolosità potenziale?
Solo conoscendo la risposta a questi
quesiti siamo effettivamente in grado di
difenderci
Stefano Suin - Information gathering -7
AIPA, 14/01/2000
Gli obiettivi
ÒNetwork mapping
ÒIdentificazione dei sistemi operativi e
loro release
ÒIdentificazione di firewall e packet
filtering
ÒIdentificazione dei servizi
ÒAttack obfuscation
AIPA, 14/01/2000
Stefano Suin - Information gathering -8
4
Le prime informazioni
ÒUna parte significativa delle
informazioni può essere ricavata dalla
normale visibilità esterna della rete
Interrogazioni
al nameserver
Web page
Ftp repository
Interrogazioni
al sistema di posta
Interrogazioni al finger
L’hacker ottiene una lista degli host e un
piano delle relazioni esistenti fra questi
AIPA, 14/01/2000
Stefano Suin - Information gathering -9
Identificazione dei componenti
““trusted”
trusted” della rete obiettivo
Òmacchine di amministrazione
Òserver
Òrouter
Ottenuto l’accesso ad un host trusted è
abbastanza semplice espandere i
propri attacchi all’interno della rete
AIPA, 14/01/2000
Stefano Suin - Information gathering -10
5
Le tecnologie dei tool di scan
ÁAnalisi dello stack TCP/IP
Firewalking
Stealth scanning
Decoys
AIPA, 14/01/2000
Stefano Suin - Information gathering -11
Analisi dello stack TCP/IP
ÒIdentificazione del sistema operativo e
relativa versione
banner
differenze
di implementazione dello stack, che
possono essere testate inviando particolari
pacchetti “costruiti in casa” e rilevando la
reazione della macchina obiettivo
Se qualcuno sta tentando di rilevare il
vostro sistema operativo si tratta, quasi
con certezza, dell’ultimo passo prima di un
attacco
AIPA, 14/01/2000
Stefano Suin - Information gathering -12
6
Gli strumenti
ù utilizzati
strumenti pi
più
utilizzati
ÒQueso
Òhttp://www.apostols.org/projectz/queso
ÒNMAP
Òhttp://www.insecure.org/nmap
AIPA, 14/01/2000
Stefano Suin - Information gathering -13
FingerPrint con queso
ÒQueso
Òidentificazione di oltre 100 sistemi
operativi, memorizzati in un file di
configurazione
ÒEx. Usage
[[email protected]]#
queso -p23 myhost.com
131.114.20.2:80 * Solaris 2.x
AIPA, 14/01/2000
Stefano Suin - Information gathering -14
7
Queso figerprint signature
17:32:32.259996 hack.telnet > realta-vpn.34151: P 213531131:1213531168(37)
ack 4262377316 win 32120 (DF)
17:32:32.703129 hack.telnet > realta-vpn.34151: P 37:41(4) ack 3 win 32120
17:32:32.728002 hack.21595 > realta.80: S 425413583:425413583(0) win 4660
17:32:32.728457 hack.21595 > realta.80: R 425413584:425413584(0) win 0
17:32:32.742262 hack.21596 > realta.80: S 425413583:425413583(0) ack 0 win
17:32:32.762146 hack.21597 > realta.80: F 425413583:425413583(0) win 4660
17:32:32.782386 hack.21598 > realta.80: F 425413583:425413583(0) ack 0 win
17:32:32.802214 hack.21599 > realta.80: SF 425413583:425413583(0) win 660
17:32:32.802581 hack.21599 > realta.80: R 425413584:425413584(0) win 0
17:32:32.822117 hack.21600 > realta.80: P win 4660
17:32:32.842225 hack.21601 > realta.80: S 425413583:425413583(0) win 4660
17:32:32.842597 hack.21601 > realta.80: R 425413584:425413584(0) win 0
AIPA, 14/01/2000
Stefano Suin - Information gathering -15
FingerPrint con NMAP
ÒAnalisi delle risposte ad una serie di
“bogus” packet
Òoltre 220 fingerprint di diversi sistemi
operativi identificabili
[[email protected]]# nmap -sS -p23 -PO myhost.com
Port State
Protocol Service
23 open
tcp
telnet
TCP Sequence Prediction: Class=random positive increments
Difficulty=34519 (Worthy challenge)
Remote operating system guess: Solaris 2.6 - 2.7
AIPA, 14/01/2000
Stefano Suin - Information gathering -16
8
Nmap fingerprint
17:37:05.067984 hack.telnet > realta-vpn.34151: P 6:85(79) ack 1 win 32120 (DF)
17:37:05.069264 hack.43848 > realta.telnet: S 3614024584:3614024584(0) win 4096
17:37:05.069713 hack.43848 > realta.telnet: R 3614024585:3614024585(0) win 0
17:37:05.071424 hack.43858 > realta.telnet: . ack 0 win 4096 <wscale 10,nop,mss
265,timestamp 1061109567[|tcp]>
17:37:05.071575 hack.43859 > realta.33704: S 4293221460:4293221460(0) win 4096
<wscale 10,nop,mss 265,timestamp 1061109567[|tcp]>
17:37:05.071700 hack.43860 > realta.33704: . ack 0 win 4096 <wscale 10,nop,mss
265,timestamp 1061109567[|tcp]>
17:37:05.071275 hack.43857 > realta.telnet: SFP 4293221460:4293221460(0) win 4096
urg 0 <wscale 10,nop,mss 265,timestamp 1061109567[|tcp]>
17:37:05.071840 hack.43861 > realta.33704: FP 4293221460:4293221460(0) win 4096
urg 0 <wscale10,nop,mss 265,timestamp 1061109567[|tcp]>
17:37:05.072029 hack.43848 > realta.33704: udp 300
AIPA, 14/01/2000
Stefano Suin - Information gathering -17
Altre informazioni
ÒDall’analisi delle risposte possiamo
ricavare molte altre informazioni
port
filtering detection
tcp sequencability
username owner dei processi su una certa
porta
potenzialità di amplificazione smurfing
AIPA, 14/01/2000
Stefano Suin - Information gathering -18
9
Le tecnologie dei tool di scan
Analisi dello stack TCP/IP
ÁFirewalking
Stealth scanning
Decoys
AIPA, 14/01/2000
Stefano Suin - Information gathering -19
Firewalking
ÒUna tecnica utilizzata per il recupero di
informazioni su una rete protetta da un
firewall
Òsi usa per analizzare firewall rules di
protezione (ACL) e individuare router
dietro a un firewall
L’hacker ottiene il disegno della topologia
di rete dietro a un firewall e la lista delle
porte aperte su un firewall
AIPA, 14/01/2000
Stefano Suin - Information gathering -20
10
Firewalk
ÒFirewalk 0.99.1
Òhttp://www.es2.net
Òusa tecniche traceroute-like per
determinare se un pacchetto può o no
passare attraverso un firewall packetfiltering
Stefano Suin - Information gathering -21
AIPA, 14/01/2000
hping
ÒHping 0.67
Òhttp://www.kyuz.org
ÒCostruzione ed invio di pacchetti
TCP/UDP/ICMP in modo estremamente
parametrico
Òpossibilità di “bump up” TTL usando
<ctrl-z>
AIPA, 14/01/2000
Stefano Suin - Information gathering -22
11
Router and filter policy
discovery
ÒStrategie traceroute -like
incremento
del TTL e analisi delle risposte
“ICMP time exceeded” dai router lungo il
cammino
raggiungimento dei target host dietro i
firewall attraverso le porte che lasciano
passare il traffico
ÒMappa dei router dietro i firewall
AIPA, 14/01/2000
Stefano Suin - Information gathering -23
Le tecnologie dei tool di scan
Analisi dello stack TCP/IP
Firewalking
ÁStealth scanning
Decoys
AIPA, 14/01/2000
Stefano Suin - Information gathering -24
12
Stealth scan
ÒVarie tecniche per il rilevamento di host,
servizi, sistemi operativi e release di
software
Ògli scan basati su connect sono
facilmente rilevabili e sono da attribuire
ad hacker poco “sofisticati”
Òhacker più competenti non vogliono
essere rilevati da sistemi IDS o firewall e
non lasciare traccia delle operazioni
compiute
AIPA, 14/01/2000
Stefano Suin - Information gathering -25
Nmap
ÒNmap supporta 4 tipi di stealth scanning
SYN
(Syn flag settato)
FIN (FIN flag settato) XMAS (FIN,URG,
PUSH)
NULL (nessun flag settato)
ÒFIN, XMAS, NULL (negative scan)
le
porte non aperte rispondono con un RST
le porte chiuse lo ignorano
AIPA, 14/01/2000
Stefano Suin - Information gathering -26
13
Syn scan signature
Nmap -sS -p25 myhost.com
19:00:08.664881 hack > realta: icmp: echo request
19:00:08.665047 hack.44132 > realta.80: . ack 2722473141 win
2048
19:00:08.974314 hack.44112 > realta.smtp: S
1191220368:1191220368(0) win 2048
19:00:08.974772 hack.44112 > realta.smtp: R
1191220369:1191220369(0) win 0
AIPA, 14/01/2000
Stefano Suin - Information gathering -27
FIN scan signature
Nmap -sF -p25 myhost.com
19:03:00.912915 hack.46005 > realta.80: . ack 195874952 win 2048
19:03:01.222258 hack.45985 > realta.smtp: F 0:0(0) win 2048
19:03:01.526442 hack.45986 > realta.smtp: F 0:0(0) win 2048
AIPA, 14/01/2000
Stefano Suin - Information gathering -28
14
XMAS scan
scan signature
signature
Nmap -sX -p25 myhost.com
19:05:12.065529 hack > realta: icmp: echo request
19:05:12.065691 hack.58598 > realta.80: . ack 4104302819 win 4096
19:05:12.375024 hack.58578 > realta.smtp: FP 0:0(0) win 4096 urg 0
19:05:12.679396 hack.58579 > realta.smtp: FP 0:0(0) win 4096 urg 0
AIPA, 14/01/2000
Stefano Suin - Information gathering -29
NULL
NULL scan
scan signature
signature
Nmap -sN -p25 myhost.com
19:07:06.684716 hack > realta: icmp: echo request
19:07:06.684867 hack.33961 > realta.80: . ack 11840539 win 3072
19:07:06.994192 hack.33941 > realta.smtp: . win 3072
19:07:07.295434 hack.33942 > realta.smtp: . win 3072
AIPA, 14/01/2000
Stefano Suin - Information gathering -30
15
Service discovery
ÒLe tecniche stealth per il service
discovery coprono la quasi totalità degli
attacchi registrati
ÒMolti tool ma le tecniche sono analoghe
AIPA, 14/01/2000
Stefano Suin - Information gathering -31
Le tecnologie dei tool di scan
Analisi dello stack TCP/IP
Firewalking
Stealth scanning
ÁDecoys
AIPA, 14/01/2000
Stefano Suin - Information gathering -32
16
Decoys
ÒMolti scanners includono la possibilità
di utilizzare dei Decoy o indirizzi alterati
per portare gli attacchi
ÒLa tecnica rende molto difficile
determinare la vera sorgente dell’attacco
ÒNMAP
ATTACK obfuscation
AIPA, 14/01/2000
Stefano Suin - Information gathering -33
Decoys
Decoys attack
attack
Nmap -sS -P0 -Ddecoy.com,decoy1.com,decoy3.com
Ddecoy.com,decoy1.com,decoy3.com myhost.com
19:22:54.063126 www.rai.it.44419 > realta.telnet: S 2800940989:2800940989(0)
win 2048
19:22:54.063275 207.46.131.28.44419 > realta.telnet: S
2800940989:2800940989(0) win 2048
19:22:54.063420 hack.44419 > realta.telnet: S 2800940989:2800940989(0) win
2048
19:22:54.063568 www.repubblica.it.44419 > realta.telnet: S
2800940989:2800940989(0) win 2048
19:22:54.063724 www.rai.it.44419 > realta.smtp: S 2800940989:2800940989(0)
win 2048
19:22:54.063872 www.microsoft.com44419 > realta.smtp: S
2800940989:2800940989(0) win 2048
19:22:54.064016 hack.44419 > realta.smtp: S 2800940989:2800940989(0) win
2048
AIPA, 14/01/2000
Stefano Suin - Information gathering -34
17
Identificazione delle
vulnerabilit
à
vulnerabilità
ÒTool automatici di scan
Nessus
http://www.nessus.org
Satan
http://www.fish.com/~zen/satan/satan.html
ÒAggiornamento periodico database
vulnerabilità
AIPA, 14/01/2000
Stefano Suin - Information gathering -35
Azione degli strumenti di scan
Ò TCP portscan di un host
Ò Lista degli indirizzi IP e macchine associate
Ò Dump dei servizi RCP
Ò Lista delle directory esportate via nfs, samba o
netbios
Ò Richieste finger
Ò Scan delle vulnerabilità
vulnerabilità CGI
Ò Server X aperti
Ò Identificazione delle vulnerabilità
vulnerabilità conosciute sui
processi server, tipicamente Posta elettronica,
Nameserver, IMAP, POP3, RPC, Http, Sistemi
Operativi, Ftp, IRC
AIPA, 14/01/2000
Stefano Suin - Information gathering -36
18
Scan automatici
ÒInformazioni in database
successivamente consultabili
ÒArchitettura software modulare (utilizzo
di plugin)
ÒCaratteristiche dello scan estremamente
parametrizzabili
AIPA, 14/01/2000
Stefano Suin - Information gathering -37
Information gathering interno
NTOP
http://ntop.unipi.it
by
Luca Deri [email protected]
with contribution of
Stefano Suin [email protected]
AIPA, 14/01/2000
Stefano Suin - Information gathering -38
19
Architettura
ÒBasato su CIDF (Common Intrusion
Detection Framefork)
Reaction to events
C-measure Box
High level,
interpreted events
Storage of events
Analysis Box
Storage Box
Event Box
Raw or low-level events
AIPA, 14/01/2000
Stefano Suin - Information gathering -39
Caratteristiche
Òdistribuito sulle principali piattaforme
unix
Òcompletamente operativo nel campo nei
network monitoring tool
Òle caratteristiche intrinseche ne
favoriscono una naturale evoluzione
verso la sicurezza
GNU GPL2 Licence agreement
AIPA, 14/01/2000
Stefano Suin - Information gathering -40
20
Supporto
ÒMedia
Loopback,
Loopback,
Ethernet,
Ethernet, Token Ring, PPP, FDDI
ÒProtocols
IP, IPX,
DLC
DecNet,
DecNet, AppleTalk,
AppleTalk, Netbios, OSI,
ÒPlatform
FreeBSD
, Linux, Debian , Plamo , Suse,
Suse,
Trinux,
Trinux, Solaris, SGI IRIX
Stefano Suin - Information gathering -41
AIPA, 14/01/2000
NTOP
Ò Internet Domain Statistics
CGI support
Ò Advanced 'per user' HTTP password protection with
encripoted passwords
Ò Support for SQL database for storing persistent traffic
information
Ò Remote hosts OS identification (via queso)
Ò OSFOSF-1 support Data received/
received/Sent:
Sent: all protocols
Ò Host information
Ò icmp plugin (by Luca Deri)
Deri)
Ò TCP session history
Ò Protocol distribuition
Ò Traffic Statistic
Ò TCPDUMPTCPDUMP-like filtering expression
AIPA, 14/01/2000
Stefano Suin - Information gathering -42
21