Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- ###############################################################################
- # Free Radius WPE log file convertor to John The Ripper formatted file for
- # password cracking. Use the following format for John:
- # ./john --format=NETNTLM freeradius.john
- #
- # 12/19/2011 - Josh Kelley
- ###############################################################################
- import sys
- if len(sys.argv) < 2:
- print "Please feed me the path to the Free Radius WPE log file"
- exit()
- fileIn = open(sys.argv[1],'r')
- fileOut = open('freeradius.john','w')
- i = 0
- for line in fileIn:
- lineClean = line.strip()
- lineSplit = lineClean.split(':')
- if lineSplit[0] == "mschap":
- i = i + 1
- if lineSplit[0] == "username":
- username = lineSplit[1].strip()
- i = i + 1
- if lineSplit[0] == "challenge":
- challenge = ""
- for x in lineSplit[1:]:
- challenge = challenge + x
- challenge = challenge.strip()
- i = i + 1
- if lineSplit[0] == "response":
- response = ""
- for x in lineSplit[1:]:
- response = response + x
- response = response.strip()
- i = i + 1
- if i == 4:
- lineNew = "%s:$NETNTLM$%s$%s" % (username, challenge, response)
- fileOut.write("%s\n" % lineNew.strip('\n'))
- i = 0
- fileIn.close()
- fileOut.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement