aircrack is an 802.11 WEP and WPA-PSK keys cracking program that

can recover keys once enough data packets have been captured.

  It implements the standard FMS attack along with some optimizations
  like KoreK attacks, thus making the attack much faster compared to
  other WEP cracking tools. In fact, aircrack is a set of tools for
  auditing wireless networks.

From Benoit Lecocq.

Note: aireplay-ng can cause kernel panics (as reported by David
Coppa), so this isn't yet connected to the build. But having it in
the tree may get some more people testing driver patches.

prodded by and ok fgsch@
"sounds like a plan" ckuethe@
This commit is contained in:
kili 2009-05-06 20:39:29 +00:00
parent 8f6f941567
commit 00090a234c
11 changed files with 342 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
COMMENT= '802.11 WEP and WPA-PSK keys cracking program'
DISTNAME= aircrack-ng-1.0-rc3
CATEGORIES= security
MASTER_SITES= http://download.aircrack-ng.org/
HOMEPAGE= http://www.aircrack-ng.org/
MAINTAINER= Benoit Lecocq <blq@arcane-labs.net>
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c pthread crypto ssl z
LIB_DEPENDS= sqlite3::databases/sqlite3
USE_GMAKE= Yes
MAKE_ENV+= SQLITE=true UNSTABLE=true
MAKE_FLAGS+= CC=${CC}
NO_REGRESS= Yes
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (aircrack-ng-1.0-rc3.tar.gz) = N4hN6Tmvguq2DT59FltArQ==
RMD160 (aircrack-ng-1.0-rc3.tar.gz) = OsLcJ/KhURtCv6KFaR+qLEwNMEc=
SHA1 (aircrack-ng-1.0-rc3.tar.gz) = Jpe2zqWG11ARgOO+weE/G8tPkNg=
SHA256 (aircrack-ng-1.0-rc3.tar.gz) = JJUCZfE67W/rx7lREXPKGrhaTxmcQwWUBZ7HltSzwF8=
SIZE (aircrack-ng-1.0-rc3.tar.gz) = 1512442

View File

@ -0,0 +1,32 @@
--- common.mak.orig Thu Mar 26 22:01:02 2009
+++ common.mak Wed Apr 15 18:36:48 2009
@@ -31,16 +31,16 @@ COMMON_CFLAGS += -DCYGWIN
endif
ifeq ($(SQLITE), true)
- COMMON_CFLAGS += -I/usr/local/include -DHAVE_SQLITE
+ COMMON_CFLAGS += -I${LOCALBASE}/include -DHAVE_SQLITE
else
ifeq ($(sqlite), true)
- COMMON_CFLAGS += -I/usr/local/include -DHAVE_SQLITE
+ COMMON_CFLAGS += -I${LOCALBASE}/include -DHAVE_SQLITE
else
ifeq ($(SQLITE), TRUE)
- COMMON_CFLAGS += -I/usr/local/include -DHAVE_SQLITE
+ COMMON_CFLAGS += -I${LOCALBASE}/include -DHAVE_SQLITE
else
ifeq ($(sqlite), TRUE)
- COMMON_CFLAGS += -I/usr/local/include -DHAVE_SQLITE
+ COMMON_CFLAGS += -I${LOCALBASE}/include -DHAVE_SQLITE
endif
endif
endif
@@ -70,7 +70,7 @@ OPTFLAGS = -D_FILE_OFFSET_BITS=64
CFLAGS ?= -g -W -Wall -Werror -O3
CFLAGS += $(OPTFLAGS) $(REVFLAGS) $(COMMON_CFLAGS)
-prefix = /usr/local
+prefix = ${LOCALBASE}
bindir = $(prefix)/bin
sbindir = $(prefix)/sbin
mandir = $(prefix)/man/man1

View File

@ -0,0 +1,58 @@
--- src/Makefile.orig Thu Mar 26 22:01:02 2009
+++ src/Makefile Wed Apr 15 18:37:27 2009
@@ -102,16 +102,16 @@ LIBOSD = $(OSD)/lib$(OSD).a
LIBSSL = -lssl -lcrypto $(LDFLAGS)
LIBSQL =
ifeq ($(SQLITE), true)
- LIBSQL = -L/usr/local/lib -lsqlite3
+ LIBSQL = -L${LOCALBASE}/lib -lsqlite3
else
ifeq ($(sqlite), true)
- LIBSQL = -L/usr/local/lib -lsqlite3
+ LIBSQL = -L${LOCALBASE}/lib -lsqlite3
else
ifeq ($(SQLITE), TRUE)
- LIBSQL = -L/usr/local/lib -lsqlite3
+ LIBSQL = -L${LOCALBASE}/lib -lsqlite3
else
ifeq ($(sqlite), TRUE)
- LIBSQL = -L/usr/local/lib -lsqlite3
+ LIBSQL = -L${LOCALBASE}/lib -lsqlite3
endif
endif
endif
@@ -129,21 +129,21 @@ $(LIBOSD):
aircrack-ng-opt: $(SRC_AC)
$(iCC) $(iCFLAGS) $(iOPTFLAGS) $(REVFLAGS) $(SRC_AC) $(ASM_AC) $(LIBSSL) \
- uniqueiv.o -o aircrack-ng-opt -lpthread $(LIBSQL)
+ uniqueiv.o -o aircrack-ng-opt -pthread $(LIBSQL)
aircrack-ng-opt-prof_gen: $(SRC_AC)
mkdir -p prof
$(iCC) $(iCFLAGS) $(iOPTFLAGS) $(REVFLAGS) -prof_genx -DDO_PGO_DUMP \
-prof_dir$(PROF_DIR) $(SRC_AC) $(ASM_AC) $(LIBSSL) uniqueiv.o -o \
- aircrack-ng-opt-prof_gen -lpthread $(LIBSQL)
+ aircrack-ng-opt-prof_gen -pthread $(LIBSQL)
aircrack-ng-opt-prof_use: $(SRC_AC)
$(iCC) $(iCFLAGS) $(iOPTFLAGS) $(REVFLAGS) -prof_use \
-prof_dir$(PROF_DIR) $(SRC_AC) $(ASM_AC) $(LIBSSL) uniqueiv.o -o \
- aircrack-ng-opt-prof -lpthread $(LIBSQL)
+ aircrack-ng-opt-prof -pthread $(LIBSQL)
aircrack-ng$(EXE): $(OBJS_AC)
- $(CC) $(CFLAGS) $(OBJS_AC) $(ASM_AC) -o $(@) -lpthread $(LIBSSL) $(LIBSQL)
+ $(CC) $(CFLAGS) $(OBJS_AC) $(ASM_AC) -o $(@) -pthread $(LIBSSL) $(LIBSQL)
airdecap-ng$(EXE): $(OBJS_AD)
$(CC) $(CFLAGS) $(OBJS_AD) -o $(@) $(LIBSSL)
@@ -185,7 +185,7 @@ airolib-ng$(EXE): $(OBJS_AL)
$(CC) $(CFLAGS) $(OBJS_AL) -o $(@) $(LIBSSL) -DHAVE_REGEXP $(LIBSQL)
airbase-ng$(EXE): $(OBJS_AB) $(LIBOSD)
- $(CC) $(CFLAGS) $(OBJS_AB) -o $(@) $(LIBS) $(LIBSSL) -lpthread
+ $(CC) $(CFLAGS) $(OBJS_AB) -o $(@) $(LIBS) $(LIBSSL) -pthread
airdecloak-ng$(EXE): $(OBJS_AU)
$(CC) $(CFLAGS) $(OBJS_AU) -o $(@)

View File

@ -0,0 +1,11 @@
--- src/aircrack-ng.h.orig Wed Mar 4 15:14:46 2009
+++ src/aircrack-ng.h Wed Mar 4 15:15:43 2009
@@ -3,6 +3,8 @@
#include <stdint.h>
#include <stdio.h>
+#include <pthread.h>
+
#include "aircrack-ptw-lib.h"
#define SUCCESS 0

View File

@ -0,0 +1,56 @@
$OpenBSD: patch-src_airserv-ng_c,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
--- src/airserv-ng.c.orig Thu Mar 26 22:01:02 2009
+++ src/airserv-ng.c Wed Apr 15 18:33:39 2009
@@ -35,14 +35,6 @@
#include <stdarg.h>
#include <signal.h>
-#ifdef __MACH__
-#include <libkern/OSByteOrder.h>
-#elif defined(__FreeBSD__)
-#include <machine/endian.h>
-#else
-#include <asm/byteorder.h>
-#endif /* __MACH__ */
-
#include "osdep/osdep.h"
#include "osdep/network.h"
#include "version.h"
@@ -442,31 +434,12 @@ static void handle_card(struct sstate *ss)
if (rd >= 0)
rd += sizeof(*ri);
-#ifdef __MACH__
- ri->ri_mactime = OSSwapHostToBigInt64(ri->ri_mactime);
- ri->ri_power = OSSwapHostToBigInt32(ri->ri_power);
- ri->ri_noise = OSSwapHostToBigInt32(ri->ri_noise);
- ri->ri_channel = OSSwapHostToBigInt32(ri->ri_channel);
- ri->ri_rate = OSSwapHostToBigInt32(ri->ri_rate);
- ri->ri_antenna = OSSwapHostToBigInt32(ri->ri_antenna);
-
-#elif defined(__FreeBSD__)
-#if BYTE_ORDER == BIG_ENDIAN
-# define __be32_to_cpu(x) (x)
-# define __be64_to_cpu(x) (x)
-#elif BYTE_ORDER == LITTLE_ENDIAN
-# define __be32_to_cpu(x) __bswap32(x)
-# define __be64_to_cpu(x) __bswap64(x)
-#endif
-
-#else
- ri->ri_mactime = __cpu_to_be64(ri->ri_mactime);
- ri->ri_power = __cpu_to_be32(ri->ri_power);
- ri->ri_noise = __cpu_to_be32(ri->ri_noise);
- ri->ri_channel = __cpu_to_be32(ri->ri_channel);
- ri->ri_rate = __cpu_to_be32(ri->ri_rate);
- ri->ri_antenna = __cpu_to_be32(ri->ri_antenna);
-#endif /* __MACH__ */
+ ri->ri_mactime = aircrack_htonl64(ri->ri_mactime);
+ ri->ri_power = htonl(ri->ri_power);
+ ri->ri_noise = htonl(ri->ri_noise);
+ ri->ri_channel = htonl(ri->ri_channel);
+ ri->ri_rate = htonl(ri->ri_rate);
+ ri->ri_antenna = htonl(ri->ri_antenna);
c = ss->ss_clients.c_next;
while (c != &ss->ss_clients) {

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_osdep_Makefile,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
--- src/osdep/Makefile.orig Thu Mar 26 22:01:02 2009
+++ src/osdep/Makefile Wed Apr 15 18:46:31 2009
@@ -10,7 +10,7 @@ OBJS = osdep.o $(OBJS_NET)
#AIRPCAP_DIR = airpcap
OBJS_APCAP = airpcap.o
-OBJS_OBSD = $(OBJS) openbsd.o openbsd_tap.o
+OBJS_OBSD = $(OBJS) openbsd.o openbsd_tap.o common.o
OBJS_NBSD = $(OBJS) netbsd.o netbsd_tap.o
OBJS_FBSD = $(OBJS) freebsd.o freebsd_tap.o
OBJS_LINUX = $(OBJS) linux.o linux_tap.o radiotap-parser.o common.o

View File

@ -0,0 +1,55 @@
--- src/osdep/network.c.orig Thu Mar 26 22:01:02 2009
+++ src/osdep/network.c Wed Apr 15 18:35:20 2009
@@ -30,24 +30,6 @@
#include <sys/select.h>
#include <errno.h>
-#ifdef __MACH__
-#include <libkern/OSByteOrder.h>
-#elif defined(__FreeBSD__)
-#include <machine/endian.h>
-#if BYTE_ORDER == BIG_ENDIAN
-# define __be32_to_cpu(x) (x)
-# define __be64_to_cpu(x) (x)
-#elif BYTE_ORDER == LITTLE_ENDIAN
-# define __be32_to_cpu(x) __bswap32(x)
-# define __be64_to_cpu(x) __bswap64(x)
-#endif
-#elif defined (__sun) && defined (__sparc) /* Solaris SPARC, not Solaris x86 */
-#include <sys/byteorder.h>
-#else
-#include <asm/byteorder.h>
-#endif /* __MACH__ */
-
-
#include "osdep.h"
#include "network.h"
@@ -308,21 +290,12 @@ static int net_read(struct wif *wi, unsigned char *h80
pri = (struct rx_info*)buf;
-#ifdef __MACH__
- pri->ri_mactime = OSSwapBigToHostInt64(pri->ri_mactime);
- pri->ri_power = OSSwapBigToHostInt32(pri->ri_power);
- pri->ri_noise = OSSwapBigToHostInt32(pri->ri_noise);
- pri->ri_channel = OSSwapBigToHostInt32(pri->ri_channel);
- pri->ri_rate = OSSwapBigToHostInt32(pri->ri_rate);
- pri->ri_antenna = OSSwapBigToHostInt32(pri->ri_antenna);
-#else
- pri->ri_mactime = __be64_to_cpu(pri->ri_mactime);
- pri->ri_power = __be32_to_cpu(pri->ri_power);
- pri->ri_noise = __be32_to_cpu(pri->ri_noise);
- pri->ri_channel = __be32_to_cpu(pri->ri_channel);
- pri->ri_rate = __be32_to_cpu(pri->ri_rate);
- pri->ri_antenna = __be32_to_cpu(pri->ri_antenna);
-#endif /* __MACH__ */
+ pri->ri_mactime = aircrack_ntohl64(pri->ri_mactime);
+ pri->ri_power = ntohl(pri->ri_power);
+ pri->ri_noise = ntohl(pri->ri_noise);
+ pri->ri_channel = ntohl(pri->ri_channel);
+ pri->ri_rate = ntohl(pri->ri_rate);
+ pri->ri_antenna = ntohl(pri->ri_antenna);
/* XXX */
if (ri)

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-src_osdep_osdep_h,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
--- src/osdep/osdep.h.orig Thu Jan 1 12:51:45 2009
+++ src/osdep/osdep.h Thu Jan 1 12:59:31 2009
@@ -13,6 +13,35 @@
#include "packed.h"
+/* XXX: There are no standard functions to byte-swap 64-bit integers */
+#ifdef __MACH__
+#include <libkern/OSByteOrder.h>
+#define aircrack_ntohl64(x) OSSwapBigToHostInt64(x)
+#define aircrack_htonl64(x) OSSwapHostToBigInt64(x)
+#elif __linux__
+#include <asm/byteorder.h>
+#define aircrack_ntohl64(x) __be64_to_cpu(x)
+#define aircrack_htonl64(x) __cpu_to_be64(x)
+#elif defined (__sun) && defined (__sparc) /* Solaris SPARC, not Solaris x86 */
+#include <sys/byteorder.h>
+#define aircrack_ntohl64(x) __be64_to_cpu(x)
+#define aircrack_htonl64(x) __cpu_to_be64(x)
+#elif __FreeBSD__
+#include <sys/endian.h>
+#define aircrack_ntohl64(x) betoh64(x)
+#define aircrack_htonl64(x) htobe64(x)
+#elif __OpenBSD__
+#include <machine/endian.h>
+#define aircrack_ntohl64(x) betoh64(x)
+#define aircrack_htonl64(x) htobe64(x)
+#elif __NetBSD__
+#include <sys/endian.h>
+#define aircrack_ntohl64(x) be64toh(x)
+#define aircrack_htonl64(x) h64tobe(x)
+#else
+#error "FIXME: Don't know how to byte-swap 64-bit integers on this platform"
+#endif /* __MACH__ */
+
/* For all structures, when adding new fields, always append them to the end.
* This way legacy binary code does not need to be recompiled. This is
* particularly useful for DLLs. -sorbo

View File

@ -0,0 +1,7 @@
aircrack is an 802.11 WEP and WPA-PSK keys cracking program that can recover
keys once enough data packets have been captured.
It implements the standard FMS attack along with some optimizations
like KoreK attacks, thus making the attack much faster compared to
other WEP cracking tools. In fact, aircrack is a set of tools for
auditing wireless networks.

View File

@ -0,0 +1,39 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/05/06 20:39:29 kili Exp $
@bin bin/aircrack-ng
@bin bin/airdecap-ng
@bin bin/airdecloak-ng
@bin bin/airolib-ng
@bin bin/buddy-ng
@bin bin/ivstools
@bin bin/kstats
@bin bin/makeivs-ng
@bin bin/packetforge-ng
@man man/man1/airbase-ng.1
@man man/man1/aircrack-ng.1
@man man/man1/airdecap-ng.1
@man man/man1/airdecloak-ng.1
@comment man/man1/airdriver-ng.1
@man man/man1/aireplay-ng.1
@comment man/man1/airmon-ng.1
@man man/man1/airodump-ng.1
@man man/man1/airolib-ng.1
@man man/man1/airserv-ng.1
@comment man/man1/airtun-ng.1
@man man/man1/buddy-ng.1
@man man/man1/easside-ng.1
@man man/man1/ivstools.1
@man man/man1/kstats.1
@man man/man1/makeivs-ng.1
@man man/man1/packetforge-ng.1
@man man/man1/tkiptun-ng.1
@man man/man1/wesside-ng.1
@bin sbin/airbase-ng
@comment sbin/airdriver-ng
@bin sbin/aireplay-ng
@comment sbin/airmon-ng
@bin sbin/airodump-ng
@bin sbin/airserv-ng
@comment sbin/airtun-ng
@bin sbin/easside-ng
@bin sbin/tkiptun-ng
@bin sbin/wesside-ng