Airtun-ng

Aus Wardriving-Forum.de Enzyklopädie

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

[Bearbeiten] Airtun-ng

+++ Übersetzung in Arbeit - Wenn jeder nur einen Absatz übersetzt in dieses HowTo auch schnell in deutsch verfügbar +++

[Bearbeiten] Beschreibung

Airtun-ng ist Programm um virtuelle Tunnelinterfaces zu erstellen. Es besitzt zwei Grundfunktionen:

  • Erlaubt das Anzeigen von verschlüsseltem Traffic für Wirelss Intrusion Detection Systeme (wIDS)
  • Beliebigen Traffic in ein Netzwerk injecten

Um wIDS-Daten zu sammeln, benötigt man den Key und die BSSID des Netzwerk dessen Traffic man analisieren möchte. Airtun-ng entschlüsselt den kompletten Traffic des angegebenen Netzwerkes und gibt ihn weiter an ein IDS-System wie z.B. [[1]]

Traffic Injection kann komplett bidirektional durchgeführt werden, wenn man den kompletten Schlüssel hat. Wenn man den PRGA z.B. mit Chopchop oder der Fragmentation Attacke herausgefunden hat, dann wird die Traffic Injection nur einseitig ausgeführt. Der größte Vorteil von Airtun-ng gegenüber den anderen Injection Tools der Aircrack-ng Suite ist, dass man jedes beliebige Tool benutzen kann, um Packets erstellen, injecten oder sniffen zu können.

Airtun-ng hat außerdem eine Reapeater und TCPreplay Funktion. Mit der Repeaterfunktion ist es einem möglich den kompletten Traffic den man mit einem WLAN Gerät sniffed auf einem anderen Gerät (Interface wird mit -i at0 ausgewählt) wiederzugeben. Optional kann der Traffic auch nach einer BSSID mit einer Netzwerkmaske gefiltert werden und die verbleibenden Packets wiedergegeben werden. Währenddessen kann man das Tuninterface (-i <interface>) immernoch benutzen. Zudem besitzt Airtun-ng auch die Möglichkeit gespeicherten Packets aus einer pcap-Datei zu injecten genauso wie sie vorher gesniffed wurden. Das alles zusammen ergibt im Prinzip eine komplette TCPreplay Funktionalität für WLAN.

Airtun-ng läuft auf Linux Plattformen.

[Bearbeiten] Anwendung

airtun-ng <options> <replay interface>

 -a <BSSID>     : die MAC-Adresse des APs
 -w <WEP-Key>   : benutze diesen WEP-Schlüssel um die Pakete zu entschlüsseln (entweder -y oder -w muss angegeben werden)
 -y <Datei>     : lese PRGA aus dieser Datei (entweder -y oder -w muss angegeben werden)
 -x <nbpps>     : maximale Anzahl an Paketen pro Sekunde (optional)
 -i <Interface> : empfange Pakete von diesem Interface (optional)
 -t <0/1>       : sende Pakete zum AP (1) oder zum Client (0) (optional / Standard ist 0 (Client))
 -r <Datei>     : lese Frames aus einer pcap-Datei (optional)

Repeateroptionen:

 -f             : aktiviert die Repeaterfunktion (oder: --repeat)
 -d <MAC>       : BSSID die benutzt werden soll (oder: --bssid)
 -m <Maske>     : Netzmaske um nach BSSIDs zu filtern (oder: --netmask)
[Bearbeiten] Beispiel

[Bearbeiten] wIDS

Zum benutzen der wIDS-Funktion bei Airtun-ng, starten wir zuerst unsere WLAN-Karte in dem Monitor-Mode und geben dann folgenden Befehl an Airtun-ng:

 airtun-ng -a 00:14:6C:7E:40:80 -w 1234567890 wlan0

Die Optionen geben dabei folgendes an:

 -a 00:14:6C:7E:40:80 : ist die MAC-Adresse des APs dessen Traffik benutzt werden soll
 -w 1234567890        : gibt den WLAN-Schlüssel an
 wlan0                : ist das Interface, dass wir zuvor in dem Monitor-Mode gestartet haben


Airtun-ng sollte wie folgt antworten:

 created tap interface at0
 WEP encryption specified. Sending and receiving frames through wlan0.
 FromDS bit set in all frames.

Wie man an der Ausgabe erkennen kann hat Airtun-ng das Interface **at0** erstellt. Jetzt wechseln wir in eine neue Konsole und fahren das neue Interface hoch:

 ifconfig at0 up

Dieses Interface (at0) wird nun eine Kopie jedes einzelnen Netzwerkpaketes erhalten. Die Pakete werden mit dem angegebenen Schlüssel entschlüsselt und können jetzt somit mit jedem Tool mitgeschrieben und analysiert werden. Mögliche Tools wären: tcpdump, wireshark oder snort.

[Bearbeiten] WEP injection

In diesem Szenario wollen wir Pakete in ein Netzwerk injecten. Die ersten Schritte sind die selben wie im vorigen Szenario, nur das wir diesmal beim hochfahren des Tunnelinferfaces (at0) eine IP-Adresse an das Interface vergeben.

  ifconfig at0 192.168.1.83 netmask 255.255.255.0 up

Die IP-Adressvergabe kann man mit "ifconfig at0" überprüfen:

  at0    Link encap:Ethernet  HWaddr 36:CF:17:56:75:27  
         inet addr:192.168.1.83  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::34cf:17ff:fe56:7527/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:192 errors:0 dropped:0 overruns:0 frame:0
         TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:500 
         RX bytes:25113 (24.5 KiB)  TX bytes:516 (516.0 b)

Jetzt kann man jedes beliebige Tool verwenden und Traffic über das at0 Interface zu WLAN-Clients senden. Anzumerken ist noch, dass Airtun-ng standardmäßig die FromDS Flag setzt. Das heißt, dass die gesendeten Pakete standardmäßig an WLAN-Clients gesendet werden. Wenn man an den AP oder kabelgebundenen Clients senden möche muss man bei starten von Airtun-ng die Option "-t 1" setzen.

WICHTIGE ANMERKUNG: Die normalen Regeln gelten auch für die Injection. Zum Beispiel wird, wenn man mit dem AP verbunden ist, die MAC-Adresse der WLAN-Karte von der Injection-Quelle übernommen. Möchte man dies ändern kann man einfach eine neue MAC-Adresse an das at0 Interface vergeben (z.B. mit iwconfig).

[Bearbeiten] PRGA injection

The next scenario is where you want to inject packets into the network but do not have the full WEP key. You only have the PRGA obtain via a chopchop or fragmentation attack. In this case you may only inject packets outbound. There is no way to decrypt inbound packets since you do not have the full WEP key.

Start your wireless card in monitor mode then enter:

  airtun-ng -a 00:14:6C:7E:40:80 -y fragment-0124-153850.xor ath0

Notice that the PRGA files was specified via the "-y" option.

The system responds (notice it correctly states "no reception"):

  created tap interface at0
  WEP encryption by PRGA specified. No reception, only sending frames through ath0.
  FromDS bit set in all frames.

From here you can define a valid IP address for the network when you bring the at0 interface up:

  ifconfig at0 192.168.1.83 netmask 255.255.255.0 up

You can confirm this by entering "ifconfig at0". Again, at this point you can use any tool you want and send traffic via the at0 interface to wireless clients.

[Bearbeiten] Connecting to Two Access Points

The next scenario is connecting to two wireless networks at the same time. This is done by simply starting airtun-ng twice and specifying the appropriate bssid MAC for each. If the 2 APs are on the same channel, then everything should be fine. If they don't share one channel, you can listen with airodump-ng on both channels (not simultaneously, but switching between only the two channels). Assuming the two APs you want to connect to are on on channels 1 and 11, enter "airodump-ng -c 1,11 ath0".

So you'll get two tunnel interfaces (at0 and at1), each pointing to another AP. if they don't use the same private subnet range, then you can use them at the same time. IE You are connected to more than one AP. In theory, you could do this for even more then two APs, but the quality of the link would be even worse when hopping on 3 channels.

[Bearbeiten] Copy packets from the optional interface

The next scenario is copying packets from the optional interface. The -i <wireless interface> is just like the aireplay-ng -i parameter. It is used for specifying a source to read packets from, other than the given injection interface (ath0 in the examples above). A typical use is to listen with a very sensitive card on one interface and to inject with a high power adapter, which has a lower sensitivity.

[Bearbeiten] Repeater Mode

This scenario allows you to repeat all packets from one wireless card to another. This would allow you to extend the distance by which you could listen to the access point communication. The cards may also be on different channels which provides additional flexibility.

Prior to running the following command, you must use airmon-ng to put each card into monitor mode on the the appropriate channels:

  airtun-ng -a 00:14:6C:7E:40:80  --repeat --bssid 00:14:6C:7E:40:80 -i ath0 wlan0

Where:

 * -a 00:14:6C:7E:40:80 is the MAC address used for packets injected via the at0 interface.
 * - -repeat specifies that inbound packets from the -i interface be repeated on the output interface.  Note the double dash.
 * - -bssid 00:14:6C:7E:40:80 used to select which packets are repeated. Note the double dash.  (Optional)
 * -i ath0 is input interface from which packets are read.
 * wlan0 is the output interface.

The system responds:

  created tap interface at0
  No encryption specified. Sending and receiving frames through wlan0.
  FromDS bit set in all frames.

At this point, any packets for the AP (00:14:6C:7E:40:80) from the ath0 interface will be repeated and sent out on the wlan0 interface.


[Bearbeiten] Packet Replay Mode

You can replay any previous capture. The capture must have been stored in pcap format.

You enter the command:

  airtun-ng -a 00:14:6C:7E:40:80 -r ath0one-01.cap ath0 

Where:

  * -a 00:14:6C:7E:40:80 is the MAC address used for packets injected via the at0 interface.
  * -r ath0one-01.cap in the name of the pcap file to be replayed.
  * ath0 is the output interface.

The system responds:

  created tap interface at0
  No encryption specified. Sending and receiving frames through ath0.
  FromDS bit set in all frames.
  Finished reading input file ath0one-01.cap.

Please note that the file contents are transmitted exactly as is. You may ignore the message "FromDS bit set in all frames". The flags nor any other field are modified while transmitting the file contents.

[Bearbeiten] Usage Tips

This tool is extremely powerful and utilizes advanced concepts. Please make sure you have built your knowledge and experience with the other tools in the aircrack-ng suite prior to using it.

[Bearbeiten] Injecting Management Frames

You can also inject management and control frames. This can be done by putting a PCAP file together of frames to be sent, or just using a capture you made before and by replaying the whole file using airtun-ng.


[Bearbeiten] Bekannte Probleme
[Bearbeiten] Ich kann airtun-ng nicht finden!

Windows platforms - "Ich kann airtun-ng nicht finden!". Antwort: airtun-ng läuft nur unter Linux.

[Bearbeiten] error opening tap device: No such file or directory

Wenn du airtun-ng laufen lässt, bekommst du eine Nachricht, die so ähnlich aussieht: "error opening tap device: No such file or directory".

Kontrolliere, ob du das OpenVPN Paket installiert hast und es läuft:

modprobe tun

Das läd das "tun" Module. Du kannst dich vergewissern, dass es geladen ist, wenn du "lsmod | grep tun" in der Konsole ausführst. Wenn es nicht läd oder es andere Probleme gibt, gib "dmesg" in die Konsole ein. Schau am Ende nach, dort sollten Fehler stehen, fals es welche gab.