TheAMM

Untitled

May 26th, 2014
19,517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.00 KB | None | 0 0
  1. #!/usr/bin/python
  2. #import requests #Whopps, not a default lib
  3. import urllib2
  4.  
  5. USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.132 Safari/537.36"
  6. HEADERS={"User-agent" : USER_AGENT}
  7.  
  8. TARGET = "http://pissity.myminicity.com/"
  9.  
  10. PROXY_LIST = ["111.1.36.21:82", "111.1.36.25:81", "111.1.36.26:83", "120.198.230.27:80", "120.198.230.30:80", "120.198.230.62:82", "202.171.253.101:80", "210.101.131.232:8080", "212.34.230.149:80", "49.213.18.58:80", "85.114.141.191:80", "111.1.36.2:80", "111.1.36.21:83", "111.1.36.21:84", "111.1.36.23:81", "111.1.36.23:83", "111.1.36.24:80", "111.1.36.24:82", "111.1.36.24:83", "111.1.36.24:85", "111.1.36.25:82", "111.1.36.25:84", "111.1.36.25:86", "111.1.36.26:81", "111.1.36.26:82", "111.1.36.26:84", "111.1.36.27:83", "111.1.36.27:84", "111.1.36.27:85", "118.97.95.174:80", "118.97.95.174:8080", "120.198.230.31:80", "120.198.230.60:80", "120.198.230.62:83", "120.203.214.187:80", "120.203.214.187:9090", "183.207.228.119:85", "183.207.228.27:80", "221.130.162.242:85", "221.130.162.242:8443", "223.27.200.2:80", "111.1.36.21:86", "111.1.36.23:80", "120.198.230.62:85", "183.207.224.19:86", "183.207.224.21:80", "183.207.224.21:83", "183.207.224.22:81", "183.207.228.119:81", "183.207.228.121:80"]
  11.  
  12. if __name__ == "__main__":
  13.   print "Got {} proxies to try. Lessee what happens.".format(len(PROXY_LIST))
  14.   failed = 0
  15.   for proxy in PROXY_LIST:
  16.     print "Trying to use", proxy
  17.     try:
  18.       # r = requests.get(TARGET, proxies={"http" : proxy})
  19.       proxy_support = urllib2.ProxyHandler({"http":"http://" + proxy})
  20.       opener = urllib2.build_opener(proxy_support)#, urllib2.HTTPHandler(debuglevel=1))
  21.       req = urllib2.Request(TARGET, None, HEADERS)
  22.       conn = opener.open(req)
  23.       conn.close()
  24.       print " - worked, maybe. Next!"
  25.     except Exception, e:
  26.       print " - failed, don't really care why ({}). Next!".format(str(e))
  27.       failed += 1;
  28.   print "All {} proxies done. {} worked, {} failed.".format(len(PROXY_LIST), len(PROXY_LIST)-failed, failed)
Advertisement
Add Comment
Please, Sign In to add comment