Code Monkey home page Code Monkey logo

aircrack-ng's Introduction

Aircrack-ng

Badges

GitHub CI

Alma Linux CI Alpine Linux DragonFlyBSD CI FreeBSD CI Gentoo CI Kali Linux CI Linux CI Linux PCRE CI macOS CI NetBSD CI OpenBSD CI Windows CI

Others

Clang Scan-build Codespell Coverity Scan Docker (git) push to DockerHub Markdown link PVS-Studio Analysis Style & Consistency

Repository versions

Arch Linux package Debian package Debian package Docker Image Version (latest by date) Fedora package homebrew version Ubuntu package Ubuntu package Ubuntu package Ubuntu package Ubuntu package Ubuntu package Ubuntu package

Description

Aircrack-ng is a complete suite of tools to assess WiFi network security.

It focuses on different areas of WiFi security:

  • Monitoring: Packet capture and export of data to text files for further processing by third party tools.
  • Attacking: Replay attacks, deauthentication, fake access points and others via packet injection.
  • Testing: Checking WiFi cards and driver capabilities (capture and injection).
  • Cracking: WEP and WPA PSK (WPA 1 and 2).

All tools are command line which allows for heavy scripting. A lot of GUIs have taken advantage of this feature. It works primarily on Linux but also Windows, macOS, FreeBSD, OpenBSD, NetBSD, as well as Solaris and even eComStation 2.

Building

Requirements

  • Autoconf
  • Automake
  • Libtool
  • shtool
  • OpenSSL development package or libgcrypt development package.
  • Airmon-ng (Linux) requires ethtool, usbutils, and often pciutils.
  • On Windows, cygwin has to be used and it also requires w32api package.
  • On Windows, if using clang, libiconv and libiconv-devel
  • Linux: LibNetlink 1 or 3. It can be disabled by passing --disable-libnl to configure.
  • pkg-config (pkgconf on FreeBSD, DragonFlyBSD, OpenBSD and NetBSD)
  • FreeBSD, DragonFlyBSD, OpenBSD, NetBSD, Solaris and OS X with Macports: gmake
  • Linux/Cygwin: make and Standard C++ Library development package (Debian: libstdc++-dev)

Note: Airmon-ng only requires pciutils if the system has a PCI/PCIe bus and it is populated. Such bus can be present even if not physically visible. For example, it is present, and populated on the Raspberry Pi 4, therefore pciutils is required on that device.

Optional stuff

  • If you want SSID filtering with regular expression in airodump-ng (--essid-regex) PCRE or PCRE2 development package is required.
  • If you want to use airolib-ng and '-r' option in aircrack-ng, SQLite development package >= 3.3.17 (3.6.X version or better is recommended)
  • If you want to use Airpcap, the 'developer' directory from the CD/ISO/SDK is required.
  • In order to build besside-ng, besside-ng-crawler, easside-ng, tkiptun-ng and wesside-ng, libpcap development package is required (on Cygwin, use the Airpcap SDK instead; see above)
  • rfkill
  • If you want Airodump-ng to log GPS coordinates, gpsd is needed
  • For best performance on SMP machines, ensure the hwloc library and headers are installed. It is strongly recommended on high core count systems, it may give a serious speed boost
  • CMocka and expect for testing
  • For integration testing on Linux only: tcpdump, HostAPd, WPA Supplicant and screen

Installing required and optional dependencies

Below are instructions for installing the basic requirements to build aircrack-ng for a number of operating systems.

Note: CMocka, tcpdump, screen, HostAPd and WPA Supplicant should not be dependencies when packaging Aircrack-ng.

Linux

Arch Linux

sudo pacman -Sy base-devel libnl openssl ethtool util-linux zlib libpcap sqlite pcre2 hwloc cmocka hostapd wpa_supplicant tcpdump screen iw usbutils pciutils expect

Debian/Ubuntu

sudo apt-get install build-essential autoconf automake libtool pkg-config libnl-3-dev libnl-genl-3-dev libssl-dev ethtool shtool rfkill zlib1g-dev libpcap-dev libsqlite3-dev libpcre2-dev libhwloc-dev libcmocka-dev hostapd wpasupplicant tcpdump screen iw usbutils expect

Fedora

sudo yum install libtool pkgconfig sqlite-devel autoconf automake openssl-devel libpcap-devel pcre2-devel rfkill libnl3-devel gcc gcc-c++ ethtool hwloc-devel libcmocka-devel make file expect hostapd wpa_supplicant iw usbutils tcpdump screen zlib-devel expect

CentOS/RHEL 7

sudo yum install epel-release
sudo ./centos_autotools.sh
# Remove older installation of automake/autoconf
sudo yum remove autoconf automake
sudo yum install sqlite-devel openssl-devel libpcap-devel pcre2-devel rfkill libnl3-devel ethtool hwloc-devel libcmocka-devel make file expect hostapd wpa_supplicant iw usbutils tcpdump screen zlib-devel

Note: autoconf, automake, libtool, and pkgconfig in the repositories are too old. The script centos_autotools.sh automatically installs dependencies to compile then install the tools.

CentOS/RHEL 8

sudo yum config-manager --set-enabled powertools
sudo yum install epel-release
sudo yum install libtool pkgconfig sqlite-devel autoconf automake openssl-devel libpcap-devel pcre2-devel rfkill libnl3-devel gcc gcc-c++ ethtool hwloc-devel libcmocka-devel make file expect hostapd wpa_supplicant iw usbutils tcpdump screen zlib-devel

openSUSE

sudo zypper install autoconf automake libtool pkg-config libnl3-devel libopenssl-1_1-devel zlib-devel libpcap-devel sqlite3-devel pcre2-devel hwloc-devel libcmocka-devel hostapd wpa_supplicant tcpdump screen iw gcc-c++ gcc ethtool pciutils usbutils expect

Mageia

sudo urpmi autoconf automake libtool pkgconfig libnl3-devel libopenssl-devel zlib-devel libpcap-devel sqlite3-devel pcre2-devel hwloc-devel libcmocka-devel hostapd wpa_supplicant tcpdump screen iw gcc-c++ gcc make expect

Alpine

sudo apk add gcc g++ make autoconf automake libtool libnl3-dev openssl-dev ethtool libpcap-dev cmocka-dev hostapd wpa_supplicant tcpdump screen iw pkgconf util-linux sqlite-dev pcre2-dev linux-headers zlib-dev pciutils usbutils expect

Note: Community repository needs to be enabled for iw

Clear Linux

sudo swupd bundle-add c-basic devpkg-openssl devpkg-libgcrypt devpkg-libnl devpkg-hwloc devpkg-libpcap devpkg-pcre2 devpkg-sqlite-autoconf ethtool wget network-basic software-testing sysadmin-basic wpa_supplicant os-testsuite

Note: hostapd must be compiled manually, it is not present in the repository

BSD

FreeBSD

pkg install pkgconf shtool libtool gcc9 automake autoconf pcre2 sqlite3 openssl gmake hwloc cmocka

DragonflyBSD

pkg install pkgconf shtool libtool gcc8 automake autoconf pcre2 sqlite3 libgcrypt gmake cmocka

OpenBSD

pkg_add pkgconf shtool libtool gcc automake autoconf pcre2 sqlite3 openssl gmake cmocka

NetBSD

pkg_add pkgconf libtool gcc7 automake autoconf pcre2 sqlite3 openssl gmake cmocka

macOS

XCode, Xcode command line tools and HomeBrew are required.

brew install autoconf automake libtool openssl shtool pkg-config hwloc pcre2 sqlite3 libpcap cmocka

Windows

Cygwin

Cygwin requires the full path to the setup.exe utility, in order to automate the installation of the necessary packages. In addition, it requires the location of your installation, a path to the cached packages download location, and a mirror URL.

An example of automatically installing all the dependencies is as follows:

c:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P autoconf -P automake -P bison -P gcc-core -P gcc-g++ -P mingw-runtime -P mingw-binutils -P mingw-gcc-core -P mingw-gcc-g++ -P mingw-pthreads -P mingw-w32api -P libtool -P make -P python -P gettext-devel -P gettext -P intltool -P libiconv -P pkg-config -P git -P wget -P curl -P libpcre2-devel -P libssl-devel -P libsqlite3-devel

MSYS2

pacman -Sy autoconf automake-wrapper libtool msys2-w32api-headers msys2-w32api-runtime gcc pkg-config git python openssl-devel openssl libopenssl msys2-runtime-devel gcc binutils make pcre2-devel libsqlite-devel

GNU/Hurd

Debian

apt-get install build-essential autoconf automake libtool pkg-config libssl-dev shtool zlib1g-dev libpcap-dev libsqlite3-dev libpcre2-dev libhwloc-dev libcmocka-dev screen expect libbsd-dev

Docker containers

We have two repositories on DockerHub:

Base command for the git version:

sudo docker run --rm -it aircrackng/git

Available platforms/CPU architectures:

  • linux/386 (base image: debian:unstable-slim)
  • linux/amd64 (base image: debian:unstable-slim)
  • linux/arm/v5 (base image: debian:unstable-slim)
  • linux/arm/v6 (base image: alpine:3)
  • linux/arm/v7 (base image: debian:unstable-slim)
  • linux/arm64/v8 (base image: debian:unstable-slim)
  • linux/mips64le (base image: debian:unstable-slim)
  • linux/ppc64le (base image: debian:unstable-slim)
  • linux/riscv64 (base image: debian:unstable-slim)
  • linux/s390x (base image: debian:unstable-slim)

Compiling

To build aircrack-ng, the Autotools build system is utilized. Autotools replaces the older method of compilation.

NOTE: If utilizing a developer version, eg: one checked out from source control, you will need to run a pre-configure script. The script to use is one of the following: autoreconf -i or env NOCONFIGURE=1 ./autogen.sh.

First, ./configure the project for building with the appropriate options specified for your environment:

./configure <options>

TIP: If the above fails, please see above about developer source control versions.

Next, compile the project (respecting if make or gmake is needed):

  • Compilation:

    make

  • Compilation on *BSD or Solaris:

    gmake

Finally, the additional targets listed below may be of use in your environment:

  • Execute all unit testing:

    make check

  • Execute all integration testing (requires root):

    make integration

  • Installing:

    make install

  • Uninstall:

    make uninstall

./configure flags

When configuring, the following flags can be used and combined to adjust the suite to your choosing:

  • with-airpcap=DIR: needed for supporting airpcap devices on Windows (Cygwin or MSYS2 only). Replace DIR above with the absolute location to the root of the extracted source code from the Airpcap CD or downloaded SDK available online. Required on Windows to build besside-ng, besside-ng-crawler, easside-ng, tkiptun-ng and wesside-ng when building experimental tools. The developer pack (Compatible with version 4.1.1 and 4.1.3) can be downloaded at https://support.riverbed.com/content/support/software/steelcentral-npm/airpcap.html

  • with-experimental: needed to compile tkiptun-ng, easside-ng, buddy-ng, buddy-ng-crawler, airventriloquist and wesside-ng. libpcap development package is also required to compile most of the tools. If not present, not all experimental tools will be built. On Cygwin, libpcap is not present and the Airpcap SDK replaces it. See --with-airpcap option above.

  • with-ext-scripts: needed to build airoscript-ng, versuck-ng, airgraph-ng and airdrop-ng. Note: Each script has its own dependencies.

  • with-gcrypt: Use libgcrypt crypto library instead of the default OpenSSL. And also use internal fast sha1 implementation (borrowed from GIT). Dependency (Debian): libgcrypt20-dev

  • with-duma: Compile with DUMA support. DUMA is a library to detect buffer overruns and underruns. Dependency (Debian): duma

  • disable-libnl: Set up the project to be compiled without libnl (1 or 3). Linux option only.

  • without-opt: Do not enable -O3 optimizations.

  • enable-shared: Make OSdep a shared library.

  • disable-shared: When combined with enable-static, it will statically compile Aircrack-ng.

  • with-avx512: On x86, add support for AVX512 instructions in aircrack-ng. Only use it when the current CPU supports AVX512.

  • with-static-simd=: Compile a single optimization in aircrack-ng binary. Useful when compiling statically and/or for space-constrained devices. Valid SIMD options: x86-sse2, x86-avx, x86-avx2, x86-avx512, ppc-altivec, ppc-power8, arm-neon, arm-asimd. Must be used with --enable-static --disable-shared. When using those 2 options, the default is to compile the generic optimization in the binary. --with-static-simd merely allows to choose another one.

  • enable-maintainer-mode: It is important to enable this flag when developing with Aircrack-ng. This flag enables additional compile warnings and safety features.

Examples:

  • Configure and compiling:

    ./configure --with-experimental
    make
    
  • Compiling with gcrypt:

    ./configure --with-gcrypt
    make
    
  • Installing:

    make install

  • Installing (strip binaries):

    make install-strip

  • Installing, with external scripts:

    ./configure --with-experimental --with-ext-scripts
    make
    make install
    
  • Testing (with sqlite, experimental and pcre2)

    ./configure --with-experimental
    make
    make check
    
  • Compiling on OS X with macports (and all options):

    ./configure --with-experimental
    gmake
    
  • Compiling on macOS running on M1/AARCH64 and Homebrew:

    autoreconf -vif
    env CPPFLAGS="-Wno-deprecated-declarations" ./configure --with-experimental
    make
    make check
    
  • Compiling on OS X 10.10 with XCode 7.1 and Homebrew:

    env CC=gcc-4.9 CXX=g++-4.9 ./configure
    make
    make check
    

    NOTE: Older XCode ships with a version of LLVM that does not support CPU feature detection; which causes the ./configure to fail. To work around this older LLVM, it is required that a different compile suite is used, such as GCC or a newer LLVM from Homebrew.

    If you wish to use OpenSSL from Homebrew, you may need to specify the location to its installation. To figure out where OpenSSL lives, run:

    brew --prefix openssl

    Use the output above as the DIR for --with-openssl=DIR in the ./configure line:

    env CC=gcc-4.9 CXX=g++-4.9 ./configure --with-openssl=DIR
    make
    make check
    
  • Compiling on FreeBSD with gcc9

    env CC=gcc9 CXX=g++9 MAKE=gmake ./configure
    gmake
    
  • Compiling on Cygwin with Airpcap (assuming Airpcap devpack is unpacked in Aircrack-ng directory)

    cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll src
    cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll src/aircrack-osdep
    cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll src/aircrack-crypto
    cp -vfp Airpcap_Devpack/bin/x86/airpcap.dll src/aircrack-util
    dlltool -D Airpcap_Devpack/bin/x86/airpcap.dll -d build/airpcap.dll.def -l Airpcap_Devpack/bin/x86/libairpcap.dll.a
    autoreconf -i
    ./configure --with-experimental --with-airpcap=$(pwd)
    make
    
  • Compiling on DragonflyBSD with gcrypt using GCC 8

    autoreconf -i
    env CC=gcc8 CXX=g++8 MAKE=gmake ./configure --with-experimental --with-gcrypt
    gmake
    
  • Compiling on OpenBSD (with autoconf 2.69 and automake 1.16)

    export AUTOCONF_VERSION=2.69
    export AUTOMAKE_VERSION=1.16
    autoreconf -i
    env MAKE=gmake CC=cc CXX=c++ ./configure
    gmake
    
  • Compiling and debugging aircrack-ng

    export CFLAGS='-O0 -g'
    export CXXFLAGS='-O0 -g'
    ./configure --with-experimental --enable-maintainer-mode --without-opt
    make
    LD_LIBRARY_PATH=.libs gdb --args ./aircrack-ng [PARAMETERS]
    

IDE development

VS Code - devcontainers

A VS Code development environment is provided, as is, for rapid setup of a development environment. This additionally adds support for GitHub Codespaces.

Requirements

The first requirement is a working Docker Engine environment.

Next, an installation of VS Code with the following extension(s):

The "Remote - Containers" extension will refuse to work with OSS Code.

Usage

  1. Clone this repository to your working folder:
$ git clone --recursive https://github.com/aircrack-ng/aircrack-ng.git
$ cd aircrack-ng
  1. After cloning this repository, open the folder inside VS Code.
$ code .

IMPORTANT: You should answer "Yes", if it asks if the folder should be opened inside a remote container. If it does not ask, then press Ctrl+Shift+P and type open in container. This should bring up the correct command, for which pressing enter will run said command.

  1. A number of warnings might appear about a missing compile_commands.json file. These are safe to ignore for a moment, as this file is automatically generated after the initial compilation.
  2. Now build the entire project by pressing Ctrl+R and selecting Build Full from the pop-up menu that appears.
  3. VS Code should detect the compile_commands.json file and ask if it should be used; selecting "Yes, always" will complete the initial setup of a fully working IDE.

IMPORTANT: If it doesn't detect the file, pressing Ctrl+Shift+P and typing reload window will bring up the selection to fully reload the environment.

  1. At this point, nearly all features of VS Code will function; from Intellisense, auto-completion, live documentation, to code formatting. Additionally, there are pre-configured tasks for builds and tests, as well as an example GDB/LLDB configuration for debugging aircrack-ng.

Packaging

Automatic detection of CPU optimization is done at run time. This behavior is desirable when packaging Aircrack-ng (for a Linux or other distribution.)

Also, in some cases it may be desired to provide your own flags completely and not having the suite auto-detect a number of optimizations. To do this, add the additional flag --without-opt to the ./configure line:

./configure --without-opt

Using pre-compiled binaries

Linux/BSD

Aircrack-ng is available in most distributions repositories. However, it is not always up-to-date.

Windows

  • Install the appropriate "monitor" driver for your card; standard drivers don't work for capturing data.
  • Aircrack-ng suite is command line tools. So, you have to open a command-line Start menu -> Run... -> cmd.exe then use them
  • Run the executables without any parameters to have help

Documentation

Some more information is present in the README file.

Documentation, tutorials, ... can be found on https://aircrack-ng.org

Support is available in the GitHub Discussions and on IRC (in #aircrack-ng on Libera Chat).

Every tool has its own manpage. For aircrack-ng, man aircrack-ng

Infrastructure sponsors

aircrack-ng's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aircrack-ng's Issues

aircrack does not compile on Arch-Linux

Reported by anonymous on 30 Dec 2006 11:11 UTC

aircrack does not compile on my Arch box.
Arch is up to date. (I use the current, extra and community repos....)

kernel is a 2.6.19

gcc version: gcc (GCC) 4.1.2 20061215 (prerelease)
I tried the PKGBUILD and just make.

this is the error-message from make:

gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 src/aircrack-ng.c \
 src/crypto.c src/sha1-mmx.S src/common.c -o aircrack-ng -lpthread
gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 src/airdecap-ng.c \
 src/crypto.c src/common.c src/crc.c -o airdecap-ng
gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 src/packetforge-ng.c \
 src/common.c src/crc.c -o packetforge-ng
gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 src/aireplay-ng.c \
 src/common.c src/crc.c -o aireplay-ng
In file included from src/aireplay-ng.c:34:
/usr/include/linux/wireless.h:885: error: 'IFNAMSIZ' undeclared \
 here (not in a function)
src/aireplay-ng.c: In function 'openraw':
src/aireplay-ng.c:2189: error: storage size of 'ifr' isn't known
src/aireplay-ng.c:2189: warning: unused variable 'ifr'
make: *** [aireplay-ng] Error 1

no keystream file warning (packetforge-ng & airtun-ng)

Reported by hirte on 24 Dec 2006 18:41 UTC

When specifying a prga where the 4th byte isn't 00-03 and/or the file extension is different from .xor then there should be a warning to specify a PRGA file from --chopchop or --fragment.

coWPAtty WPA tables

Reported by misterx on 22 Dec 2006 22:10 UTC

Make aircrack-ng being able to use coWPAtty WPA/WPA2 tables

Ensure a solid connection to the AP

Reported by misterx on 7 Jan 2007 20:38 UTC

from darkAudax:

Since there are now multiple ways to get xor files (chopchop, fragmentation), why not have an option to read in the xor file and create a valid keep encrypted keep alive packet. This would further ensure a solid "connection" to the access point.

fragmentation attack for a client

Reported by darkAudax on 8 Jan 2007 22:03 UTC

This enhancement is for a future generation of the fragmentation attack. This write-up is to start people thinking about it and there is no expectation that the implementation will be any time soon.

The current frag attack is oriented towards access points. As access points become stronger from a security point of view, the weak link is the wireless client itself. The wireless client tends to have very few controls or smarts to prevent attacks. So with this in mind...

Why not modify the frag attack so packets can optionally be sent to the wireless client instead of the access point. There is an existing "-j" flag in aireplay-ng to "-j : arpreplay attack : inject FromDS pkts". I don't believe this gets applied to the packets being generated for the frag attack.

For this to work, both the FromDS and ToDS flags would need to get set correctly. As well, you would need to know the IP address of the client so the arp could be directed at the client directly and it would respond to the arp request. Makes it harder but doable.

The other unknown is if a wireless client would reassemble fragmented packets. My thought would be yes but I don't know that for sure.

Although there are some unknowns, if it could all be made to work, it would be a great new attack vector.

d.

Create a new format to replace IVs

Reported by misterx on 15 Dec 2006 23:17 UTC

Create a new format that will replace IVs file with the following advantages:

  • Contain the ESSID (or at least its lenght if it wasn't found)
  • Can handle both WEP (IVs and enough data for PTW) or WPA (handshake). And a file can contain both format (I mean one or more WEP network and one or more WPA network) at the same time
  • Versionned, so that it can be easily updated

More options for ivstools

Reported by misterx on 15 Dec 2006 23:12 UTC

Add 2 options to ivstools:

  • Split in several files containing each the same number of IVs
  • Merge IVS from different BSSID (AP MAC address)

Fragmentation attack issue with madwifi-ng

Reported by misterx on 7 Jan 2007 13:17 UTC

Taken from the forum ( http://tinyshell.be/aircrackng/forum/index.php?topic=14.msg5122#msg5122 ) :

The fragmentation attack would not work consistently.

The cause is that if MAC address of the spoofed packets does not match the MAC address of the card in the PC then they are malformed. The only way to successfully have the fragmentation attack work is to first change the MAC address of the card to match the spoofed MAC address. The details follow. To simplify the analysis, I changed aireplay-ng to only do one round instead of ten.

The first packet capture "frag-different-mac.cap" is a capture when the mac address is different. You will see that the fragmented packet is properly generated. IE 12 fragments numbered 0 to 11. However, notice that the sequence number in the frame control is different for each fragment instead of being the same. So the access point does not know to assemble the fragments into a single packet.

Here is what it looks like. Notice also that there is a false positive "Got ANSWER packet!!". I am not sure why this happens.

# aireplay-ng -5 ath0 -b 00:14:6C:7E:40:80 -h 00:09:5B:EC:EE:F2 -l 192.168.55.15
Madwifi: 1  Madwifi-ng: 1
Waiting for a data packet...
Data packet found!
Sending fragmented packet
Got ANSWER packet!!
Trying to get 408 bytes of a keystream
No answer, repeating...
Still nothing, trying another packet...

Now I change the mac address of the wireless card to match the spoofed mac address.

The second packet capture "frag-same-mac.cap" is a capture when the mac address is the same. You will see that the fragmented packet is properly generated. IE 12 fragments numbered 0 to 11. And now the sequence number in the frame control is the same for each fragment. Bingo, the access point knows the fragments belong to the same packet and can assemble it.

Here is the successful output:

# aireplay-ng -5 ath0 -b 00:14:6C:7E:40:80 -h 00:09:5B:EC:EE:F2 -l 192.168.55.15
Madwifi: 1  Madwifi-ng: 1
Waiting for a data packet...
Data packet found!
Sending fragmented packet
Got RELAYED packet!!
Thats our ARP packet!
Trying to get 408 bytes of a keystream
Got RELAYED packet!!
Thats our ARP packet!
Trying to get 1500 bytes of a keystream
Got RELAYED packet!!
Now you can build a packet with packetforge-ng out of that 1500 bytes keystream

Proof also comes from a sniff from a system on the ethernet. You can see that the arp was successfully generated.

tcpdump -n arp
16:50:28.397796 arp who-has 255.255.255.255 tell 192.168.55.15

So now the question comes... What causes this problem? I suspect it is the madwifi-ng drivers. I will let you and the other gurus decide on the root cause. Makes me wonder if new madwifi-ng drivers would fix the problem. In the meantime, we have a workaround.

The other question is if this same problem occurs with other drivers.

So folks, here is what to look for if you are using Atheros/madwifi-ng and your fragmentation attack is not working. First, change your card mac address to the one you will be spoofing. Second, capture your attack traffic. Then confirm that the following is true:

You should see 12 fragments numbered 0 through 11. Each fragment must have the same sequence number and initialization vector. The initialization vector should match the one on the packet which triggered the fragmentation attack.

"[: 417: ==: unexpected operator" in airmon-ng and other errors

Reported by misterx on 2 Jan 2007 21:36 UTC

There's 2/3 errors with airmon-ng:

  • First it should check if the user is root to avoid SIOCSIFFLAGS (Permission denied)
  • wlanconfig: ioctl: Operation not permitted (it could be linked to the first error)
  • [: 417: ==: unexpected operator

Here is the output:

# airmon-ng stop ath0


Interface	Chipset		Driver

SIOCSIFFLAGS: Permission denied
wifi0		Atheros		madwifi-ng
[: 417: ==: unexpected operator
eth1		Centrino b/g	ipw3945
[: 417: ==: unexpected operator
ath0		Atheros		madwifi-ng VAP (parent: wifi0)wlanconfig: ioctl (VAP destroyed)


# airmon-ng start wifi0


Interface	Chipset		Driver

SIOCSIFFLAGS: Permission denied
wifi0		Atheros		madwifi-ngwlanconfig: ioctl: Operation not permitted
Error : unrecognised wireless request 10

[: 417: ==: unexpected operator
eth1		Centrino b/g	ipw3945
[: 417: ==: unexpected operator
ath0		Atheros		madwifi-ng VAP (parent: wifi0)

Close open handles

Reported by misterx on 12 Dec 2006 21:41 UTC

Close open handles on files in packetforge-ng

change airodump-ng txt-file format

Reported by Ace on 5 Jan 2007 23:38 UTC

It would be very nice if someone could change this:

  • the *.txt is now a binary file (not so bad, but can't edit it for testing)
  • if airodump can't get specific informations, it writes nothing to the file instead of a blank (" ")

e.g. :

BSSID, First time seen, Last time seen, channel, Speed, Privacy, Cipher, Authentication, Power, # beacons, # IV, LAN IP, ID-length, ESSID, Key
00:03:C9:B5:4C:29, 2007-01-05 12:02:17, 2007-01-05 12:02:21, 11,  48, OPN '''!,,,'''   6,       31,        0,   0.  0.  0.  0,   8,         ,

should be :

BSSID, First time seen, Last time seen, channel, Speed, Privacy, Cipher, Authentication, Power, # beacons, # IV, LAN IP, ID-length, ESSID, Key
00:03:C9:B5:4C:29, 2007-01-05 12:02:17, 2007-01-05 12:02:21, 11,  48, OPN ''', , ,'''   6,       31,        0,   0.  0.  0.  0,   8,         ,

link to forum post: http://tinyshell.be/aircrackng/forum/index.php?topic=982.0

airmon-ng script completly fails with /bin/sh as dash

Reported by gandalf on 11 Dec 2006 22:01 UTC

Debian Bug Report #390673

The /usr/sbin/airmon-ng script completly breaks if /bin/sh is dash. In fact, the entire script is full of bashisms.

The solution is to either use /bin/bash, or fix all of the bashisms.

orinoco problem

Reported by b cisek on 12 Jan 2007 18:10 UTC

There is a problem with airodump-ng (from svn) when I try to run it on Orinoco/Hermes I.

Config:

Linux kernel 2.6.18.2

orinoco drivers http: www.kismetwireless.net /code/ orinoco-0.13-dragorn-2.6.17.tar.gz

eth2 Available private ioctls :

      force_reset      (8BE0) : set   0       & get   0

      card_reset       (8BE1) : set   0       & get   0

      set_port3        (8BE2) : set   1 int   & get   0

      get_port3        (8BE3) : set   0       & get   1 int

      set_preamble     (8BE4) : set   1 int   & get   0

      get_preamble     (8BE5) : set   0       & get   1 int

      set_ibssport     (8BE6) : set   1 int   & get   0

      get_ibssport     (8BE7) : set   0       & get   1 int

      monitor          (8BE8) : set   2 int   & get   0

      dump_recs        (8BFF) : set   0       & get   0

Error message:

mustafa:~# airodump-ng --channel 2 --ivs -w wep eth2

ioctl(SIOCSIWMODE) failed: Invalid argument

Error setting monitor mode on eth2

thanks :)

deadlock in Aircrack-ng when reading a corrupt capture file

Reported by misterx on 22 Dec 2006 22:19 UTC

In read_thread() in aircrack-ng.c, there is a possibility of a deadlock at the mutex lock (mx_apl) due to a continue which doesn't unlock the mutex.

This manifests itself as a hang when reading from a capture file (which contains a packet formed in such a way that it triggers the problem). The output looks like this:

aircrack-ng file.cap
Opening file.cap
Reading packets, please wait...

A possible fix:

--- aircrack-ng-0.6/src/aircrack-ng.c   2006-06-22 20:53:57.000000000 -0700
+++ aircrack-ng-0.6_modified/src/aircrack-ng.c  2006-07-04 20:54:47.000000000 -0700
@@ -845,7 +845,7 @@
                ap_cur->crypt = 3;               /* set WPA */

                if( st_cur == NULL )
-                       continue;
+                       goto unlock_mx_apl;

                /* frame 1: Pairwise == 1, Install == 0, Ack == 1, MIC == 0 */

See http://tinyshell.be/aircrackng/forum/index.php?topic=322.0

Replace airmon-ng by wifidetect and add add support for other drivers

Reported by misterx on 16 Dec 2006 13:35 UTC

Replace airmon-ng by wifidetect (by Zero Chaos) and fix known limitations:

  • if madwifi-ng detection fails it should use madwifi-old before continuing
  • if you have multiple madwifi-ng devices it may get ugly (not sure)
  • if you have madwifi-ng and you run monitor twice it will loop creating monitor VAPs

Add support for detecting other drivers:

  • Realtek 8187
  • Latest ralink chipsets
  • Other less used drivers (admtek, atmel_usb, legacy cisco, ...)
  • ...

Show revision in unstable/development svn builds

Reported by hirte on 3 Jan 2007 21:36 UTC

Define

-D_DEVEL="`cat .svn/entries | grep revision | sed 's/.*revision=\"\(.*\)\".*/\1/'`"

as an OPTFLAGS option in the Makefile and delete "#define _DEVEL 0" in version.h

'''We have to reverse that for the stable versions! '''

But using that method gives us way better control of hunting down bugs in svn revisions, as users can post us the exact version from the command they used ( | grep dev) , instead of trusting their intuition for using "the newest checkout" ...

Personally i don't like this rather complex command to be used as an option for gcc, because of the high failure potential it involves. So I'd like to read some alternatives as a response to this ticket ;).

Error compiling aircrack-ng on Mac Intel

Reported by misterx on 5 Jan 2007 22:07 UTC

make error message (line 20 of sha1-mmx):

gcc -g -W -Wall -O3 -D_FILE_OFFSET_BITS=64 src/aircrack-ng.c src/crypto.c \
  src/sha1-mmx.S src/common.c -o aircrack-ng -lpthread
src/sha1-mmx.S:20:Alignment too large: 15. assumed.
/usr/bin/ld: alignment (0x8000) of section (__DATA,__data) greater than the segment alignment (0x1000)
collect2: ld returned 1 exit status
make: *** [aircrack-ng] Error 1

Sources and timeline not always up to date

Reported by misterx on 16 Dec 2006 15:51 UTC

Timeline and sources are sometimes not updated. At the moment, we are at revision 13 but timeline and sources only show revision 11.

Special handling of spanning tree packets

Reported by misterx on 16 Dec 2006 12:33 UTC

Many access points (e.g. Linksys) send out spanning tree BPDU packets every second or so. These packets are WEP encrypted and thus contribute to the IV data used for cracking. There is only one small problem: The first two bytes of these packets (before encryption) are not 0xAA, but 0x42.

Currently, aircrack-ng sort of ignores this. Given that these STP packets are usually only a small fraction of the total number of packets with IV data, the incorrect assumption about the first two bytes only contributes a little bit of statistical noise to the analysis, but with enough packets, it doesn't make too much of a difference. However, what this means is that there is a bit of room for improvement to make the analysis more accurate with less IV data.

The STP packets can be easily identified, because the Destination Address in the packet header will be 01:80:C2:00:00:00 (which is the All STP bridges multicast MAC address). So for these packets, we can have airodump-ng modify the IV data it saves to the .ivs file as follows:

if (Destination Address of packet == 01:80:C2:00:00:00)
write 3 byte IV to .ivs file

outbyte1 = (outbyte1 XOR 0x42) XOR 0xAA

outbyte2 = (outbyte2 XOR 0x42) XOR 0xAA

write outbyte1, outbyte2 to .ivs file

What we are doing here is xoring the output bytes with 0x42 to recover the keystream and then xoring that with 0xAA so that when aircrack-ng applies the FMS and KoreK attacks to the (IV, output byte) set, the assumption that the plaintext output bytes before encryption == 0xAA will be correct (even though in the original packet, this assumption would have been incorrect).

This should help remove some false positives/negatives and make the analysis more accurate.

There's also issues when chopchoping STP packets.

Build keystream database

Reported by hirte on 1 Jan 2007 15:22 UTC

Create a new file format, which contains all recovered keystreams. Build a tool (or include in aireplay as attack -6?), that'll generate keystreams and fill the database. Support for this db has to be written for packetforge-ng, airtun-ng and aireplay-ng (for all tools, which are using a keystream). These keystreams can be used in a way that we evade WIDS. Another example is airtun-ng, which could en-/decrypt (with a more or less complete keyspace) and thus using a network without cracking the key.

packetforge-ng reverses IPs for ARP generation

Reported by misterx on 31 Dec 2006 23:43 UTC

Lets say we have two workstations:

Ethernet workstation
IP: 192.168.55.51
MAC: 00:40:F4:77:F0:9B

Wireless workstation
IP: 192.168.55.109
MAC: 00:0F:B5:46:11:19

I want to create an ARP request packet from the ethernet workstation going to the wireless workstation.

The ARP request says "Who has 192.168.55.109? Tell 192.168.55.51".

So in my mind:

  • Source IP in this case is 192.168.55.51 since this is where we want the packet returned.
  • Destination IP in this case is 192.168.55.109 since this workstation will be receiving the packet and responding.

IE:

-k <ip[: set Source      IP [Port](:port]>)
-l <ip[: set Destination IP [Port](:port]>)

-k 192.168.55.51
-l 192.168.55.109

However to get the desired ARP packet, you need to reverse the addresses. The following command successfully generates the packet we want. You notice the sending and receiving IPs are reversed.

packetforge-ng --arp -a 00:14:6C:7E:40:80 -c 00:0F:B5:46:11:19
-h 00:40:F4:77:F0:9B -j -o -k 192.168.55.109 -l 192.168.55.51
-y replay_dec-1231-133021.xor -w arpforge.cap
tcpdump -n -vvv -e -s0 -r arpforge.cap           
reading from file arpforge.cap, link-type IEEE802_11 (802.11)
13:32:06.523444 WEP Encrypted 258us DA:Broadcast BSSID:00:14:6c:7e:40:80 SA:00:40:f4:77:f0:9b Data IV:162 Pad 0 KeyID 0

So I believe there is a bug in packetforge-ng whereby it reverses the addresses in the specific case above.

(Taken from the forum: http://tinyshell.be/aircrackng/forum/index.php?topic=986.0 )

Custom key space restriction

Reported by misterx on 22 Dec 2006 21:35 UTC

Be able to specify the key space when cracking.
It can be ASCII chars or hexadecimal values.
For example: --keyspace ABCDEFGHIJKL

BTW, all options restricting key space should be grouped into one option (with an argument telling which predefined key space to use.

Being able to "pause" cracking - aka save/restore session

Reported by misterx on 22 Dec 2006 21:43 UTC

In some cases, it's not possible to crack a key in one step, so it could be useful that aircrack-ng saves its current state and then being able to continue where it was stopped.

A state file should be created (or maybe the current key tested (or the state of the votes).

Remark: This will only work for a file that didn't change (no more IVs added/removed)

aircrack-ng doesn't work with 802.11e QoS packets

Reported by gandalf on 11 Dec 2006 22:13 UTC

Debian Bug Report #400775

aircrack-ng does not work when the wireless network has 802.11e QOS enabled;
the reason is an packet offset error in aircrack-ng.c, a simple patch is attached.

airdecap-ng fails to decrypt wep

Reported by gandalf on 11 Dec 2006 22:09 UTC

Debian Bug Report #399674

airdecap-ng fails to decrypt wep packets.

Function check_crc_buf() was modified not taking into account the way
the variable "buf" was used.

A solution is: at src/crc.c:22 (right before return), insert a: buf+=len

This was reported by user "!LatinSud" via forum at:
http://tinyshell.be/aircrackng/forum/index.php?topic=771.0

Confirmed that wep decrypt now works after recompiling package with
above change.

Update aireplay-ng manpage

Reported by misterx on 16 Dec 2006 20:54 UTC

Update aireplay-ng manpage for the new --fragment option

WIDS evasion

Reported by misterx on 18 Dec 2006 21:24 UTC

  • Aireplay should be able to choose IV from a pool (when ringbuffer is big enough or unlimited) that hasn't been used in last X packets
  • Ghosting (tx power): by changing tx power of the card while injecting, we can evade location tracking. If you turn the radio's power up and down every few ms, the trackers will have a much harder time finding you (basicly you will hop all over the place depending on sensor position). At least madwifi can do it.
  • Ghosting (speed/modulation): change speed every few ms, not a fantastic evasion technique but it may cause more location tracking oddity. Note that tx power levels can only be set at certain speeds (lower speed means higher tx power allowed).
  • 802.11 allows you to fragment each packet into as many as 16 pieces. It would be nice if we could use fragmentated packets in every aireplay-ng attack.

make doc fails due to missing INSTALL file

Reported by cygeus on 4 Jan 2007 20:54 UTC

In 37a05c1 INSTALL was renamed to INSTALLING. so the Makefiles need to be changed accordingly:

old:

DOCFILES        = ChangeLog INSTALL README LICENSE AUTHORS VERSION

new:

DOCFILES        = ChangeLog INSTALLING README LICENSE AUTHORS VERSION

Modify or enhance fakeauth

Reported by misterx on 6 Jan 2007 23:40 UTC

Taken from the forum ( http://tinyshell.be/aircrackng/forum/index.php?topic=1014.0 ):

I have always had major problems using "aireplay -1" fake authentication with my access point. When you run the command (with the appropriate parameters), it would get all kinds of variations: connected then get a disassociate packets, athenticate but can't associate, and on and on. Sometimes it would never complete successfully or sometimes take 5 to 8 minutes to be successful.

I finally got fed up and did some experiments. One thing that I noticed is that the standard fake authentication sends multiple authentication and associate requests out. My theory was that this was confusing the access point. So I modified aireplay to only send 1 packet of each instead of multiple.

Bingo! Aireplay consistently does fake authentication on the first try.

So this same problem likely comes up with other access points and certainly all the access points of the same brand. So here are my suggestions:

  • Provide an option to override the default built into the program. This way we can try different numbers of packets. Maybe different numbers work better on certain APs. Certainly the quantity of 1 is required on my brand.

  • Provide an option to overide the default time between keep alive packets. The default is currently 15 seconds. Personnally I like being able to send them every second. This way you know for sure you are still associated with the AP. If you become disassociated then you get know immediately.

Distributed cracking

Reported by misterx on 22 Dec 2006 22:13 UTC

Make aircrack-ng being able to distribute cracking of a key more or less like it does for SMP computer.

This should be done for 2.0 or 2.1 release (the server will be the "coordinator").

Aireplay-ng complaining about interface MAC being 00:00:00:00:00:00

Reported by CValentine on 10 Jan 2007 18:50 UTC

Aireplay-ng keeps complaining about the interface MAC not matching the specified one during an aireplay-ng -3 attack. It's always listing the MAC as being set to 00:00:00:00:00:00 no matter if the mac is the card's original or been changed by macchanger. Via ifconfig the MAC is always correctly shown as set to the one requested though.

System is Ubuntu Edgy on a Centrino, Aircrack-ng SVN, patched IPW2200 v1.2.1 (and lower ones)

Packet length < 30 bytes (bad detection of madwifi-ng)

Reported by misterx on 29 Dec 2006 18:05 UTC

It seems like the packets being returned are 26 bytes in length. That is: frame control (2 bytes), duration id (2 bytes), 3 mac addresses (18 bytes), CRC (4 bytes). In other words, there is no actual data being returned. This is happening on the authentication request.

I am not sure if this is the fault of aireplay-ng when it sends the authentication request or reads the response, the fault of the madwifi driver when it sends or receives, or due to the specifics of the routers. It doesn't seem to happen with all routers, but most.

This is the extent to which I can help with this I think. Hopefully someone who can do more finds it useful. Below are a couple of packets in hex.

B0 - 08 - 3A - 01 - 00 - 11 - 22 - 33 - 44 - 55 - 00 - 0B - 23 - EB - D4 - F2 - 00 - 0B - 23 - EB - D4 - F2 - 80 - 07 - 00 - 00
B0 - 08 - 3A - 01 - 00 - 11 - 22 - 33 - 44 - 55 - 00 - 0B - 23 - EB - D4 - F2 - 00 - 0B - 23 - EB - D4 - F2 - 90 - 07 - 00 - 00
B0 - 08 - 3A - 01 - 00 - 13 - 02 - A4 - 21 - 95 - 00 - 13 - 46 - FC - 80 - BC - 00 - 13 - 46 - FC - 80 - BC - 70 - 39 - 00 - 00
B0 - 00 - 3A - 01 - 00 - 13 - 02 - A4 - 21 - 95 - 00 - 13 - 46 - FC - 80 - BC - 00 - 13 - 46 - FC - 80 - BC - 90 - 39 - 00 - 00

(Taken from the forum)

Airmon-ng does not recognize ipw2200 1.2.0

Reported by latinsud on 23 Dec 2006 19:29 UTC

Airmon-ng has a list of invalid ipw2200 driver versions. This list is not currently correct.

Current code is:

if { echo "$MODINFO" | grep -E '^1\.0\.(0|1|2|3)$|^1\.[; }
...
if { echo "$MODINFO" | grep -E '^1\.0\.(5|7|8|11)$|^1\.[1-9](1-9]')' ; }

This blacklists current working version, 1.2.0, as well as future versions. I don't remember the whole versioning history of the driver, but iirc it'd be safe to assume that version 1.1.1 and higher worked fine. So i suggest:

if { echo "$MODINFO" | grep -E '^1\.0\.(0|1|2|3)$' ; }
...
if { echo "$MODINFO" | grep -E '^1\.0\.(5|7|8|11)$' ; }

There's also an interesting feature of driver, starting from version 1.1.2, that appends a list of capabilities to version, like: 1.2.0dmprq. The 'm' indicates that support for monitor mode was compiled in.

Previously reported in forum
http://tinyshell.be/aircrackng/forum/index.php?topic=685.0

Bad output of airmon-ng

Reported by misterx on 16 Dec 2006 22:26 UTC

This happens on ubuntu (and maybe other distro) with [airmon-ng <start|stop> [channel](18]:

usage:)
 
-e Interface    Chipset         Driver
 
-e -n wifi0             Atheros         madwifi-ng
 
[: 377: ==: unexpected operator
-e -n ath0              Atheros         madwifi-ng VAP (parent: wifi0)

too many threads for opening input files

Reported by hirte on 23 Dec 2006 21:53 UTC

"pthread_create failed: Cannot allocate memory" when specifying too many capture files.

A possible solution would be to limit the number of concurrent threads and reuse threads to read more than one pcap-file.

Timeline sometimes throw an error

Reported by misterx on 16 Dec 2006 15:49 UTC

Sometimes it gives an error telling that one changeset doesn't exist.

This will be fixed when debian will release Trac 0.10.3

aircrack for pocket pc

Reported by anonymous on 3 Jan 2007 23:10 UTC

It would be really interesting to run aircrack on pocket pc devices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.