[Tutor] bruteforce match word in text file

David david at abbottdavid.com
Wed Jan 21 23:52:05 CET 2009


bob gailer wrote:
> David wrote:
>> I have to ask for a pointer, not sure what I am doing wrong.
> 
> The first thing you are doing "wrong" is failing to tell us what is in 
> the wordlist file and what results you get when you run the program.
> 
> Please re-post with that information.
>>
>> #!/usr/bin/python
>> password = 'loser'
>> wordlist = '/home/david/Challenge-You/wordlist.txt'
>> try:
>>     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 word
>>     else:
>>         print 'You are a loser'
>>
> 
> 
wordlist.txt

next block is the meat the script will go through the list of words 
create our form with information encode that form and then apply that 
loser get source added comments above each line to help you understand

results;

./py_bruteforce.py
next block is the meat the script will go through the list of words 
create our form with information encode that form and then apply that 
loser get source added comments above each line to help you understand
You are a loser


-- 
Powered by Gentoo GNU/LINUX
http://www.linuxcrazy.com
pgp.mit.edu



More information about the Tutor mailing list