Commit ac07c530 authored by Devon Kearns's avatar Devon Kearns

Imported Upstream version 1.2~svn2256

parent 73f4974a
......@@ -53,6 +53,9 @@ Reads packet from a file.
.I -x <msecs>
Active Scanning Simulation (send probe requests and parse the probe responses).
.TP
.I -M, --manufacturer
Display a manufacturer column with the information obtained from the IEEE OUI list. See airodump-ng-oui-update(8)
.TP
.I --output-format <formats>
Define the formats to use (separated by a comma). Possible values are: pcap, ivs, csv, gps, kismet, netxml. The default values are: pcap, csv, kismet, kismet-newcore.
\(aqpcap\(aq is for recording a capture in pcap format, \(aqivs\(aq is for ivs format (it is a shortcut for --ivs). \(aqcsv\(aq will create an airodump-ng CSV file, \(aqkismet\(aq will create a kismet csv file and \(aqkismet-newcore\(aq will create the kismet netxml file. \(aqgps\(aq is a shortcut for --gps.
......@@ -219,6 +222,8 @@ On Debian systems, the complete text of the GNU General Public License can be fo
.br
.B airmon-ng(8)
.br
.B airodump-ng-oui-update(8)
.br
.B airolib-ng(1)
.br
.B airserv-ng(8)
......
......@@ -148,7 +148,7 @@ ivstools$(EXE): $(OBJS_IV)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_IV) -o $(@) $(LIBSSL)
kstats$(EXE): kstats.o
$(CC) $(CFLAGS) $(LDFLAGS) kstats.o -o $(@)
$(CC) $(CFLAGS) $(LDFLAGS) kstats.o -o $(@) $(LDFLAGS)
wesside-ng$(EXE): $(OBJS_WS) $(LIBOSD)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_WS) -o $(@) $(LIBS) $(LIBSSL) -lz
......@@ -157,7 +157,7 @@ easside-ng$(EXE): $(OBJS_ES) $(LIBOSD)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_ES) -o $(@) $(LIBS) -lz
buddy-ng$(EXE): $(OBJS_BUDDY)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BUDDY) -o $(@)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BUDDY) -o $(@) $(LDFLAGS)
besside-ng$(EXE): $(OBJS_BS) $(LIBOSD)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BS) -o $(@) $(LIBS) $(LIBSSL) -lz
......@@ -166,7 +166,7 @@ besside-ng-crawler$(EXE): $(OBJS_BC)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_BC) -o $(@) -lpcap
makeivs-ng$(EXE): $(OBJS_MI)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_MI) -o $(@)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_MI) -o $(@) $(LDFLAGS)
airolib-ng$(EXE): $(OBJS_AL)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_AL) -o $(@) $(LIBSSL) -DHAVE_REGEXP $(LIBSQL)
......@@ -175,7 +175,7 @@ airbase-ng$(EXE): $(OBJS_AB) $(LIBOSD)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_AB) -o $(@) $(LIBS) $(LIBSSL) -lpthread
airdecloak-ng$(EXE): $(OBJS_AU)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_AU) -o $(@)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_AU) -o $(@) $(LDFLAGS)
tkiptun-ng$(EXE): $(OBJS_TT) $(LIBOSD)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_TT) -o $(@) $(LIBS) $(LIBSSL)
......
......@@ -4767,8 +4767,10 @@ usage:
continue;
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
n = caplen = pkh.caplen;
......
......@@ -910,8 +910,10 @@ void read_thread( void *arg )
if( close_aircrack )
break;
if( pfh.magic == TCPDUMP_CIGAM )
if( pfh.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
if( pkh.caplen <= 0 || pkh.caplen > 65535 )
{
......@@ -1837,8 +1839,10 @@ void check_thread( void *arg )
while( ! atomic_read( &rb, fd, sizeof( pkh ), &pkh ) )
goto read_fail;
if( pfh.magic == TCPDUMP_CIGAM )
if( pfh.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
if( pkh.caplen <= 0 || pkh.caplen > 65535 )
{
......
......@@ -618,8 +618,10 @@ usage:
if( fread( &pkh, 1, n, f_in ) != (size_t) n )
break;
if( magic == TCPDUMP_CIGAM )
if( magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
n = pkh.caplen;
......
......@@ -895,8 +895,10 @@ int capture_ask_packet( int *caplen, int just_grab )
return( 1 );
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......@@ -2526,8 +2528,10 @@ int do_attack_arp_resend( void )
continue;
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......@@ -2937,8 +2941,10 @@ int do_attack_caffe_latte( void )
continue;
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......@@ -3363,8 +3369,10 @@ int do_attack_migmode( void )
continue;
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......
......@@ -612,6 +612,7 @@ char usage[] =
" are received (Default: 120 seconds)\n"
" -r <file> : Read packets from that file\n"
" -x <msecs> : Active Scanning Simulation\n"
" --manufacturer : Display manufacturer from IEEE OUI list\n"
" --output-format\n"
" <formats> : Output format. Possible values:\n"
" pcap, ivs, csv, gps, kismet, netxml\n"
......@@ -2971,6 +2972,12 @@ void dump_print( int ws_row, int ws_col, int if_num )
" #Data, #/s CH MB ENC CIPHER AUTH ESSID", columns_ap );
}
if ( G.show_manufacturer && ( ws_col > (columns_ap - 4) ) ) {
// write spaces (32).
memset(strbuf+columns_ap, 32, G.maxsize_essid_seen - 5 ); // 5 is the len of "ESSID"
snprintf(strbuf+columns_ap+G.maxsize_essid_seen-5, 15,"%s"," MANUFACTURER");
}
strbuf[ws_col - 1] = '\0';
fprintf( stderr, "%s\n", strbuf );
......@@ -3133,14 +3140,33 @@ void dump_print( int ws_row, int ws_col, int if_num )
if(ap_cur->essid[0] != 0x00)
{
snprintf( strbuf, sizeof( strbuf ) - 1,
"%-256s", ap_cur->essid );
"%s", ap_cur->essid );
}
else
{
snprintf( strbuf, sizeof( strbuf ) - 1,
"<length:%3d>%-256s", ap_cur->ssid_length, "\x00" );
"<length:%3d>%s", ap_cur->ssid_length, "\x00" );
}
if (G.show_manufacturer) {
if (G.maxsize_essid_seen <= strlen(strbuf))
G.maxsize_essid_seen = strlen(strbuf);
else // write spaces (32)
memset( strbuf+strlen(strbuf), 32, (G.maxsize_essid_seen - strlen(strbuf)) );
if (ap_cur->manuf == NULL)
ap_cur->manuf = get_manufacturer(ap_cur->bssid[0], ap_cur->bssid[1], ap_cur->bssid[2]);
snprintf( strbuf + G.maxsize_essid_seen , sizeof(strbuf)-G.maxsize_essid_seen, " %s", ap_cur->manuf );
}
// write spaces (32) until the end of column
memset( strbuf+strlen(strbuf), 32, ws_col - (columns_ap - 4 ) );
// end the string at the end of the column
strbuf[ws_col - (columns_ap - 4)] = '\0';
fprintf( stderr, " %s", strbuf );
}
......@@ -5385,6 +5411,7 @@ int main( int argc, char *argv[] )
{"detect-anomaly", 0, 0, 'E'},
{"output-format", 1, 0, 'o'},
{"ignore-negative-one", 0, &G.ignore_negative_one, 1},
{"manufacturer", 0, 0, 'M'},
{0, 0, 0, 0 }
};
......@@ -5451,6 +5478,8 @@ int main( int argc, char *argv[] )
G.show_sta = 1;
G.show_ack = 0;
G.hide_known = 0;
G.maxsize_essid_seen = 5; // Initial value: length of "ESSID"
G.show_manufacturer = 0;
G.hopfreq = DEFAULT_HOPFREQ;
G.s_file = NULL;
G.s_iface = NULL;
......@@ -5541,7 +5570,7 @@ int main( int argc, char *argv[] )
option_index = 0;
option = getopt_long( argc, argv,
"b:c:egiw:s:t:u:m:d:aHDB:Ahf:r:EC:o:x:",
"b:c:egiw:s:t:u:m:d:aHDB:Ahf:r:EC:o:x:M",
long_options, &option_index );
if( option < 0 ) break;
......@@ -5591,6 +5620,11 @@ int main( int argc, char *argv[] )
G.decloak = 0;
break;
case 'M':
G.show_manufacturer = 1;
break;
case 'c' :
if (G.channel[0] > 0 || G.chanoption == 1) {
......@@ -6233,8 +6267,10 @@ usage:
continue;
}
if( G.pfh_in.magic == TCPDUMP_CIGAM )
if( G.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
n = caplen = pkh.caplen;
......
......@@ -453,6 +453,8 @@ struct globals
uchar selected_bssid[6]; /* bssid that is selected */
int ignore_negative_one;
u_int maxsize_essid_seen;
int show_manufacturer;
}
G;
......
......@@ -1592,8 +1592,10 @@ usage:
continue;
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
n = caplen = pkh.caplen;
......
......@@ -882,8 +882,10 @@ int main( int argc, char *argv[] )
if( fread( &pkh, 1, n, f_in ) != (size_t) n )
break;
if( pfh.magic == TCPDUMP_CIGAM )
if( pfh.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
n = pkh.caplen;
......
......@@ -181,7 +181,7 @@
* Solaris
* -------
*/
#if defined(__sparc__)
#if defined(__sparc__) && defined(__sun__)
#include <sys/byteorder.h>
#include <sys/types.h>
#include <unistd.h>
......
......@@ -202,8 +202,10 @@ int capture_ask_packet( int *caplen )
return( 1 );
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......
......@@ -1097,8 +1097,10 @@ int capture_ask_packet( int *caplen, int just_grab )
return( 1 );
}
if( dev.pfh_in.magic == TCPDUMP_CIGAM )
if( dev.pfh_in.magic == TCPDUMP_CIGAM ) {
SWAP32( pkh.caplen );
SWAP32( pkh.len );
}
tv.tv_sec = pkh.tv_sec;
tv.tv_usec = pkh.tv_usec;
......
......@@ -5,7 +5,12 @@ from scapy import *
import pcapy
from impacket.ImpactDecoder import *
conf.verb=0
try:
conf.verb=0
except NameError:
# Scapy v2
from scapy.all import *
conf.verb=0
if len(sys.argv) != 2:
print "Usage: ./replay.py <iface>"
......@@ -30,8 +35,12 @@ def recv_pkts(hdr, data):
raw_header = data[:11] + "\xFF" + data[12:14]
header = Ether(raw_header)
packet = Dot11(data[14:])
# end of separation
try:
# end of separation
packet = Dot11(data[14:])
except struct.error:
# Ignore unpack errors on short packages
return
# manipulate/drop/insert dot11 packet
print packet.summary()
......
......@@ -19,14 +19,24 @@ tmpdir="$(mktemp -d)"
trap "rm -fr "${tmpdir}"" SIGINT SIGKILL SIGQUIT SIGSEGV SIGPIPE SIGALRM SIGTERM EXIT
# Test1
cp -f "${TESTDIR}/wpa.cap" "${tmpdir}"
airdecap-ng -e test -p biscotte "${tmpdir}/wpa.cap" | tee /dev/stderr | grep -q "Number of decrypted WPA packets 2"
# Check that the hash is what we expect
[[ $(sha1sum "${tmpdir}/wpa-dec.cap" | awk '{print $1}') == "69f8557cf96a26060989e88adfb521a01fc9b122" ]]
airdecap-ng -e test -p biscotte "${tmpdir}/wpa.cap" | \
grep "Number of decrypted WPA packets 2"
# Check that the hash is what we expect.
# For each hash there are two possibilities: little or big endian
sha1sum=$(sha1sum "${tmpdir}/wpa-dec.cap" | awk '{print $1}')
[[ "${sha1sum}" == "69f8557cf96a26060989e88adfb521a01fc9b122" ]] || \
[[ "${sha1sum}" == "fb1592b2c0dccef542c1f46297394ee2892f8ed3" ]]
# Test 2
cp -f "${TESTDIR}/wpa-psk-linksys.cap" "${tmpdir}"
airdecap-ng -e linksys -p dictionary "${tmpdir}/wpa-psk-linksys.cap" | tee /dev/stderr | grep -q "Number of decrypted WPA packets 53"
[[ $(sha1sum "${tmpdir}/wpa-psk-linksys-dec.cap" | awk '{print $1}') == "1e75a9af0d9703c4ae4fc8ea454326aeb4abecc1" ]]
airdecap-ng -e linksys -p dictionary "${tmpdir}/wpa-psk-linksys.cap" | \
grep "Number of decrypted WPA packets 53"
sha1sum=$(sha1sum "${tmpdir}/wpa-psk-linksys-dec.cap" | awk '{print $1}')
[[ "${sha1sum}" == "1e75a9af0d9703c4ae4fc8ea454326aeb4abecc1" ]] || \
[[ "${sha1sum}" == "1c3c4123ba6718bd3db66de251a125ed65cd6ee6" ]]
# Test 3
cp -f "${TESTDIR}/wpa2-psk-linksys.cap" "${tmpdir}"
airdecap-ng -e linksys -p dictionary "${tmpdir}/wpa2-psk-linksys.cap" | tee /dev/stderr | grep -q "Number of decrypted WPA packets 25"
[[ $(sha1sum "${tmpdir}/wpa2-psk-linksys-dec.cap" | awk '{print $1}') == "2da107b96fbe19d926020ffb0da72553b18a5775" ]]
airdecap-ng -e linksys -p dictionary "${tmpdir}/wpa2-psk-linksys.cap" | \
grep "Number of decrypted WPA packets 25"
sha1sum=$(sha1sum "${tmpdir}/wpa2-psk-linksys-dec.cap" | awk '{print $1}')
[[ "${sha1sum}" == "2da107b96fbe19d926020ffb0da72553b18a5775" ]] || \
[[ "${sha1sum}" == "dc7d033b9759838d57b74db04185c3586cbd8042" ]]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment