the last unbiased stronghold

wpacrack.py.txt

wpacrack.py.txt
Posted Jul 10, 2008
Authored by d3hydr8 | Site darkc0de.com

Python script that cracks a 256-bit WPA-PSK hash (64 char) using wpa_passphrase and a wordlist.

tags | tool, scanner, python
systems | unix
MD5 | f526e7dcfd3f3a9583738f494b0791d1

wpacrack.py.txt

Change Mirror Download
#!/usr/bin/python
#Cracks a 256-bit WPA-PSK hash (64 char) using wpa_passphrase
#and a wordlist.

#This uses the linux tool wpa_passphrase to generate a 256-bit PSK.
#Make sure you have this tool prier to using this cracker.

#d3hydr8@linuxbox:~$ man wpa_passphrase
#d3hydr8@linuxbox:~$ wpa_passphrase <ssid> <paraphrase>

#Check the /etc/network/interfaces file for this hash. It will look something like this.

#auto lo
#iface lo inet loopback

#iface eth1 inet dhcp
#wpa-psk 11f3833adac3ed17ad05031c18170597ae0f911eed618927513c5d40a800b9d8
#wpa-driver wext
#wpa-key-mgmt WPA-PSK
#wpa-proto WPA
#wpa-ssid darkc0de

#auto eth1

#Hash: 11f3833adac3ed17ad05031c18170597ae0f911eed618927513c5d40a800b9d8

#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com

import md5, sys, commands, getopt, StringIO, re

def gethash(word):
cmd = "wpa_passphrase "+sys.argv[2]+" "+word
out = StringIO.StringIO(commands.getstatusoutput(cmd)[1]).read()
hash = re.findall("[a-f0-9]"*64,out)
if len(hash) > 0:
return hash[0]

if len(sys.argv) != 4:
print "Usage: ./wpacrack.py <hash> <ssid> <wordlist>"
sys.exit(1)

if len(sys.argv[1]) != 64:
print "\nError: Hash length incorrect (64 char)\n"
sys.exit(1)

try:
words = open(sys.argv[3], "r").readlines()
except(IOError):
print "\nError: Check your wordlist path\n"
sys.exit(1)

print "\n",len(words),"words loaded..."
for word in words:
hash = gethash(word.replace("\n",""))
if sys.argv[1] == hash:
print "Password is:",word






Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close