Okay, I've written this script to check if a password works right, but how
do I know if an authentication actually exists?
import urllib2
def passIT(link):
        f = open("valid2.txt","a")
        f.write(link)
        f.close
file = open("p2.txt")
passes = file.readlines()
file.close
for x in passes:
        x = x.split("http://";)
        r = x[1]
        e = r.split("@")
        domain = e[1]
        w = e[0].split(":")
        user = w[0]
        password = w[1]
        print "\n----\n"
        x = urllib2.HTTPPasswordMgrWithDefaultRealm()
        x.add_password(None,'http://%s' % (domain),user,password)
        auth = urllib2.HTTPBasicAuthHandler(x)
        opener = urllib2.build_opener(auth)
        urllib2.install_opener(opener)
        try:
                flob = urllib2.urlopen('http://%s' % domain)
        except:
                print "Dead Pass"
        else:
                print user,password,domain,"\n"
                try:
                        passIT("\nhttp://%s:[EMAIL PROTECTED]" % 
(user,password,domain))
                except:
                        print "Couldn't add to file"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to