[Tutor] bruteforce match word in text file
bgailer at gmail.com
Thu Jan 22 02:19:03 CET 2009
> Thanks Bob,
> I changed the wordlist.txt to
> and the program;
> password = 'loser'
> wordlist = '/home/david/Challenge-You/wordlist.txt'
> words = open(wordlist, 'r').readlines()
> except IOError, e:
> print "Sorry no words"
> for word in words:
> word = word.replace("\n","")
> if password in word:
> print "The password is: ", word
> I could not figure out how to split the file into words.
look up the string method split.
Also take a look at the syntax of the for statement and notice it has an
Chapel Hill NC
More information about the Tutor