├── Challenge-1-Easy.cap ├── README.md ├── client-probe-sniffer.py ├── ssid-sniffer.py └── Airdecap-WEP-Crack.py /Challenge-1-Easy.cap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/securitytube/hack-of-the-day/HEAD/Challenge-1-Easy.cap -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This Repo Contains all the demo code for the Hack of the Day series on SecurityTube.net 2 | 3 | Videos: http://www.securitytube.net/tags/hod 4 | 5 | Blog Posts: http://hackoftheday.securitytube.net/ 6 | 7 | 8 | -------------------------------------------------------------------------------- /client-probe-sniffer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import * 4 | 5 | def PacketHandler(pkt) : 6 | 7 | if pkt.haslayer(Dot11) : 8 | if pkt.type == 0 and pkt.subtype == 4 : 9 | if pkt.info : 10 | print "Client: %s SSID: %s" % (pkt.addr2, pkt.info) 11 | 12 | 13 | sniff(iface="mon0", prn = PacketHandler) 14 | -------------------------------------------------------------------------------- /ssid-sniffer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from scapy.all import * 4 | 5 | ap_list = [] 6 | 7 | def PacketHandler(pkt) : 8 | 9 | if pkt.haslayer(Dot11) : 10 | if pkt.type == 0 and pkt.subtype == 8 : 11 | if pkt.addr2 not in ap_list : 12 | ap_list.append(pkt.addr2) 13 | print "AP MAC: %s with SSID: %s " %(pkt.addr2, pkt.info) 14 | 15 | 16 | sniff(iface="mon0", prn = PacketHandler) 17 | -------------------------------------------------------------------------------- /Airdecap-WEP-Crack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Author - Vivek Ramachandran vivek@securitytube.net 3 | # 4 | 5 | 6 | import sys, binascii, re 7 | from subprocess import Popen, PIPE 8 | 9 | f = open(sys.argv[1], 'r') 10 | for line in f: 11 | wepKey = re.sub(r'\W+', '', line) 12 | 13 | if not (len(wepKey) == 5 or len(wepKey) == 13) : 14 | continue 15 | 16 | hexKey = binascii.hexlify(wepKey) 17 | 18 | print "Trying with WEP Key: " +wepKey + " Hex: " + hexKey 19 | 20 | p = Popen(['/usr/local/bin/airdecap-ng', '-w', hexKey, sys.argv[2]], stdout=PIPE) 21 | output = p.stdout.read() 22 | 23 | finalResult = output.split('\n')[4] 24 | if finalResult.find('1') != -1 : 25 | print "Success WEP Key Found: " + wepKey 26 | sys.exit(0) 27 | 28 | print "Failure! WEP Key Could not be Found with the existing dictionary!" 29 | --------------------------------------------------------------------------------