Airbase NG
Airbase NG
Airbase NG
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Airbase-ng
Description
This documentation is still under development. There is quite a bit more work to be done on this documentation. Please post any comments or suggestions to this thread in the Forum [http://forum.aircrack-ng.org/index.php?topic=3247.0]. Airbase-ng is multi-purpose tool aimed at attacking clients as opposed to the Access Point (AP) itself. Since it is so versatile and flexible, summarizing it is a challenge. Here are some of the feature highlights: Implements the Caffe Latte WEP client attack Implements the Hirte WEP client attack Ability to cause the WPA/WPA2 handshake to be captured Ability to act as an ad-hoc Access Point Ability to act as a full Access Point Ability to filter by SSID or client MAC addresses Ability to manipulate and resend packets Ability to encrypt sent packets and decrypt received packets The main idea is of the implementation is that it should encourage clients to associate with the fake AP, not prevent them from accessing the real AP. A tap interface (atX) is created when airbase-ng is run. This can be used to receive decrypted packets or to send encrypted packets. As real clients will most probably send probe requests for common/configured networks, these frames are important for binding a client to our softAP. In this case, the AP will respond to any probe request with a proper probe response, which tells the client to authenticate to the airbase-ng BSSID. That being said, this mode could possibly disrupt the correct functionality of many APs on the same channel. WARNING: airbase-ng can easily disrupt Access Points around you. Where possible, use filters to minimize this possibility. Always act responsibly and do not disrupt networks which do not belong to you.
Usage
usage: airbase-ng <options> <replay interface> Options -a bssid : set Access Point MAC address -i iface : capture packets from this interface -w WEP key : use this WEP key to encrypt/decrypt packets -h MAC : source mac for MITM mode -f disallow : disallow specified client MACs (default: allow) -W 0|1 : [don't] set WEP flag in beacons 0|1 (default: auto) -q : quiet (do not print statistics) -v : verbose (print more messages) (long --verbose) -M : M-I-T-M between [specified] clients and bssids (NOT CURRENTLY IMPLEMENTED) -A : Ad-Hoc Mode (allows other clients to peer) (long --ad-hoc) -Y in|out|both : external packet processing -c channel : sets the channel the AP is running on
1 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
-X : hidden ESSID (long --hidden) -s : force shared key authentication -S : set shared key challenge length (default: 128) -L : Caffe-Latte attack (long --caffe-latte) -N : Hirte attack (cfrag attack), creates arp request against wep client (long cfrag) -x nbpps : number of packets per second (default: 100) -y : disables responses to broadcast probes -0 : set all WPA,WEP,open tags. can't be used with -z & -Z -z type : sets WPA1 tags. 1=WEP40 2=TKIP 3=WRAP 4=CCMP 5=WEP104 -Z type : same as -z, but for WPA2 -V type : fake EAPOL 1=MD5 2=SHA1 3=auto -F prefix : write all sent and received frames into pcap file -P : respond to all probes, even when specifying ESSIDs -I interval : sets the beacon interval value in ms -C seconds : enables beaconing of probed ESSID values (requires -P) Filter options: --bssid <MAC> : BSSID to filter/use (short -b) --bssids <file> : read a list of BSSIDs out of that file (short -B) --client <MAC> : MAC of client to accept (short -d) --clients <file> : read a list of MACs out of that file (short -D) --essid <ESSID> : specify a single ESSID (short -e) --essids <file> : read a list of ESSIDs out of that file (short -E) Help: --help: Displays the usage screen (short -H)
-a BSSID Definition
If the BSSID is not explicitly specified by using -a <BSSID>, then the current MAC of the specified interface is used.
-i iface
If you specify an interface with this option then packets are also captured and processed from this interface in addition to replay interface.
-w WEP key
If WEP should be used as encryption, then the parameter -w <WEP key> sets the en-/decryption key. This is sufficient to let airbase-ng set all the appropriate flags by itself. If the softAP operates with WEP encryption, the client can choose to use open system authentication or shared key authentication. Both authentication methods are supported by airbase-ng. But to get a keystream, the user can try to force the client to use shared key authentication. -s forces a shared key auth and -S <len> sets the challenge length.
-h MAC
This is the source MAC for the man-in-the-middle attack. The -M must also be specified.
2 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
-f allow/disallow
If this option is not specified, it defaults to -f allow. This means the various client MAC filters (-d and -D) define which clients to accept. By using the -f disallow option, this reverses selection and causes airbase to ignore the clients specified by the filters.
-W WEP Flag
This sets the beacon WEP flag. Remember that clients will normally only connect to APs which are the same as themselves. Meaning WEP to WEP, open to open. The auto option is to allow airbase-ng to automatically set the flag based on context of the other options specified. For example, if you set a WEP key with -w, then the beacon flag would be set to WEP. One other use of auto is to deal with clients which can automatically adjust their connection type. However, these are few and far between. In practice, it is best to set the value to the type of clients you are dealing with.
-q Quiet Flag
This suppresses printing any statistics or status information.
-v Verbose Flag
This prints additional messages and details to assist in debugging.
-M MITM Attack
This option is not implemented yet. It is a man-in-the-middle attack between specified clients and BSSIDs.
-A Ad-Hoc Mode
This causes airbase-ng to act as an ad-hoc client instead of a normal Access Point. In ad-hoc mode airbase-ng also sends beacons, but doesn't need any authentication/association. It can be activated by using -A. The soft AP will adjust all flags needed to simulate a station in ad-hoc mode automatically and generate a random MAC, which is used as CELL MAC instead of the BSSID. This can be overwritten by the -a <BSSID> tag. The interface MAC will then be used as source mac, which can be changed with -h <sourceMAC>.
-Y External Processing
The parameter -Y enables the external processing Mode. This creates a second interface atX, which is used to replay/modify/drop or inject packets at will. This interface must also be brought up with ifconfig and an external tool is needed to create a loop on that interface. The packet structure is rather simple: the ethernet header (14 bytes) is ignored and right after that follows the complete ieee80211 frame the same way it is going to be processed by airbase-ng (for incoming packets) or before the packets will be sent out of the wireless card (outgoing packets). This mode intercepts all data packets and loops them through an external application, which decides what
3 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
happens with them. The MAC and IP of the second tap interface doesn't matter, as real ethernet frames on this interface are dropped dropped anyway. There are 3 arguments for -Y: in, out and both, which specify the direction of frames to loop through the external application. Obviously in redirects only incoming (through the wireless NIC) frames, while outgoing frames aren't touched. out does the opposite, it only loops outgoing packets and both sends all both directions through the second tap interface. There is a small and simple example application to replay all frames on the second interface. The tool is called replay.py and is located in ./test. It's written in python, but the language doesn't matter. It uses pcapy to read the frames and scapy to potentially alter/show and reinject the frames. The tool as it is, simply replays all frames and prints a short summary of the received frames. The variable packet contains the complete ieee80211 packet, which can easily be dissected and modified using scapy. This can be compared to ettercap filters, but is more powerful, as a real programming language can be used to build complex logic for filtering and packet customization. The downside on using python is, that it adds a delay of around 100ms and the cpu utilization is rather large on a high speed network, but its perfect for a demonstration with only a few lines of code.
-c Channel Flag
This is used to specify the channel on which to run the Access Point.
4 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
-V EAPOL Type
This specifies the valid EAPOL types. The valid values are: 1=MD5 2=SHA1 3=auto
-P All Probes
5 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
This causes the fake access point to respond to all probes regardless of the ESSIDs specified. Without -P, the old behavior of ignoring probes for non-matching ESSIDs will be used.
-I Beacon Interval
This sets the time in milliseconds between beacons being sent. When using a list of ESSIDs, all ESSIDs will be broadcast with beacons. As extra ESSIDs are added, the beacon interval value is now adjusted based on the number of ESSIDs times the interval value (0x64 is default still). To support fast beaconing of a long list of ESSIDs, the -I parameter can be used to set a smaller interval. To get 0x64 interval for N beacons, set the -I parameter to 0x64/N. If this value goes below ~10 or so, the maximum injection rate will be reached and airbase-ng will not be able to reliable handle new clients. Since each card's injection rates are different, the -I parameters allows it to be tuned to a specific setup and injection speed based on the number of beacons.
-C Seconds
The -P option must also be specified in order to use this option. The wildcard ESSIDs will also be beaconed this number of seconds. A good typical value to use is -C 60. When running in the default mode (no ESSIDs) or with the -P parameter, the -C option can be used to enable beacon broadcasting of the ESSIDs seen by the directed probes. This allows one client which is probing for a network to result in a beacon for the same network for a brief period of time (the -C parameter, which is the number of seconds to broadcast new probe requests). This works well when some clients are sending directed probes, while others listen passively for beacons. A client which does directed probes results in a beacon which wakes up the passive client and causes the passive client to join the network as well. This is especially useful with Vista clients (which listens passively for beacons in many cases) which share the same WiFi? network as Linux/Mac OS X clients which send directed probes.
Beacon Frames
The beacon frame contains the ESSID in case exactly one ESSID is specified, if several are set, the ESSID will be hidden in the beacon frame with a length of 1. If no ESSID is set, the beacon will contain default as ESSID, but accept all ESSIDs in association requests. If the ESSID should be hidden in the beacon frame all the time (read: for no or one specified ESSID), the -X flag can be set.
Filtering
There are rich filtering capabilities. To limit the supported ESSIDs, you can specify -e <ESSID> to add an ESSID to the list of allowed ESSIDs, or use -E <ESSIDfile> to read a list of allowed ESSIDs out of this file (one ESSID per line).
6 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
The same can be done for client MACs (sort of a MAC-filter). -d <MAC> adds a single MAC to the list, -D <MACfile> adds all MACs out of the <MACfile> to that list (again, one MAC per line). The MAC list can be used to allow only the clients on this list and block all others (default), or to block the specified ones and allow all others. This is controlled by -f allow or -f disallow. allow creates a whitelist (default in case -f is not set), whereas disallow a blacklist builds (the second case).
Tap Interface
Each time airbase is run, a tap interface (atX) is created. To use it, run ifconfig atX up where X is the actual interface number. This interface has many uses: If an encryption key is specified with -w, then incoming packets will be decrypted and presented on the interface. Packets sent to this interface will be transmitted. Additionally, they will be encrypted if the -w option is used.
Usage Examples
Here are usage examples. You only require a single wireless device even though two cards were used in some of the examples.
Simple
Using airbase-ng <iface> is enough to setup an AP without any encryption. It will accept connections from any MAC for every ESSID, as long as the authentication and association is directed to the BSSID. You really cannot do much in this scenario. However, it will present a list of clients which are connecting plus the encryption method and the SSIDs.
Where: -c 9 specifies the channel -e teddy filters a single SSID -N specifies the Hirte attack -W 1 forces the beacons to specify WEP rausb0 specifies the wireless interface to use The system responds:
18:57:54 18:57:55 Created tap interface at0 Client 00:0F:B5:AB:CB:9D associated (WEP) to ESSID: "teddy"
7 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
On another console window run:
airodump-ng -c 9 -d 00:06:62:F8:1E:2C -w cfrag wlan0
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Where: -c 9 specifies the channel -d 00:06:62:F8:1E:2C filters the data captured to fake AP MAC (this is optional) -w specifies the file name prefix of the captured data wlan0 specifies the wireless interface to capture data on Here is what the window looks like when airbase-ng has received a packet from the client and has successfully started the attack:
CH 9 ][ Elapsed: 8 mins ][ 2008-03-20 19:06 PWR RXQ 100 29 Beacons 970 #Data, #/s 14398 PWR 89 33 Rate 2-48 CH 9 Lost 0 MB 54 ENC WEP CIPHER AUTH ESSID WEP Probes teddy
STATION 00:0F:B5:AB:CB:9D
Packets 134362
At this point you can start aircrack-ng in another console window to obtain the wep key. Alternatively, use the -F <file name prefix> option with airbase-ng to directly write a capture file instead of using airodump-ng.
Where: -c 9 specifies the channel -e teddy filters a single SSID -N specifies the Hirte attack -W 1 forces the beacons to specify WEP -A specifies ad-hoc mode rausb0 specifies the wireless interface to use The rest will be the same as the AP mode.
8 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
Where: -c 9 specifies the channel -e teddy filters a single SSID -L specifies the Caffe Latte attack -W 1 forces the beacons to specify WEP rausb0 specifies the wireless interface to use The rest is the same as the Hirte client attack.
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Where: -c 9 specifies the channel -e teddy filters a single SSID -s forces shared key authentication -W 1 forces the beacons to specify WEP wlan0 specifies the wireless interface to use The system responds:
15:08:31 15:13:38 15:13:38 15:13:38 Created tap interface at0 Got 140 bytes keystream: 00:0F:B5:88:AC:82 SKA from 00:0F:B5:88:AC:82 Client 00:0F:B5:88:AC:82 associated to ESSID: "teddy"
The last three lines only appear when the client associates with the fake AP. On another console window run:
airodump-ng -c 9 wlan0
Where: -c 9 specifies the channel wlan0 specifies the wireless interface to use Here is what the window looks like with a successful SKA capture. Notice 140 bytes keystream: 00:C0:CA:19:F9:65 in the top right-hand corner:
CH 9 ][ Elapsed: 9 mins ][ 2008-03-12 15:13 ][ 140 bytes keystream: 00:C0:CA:19:F9:65 PWR RXQ 87 92 Beacons 5310 PWR 83 #Data, #/s 0 Rate 0- 1 0 CH 9 Lost 0 MB 54 ENC WEP CIPHER AUTH ESSID WEP SKA teddy
STATION 00:0F:B5:88:AC:82
Packets 4096
Probes teddy
Alternatively, use the -F <file name prefix> option with airbase-ng to directly write a capture file instead
9 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
of using airodump-ng.
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Where: -c 9 specifies the channel -e teddy filters a single SSID -z 2 specifies TKIP -W 1 set WEP flag because some clients get confused without it. rausb0 specifies the wireless interface to use The -z type will have to be changed depending on the cipher you believe the client will be using. TKIP is typical for WPA. The system responds:
10:17:24 10:22:13 Created tap interface at0 Client 00:0F:B5:AB:CB:9D associated (WPA1;TKIP) to ESSID: "teddy"
The last line only appears when the client associates. On another console window run:
airodump-ng -c 9 -d 00:C0:C6:94:F4:87 -w cfrag wlan0
-c 9 specifies the channel -d 00:C0:C6:94:F4:87 filters the data captured to fake AP MAC. It is MAC of card running the fake AP. This is optional. -w specifies the file name of the captured data wlan0 specifies the wireless interface to capture data on When the client connects, notice the WPA handshake: 00:C0:C6:94:F4:87 in the top right-hand corner of the screen below:
CH 9 ][ Elapsed: 5 mins ][ 2008-03-21 10:26 ][ WPA handshake: 00:C0:C6:94:F4:87 PWR RXQ 100 70 Beacons 1602 PWR 86 #Data, #/s 14 0 CH 9 Lost 0 MB 54 ENC WPA CIPHER AUTH ESSID TKIP Probes PSK teddy
STATION 00:0F:B5:AB:CB:9D
Rate 2- 1
Packets 75
Alternatively, use the -F <file name prefix> option with airbase-ng to directly write a capture file instead of using airodump-ng. Running aircrack-ng cfrag-01.cap proves it captured a valid WPA handshake:
Opening cfrag-01.cap Read 114392 packets.
10 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
# 1
BSSID 00:C0:C6:94:F4:87
ESSID teddy
softAP
GURU EXPERTS ONLY: This functionality requires extremely advanced linux and networking knowledge. Do not post questions to the forum regarding this section. If you cannot debug this functionality on your own then you should not be using it! A new tap interface atX will be created, which acts as the wired side to the AP. In order to use the AP, this new interface must be brought up with ifconfig and needs an IP. The assigned MAC is automatically set to the BSSID [by default the wireless interface MAC]. Once an IP is assigned and the client uses a static IP out of the same subnet, there is a working Ethernet connection between the AP and the client. Any daemon can be assigned to that interface, for example a dhcp and dns server. Together with kernel ip_forwarding and a proper iptable rule for masquerading, the softAP acts as a wireless router. Any tool, which operates on ethernet can be bound to this interface. This forum posting [http://forum.aircrack-ng.org/index.php?topic=3983.msg23110#msg23110] provides an example of the commands needed to setup the softAP. This forum posting [http://forum.aircrack-ng.org /index.php?topic=4495.msg25342#msg25342] provides IPTables troubleshooting tip. Here are some links that may find useful in getting bridging operational. In the madwifi-project.org one, just use at0 where ath0 is referenced. http://madwifi-project.org/wiki/UserDocs/TransparentBridge [http://madwifi-project.org/wiki/UserDocs
/TransparentBridge]
http://wiki.ubuntuusers.de/WLAN/MadWifi#Einfache-Methode
/WLAN/MadWifi#Einfache-Methode]
[http://wiki.ubuntuusers.de
Usage Tips
How Does the Caffe Latte Attack Work?
Here are some links: Cafe Latte attack [http://www.airtightnetworks.net/knowledgecenter/wep-caffelatte.html] The Caffe Latte Attack: How It Worksand How to Block It [http://www.esecurityplanet.com
/prevention/article.php/3716656]
In addition to the descriptions above, airbase-ng sends the last 100 packets 100 times to attempt to increase the effectiveness of the attack.
11 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Usage Troubleshooting
Driver Limitations
Some drivers like r8187 don't capture packets transmitted by itself. The implication of this is that the softAP will not show up in airodump-ng. You can get around this by using two wireless cards, one to inject and one to capture. Alternatively, you can use the rtl8187 driver. The madwifi-ng currently does not support the Caffe-Latte or Hirte attacks. The root cause is deep within the madwifi-ng driver. The driver does not properly synchronize speeds with the client and thus the client never receives the packets. If you need to use these attacks, try using the ath5k driver.
"write failed: Message too long" / "wi_write(): Illegal seek" error messages
See this trac ticket [http://trac.aircrack-ng.org/ticket/469] for a workaround. The trac ticket explains the root cause and how to adjust the MTU to avoid the problem.
12 of 13
04/29/2012 11:55 PM
airbase-ng [Aircrack-ng]
http://www.aircrack-ng.org/doku.php?id=airbase-ng
Related Commands
-D is a new option that has been added to aireplay-ng. By default, aireplay-ng listens for beacons from the specified AP and fails if it does not hear any beacons. The -D option disables this requirement.
Except where otherwise noted, content on this wiki is licensed under the following license:CC AttributionNoncommercial-Share Alike 3.0 Unported [http://creativecommons.org/licenses/by-nc-sa/3.0/]
13 of 13
04/29/2012 11:55 PM