DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Fertilizer - Helps In Growing Counters

03.01.2008
| 1303 views |
  • submit to reddit
        This simple program helps in growing many different counters, often seen on webpages, when started it access the webpage, changing proxies.


import urllib2
import socket
import sys
import os
import string


timeout = 30
socket.setdefaulttimeout(timeout)
ladres=[]

for arg in sys.argv[1:]:
        if  arg == '-u':
                f =urllib2.urlopen('http://proxy-list.org/downloadproxylist.php?
sp=-1&pp=any&pt=any&pc=any&ps=any')
                if os.path.exists('proxy-list.txt'):
                        os.remove('proxy-list.txt')
                writefile = file('proxy-list.txt','w')
                writefile.write(f.read())
                writefile.close()
        else:
                ladres.append(arg)


timeout = 15
socket.setdefaulttimeout(timeout)

if len(ladres)==0:
        ladres.append(raw_input('Podaj adres do zbombardowania:'))


for adres in ladres:
        file = open('proxy-list.txt')
        while 1:
                line=file.readline()
                line.replace("\n","")
                if not line:
                        break
                proxyurl='http://'+line+'/'
                proxy_handler = urllib2.ProxyHandler({'http': proxyurl})
                opener = urllib2.build_opener(proxy_handler)
                try:
                        print line
                        opener.open(adres)
                except urllib2.URLError,e:
                        print e
                except Exception,e1:
                        print e1