Strumenti Utente

Strumenti Sito


it:newbie_guide

Questa è una vecchia versione del documento!


Aircrack-ng Guida per Newbie per OS Linux

Idea e lavoro iniziale di: ASPj
Aiutato da: un buon numero di buone anime
Traduzione di: Asafarakaratara e Incompatibile
Ultimo aggiornamento: May 09, 2008

Questo tutorial ti da le basi per poter iniziare ad utilizzare la suite di Aricrack-ng. E' impossibile prevedere ogni singolo pezzo di informazione che ti servirà per ogni singolo scenario. Sii preparato a svolegere ricerche e vari compiti. Il Forum e la Wiki hanno parecchie informazioni addizionali.

Anche se questo tutorial non compre tutte e quante le fasi in maniera dettagliata, il Simple WEP Crack tututorial tratta tutte quante le fasi in maniera maggiormente dettagliata.

Preparare l'Hardware, Installare Aircrack-ng

Il primo passo per fare si che Aircrack-ng funzioni correttamente sul tuo sistema Linux è quello di applicare le Patch ai driver della tua scheda wireless. Molte schede possono funzionare con più driver, alcune di queste hanno il necessario per utilizzare aircrack-ng, altre no. In ogni caso hai bisogno di una scheda che sia compatibile con aircrack-ng suite. Questo è l'hardware che è totalmente compatibile con l'iniezione dei pacchetti. Una wireless card compatibile può essere utilizzata per crackkare un Access Point in circa un ora. Per determinare a quale categoria appartiene la tua scheda guarda qui: hardware compatibility page.Leggi qui: Tutorial: Is My Wireless Card Compatible? Se tu non sai dove guardare nella tabella, non dovrebbe comunque farti male leggere questo tutorial per aumentare la tua conoscenza e confermare gli attirbuti della tua scheda wireless.

Prima di tutto hai bisogno di comprendere che chipset viene utilizzato nella tua carta e che driver hai bisogno per esso. Puoi determinare il chipset utilizzando le informazioni presenti nel precedente paragrafo. La drivers section ti dice di che driver hai bisogno per un determinato chipset. Scaricali e scarica anche le corrispondeti Patch per l'iniezione di paccheti da http://patches.aircrack-ng.org.

Io ho questa scheda: Ralink USB device. Descriverò i passi per fare funzionare Aircrack-ng con questa scheda. Prima che tu possa compilare e installare i tuoi drivers, hai bisogno dei kernel-sources per la tua distribuzione installati.

Se tu possiedi un altro tipo di scheda wireless, guarda installing drivers page per le istruzioni a riguardo degli altri driver. Se hai delle incertezze, se non sai se installarli, fai una piccola ricerca sul web.

Se tu hai rt2570 USB device (simile a: D-Link DWL-G122 rev. B1 o a: Linksys WUSB54G v4) puoi utilizzare questi driver: http://homepages.tu-darmstadt.de/~p_larbig/wlan/ Questi sono speciali drivers modificati, che supportano l'inziezione di pacchetti ed è stato riportato che funzionano al meglio con Aircrack-ng. Non hanno bisogno della patch. Questi drivers funzionano benissimo anche per le operazioni normali. (Partendo con il kernel 2.6.25 e Aircrack-ng v1.0-rc1, i drivers inseriti nel kernel , rt2500usb, possono comunque essere utilizzati.) Ora facciamo l'unpack dei drivers e installiamoli:

tar xfj rt2570-k2wrlz-1.3.0.tar.bz2
cd rt2570-k2wrlz-1.3.0/Module
make
make install

L'ultimo passaggio va fatto come root. Utilizza su per ottenere i privilegi di root. Ora possiamo caricare il modulo nel kernel:

modprobe rt2570

Attacca la tua wireless card dovrebbe essere riconosciuta come: rausb0. Lanica iwconfig per la listare i tuoi deivces wireless e controllare che tutto funzioni.

Installazione di Aircrack-ng

Fonti

Prendi l'ultima copia di Aircrack-ng dall’ homepage: http://www.aircrack-ng.org I seguenti comandi potrebbero cambiare se utilizzi una versione più recente del software. Unpack, compilazione, installazione:

tar xfz aircrack-ng-1.0-rc1.tar.gz
cd aircrack-ng-1.0-rc1
make
make install

Di solito queste operazioni vanno fatte come root, usa su o sudo -s per loggarti come root (usa sudo make install per Ubuntu).

YUM

ATTENZIONE!!! Correntemente nessun host respository ha l'ultima versione di aircrack-ng, quindi si consiglia di utilizzare il primo metodo. Se stai utilizzando un sistema come Redhat Linux o Fedora Core puoi installare aircrack-ng con yum. Prima devi aggiungere i repository diDag Wieers o Dries.

su
yum -y install aircrack-ng

RPM

ATTENZIONE!!!Correntemente nessun host respository ha l'ultima versione di aircrack-ng, quindi si consiglia di utilizzare il primo metodo.

Se tu stai utilizzando un sistema basato sugli rpm puoi utilizzare la via più semplice per installare aircrack-ng. (Ad esempio Redhat Linux 4)

su
rpm -ihv http://dag.wieers.com/rpm/packages/aircrack-ng/aircrack-ng-0.7-1.el4.rf.i386.rpm

IMPORTANTE: Controlla http://dag.wieers.com/rpm/packages/aircrack-ng/ per l'ultima versione di aircrack-ng suite e cambia i comandi con quelli adeguati all'ultima versione

IEEE 802.11 basics

Ok, ora tutto è pronto, è tempo di fare un pit stop prima di iniziare la fase di azione e quindi è ora di apprendere qualcosa sul funzionamento delle reti wireless.

Il seguente capitolo è molto importante in caso qualcosa non funzionasse come ci aspettavamo. Sapere come funzionano le reti wireless ti aiuta a trovare la fonte di eventuali problemi o ti può aiutare a descrivere cosa succede a qualcuno che ti può aiutare. Questo capitolo appare un po' scientifico e potrebbe venirti voglia di saltarlo, ma una piccola conoscenza è necessaria per crakkare le reti wireless siccome si tratta di qualcosa di un pizzico più ampio rispetto al semplice scrivere un comando e lasciare che aircrack faccia il resto.

Come è composta una rete wireless

Questa è una breve introduzione alle reti amministrate, queste reti funzionano con un Access Points (AP). Ogni AP manda circa 10 beacon frames al secondo. Questi pacchetti contengono le seguenti informazioni:

  • Nome della rete (ESSID)
  • Se è utilizzata una protezione (e quale tipo di protezione è utilizzata; fai attenzione, questa potrebbe non essere sempre vera)
  • Quale MBit data rates è supportata (quindi la velocità della rete)
  • In quale canale è la rete

Queste informazioni sono mostrate nei tool che si collegano alle reti. Tutto ciò viene visualizzato quando la tua carta wireless fa lo scan per rilevare reti con: iwlist <interface> scan e quando tu fai partire airodump-ng.

Ogni AP ha un un unico indirizzo MAC (48 bit, 6 paia di numeri esadecimali). E' qualcosa di simile a questo: 00:01:23:4A:BC:DE. Ogni hardware facente parte di una rete ha un indirizzo fisico chiamato MAC e comunica con gli altri device mostrando questo indirizzo, praticamente è un nome unico. Gli indirizzo MAC sono unici, non esistono due device con lo stesso indirizzo MAC.

Connetersi a una rete

Se tu vuoi connetterti a una rete wireless ci sono alcune possibilità. Nella maggior parte dei casi è utilizzata l'autenticazione Open System. (Facoltativo: Se tu vuoi più informazioni sul’autenticazione, guarda quik this)

Open System Authentication:

  1. Chiede all'AP di autenticarsi.
  2. L'AP risponde: OK, tu sei autenticato.
  3. Chiedi al AP di associarti
  4. L'AP risponde: OK, ora sei connesso.


Quest è il caso più semplice, ma ci potrebbero essere alcuni problemi se tu non ti stai connettendo legittimamente:

  • La EPA/WPA2 è in uso, quindi hai bisogno dell’ autenticazione EAPOL. L' AP ti rifiuterà al passo 2.
  • L'Access Point ha una lista di clienti autorizzati (indirizzi MAC ),e nessun altro si può connettere. Questo viene definito: MAC filtering.
  • L'Access Point usa la Shared Key Authentication, devi fornire la chiave WEP corretta per connetterti. (Guarda qui per le tecniche avanzate: How to do shared key fake authentication? tutorial.)

Semplice sniffing e cracking

Trovare reti

La prima da fare è trovare un potenziale bersaglio. La suite di aircrack-ng suite contiene airodump-ng for this - per fare ciò – ma spesso vengono utilizziati anche programmi come Kismet.

Prima di cercare reti devi mettere la tua carta wireless nella “monitor mode”.La Monitor mode è una modalità speciale che permette al tuo pc di ascoltare ogni singolo pacchetto wireless che passa nelle vicinanze. Questa monitor mode ti permette anche di iniettare pacchetti al interno delle reti. L'iniezione verrà trattata piu tardi in questo tutorial.

Per mettere la tua wireless card nella monitor mode::

airmon-ng start rausb0

Per avere la conferma che è in monitor mode, lancia “iwconfig” e prendi conferma della modalità. La pagina di airmon-ng page sulla Wiki ha le informazioni generali di come farla partire sugli altri device.

Quindi, lancia airodump-ng per guardare le reti:

airodump-ng rausb0

“rausb0” è il nome della network interface (nic). Se tu stai usando un WLAN device diverso dal rt2570 probabilmente dovrai utilizzare un diverso nic name. Dai un occhiata alla documentazione dei nic driver. Per la maggior parte dei più recenti driver, il nome dell’ interfaccia primaria è “wlan0”, ma per monitorare, viene utilizzata la seconda interfaccia (“mon0”,viene creato quando tu lanci airmon-ng) .

Se airodump-ng può connettersi a un WLAN device, tu vedrai una schermata tipo questa:

airodump-ng salta da canale a canale e fa vedere gli access points che possono ricevere beacons from.I canali dal 1 al 14 sono utilizzati per il protocollo 802.11b e g (In US, sono abilitiati ad utilizzare i canali dal 1 al 11; dal 1 al 13 in Europa con alcuni casi speciali;dal 1al 14 in Giappone). I canali tra il 36 e il 149 sono utilizzati per il protocollo 802.11a. Il canale corrente è visualizzato in alto a sinistra.

Dopo poco tempo vengono visualizzati alcuni APs e (perfortuna) alcuni client associati ad essi.

Le scritte in alto ti spiegano cosa ha trovato:

BSSID L'indirizzo MAC del AP
PWR La potenza del segnale. Alcuni driver non la rilevano
Beacons Il numero di beacon frames ricevute. Se non puoi visualizzare la potenza del segnale puoi trarre una stima dal numero di beacon: più beacons ci sono, maggiore sarà la qualità
Data Numero di data frames ricevuti
CH Il canale il cui l'AP sta operando
MB Velocità o AP Mode. 11 è un puro 802.11b, 54 è un puro 802.11g. I valori in mezzo sono una mistura
ENC Crittografia: OPN: nessuna crittografia, WEP: chiave WEP , WPA: chiavi WPA or WPA2, WEP?:Chiavi WEP o WPA (non si sa quale delle due)
ESSID Nome della rete. A volte è nascosto

Le scritte in basso parlano dei client:

BSSID Il MAC del AP a cui il Client è associato
STATION Il MAC del client
PWR La potenza del segnale. Alcuni driver non la visualizzano
Packets Numero dei Data Frames ricevuti
Probes Il nome della rete (ESSIDs) che il client ha sondato

Ora dovresti cercare una rete bersaglio. Dovrebbe avere un client connesso, siccome cracckare una rete senza client è un topic avanzato (Guarda: How to crack wep with no clients). Dovrebbe avere una chiave WEP e una potenza di segnale alta. Ma tu puoi sempre riposizionare la tua antenna per avere un segnale migliore. A volte pochi centrimetri fanno una grande differenza sulla potenza del segnale.

Nell’ esempio riguardante la rete 00:01:02:03:04:05 scegliamo quella siccome era l'uncio target possibile con un client associato. Ma è anche un target con un buon segnale, quindi è un ottimo target su cui fare pratica.

Sniffing IVs

Because of the channel hopping you won't capture all packets from your target net. So we want to listen just on one channel and additionally write all data to disk to be able to use it for cracking:

airodump-ng -c 11 --bssid 00:01:02:03:04:05 -w dump rausb0

With the -c parameter you tune to a channel and the parameter after -w is the prefix to the network dumps written to disk. The “--bssid” combined with the AP MAC address limits the capture to the one AP. The “--bssid” option is only available on new versions of airodump-ng.

Before being able to crack WEP you'll usually need between 40 000 and 85 000 different Initialization Vectors (IVs). Every data packet contains an IV. IVs can be re-used, so the number of different IVs is usually a bit lower than the number of data packets captured.

So you'll have to wait and capture 40K to 85K of data packets (IVs). If the network is not busy it will take a very long time. Often you can speed it up a lot by using an active attack (=packet replay). See the next chapter.

Cracking

If you've got enough IVs captured in one or more file, you can try to crack the WEP key:

aircrack-ng -b 00:01:02:03:04:05 dump-01.cap

The MAC after the -b option is the BSSID of the target and dump-01.cap the file containing the captured packets. You can use multiple files, just add all their names or you can use a wildcard such as dump*.cap.

For more information about aircrack-ng parameters, description of the output and usage see the manual.

The number of IVs you need to crack a key is not fixed. This is because some IVs are weaker and leak more information about the key than others. Usually these weak IVs are randomly mixed in between the stonger ones. So if you are lucky, you can crack a key with only 20 000 IVs. But often this it not enough and aircrack-ng will run a long time (up to a week or even longer with a high fudge factor) and then tell you the key could not be cracked. If you have more IVs cracking can be done a lot faster and is usually done in a few minutes, or even seconds. Experience shows that 40 000 to 85 000 IVs is usually enough for cracking.

There are some more advanced APs out there that use an algorithm to filter out weak IVs. The result is either that you can't get more than “n” different IVs from the AP or that you'll need millions (like 5 to 7 million) to crack the key. Search in the Forum, there are some threads about cases like this and what to do.

Active attacks

Injection support

Most devices don't support injection - at least not without patched drivers. Some only support certain attacks. Take a look at the compatibility page, column aireplay. Sometimes this table is not up-to-date, so if you see a “NO” for your driver there don't give up yet, but look at the driver homepage, the driver mailing list or our Forum. If you were able to successfully replay using a driver which is not listed as supported, don't hesitate to update the compatibility page table and add a link to a short howto. (To do this, request a wiki account on IRC.)

The first step is to make sure packet injection really works with your card and driver. The easiest way to test it is the injection test attack. Make sure to perform this test prior to proceeding. Your card must be able to successfully inject in order to perform the following steps.

You'll need the BSSID (AP MAC) and ESSID (network name) of an AP that does not do MAC filtering (e.g. your own) and must be in range of the AP.

Try to connect to your AP using aireplay-ng:

aireplay-ng --fakeauth 0 -e "your network ESSID" -a 00:01:02:03:04:05 rausb0

The value after -a is the BSSID of your AP.

If injection works you should see something like this:

12:14:06  Sending Authentication Request
12:14:06  Authentication successful
12:14:06  Sending Association Request
12:14:07  Association successful :-)

If not

  1. double-check ESSID and BSSID
  2. make sure your AP has MAC filtering disabled
  3. test it against another AP
  4. make sure your driver is properly patched and supported
  5. Instead of “0”, try “6000 -o 1 -q 10”

ARP replay

Now that we know that packet injection works, we can do something to massively speed up capturing IVs: ARP-request reinjection

The idea

ARP works (simplified) by broadcasting a query for an IP and the device that has this IP sends back an answer. Because WEP does not protect against replay, you can sniff a packet, send it out again and again and it is still valid. So you just have to capture and replay an ARP-request targeted at the AP to create lots of traffic (and sniff IVs).

The lazy way

First open a window with an airodump-ng sniffing for traffic (see above). aireplay-ng and airodump-ng can run together. Wait for a client to show up on the target network. Then start the attack:

aireplay-ng - -arpreplay -b 00:01:02:03:04:05 -h 00:04:05:06:07:08 rausb0

-b specifies the target BSSID, -h the MAC of the connected client.

Now you have to wait for an ARP packet to arrive. Usually you'll have to wait for a few minutes (or look at the next chapter).

If you were successfull, you'll see something like this:

Saving ARP requests in replay_arp-0627-121526.cap
You must also start airodump to capture replies.
Read 2493 packets (got 1 ARP requests), sent 1305 packets...

If you have to stop replaying, you don't have to wait for the next ARP packet to show up, but you can re-use the previously captured packet(s) with the -r <filename> option.

When using the arp injection technique, you can use the PTW method to crack the WEP key. This dramatically reduces the number of data packets you need and also the time needed. You must capture the full packet in airodump-ng, meaning do not use the “--ivs” option when starting it. For aircrack-ng, use “aircrack -z <file name>”. (PTW is the default attack in 1.0-rc1.)

If the number of data packets received by airodump-ng sometimes stops increasing you maybe have to reduce the replay-rate. You do this with the -x <packets per second> option. I usually start out with 50 and reduce until packets are received contiously again. Better positioning of your antenna usually also helps.

The aggressive way

Most operating sytems clear the ARP cache on disconnection. If they want to send the next packet after reconnection (or just use DHCP), they have to send out ARP requests. So the idea is to disconnect a client and force it to reconnect to capture an ARP-request. A side-effect is that you can sniff the ESSID and possibly a keystream during reconnection too. This comes in handy if the ESSID of your target is hidden, or if it uses shared-key authentication.

Keep your airodump-ng and aireplay-ng running. Open another window and run a deauthentication attack:

aireplay-ng --deauth 5 -a 00:01:02:03:04:05 -c 00:04:05:06:07:08 rausb0

-a is the BSSID of the AP, -c the MAC of the targeted client.

Wait a few seconds and your arp replay should start running.

Most clients try to reconnect automatically. But the risk that someone recognizes this attack or at least attention is drawn to the stuff happening on the WLAN is higher than with other attacks.

Further tools and information

it/newbie_guide.1250332497.txt.gz · Ultima modifica: 2009/08/15 12:34 da asafarakaratara