Airolib-ng

Description

Airolib-ng is an aircrack-ng suite tool designed to store and manage essid and password lists, compute their Pairwise Master Keys (PMKs) and use them in WPA/WPA2 cracking. The program uses the lightweight SQLite3 database as the storage mechanism which is available on most platforms. The SQLite3 database was selected taking in consideration platform availability plus management, memory and disk overhead.

WPA/WPA2 cracking involves calculating the pairwise master key, from which the private transient key (PTK) is derived. Using the PTK, we can compute the frame message identity code (MIC) for a given packet and will potentially find the MIC to be identical to the packet's thus the PTK was correct therefore the PMK was correct as well.

Calculating the PMK is very slow since it uses the pbkdf2 algorithm. Yet the PMK is always the same for a given ESSID and password combination. This allows us to pre-compute the PMK for given combinations and speed up cracking the wpa/wpa2 handshake. Tests have shown that using this technique in aircrack-ng can check more than 50 000 passwords per second using pre-computed PMK tables.

Computing the PMK is still required, yet we can:

Precompute it for later and/or shared use.

Use distributed machines to generate the PMK and use their value elsewhere.

As stated above, this program requires the SQLite3 database environment. You must be running version 3.3.17 or above. You may obtain the latest version from the SQLite download page.

Usage

Usage: airolib <database> <operation> [options]

Where:

database is name of the database file. Optionally specify the full path.

operation specifies the action you would like taken on the database. See below for a complete list.

options may be required depending on the operation specified

Here are the valid operations:

- -stats - Output some information about the database.

- -sql {sql} - Execute the specified SQL statement.

- -clean [all] - Perform steps to clean the database from old junk. The option 'all' will also reduce file size if possible and run an integrity check.

- -batch - Start batch-processing all combinations of ESSIDs and passwords. This must be run prior to using the database within aircrack-ng or after you have added additional SSIDs or passwords.

- -verify [all] - Verify a set of randomly chosen PMKs. If the option 'all' is given, all(!) PMKs in the database are verified and the incorrect ones are deleted.

- -export cowpatty {essid} {file} - Export to a cowpatty file.

- -import cowpatty {file} - Import a cowpatty file and create the database if it does not exist.

- -import {essid|passwd} {file} - Import a text flat file as a list of either ESSIDs or passwords and create the database if it does not exist. This file must contain one essid or password per line. Lines should be terminated with line feeds. Meaning press “enter” at the end of each line when entering the values.

verifyChecking all PMKs. This could take a while...
ESSID PASSWORD PMK_DB CORRECT

Cowpatty table Export Operation

Enter:

airolib-ng testdb --export cowpatty test cowexportoftest

The system responds:

exportExporting...
Done.

Import Operation

SSID

To import an ascii list of SSIDs and create the database if it does not exist, enter:

airolib-ng testdb --import essid ssidlist.txt

Where:

testdb is the name of the database to be updated and it will be created if it does not exist.

- -import is the operation to be performed.

essid indicates it is a list of SSIDs.

ssidlist.txt is the file name containing the SSIDs. One per line. It can optionally be fully qualified.

The system responds:

importReading...
Writing...
Done.

Passwords

To import an ascii list of passwords and create the database if it does not exist, enter:

airolib-ng testdb --import passwd password.lst

Where:

testdb is the name of the database to be updated and it will be created if it does not exist.

- -import is the operation to be performed.

passwd indicates it is a list of passwords.

password.list is the file name. One per line. It can optionally be fully qualified.

The system responds:

importReading...
Writing... read, 1814 invalid lines ignored.
Done.

Cowpatty tables

Imports a cowpatty table and create the database if it does not exist, enter:

airolib-ng testdb --import cowpatty cowexportoftest

Where:

testdb is the name of the database to be updated and it will be created if it does not exist.

- -import is the operation to be performed.

cowpatty indicates it is a cowpatty table.

cowexportoftest is the file name. One per line. It can optionally be fully qualified.

The system responds:

importReading header...
Reading...
Updating references...
Writing...

Aircrack-ng Usage Example

The ultimate objective is to speed up WPA/WPA2 cracking under aircrack-ng. To use the tables you have built using airolib-ng then use the “-r” option to specify the database containing the pre-calculated PMKs.

Enter:

aircrack-ng -r testdb wpa2.eapol.cap

Where:

-r specifies that a pre-computed PMK database will be used.

testdb is the name of the database file and may optionally be fully qualified.

wpa2.eapol.cap is capture file containing the WPA/WPA2 handshake.

Note: All the other standard options which are applicable to WPA/WPA2 may also be used. This is a very limited example.

Usage Tips

Creating your own database example

To test the tool yourself…

get yourself the sqlite3 library and headers (latest version is recommended)

Using a sample pre-made database

Another way to test for yourself is to download a pre-made database called passphrases.db. This file is also located in the test directory of the aircrack-ng sources. Then try this database with the two test WPA/WPA2 files supplied in the test directory of the aircrack-ng sources. The WPA/WPA2 test files are called “wpa.cap” and “wpa2.eapol.cap”.

This should give you the passphase. Success indicates that your setup is working correctly.

Usage Troubleshooting

Enabling Airolib-ng

Airolib-ng is not compiled by default. To enable compiling, do “make sqlite=true” and “make sqlite=true install”.

Compile Error

Although this is not a usage troubleshooting tip, it is a common problem during the compilation of the 1.0dev version. As a reminder, SQLite must be version 3.3.13 or above. This is the compile error you receive when your version of SQLite is less then the requirement: