Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import urllib, urllib2, cookielib, re, os, sys, thread, threading, time, httplib, subprocess, poplib, smtplib
- import string, random
- class ProxyManagement():
- class CheckProxys():
- def main(self, proxys):
- self.ThreadCount = 0
- self.Finish = 0
- start = time.time()
- for proxy in proxys:
- while True:
- if self.ThreadCount < 30:
- self.ThreadCount += 1
- thread.start_new_thread(self.CheckProxy, (proxy,))
- break
- if self.Finish:
- break
- print "Elapsed Time: %s" % (time.time() - start)
- if self.Finish:
- return(self.Proxy)
- def CheckProxy(self, proxy):
- proxyhandler = urllib2.ProxyHandler({"http":proxy})
- cookieprocessor = urllib2.HTTPCookieProcessor(cookielib.CookieJar())
- session = urllib2.build_opener(cookieprocessor, proxyhandler)
- session.addheaders = [("User-agent", "Opera/9.80 (Windows NT 6.1; U; en-US) Presto/2.7.62 Version/11.01")]
- try:
- Url = "http://www.google.de/"
- session.open(Url).read()
- if not self.Finish:
- self.Proxy = proxy
- print("Working proxy: %s" % (proxy))
- self.Finish = 1
- except Exception as e:
- pass
- self.ThreadCount -= 1
- thread.exit()
- def SearchProxys(self):
- session = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookielib.CookieJar()))
- session.addheaders = [("User-agent", "Opera/9.80 (Windows NT 6.1; U; en-US) Presto/2.7.62 Version/11.01")]
- Tmp = session.open("http://www.proxy-listen.de/Proxy/Proxyliste.html").read()
- value = re.findall('<input name="ggfhgfjcfgds" value="(.*)" type="hidden"/>', Tmp)[0]
- ProxyList = []
- post_vars = {
- "filter_port": "",
- "filter_http_gateway": "",
- "filter_http_anon": "",
- "filter_response_time_http": "",
- "ggfhgfjcfgds": value,
- "filter_country": "",
- "filter_timouts1": "", #100% Connection enable (100- x)
- "liststyle": "info",
- "proxies": "50",
- "type": "http",
- "submit": "Anzeigen"
- }
- Context = session.open("http://www.proxy-listen.de/Proxy/Proxyliste.html", urllib.urlencode(post_vars)).read()
- IPs = re.findall('><a href="http://whois.sc/(.*)" target="_blank">', Context)
- for IP in IPs:
- try:
- Split = Context.split('<td><a href="http://whois.sc/%s" target="_blank">%s</a></td>' % (IP, IP))[1]
- tmp = re.findall('<td>(.*)</td>', Split)[0]
- ProxyList.append("%s:%s" % (IP, tmp))
- except: pass
- return(ProxyList)
- def SetProxySession(**kwargs):
- global session
- Proxy = ProxyManagement()
- if not "proxy" in kwargs:
- ProxyList = Proxy.SearchProxys()
- WorkingProxy = Proxy.CheckProxys().main(ProxyList)
- else:
- WorkingProxy = kwargs["proxy"]
- if WorkingProxy:
- print("Using Proxy Server: %s" % (WorkingProxy))
- proxyhandler = urllib2.ProxyHandler({"http":WorkingProxy})
- cookieprocessor = urllib2.HTTPCookieProcessor(cookielib.CookieJar())
- session = urllib2.build_opener(cookieprocessor, proxyhandler)
- session.addheaders = [("User-agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; chromeframe/12.0.742.112)")]
- else:
- print("No working proxy found.")
- return(SetProxySession())
- class LoginChecker():
- def __init__(self, url, user_pass):
- user_name, email_url = url.split("@")
- service = self.assert_email(email_url)
- if isinstance(service, str):
- print(service)
- else:
- SetProxySession()
- answer = service(user_name, user_pass)
- if answer and not isinstance(answer, str):
- print("Login successfull.")
- else:
- if isinstance(answer, str):
- print(answer)
- print("Login failed.")
- def assert_email(self, url):
- url = url.lower()
- email_dict = {
- "web.de": self.web_login,
- "gmx.de": self.gmx_de_login,
- "gmx.at": self.gmx_at_login,
- "gmx.ch": self.gmx_ch_login,
- "hotmail.de": self.hotmail_de_login,
- "hotmail.com": self.hotmail_com_login,
- "live.de": self.live_de_login,
- "live.com": self.live_com_login,
- "kabelbw.de": self.kabelbw_login,
- "aol.com": self.aol_login,
- "arcor.de": self.arcor_login,
- "t-online.de": self.tonline_login,
- "ymail.com": self.ymail_login,
- "yahoo.de": self.yahoo_de_login,
- "yahoo.com": self.yahoo_com_login,
- "gmail.com": self.gmail_login,
- "googlemail.com": self.googlemail_login,
- }
- if url in email_dict:
- return(email_dict[url])
- return("not supported url")
- def web_login(self, user_name, user_pass):
- print("Login to: web.de")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- login_url = "https://login.web.de/intern/login?hal=true"
- success_url = "https://navigator.web.de/login"
- post_vars = {
- "service": "freemail",
- "server": "https://freemail.web.de",
- "successURL": success_url,
- "loginFailedURL": "http://web.de/fm?status=login-failed",
- "loginErrorURL": "http://freemail.web.de/msg/failure.htm",
- "onerror": "http://freemail.web.de/msg/failure.htm",
- "onfail": "http://web.de/fm?status=login-failed",
- "username": user_name,
- "password": user_pass,
- "submit": "Login",
- }
- redirect_url = session.open(login_url, urllib.urlencode(post_vars)).geturl()
- try:
- redirect_url.index(success_url)
- return(True)
- except ValueError:
- return(False)
- def gmx_de_login(self, user_name, user_pass):
- user_name = user_name + "@gmx.de"
- return(self.gmx_login(user_name, user_pass))
- def gmx_at_login(self, user_name, user_pass):
- user_name = user_name + "@gmx.at"
- return(self.gmx_login(user_name, user_pass))
- def gmx_ch_login(self, user_name, user_pass):
- user_name = user_name + "@gmx.ch"
- return(self.gmx_login(user_name, user_pass))
- def gmx_login(self, user_name, user_pass):
- print("Login to: %s" % (user_name.split("@")[1]))
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- login_url = "https://service.gmx.net/de/cgi/login"
- success_url = "https://service.gmx.net/de/cgi/g.fcgi/startpage?"
- post_vars = {
- "AREA": "1",
- "EXT": "redirect",
- "EXT2": "",
- "uinguserid": "__uuid__",
- "dlevel": "c",
- "id": user_name,
- "p": user_pass,
- "submit": "Login",
- }
- redirect_url = session.open(login_url, urllib.urlencode(post_vars)).geturl()
- try:
- redirect_url.index(success_url)
- return(True)
- except ValueError:
- return(False)
- def hotmail_de_login(self, user_name, user_pass):
- user_name = user_name + "@hotmail.de"
- return(self.hotmail_login(user_name, user_pass))
- def hotmail_com_login(self, user_name, user_pass):
- user_name = user_name + "@hotmail.com"
- return(self.hotmail_login(user_name, user_pass))
- def live_de_login(self, user_name, user_pass):
- user_name = user_name + "@live.de"
- return(self.hotmail_login(user_name, user_pass))
- def live_com_login(self, user_name, user_pass):
- user_name = user_name + "@live.com"
- return(self.hotmail_login(user_name, user_pass))
- def hotmail_login(self, user_name, user_pass):
- print("Login to: hotmail.de")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- connection = poplib.POP3_SSL('pop3.live.com', 995)
- try:
- connection.user(user_name)
- connection.pass_(user_pass)
- return(True)
- except:
- return(False)
- def kabelbw_login(self, user_name, user_pass):
- user_name = user_name + "@kabelbw.de"
- print("Login to: kabelbw.de")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- login_url = "https://webmail.kabelbw.de/do/dologin"
- session_content = session.open("https://webmail.kabelbw.de/").read()
- sessionId = re.findall('name="sessionId" value="(.*)"/>', session_content)[0]
- post_vars = {
- "sessionId": sessionId,
- "variant": "kabelbw",
- "locale": "de-DE",
- "client": "html",
- "directMessageView": "",
- "uid": "",
- "uidl": "",
- "folder": "",
- "remoteAccountUID": "",
- "login": "1",
- "account": user_name,
- "password": user_pass,
- }
- redirect_url = session.open(login_url, urllib.urlencode(post_vars)).read()
- if redirect_url.find('Bitte versuchen Sie es noch einmal') != -1:
- return(False)
- else:
- return(True)
- def aol_login(self, user_name, user_pass):
- print("Login to: aol.com")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- try:
- mailServer = smtplib.SMTP("smtp.aol.com:587")
- mailServer.set_debuglevel(1)
- except smtplib.SMTPServerDisconnected:
- return("SMTP Server Disconnected")
- try:
- mailServer.login(user_name, user_pass)
- mailServer.quit()
- return(True)
- except smtplib.SMTPAuthenticationError:
- return(False)
- def arcor_login(self, user_name, user_pass):
- print("Login to: aol.com")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- login_url = "https://www.arcor.de/login/login.jsp"
- post_vars = {
- "user_name": user_name,
- "password": user_pass,
- "info": "Online-Passwort",
- "login": "Login",
- "goto": "",
- "protocol": "https",
- "promo": "",
- }
- redirect_url = session.open(login_url, urllib.urlencode(post_vars)).geturl()
- try:
- redirect_url.index(login_url)
- return(False)
- except ValueError:
- return(True)
- def tonline_login(self, user_name, user_pass):
- print("Login to: t-online.de")
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- try:
- mailServer = smtplib.SMTP("smtpmail.t-online.de")
- mailServer.set_debuglevel(1)
- except smtplib.SMTPServerDisconnected:
- return("SMTP Server Disconnected")
- try:
- mailServer.login(user_name, user_pass)
- mailServer.quit()
- return(True)
- except smtplib.SMTPAuthenticationError:
- return(False)
- def gmail_login(self, user_name, user_pass):
- user_name = user_name + "@gmail.com"
- return(self.googlemail_mail_login(user_name, user_pass))
- def googlemail_login(self, user_name, user_pass):
- user_name = user_name + "@googlemail.com"
- return(self.googlemail_mail_login(user_name, user_pass))
- def googlemail_mail_login(self, user_name, user_pass):
- print("Login to: %s" % (user_name.split("@")[1]))
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- try:
- mailServer = smtplib.SMTP("smtp.gmail.com:465")
- mailServer.set_debuglevel(1)
- except smtplib.SMTPServerDisconnected:
- return("SMTP Server Disconnected")
- try:
- mailServer.login(user_name, user_pass)
- mailServer.quit()
- return(True)
- except smtplib.SMTPAuthenticationError:
- return(False)
- def ymail_login(self, user_name, user_pass):
- user_name = user_name + "@ymail.com"
- return(self.yahoo_mail_login(user_name, user_pass))
- def yahoo_de_login(self, user_name, user_pass):
- user_name = user_name + "@yahoo.de"
- return(self.yahoo_mail_login(user_name, user_pass))
- def yahoo_com_login(self, user_name, user_pass):
- user_name = user_name + "@yahoo.com"
- return(self.yahoo_mail_login(user_name, user_pass))
- def yahoo_mail_login(self, user_name, user_pass):
- print("Login to: %s" % (user_name.split("@")[1]))
- print("Username: %s" % (user_name))
- print("Passwort: %s" % (user_pass))
- try:
- mailServer = smtplib.SMTP("smtp.mail.yahoo.com:465")
- mailServer.set_debuglevel(1)
- except smtplib.SMTPServerDisconnected:
- return("SMTP Server Disconnected")
- try:
- mailServer.login(user_name, user_pass)
- mailServer.quit()
- return(True)
- except smtplib.SMTPAuthenticationError:
- return(False)
- LoginChecker("Benutzer@hotmail.de", "Passwort")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement