Massive refactor/renaming. No more upper-case filenames.
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
8
tests/files/airmon.output
Normal file
8
tests/files/airmon.output
Normal file
@@ -0,0 +1,8 @@
|
||||
No interfering processes found
|
||||
PHY Interface Driver Chipset
|
||||
|
||||
phy2 wlan0 rtl8187 Realtek Semiconductor Corp. RTL8187
|
||||
(mac80211 monitor mode vif enabled for [phy2]wlan0 on [phy2]wlan0mon)
|
||||
(mac80211 station mode vif disabled for [phy2]wlan0)
|
||||
|
||||
|
||||
42
tests/files/airodump.csv
Normal file
42
tests/files/airodump.csv
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
BSSID, First time seen, Last time seen, channel, Speed, Privacy, Cipher, Authentication, Power, # beacons, # IV, LAN IP, ID-length, ESSID, Key
|
||||
78:24:AF:D5:29:98, 2015-05-30 11:28:44, 2015-05-30 11:28:44, 6, -1, WPA, , , -73, 0, 1, 0. 0. 0. 0, 0, ,
|
||||
00:13:10:33:A6:56, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA, TKIP,PSK, -71, 7, 0, 0. 0. 0. 0, 11, orangefloss,
|
||||
D8:50:E6:D7:22:95, 2015-05-30 11:28:43, 2015-05-30 11:28:43, -1, -1, , , , -70, 0, 0, 0. 0. 0. 0, 0, ,
|
||||
F0:99:BF:0A:B5:B0, 2015-05-30 11:28:45, 2015-05-30 11:28:48, 6, 54, WPA2, CCMP,PSK, -70, 3, 0, 0. 0. 0. 0, 22, Ingham's Wi-Fi Network,
|
||||
60:02:92:BC:08:00, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -68, 17, 0, 0. 0. 0. 0, 13, HOME-89B5-2.4,
|
||||
00:25:BC:8B:24:95, 2015-05-30 11:28:44, 2015-05-30 11:28:44, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -68, 1, 0, 0. 0. 0. 0, 8, atlantis,
|
||||
60:02:92:BC:08:02, 2015-05-30 11:28:44, 2015-05-30 11:28:49, 6, 54, OPN, , , -68, 5, 0, 0. 0. 0. 0, 11, xfinitywifi,
|
||||
00:23:69:BA:6D:F0, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -67, 21, 0, 0. 0. 0. 0, 15, Pine Lake Girl2,
|
||||
46:32:C8:5C:0E:3D, 2015-05-30 11:28:44, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -67, 6, 0, 0. 0. 0. 0, 12, \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,
|
||||
44:32:C8:5C:0E:3C, 2015-05-30 11:28:44, 2015-05-30 11:28:48, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -67, 5, 3, 0. 0. 0. 0, 9, HOME-0E3C,
|
||||
60:02:92:BC:08:01, 2015-05-30 11:28:44, 2015-05-30 11:28:49, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -69, 14, 0, 0. 0. 0. 0, 0, ,
|
||||
CC:A4:62:E8:E5:F0, 2015-05-30 11:28:44, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP TKIP,PSK, -67, 8, 0, 0. 0. 0. 0, 9, HOME-E5F2,
|
||||
C2:A4:62:E8:E5:F0, 2015-05-30 11:28:44, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -65, 13, 0, 0. 0. 0. 0, 0, ,
|
||||
C6:A4:62:E8:E5:F0, 2015-05-30 11:28:45, 2015-05-30 11:28:50, 6, 54, OPN, , , -65, 14, 0, 0. 0. 0. 0, 11, xfinitywifi,
|
||||
F0:99:BF:05:20:64, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -62, 30, 0, 0. 0. 0. 0, 4, JJML,
|
||||
F2:64:20:05:BF:90, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -62, 23, 0, 0. 0. 0. 0, 9, JJMLGuest,
|
||||
90:84:0D:DA:A8:87, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -62, 33, 5, 0. 0. 0. 0, 10, Rolston123,
|
||||
10:0D:7F:8C:C1:FB, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -62, 12, 0, 0. 0. 0. 0, 12, The Internet,
|
||||
00:00:00:00:00:00, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WEP, WEP, , -57, 138, 0, 0. 0. 0. 0, 0, ,
|
||||
00:1D:D5:9B:11:00, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP TKIP,PSK, -52, 32, 6, 0. 0. 0. 0, 9, HOME-1102,
|
||||
00:24:7B:AB:5C:EE, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2 WPA, CCMP TKIP,PSK, -55, 16, 25, 0. 0. 0. 0, 11, myqwest0445,
|
||||
02:1D:D5:9B:11:00, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -53, 41, 0, 0. 0. 0. 0, 0, ,
|
||||
06:1D:D5:9B:11:00, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, OPN, , , -53, 56, 0, 0. 0. 0. 0, 11, xfinitywifi,
|
||||
00:F7:6F:CD:B2:2A, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -48, 44, 0, 0. 0. 0. 0, 13, im human 2015,
|
||||
30:85:A9:39:D2:18, 2015-05-30 11:28:43, 2015-05-30 11:28:50, 6, 54, WPA2, CCMP,PSK, -21, 44, 4, 0. 0. 0. 0, 32, Uncle Router's Gigabit LAN Party,
|
||||
00:0E:58:FA:7C:61, 2015-05-30 11:28:44, 2015-05-30 11:28:49, 6, -1, WPA, , , -1, 0, 57, 0. 0. 0. 0, 0, ,
|
||||
00:0E:58:F8:0B:B5, 2015-05-30 11:28:44, 2015-05-30 11:28:48, 6, -1, WPA, , , -1, 0, 59, 0. 0. 0. 0, 0, ,
|
||||
28:01:00:00:D0:00, 2015-05-30 11:28:44, 2015-05-30 11:28:44, 6, -1, , , , -1, 0, 0, 0. 0. 0. 0, 0, ,
|
||||
00:0E:58:E9:36:B3, 2015-05-30 11:28:44, 2015-05-30 11:28:48, 6, -1, WPA, , , -1, 0, 2, 0. 0. 0. 0, 0, ,
|
||||
05:00:40:00:BB:7C, 2015-05-30 11:28:50, 2015-05-30 11:28:50, -1, -1, , , , -1, 0, 0, 0. 0. 0. 0, 0, ,
|
||||
|
||||
Station MAC, First time seen, Last time seen, Power, # packets, BSSID, Probed ESSIDs
|
||||
3A:01:44:32:C8:5C, 2015-05-30 11:28:44, 2015-05-30 11:28:44, -69, 3, 28:01:00:00:D0:00,
|
||||
54:35:30:23:62:8E, 2015-05-30 11:28:43, 2015-05-30 11:28:50, -64, 7, 00:1D:D5:9B:11:00,HOME-1102
|
||||
10:40:F3:93:13:FA, 2015-05-30 11:28:44, 2015-05-30 11:28:48, -52, 4, 00:F7:6F:CD:B2:2A,
|
||||
00:0E:58:FA:7C:61, 2015-05-30 11:28:45, 2015-05-30 11:28:50, -50, 6, 00:0E:58:E9:36:B3,Sonos_ynFI1HY4cF3gqPuljCuicmFZ66
|
||||
00:0E:58:E9:36:B3, 2015-05-30 11:28:43, 2015-05-30 11:28:49, -51, 124, 00:0E:58:FA:7C:61,Sonos_ynFI1HY4cF3gqPuljCuicmFZ66
|
||||
00:0E:58:F8:0B:B5, 2015-05-30 11:28:44, 2015-05-30 11:28:50, -48, 9, 00:0E:58:E9:36:B3,Sonos_ynFI1HY4cF3gqPuljCuicmFZ66
|
||||
5C:93:A2:0D:3D:63, 2015-05-30 11:28:44, 2015-05-30 11:28:50, -1, 22, 00:24:7B:AB:5C:EE,
|
||||
|
||||
|
BIN
tests/files/contains_wps_network.cap
Normal file
BIN
tests/files/contains_wps_network.cap
Normal file
Binary file not shown.
BIN
tests/files/handshake_exists.cap
Normal file
BIN
tests/files/handshake_exists.cap
Normal file
Binary file not shown.
BIN
tests/files/handshake_exists.cap.stripped.tshark
Normal file
BIN
tests/files/handshake_exists.cap.stripped.tshark
Normal file
Binary file not shown.
BIN
tests/files/handshake_not_exists.cap
Normal file
BIN
tests/files/handshake_not_exists.cap
Normal file
Binary file not shown.
BIN
tests/files/wep-crackable.ivs
Normal file
BIN
tests/files/wep-crackable.ivs
Normal file
Binary file not shown.
BIN
tests/files/wep-uncrackable.ivs
Normal file
BIN
tests/files/wep-uncrackable.ivs
Normal file
Binary file not shown.
53
tests/test_Handshake.py
Normal file
53
tests/test_Handshake.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
sys.path.insert(0, '..')
|
||||
|
||||
from py.Handshake import Handshake
|
||||
|
||||
import unittest
|
||||
|
||||
class TestHandshake(unittest.TestCase):
|
||||
''' Test suite for Target parsing an generation '''
|
||||
|
||||
def getFile(self, filename):
|
||||
''' Helper method to parse targets from filename '''
|
||||
import os, inspect
|
||||
this_file = os.path.abspath(inspect.getsourcefile(self.getFile))
|
||||
this_dir = os.path.dirname(this_file)
|
||||
return os.path.join(this_dir, 'files', filename)
|
||||
|
||||
def testAnalyze(self):
|
||||
hs_file = self.getFile('handshake_exists.cap')
|
||||
hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A')
|
||||
try:
|
||||
hs.analyze()
|
||||
except Exception, e:
|
||||
fail()
|
||||
|
||||
def testHandshakeTshark(self):
|
||||
hs_file = self.getFile('handshake_exists.cap')
|
||||
hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A')
|
||||
assert(len(hs.tshark_handshakes()) > 0)
|
||||
|
||||
def testHandshakePyrit(self):
|
||||
hs_file = self.getFile('handshake_exists.cap')
|
||||
hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A')
|
||||
assert(len(hs.pyrit_handshakes()) > 0)
|
||||
|
||||
def testHandshakeCowpatty(self):
|
||||
hs_file = self.getFile('handshake_exists.cap')
|
||||
hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A')
|
||||
hs.divine_bssid_and_essid()
|
||||
assert(len(hs.cowpatty_handshakes()) > 0)
|
||||
|
||||
def testHandshakeAircrack(self):
|
||||
hs_file = self.getFile('handshake_exists.cap')
|
||||
hs = Handshake(hs_file, bssid='A4:2B:8C:16:6B:3A')
|
||||
assert(len(hs.aircrack_handshakes()) > 0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
35
tests/test_Target.py
Normal file
35
tests/test_Target.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/python2.7
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from py.Airodump import Airodump
|
||||
|
||||
import unittest
|
||||
|
||||
class TestTarget(unittest.TestCase):
|
||||
''' Test suite for Target parsing an generation '''
|
||||
|
||||
airodump_csv = 'airodump.csv'
|
||||
|
||||
def getTargets(self, filename):
|
||||
''' Helper method to parse targets from filename '''
|
||||
import os, inspect
|
||||
this_file = os.path.abspath(inspect.getsourcefile(TestTarget.getTargets))
|
||||
this_dir = os.path.dirname(this_file)
|
||||
csv_file = os.path.join(this_dir, 'files', filename)
|
||||
# Load targets from CSV file
|
||||
return Airodump.get_targets_from_csv(csv_file)
|
||||
|
||||
def testTargetParsing(self):
|
||||
''' Asserts target parsing finds targets '''
|
||||
targets = self.getTargets(TestTarget.airodump_csv)
|
||||
assert(len(targets) > 0)
|
||||
|
||||
def testTargetClients(self):
|
||||
''' Asserts target parsing captures clients properly '''
|
||||
targets = self.getTargets(TestTarget.airodump_csv)
|
||||
for t in targets:
|
||||
if t.bssid == '00:1D:D5:9B:11:00':
|
||||
assert(len(t.clients) > 0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user