Commit 01df1e05 authored by Sophie Brun's avatar Sophie Brun

Imported Upstream version 1.2-0~rc4

parent 0734de7c
src/*-ng
src/besside-ng-crawler
src/ivstools
src/kstats
src/wpaclean
src/osdep/.os.Linux
src/osdep/libosdep.a
*.o
*.exe
Version 1.2-rc4 (changes from aircrack-ng 1.2-rc3) - Released 14 Feb 2016:
* Airodump-ng: Increase console window size.
* Aircrack-ng: Added time remaining and percentage done when doing WPA cracking with a dictionary (file).
* Aircrack-ng: Make benchmark last 15 seconds for a more accurate value.
* Aircrack-ng: Fixed compilation on Cygwin 64 and drastically improve cracking speed for all CPUs (up to +175% performance).
* Airmon-ng: Improved chipset detection on FreeBSD.
* Airmon-ng: Display chipset for some Broadcom SDIO.
* Airbase-ng: Fixed broadcasting 'default'.
* General: Updated and cleanup TravisCI file to test compilation and testing on OSX.
* General: Fixed reading large files on Cygwin.
* General: Fixed a bunch of compilation warnings with gcc and clang.
* General: Fixed compilation on Solaris, OpenBSD, DragonFlyBSD 4.4, NetBSD, OSX.
* General: Fixed compilation on ARM and MIPS.
* General: Improved compatibility on FreeBSD and Cygwin (RAM and CPU detection).
* General: Fixed gcc segfault on cygwin.
* General: Memory cleanups, fixed memory leaks and fix other issues reported by Valgrind.
* Testing: Fixes on various OSes.
* INSTALLING: Updated installation instructions for different OS.
* TravisCI: Improved file.
Version 1.2-rc3 (changes from aircrack-ng 1.2-rc2) - Released 21 Nov 2015:
* Airodump-ng: Prevent sending signal to init which caused the system to reboot/shutdown.
* Airbase-ng: Allow to use a user-specified ANonce instead of a randomized one when doing the 4-way handshake
......
=== Requirements ===
* OpenSSL development package or libgcrypt development package
* If you want SSID filtering with regular expression in airodump-ng,
pcre development package is required (pcre on FreeBSD).
* 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):
- libsqlite3-dev on a Debian based distro (sqlite3 on FreeBSD)
* On windows, cygwin has to be used and it also requires w32api.
* If you want to use Airpcap, the 'developer' directory from the CD is required.
* OpenSSL development package or libgcrypt development package.
* Airmon-ng (Linux) requires ethtool.
* On windows, cygwin has to be used and it also requires w32api package.
* Linux: LibNetlink 1 or 3. It can be disabled by setting the flag 'libnl' to false.
See Makefile flags below.
* pkg-config (pkgconf on FreeBSD)
* FreeBSD: gmake
* FreeBSD, OpenBSD, NetBSD, Solaris and OS X with macports: gmake
* Linux/Cygwin: make
=== Optional stuff ===
* If you want SSID filtering with regular expression in airodump-ng
(-essid-regex) pcre 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 is required.
* For best performance on FreeBSD (50-70% more), install gcc5 via: pkg install gcc5
Then compile with: gmake CC=gcc5 CXX=g++5
* rfkill
=== Compiling ===
* Compilation:
make
* Compilation on FreeBSD:
gmake CC=cc
* Compilation on *BSD or Solaris:
gmake
* Strip debugging symbols:
make strip
......@@ -33,10 +39,12 @@
==== Makefile flags ====
When compile and installing, the following flags can be used and combined
to compile and install the suite:
to compile and install the suite (by setting them to true):
* sqlite: needed to compile airolib-ng and add support for airolib-ng
databases in aircrack-ng.
* sqlite: Compile airolib-ng and add support for airolib-ng databases
in aircrack-ng:
- Debian based distro: libsqlite3-dev
- FreeBSD: sqlite3
* airpcap: needed for supporting airpcap devices on windows (cygwin only)
REQUIREMENT: Copy 'developers' directory from Airpcap CD one
......@@ -45,9 +53,8 @@ to compile and install the suite:
* experimental: needed to compile tkiptun-ng, easside-ng (and buddy-ng),
wesside-ng and besside-ng.
If you want to build besside-ng-crawler, you will need
LibPCAP (development package). On Debian based
distributions: libpcap-dev
Building besside-ng-crawler requires LibPCAP (development package).
On Debian based distributions: libpcap-dev
* ext_scripts: needed to build airoscript-ng, versuck-ng, airgraph-ng and
airdrop-ng.
......@@ -56,6 +63,7 @@ to compile and install the suite:
* gcrypt: Use libgcrypt crypto library instead of the default OpenSSL.
And also use internal fast sha1 implementation (borrowed from GIT)
Dependency (Debian): libgcrypt20-dev
* libnl: Add support for netlink (nl80211). Linux only. Requires libnl1 OR libnl3.
Enabled by default. Dependencies (debian):
......@@ -63,11 +71,17 @@ to compile and install the suite:
LibNL 3: libnl-3-dev and libnl-genl-3-dev.
* pcre: Add support for regular expression matching for ESSID in airodump-ng and besside-ng.
Dependencies (debian): libpcre3-dev
Dependencies:
- Debian based distro: libpcre3-dev
- FreeBSD: pcre
* duma: Compile with DUMA support. DUMA is a library to detect buffer overruns and under-runs.
Dependencies (debian): duma
* xcode: Set this flag to true to compile on OS X with Xcode 7+.
* macport: Set this flag to true to compile on OS X with macports.
Example:
* Compiling:
......@@ -82,6 +96,15 @@ Example:
* Installing, with external scripts:
make sqlite=true pcre=true experimental=true ext_scripts=true
* Testing (with sqlite, experimental and pcre)
make sqlite=true experimental=true pcre=true check
* Compiling on OS X with macports (and all options):
gmake macport=true sqlite=true experimental=true pcre=true
* Compiling on FreeBSD with better performance
gmake CC=gcc5 CXX=g++5
=== Using precompiled binaries ===
Linux/BSD:
......
need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) \
$(need))))
ifndef ok
$(error fatal error... Need make $(need) but using $(MAKE_VERSION), please upgrade)
endif
......@@ -66,6 +66,7 @@ doc:
clean:
-rm -rf $(COVERITY_DIR)
-rm -f common.cfg
$(MAKE) -C src $(@)
$(MAKE) -C test/cryptounittest $(@)
$(MAKE) -C test $(@)
......
......@@ -98,6 +98,8 @@ Aircrack-ng
Problem: Aircrack-ng doesn't build on Cygwin64
Solution: None at this time. Build it using 32 bit cygwin.
Problem: /usr/include/sys/reent.h:14:20: fatal error: stddef.h: No such file or directory
Solution: It happens because the gcc and g++ version are different. Make sure they are the same.
Sample files
============
......
1.2-rc3
\ No newline at end of file
1.2-rc4
\ No newline at end of file
#!/bin/sh
#
# aircrack-ng build config generation script by Len White <lwhite@nrw.ca>
#
# The purpose of this is to generate a file to be included by common.mak that defines
# compile time configuration, granting us more flexibility in tests and speeding build process
# by not running the tests every time we compile a single file.
#
# NOTES: * common.cfg is automatically regenerated on make clean
# * common.cfg is NOT required to build aircrack, but is required for autoconfiguration of the new crypto cores.
#
CC=$1
IS_X86=0
IS_ARM=0
IS_CROSS=0
SIMDSIZE=0
SIMDFLAG=""
if [ ! $1 ]; then
echo "Usage: $0 <compiler> [cfgpath]"
exit 127
fi
if [ ! $2 ]; then
CURDIR=$(pwd)
else
CURDIR=$2
fi
CFGFILE="${CURDIR}/common.cfg"
clean_exit () {
if [ -n "$tmpdir" ]; then
if [ -d "${tmpdir}" ]; then
rm -rf "${tmpdir}"
fi
fi
}
if [ "$(uname -s)" = 'OpenBSD' ]; then
OPENBSD=1
trap clean_exit EXIT
else
trap clean_exit SIGINT SIGKILL SIGQUIT SIGSEGV SIGPIPE SIGALRM SIGTERM EXIT
fi
# $1 flag $2 variable
test_compile_flag () {
FLAGTEST=$(echo | $CC -fsyntax-only ${1} -xc -Werror - 2>/dev/null && echo Y)
if [ "$FLAGTEST" = "Y" ] && [ $2 ]; then
echo "${2}=${FLAGTEST}" >> $CFGFILE
fi
}
test_header_file () {
if [ -f "$1" ]; then
echo "${2}=Y" >> $CFGFILE
fi
}
cpuid_test () {
tmpdir="$(mktemp -d -t acng.XXXX)"
cat >${tmpdir}/cpuidtest.c <<EOF
#include <cpuid.h>
#include <stdio.h>
int main() {
unsigned eax = 0, ebx = 0, ecx = 0, edx = 0;
unsigned int max_level = __get_cpuid_max(0, NULL);
if (max_level >= 7) {
__cpuid_count(7, 0, eax, ebx, ecx, edx);
if (ebx & (1 << 5)) // AVX2
return 16;
}
__cpuid(1, eax, ebx, ecx, edx);
if (ecx & (1 << 28)) // AVX1
return 8;
if (edx & (1 << 26)) // SSE2
return 4;
return 1;
}
EOF
$($CC -o ${tmpdir}/cpuidtest ${tmpdir}/cpuidtest.c 2>/dev/null)
if [ -x "${tmpdir}/cpuidtest" ]; then
${tmpdir}/cpuidtest
SIMDSIZE=$?
fi
if [ $SIMDSIZE -gt 0 ]; then
case $SIMDSIZE in
16)
SIMDTYPE="AVX2"
;;
8)
SIMDTYPE="AVX"
;;
4)
SIMDTYPE="SSE2"
;;
1)
SIMDTYPE="MMX"
;;
esac
fi
}
case "$CC" in
mips-* | arm-*)
IS_CROSS=1
IS_X86=0
;;
*);;
esac
UARCH=$(uname -m)
case "$UARCH" in
x86_64 | amd64 | i*86*)
IS_X86=1
;;
*arm*)
IS_ARM=1
;;
*mips*)
IS_CROSS=1
;;
*)
;;
esac
if [ $IS_X86 = 1 ]; then
cpuid_test
if [ $SIMDSIZE -gt 0 ]; then
if [ $SIMDSIZE = 16 ]; then
test_compile_flag -mavx2
if [ "$FLAGTEST" = "Y" ]; then
echo "AVX2FLAG=Y" > $CFGFILE
fi
echo "SIMDCORE=true" >> $CFGFILE
elif [ $SIMDSIZE = 8 ]; then
test_compile_flag -mavx
if [ "$FLAGTEST" = "Y" ]; then
echo "AVX1FLAG=Y" > $CFGFILE
fi
echo "SIMDCORE=true" >> $CFGFILE
elif [ $SIMDSIZE = 4 ]; then
test_compile_flag -msse2
if [ "$FLAGTEST" = "Y" ]; then
echo "SSEFLAG=Y" > $CFGFILE
fi
fi
fi
if [ ! $OPENBSD ]; then
test_compile_flag -masm=intel INTEL_ASM
fi
elif [ $IS_ARM = 1 ]; then
>$CFGFILE
if [ -f "/proc/cpuinfo" ]; then
NEON_FLAG=$(grep -c neon /proc/cpuinfo)
if [ $NEON_FLAG -eq 1 ]; then
test_compile_flag -mfpu=neon HAS_NEON
if [ "$FLAGTEST" = "Y" ]; then
echo "SIMDCORE=true" >>$CFGFILE
else
IS_CROSS=1
fi
else
IS_CROSS=1
fi
else
IS_CROSS=1
fi
fi
test_compile_flag -pthread PTHREAD
if [ $IS_X86 -eq 0 ]; then
# If we're on non-x86 platform, we need to check for auxv for cpuid since it's broken on some debian vers
test_header_file sys/auxv.h HAS_AUXV
fi
if [ $IS_CROSS -eq 1 ]; then
echo "NEWSSE=false" >>$CFGFILE
fi
# If we fall thru all the tests and still haven't created a config, create an empty one.
if [ ! -f "$CFGFILE" ]; then
echo >$CFGFILE
fi
PKG_CONFIG ?= pkg-config
NEWSSE = true
# Newer version of the core can be enabled via SIMDCORE
# but should be automatically flipped on thru autodetection
SIMDCORE = false
# Multibin will compile a seperate binary for each core: original, SSE and SIMD.
MULTIBIN = false
ifndef TOOL_PREFIX
TOOL_PREFIX =
endif
......@@ -20,7 +28,12 @@ PIC =
SQLITE = false
else
EXE =
ifeq ($(OSNAME), SunOS)
PIC =
LDFLAGS += -lsocket -lnsl
else
PIC = -fPIC
endif
ifndef SQLITE
SQLITE = true
endif
......@@ -28,7 +41,14 @@ endif
COMMON_CFLAGS =
ifeq ($(subst TRUE,true,$(filter TRUE true,$(xcode) $(XCODE))),true)
COMMON_CFLAGS += -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/ -D_XCODE -I../..
endif
ifeq ($(subst TRUE,true,$(filter TRUE true,$(macport) $(MACPORT))),true)
COMMON_CFLAGS += -I/opt/local/include -I../..
LDFLAGS += -L/opt/local/lib
endif
ifeq ($(subst TRUE,true,$(filter TRUE true,$(sqlite) $(SQLITE))),true)
COMMON_CFLAGS += -DHAVE_SQLITE
......@@ -106,9 +126,18 @@ ifeq ($(subst TRUE,true,$(filter TRUE true,$(airpcap) $(AIRPCAP))),true)
endif
ifneq ($(origin CC),environment)
ifeq ($(OSNAME), FreeBSD)
CC = $(TOOL_PREFIX)cc
CXX = $(TOOL_PREFIX)c++
else
CC = $(TOOL_PREFIX)gcc
CXX = $(TOOL_PREFIX)g++
endif
endif
# This is for autodetection of processor features in the new crypto cores.
-include $(AC_ROOT)/common.cfg
RANLIB ?= $(TOOL_PREFIX)ranlib
ifneq ($(origin AR),environment)
AR = $(TOOL_PREFIX)ar
......@@ -117,8 +146,65 @@ endif
REVISION = $(shell $(AC_ROOT)/evalrev $(AC_ROOT))
REVFLAGS ?= -D_REVISION=$(REVISION)
OPTFLAGS = -D_FILE_OFFSET_BITS=64
CFLAGS ?= -g -W -Wall -O3
OPTFLAGS = -D_FILE_OFFSET_BITS=64
CFLAGS ?= -g -W -Wall -O3
ifeq ($(subst TRUE,true,$(filter TRUE true,$(icc) $(ICC))),true)
ICCMODE = Y
CC = icc
CXX = icpc
AR = xiar
CFLAGS += -no-prec-div
endif
# If we're building multibin make sure simd is disabled
ifeq ($(subst TRUE,true,$(filter TRUE true,$(multibin) $(MULTIBIN))),true)
SIMDCORE = false
endif
ifeq ($(HAS_NEON), Y)
CFLAGS += -mfpu=neon
endif
ifeq ($(subst FALSE,false,$(filter FALSE false,$(newsse) $(NEWSSE))),false)
CFLAGS += -DOLD_SSE_CORE=1
else
ifeq ($(AVX2FLAG), Y)
ifeq ($(ICCMODE), Y)
CFLAGS += -march=core-avx2 -DJOHN_AVX2
else
CFLAGS += -mavx2 -DJOHN_AVX2
endif
else
ifeq ($(AVX1FLAG), Y)
ifeq ($(ICCMODE), Y)
CFLAGS += -march=corei7-avx -DJOHN_AVX
else
CFLAGS += -mavx -DJOHN_AVX
endif
else
ifeq ($(SSEFLAG), Y)
ifeq ($(ICCMODE), Y)
CFLAGS += -march=corei7
else
CFLAGS += -msse2
endif
endif
endif # AVX1FLAG
endif # AVX2FLAG
endif # NEWSSE
ifeq ($(INTEL_ASM), Y)
ASMFLAG = -masm=intel
endif
# This will enable -D_REENTRANT if compatible so we have thread-safe functions available to us via -pthread.
ifeq ($(PTHREAD), Y)
CFLAGS += -pthread
endif
CXXFLAGS = $(CFLAGS) $(ASMFLAG) -fdata-sections -ffunction-sections
CFLAGS += $(OPTFLAGS) $(REVFLAGS) $(COMMON_CFLAGS)
prefix = /usr/local
......@@ -131,6 +217,7 @@ docdir = $(datadir)/doc/aircrack-ng
libdir = $(prefix)/lib
etcdir = $(prefix)/etc/aircrack-ng
ifneq ($(ICCMODE), Y)
GCC_OVER41 = $(shell expr 41 \<= `$(CC) -dumpversion | awk -F. '{ print $1$2 }'`)
GCC_OVER45 = $(shell expr 45 \<= `$(CC) -dumpversion | awk -F. '{ print $1$2 }'`)
GCC_OVER49 = $(shell expr 49 \<= `$(CC) -dumpversion | awk -F. '{ print $1$2 }'`)
......@@ -144,7 +231,6 @@ ifeq ($(GCC_OVER49), 0)
GCC_OVER49 = $(shell expr 4.9 \<= `$(CC) -dumpversion | awk -F. '{ print $1$2 }'`)
endif
ifeq ($(GCC_OVER49), 0)
ifeq ($(GCC_OVER41), 1)
COMMON_CFLAGS += -fstack-protector
......@@ -158,6 +244,7 @@ endif
ifeq ($(GCC_OVER45), 1)
CFLAGS += -Wno-unused-but-set-variable -Wno-array-bounds
endif
endif
ifeq ($(subst TRUE,true,$(filter TRUE true,$(duma) $(DUMA))),true)
LIBS += -lduma
......
.TH AIRBASE-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIRBASE-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airbase-ng - multi-purpose tool aimed at attacking clients as opposed to the Access Point (AP) itself
......
.TH AIRCRACK-NG 1 "November 2015" "Version 1.2-rc3"
.TH AIRCRACK-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
aircrack-ng - a 802.11 WEP / WPA-PSK key cracker
......
.TH AIRDECAP-NG 1 "November 2015" "Version 1.2-rc3"
.TH AIRDECAP-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
airdecap-ng - decrypt a WEP/WPA crypted pcap file
......
.TH AIRDECLOAK-NG 1 "November 2015" "Version 1.2-rc3"
.TH AIRDECLOAK-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
airuncloak-ng - Removes wep cloaked framed from a pcap file.
......
.TH AIREPLAY-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIREPLAY-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
aireplay-ng - inject packets into a wireless network to generate traffic
......
.TH AIRMON-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIRMON-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airmon-ng - POSIX sh script designed to turn wireless cards into monitor mode.
......
.TH AIRODUMP-NG-OUI-UPDATE 8 "November 2015" "Version 1.2-rc3"
.TH AIRODUMP-NG-OUI-UPDATE 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airodump-ng-oui-updater - IEEE oui list updater for airodump-ng
......
.TH AIRODUMP-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIRODUMP-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airodump-ng - a wireless packet capture tool for aircrack-ng
......
.TH AIROLIB-NG 1 "November 2015" "Version 1.2-rc3"
.TH AIROLIB-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
airolib-ng - manage and create a WPA/WPA2 pre-computed hashes tables
......
.TH AIRSERV-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIRSERV-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airserv-ng - a wireless card server
......
.TH AIRTUN-NG 8 "November 2015" "Version 1.2-rc3"
.TH AIRTUN-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
airtun-ng - a virtual tunnel interface creator for aircrack-ng
......
.TH BESSIDE-NG-CRAWLER 1 "November 2015" "Version 1.2-rc3"
.TH BESSIDE-NG-CRAWLER 1 "February 2016" "Version 1.2-rc4"
.SH NAME
......
.TH BESSIDE-NG 8 "November 2015" "Version 1.2-rc3"
.TH BESSIDE-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
besside-ng - crack a WEP or WPA key without user intervention and collaborate with WPA cracking statistics
......
.TH BUDDY-NG 1 "November 2015" "Version 1.2-rc3"
.TH BUDDY-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
buddy-ng - a tool to work with easside-ng
......
.TH EASSIDE-NG 8 "November 2015" "Version 1.2-rc3"
.TH EASSIDE-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
easside-ng - an auto-magic tool which allows you to communicate via an WEP-encrypted AP without knowing the key
......
.TH IVSTOOLS 1 "November 2015" "Version 1.2-rc3"
.TH IVSTOOLS 1 "February 2016" "Version 1.2-rc4"
.SH NAME
ivstools - extract IVs from a pcap file or merges several .ivs files into one
......
.TH KSTATS 1 "November 2015" "Version 1.2-rc3"
.TH KSTATS 1 "February 2016" "Version 1.2-rc4"
.SH NAME
kstats - show statistical FMS algorithm votes for an ivs dump and a specified WEP key
......
.TH MAKEIVS-NG 1 "November 2015" "Version 1.2-rc3"
.TH MAKEIVS-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
makeivs - generate a dummy IVS dump file with a specific WEP key
......
.TH PACKETFORGE-NG 1 "November 2015" "Version 1.2-rc3"
.TH PACKETFORGE-NG 1 "February 2016" "Version 1.2-rc4"
.SH NAME
packetforge-ng - forge packets: ARP, UDP, ICMP or custom packets.
......
.TH TKIPTUN-NG 8 "November 2015" "Version 1.2-rc3"
.TH TKIPTUN-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
tkiptun-ng - inject a few frames into a WPA TKIP network with QoS
......
.TH WESSIDE-NG 8 "November 2015" "Version 1.2-rc3"
.TH WESSIDE-NG 8 "February 2016" "Version 1.2-rc4"
.SH NAME
wesside-ng - crack a WEP key of an open network without user intervention
......
.TH WPACLEAN 1 "November 2015" "Version 1.2-rc3"
.TH WPACLEAN 1 "February 2016" "Version 1.2-rc4"
.SH NAME
wpaclean - clean wpa capture files
......
......@@ -71,8 +71,9 @@ if [ ! -x "$(command -v uname 2>&1)" ]; then
printf "How in the world do you not have uname installed?\n"
printf "Please select a linux distro which has at least basic functionality (or install uname).\n"
exit 1
#else
# #write something in here to test uname for Darwin/Linux and set a variable
else
OS=$(uname -s)
#Recognized values are Linux and Darwin
fi
if [ ! -x "$(command -v ip 2>&1)" ] && [ ! -x "$(command -v ifconfig 2>&1)" ]; then
......@@ -409,29 +410,34 @@ startMac80211Iface() {
done
fi
#we didn't bail means we need a monitor interface
if [ -e /sys/class/net/${1}mon ]; then
printf "\nYou already have a ${1}mon device but it is NOT in monitor mode."
printf "\nWhatever you did, don't do it again."
printf "\nPlease run \"iw ${1}mon del\" before attempting to continue\n"
exit 1
fi
#we didn't bail means our target interface is available
setLink ${1} down
IW_ERROR="$(iw phy ${PHYDEV} interface add ${1}mon type monitor 2>&1)"
if [ -z "${IW_ERROR}" ]; then
sleep 1
if [ "$(cat /sys/class/ieee80211/${PHYDEV}/device/net/${1}mon/type)" = "803" ]; then
setChannelMac80211 ${1}mon
if [ ${#1} -gt 12 ]; then
printf "Interface ${#1}mon is too long for linux so it will be renamed to the old style (wlan#) name.\n"
findFreeInterface monitor
else
if [ -e /sys/class/net/${1}mon ]; then
printf "\nYou already have a ${1}mon device but it is NOT in monitor mode."
printf "\nWhatever you did, don't do it again."
printf "\nPlease run \"iw ${1}mon del\" before attempting to continue\n"
exit 1
fi
#we didn't bail means our target interface is available
setLink ${1} down
IW_ERROR="$(iw phy ${PHYDEV} interface add ${1}mon type monitor 2>&1)"
if [ -z "${IW_ERROR}" ]; then
sleep 1
if [ "$(cat /sys/class/ieee80211/${PHYDEV}/device/net/${1}mon/type)" = "803" ]; then
setChannelMac80211 ${1}mon
else
printf "\nNewly created monitor mode interface ${1}mon is *NOT* in monitor mode.\n"
printf "Removing non-monitor ${1}mon interface...\n"
stopMac80211Iface ${1}mon abort
exit 1
fi
printf "\n\t\t(mac80211 monitor mode vif enabled for [${PHYDEV}]${1} on [${PHYDEV}]${1}mon)\n"
else
printf "\nNewly created monitor mode interface ${1}mon is *NOT* in monitor mode.\n"
printf "Removing non-monitor ${1}mon interface...\n"