def worker(self, rhost): self.domains = [] self.victim = rhost try: self.ip = gethostbyname(self.victim) except: self.frmwk.print_error('Cann\' get IP Address') return False self.domains.append(self.victim) if self.ip in CONFIG.IP_WHITE_LIST: self.frmwk.print_error('Site down!') return False self.threadlist = [] self.frmwk.print_status("IP : %s" % self.ip) self.frmwk.print_line("-------------------------------------------") for searcher in self.SEARCHERS: thread = Thread(target = self.reverseip, args = (searcher,)) self.threadlist.append(thread) thread.start() for thread in self.threadlist: try: thread.join(CONFIG.TIME_OUT) if thread.isAlive(): thread.terminate() except timeout: self.frmwk.print_error('Exception Timeout') pass self.frmwk.print_line("-------------------------------------------\n") #import from db if self.frmwk.dbconnect: self.frmwk.print_status('Getting subdomain in database') cursor = self.frmwk.dbconnect.db.cursor() iprow = getIP(cursor, self.ip) if iprow: dmrow = getDomain(cursor, ['domain_name'], {'ip_id_list': '%%!%s|%%' % iprow[0]}) for dm in dmrow: self.domains.append(dm[0]) cursor.close() self.domains = sortlistdomain(self.domains) if self.options['CHECK']: self.frmwk.print_status('Checking domain\'s in this IP') checker = checkdomains(self.frmwk, self.ip, self.domains) checker.checklistdomain(self.options['THREADS']) self.domains = sorted(list(set(checker.response))) if self.frmwk.dbconnect and self.options['CHECK']: self.frmwk.print_status('Saving database!') self.Saver() self.frmwk.print_success('List domain:') self.frmwk.print_line("----------------") self.frmwk.print_line("\n".join(self.domains)) return True
def worker(self, rhost): self.domains = [] self.victim = rhost try: self.ip = gethostbyname(self.victim) except: self.frmwk.print_error('Cann\' get IP Address') return False self.domains.append(self.victim) if self.ip in CONFIG.IP_WHITE_LIST: self.frmwk.print_error('Site down!') return False self.threadlist = [] self.frmwk.print_status("IP : %s" % self.ip) self.frmwk.print_line("-------------------------------------------") for searcher in self.SEARCHERS: thread = Thread(target=self.reverseip, args=(searcher, )) self.threadlist.append(thread) thread.start() for thread in self.threadlist: try: thread.join(CONFIG.TIME_OUT) if thread.isAlive(): thread.terminate() except timeout: self.frmwk.print_error('Exception Timeout') pass self.frmwk.print_line("-------------------------------------------\n") #import from db if self.frmwk.dbconnect: self.frmwk.print_status('Getting subdomain in database') cursor = self.frmwk.dbconnect.db.cursor() iprow = getIP(cursor, self.ip) if iprow: dmrow = getDomain(cursor, ['domain_name'], {'ip_id_list': '%%!%s|%%' % iprow[0]}) for dm in dmrow: self.domains.append(dm[0]) cursor.close() self.domains = sortlistdomain(self.domains) if self.options['CHECK']: self.frmwk.print_status('Checking domain\'s in this IP') checker = checkdomains(self.frmwk, self.ip, self.domains) checker.checklistdomain(self.options['THREADS']) self.domains = sorted(list(set(checker.response))) if self.frmwk.dbconnect and self.options['CHECK']: self.frmwk.print_status('Saving database!') self.Saver() self.frmwk.print_success('List domain:') self.frmwk.print_line("----------------") self.frmwk.print_line("\n".join(self.domains)) return True
def run(self, frmwk, args): self.frmwk = frmwk self.victim = HTTP(self.options['URL'], timeout=self.advanced_options['TIMEOUT']) self.victim.storecookie = True self.verbose = self.options['VERBOSE'] self.userlist = [] self.passlist = [] self.success = [] self.victim.headers.update({'Cookie': self.advanced_options['COOKIE']} if self.advanced_options['COOKIE'] else {}) ####################################### if self.options['USERNAME']: self.userlist = self.options['USERNAME'].split(',') else: self.userlist = ReadFromFile(FullPath(self.options['USERLIST'])) if self.options['PASSWORD']: self.passlist = self.options['PASSWORD'].split(',') else: for a in ReadFromFile(FullPath(self.options['PASSLIST'])): self.passlist.append(a) self.lenuser = len(self.userlist) self.lenpass = len(self.passlist) ############################################### listthread = [] if len(self.userlist) > 0: self.temppass = [] for i in range(self.options['THREADS']): t = Thread(target=self.worker) listthread.append(t) t.start() try: for t in listthread: t.join() except KeyboardInterrupt: for t in listthread: if t.isAlive(): t.terminate() pass ############################################## self.success = sorted(self.success) self.frmwk.print_line() self.frmwk.print_status("List login:\n-----------") if len(self.success) > 0: for u, p in self.success: self.frmwk.print_success( 'SUCCESS: username: {0:<20} password: {1}'.format( u, p)) self.frmwk.print_status("-----------") else: self.frmwk.print_status('Nothing to do!')
def threader(self): self.thread_lock.acquire() if(len(self.hosts) > 0): t = Thread(target = self.scanner, args = (self.hosts.pop(0),)) t.start() self.list_threads.append(t) else: try: self.thread_flag = False for t in self.list_threads: if t.isAlive(): t.join(self.timeout * len(self.ports) + 5) if t.isAlive(): t.terminate() except: for t in self.list_threads: if t.isAlive(): t.terminate() self.lock.release() self.thread_lock.release()
def threader(self): self.thread_lock.acquire() if(len(self.hosts) > 0): t = Thread(target = self.scanner, args = (self.hosts.pop(0),)) t.start() self.list_threads.append(t) else: try: self.thread_flag = False for t in self.list_threads: if t.isAlive(): t.join(self.timeout * len(self.accounts) + 5) if t.isAlive(): t.terminate() except: for t in self.list_threads: if t.isAlive(): t.terminate() self.lock.release() self.thread_lock.release()
def run(self, frmwk, args): self.frmwk = frmwk self.victim = HTTP(self.options["URL"], timeout=self.advanced_options["TIMEOUT"]) self.victim.storecookie = True self.verbose = self.options["VERBOSE"] self.userlist = [] self.passlist = [] self.success = [] self.victim.headers.update( {"Cookie": self.advanced_options["COOKIE"]} if self.advanced_options["COOKIE"] else {} ) ####################################### if self.options["USERNAME"]: self.userlist = self.options["USERNAME"].split(",") else: self.userlist = ReadFromFile(FullPath(self.options["USERLIST"])) if self.options["PASSWORD"]: self.passlist = self.options["PASSWORD"].split(",") else: for a in ReadFromFile(FullPath(self.options["PASSLIST"])): self.passlist.append(a) self.lenuser = len(self.userlist) self.lenpass = len(self.passlist) ############################################### listthread = [] if len(self.userlist) > 0: self.temppass = [] for i in range(self.options["THREADS"]): t = Thread(target=self.worker) listthread.append(t) t.start() try: for t in listthread: t.join() except KeyboardInterrupt: for t in listthread: if t.isAlive(): t.terminate() pass ############################################## self.success = sorted(self.success) self.frmwk.print_line() self.frmwk.print_status("List login:\n-----------") if len(self.success) > 0: for u, p in self.success: self.frmwk.print_success("SUCCESS: username: {0:<20} password: {1}".format(u, p)) self.frmwk.print_status("-----------") else: self.frmwk.print_status("Nothing to do!")
def filechecker(self, dirpath): self.tmp_files = list(self.files) + [] threads = [] for i in range(self.thread): t = Thread(target = self.checkfile, args = (dirpath,)) threads.append(t) t.start() try: for t in threads: t.join() except KeyboardInterrupt: for t in threads: if t.isAlive(): t.terminate() pass
def filechecker(self, dirpath): self.tmp_files = self.files + [] threads = [] for i in range(self.thread): t = Thread(target=self.checkfile, args=(dirpath, )) threads.append(t) t.start() try: for t in threads: t.join() except KeyboardInterrupt: for t in threads: if t.isAlive(): t.terminate() pass
def run(self, frmwk, args): self.frmwk = frmwk self.dirs = ReadFromFile(FullPath(self.options['DIRLIST'])) if self.options['DIRLIST'] else [] self.files = ReadFromFile(FullPath(self.options['FILELIST'])) if self.options['FILELIST'] else [] self.url = self.options['URL'] if self.options['URL'].endswith('/') else self.options['URL'] + '/' self.type = self.options['TYPE'] self.thread = self.options['THREADS'] self.stop = self.options['STOP'] self.extension = self.options['EXTENSION'].split(',') self.timeout = self.advanced_options['TIMEOUT'] self.into = self.advanced_options['INTO'] self.victim = HTTP(self.url, timeout = self.timeout) self.victim.headers.update({'Cookie': self.advanced_options['COOKIE']} if self.advanced_options['COOKIE'] else {}) self.success = [] self.tmp_dirs = list(self.dirs) + [] self.current_dir = '' self.locker = Lock() if self.type in ['lenght', 'auto']: victim = deepcopy(self.victim) victim.redirect = False self.frmwk.print_status('Init not found infomation') victim.Request(self.url + 'ASDASdadhkjlhjfasdfawefa/', 'GET') if self.type == 'auto': # if victim.response.status == 404: # self.type = 'status' # self.frmwk.print_success('auto get type: error') # el if victim.response.status == 200: self.type = 'lenght' self.frmwk.print_success('auto get type: lenght') else: self.type = 'location' self.frmwk.print_success('auto get type: location') if self.type == 'lenght': self.notfounddir = len(victim.result) if self.type in ['lenght', 'location']: self.notfoundfile = len(victim.Request(self.url + 'adfasdaszxcvzdczxfasASasda.' + self.extension[0], 'GET')) self.offset = self.advanced_options['OFFSET'] del victim if self.type == 'location': self.victim.redirect = False self.frmwk.print_status('Starting scanner') ########check file in current path###### try: if self.url.endswith('/'): self.url = self.url[:-1] self.filechecker(self.url) if not self.url.endswith('/'): self.url = self.url + '/' ######################################## threads = [] for i in range(self.thread): t = Thread(target = self.worker) threads.append(t) t.start() for t in threads: t.join() except KeyboardInterrupt: for t in threads: if t.isAlive(): t.terminate() pass if len(self.success) > 0: self.frmwk.print_success('Found list:\n-----------') for link in self.success: self.frmwk.print_success(link) else: self.frmwk.print_error('---------\nNot Found!\n---------')
def run(self, frmwk, args): self.frmwk = frmwk self.dirs = read_from_file(full_path( self.options['DIRLIST'])) if self.options['DIRLIST'] else [] self.files = read_from_file(full_path( self.options['FILELIST'])) if self.options['FILELIST'] else [] self.url = self.options['URL'] if self.options['URL'].endswith( '/') else self.options['URL'] + '/' self.type = self.options['TYPE'] self.thread = self.options['THREADS'] self.stop = self.options['STOP'] self.extension = self.options['EXTENSION'].split(',') self.timeout = self.advanced_options['TIMEOUT'] self.into = self.advanced_options['INTO'] self.victim = HTTP(self.url, timeout=self.timeout) self.victim.headers.update({'Cookie': self.advanced_options['COOKIE']} if self.advanced_options['COOKIE'] else {}) self.success = [] self.tmp_dirs = self.dirs + [] self.current_dir = '' self.locker = Lock() if self.type in ['lenght', 'auto']: victim = deepcopy(self.victim) victim.redirect = False self.frmwk.print_status('Init not found infomation') victim.Request(self.url + 'ASDASdadhkjlhjfasdfawefa/', 'GET') if self.type == 'auto': # if victim.response.status == 404: # self.type = 'status' # self.frmwk.print_success('auto get type: error') # el if victim.response.status == 200: self.type = 'lenght' self.frmwk.print_success('auto get type: lenght') else: self.type = 'location' self.frmwk.print_success('auto get type: location') if self.type == 'lenght': self.notfounddir = len(victim.result) if self.type in ['lenght', 'location']: self.notfoundfile = len( victim.Request( self.url + 'adfasdaszxcvzdczxfasASasda.' + self.extension[0], 'GET')) self.offset = self.advanced_options['OFFSET'] del victim if self.type == 'location': self.victim.redirect = False self.frmwk.print_status('Starting scanner') ########check file in current path###### try: if self.url.endswith('/'): self.url = self.url[:-1] self.filechecker(self.url) if not self.url.endswith('/'): self.url = self.url + '/' ######################################## threads = [] for i in range(self.thread): t = Thread(target=self.worker) threads.append(t) t.start() for t in threads: t.join() except KeyboardInterrupt: for t in threads: if t.isAlive(): t.terminate() pass if len(self.success) > 0: self.frmwk.print_success('Found list:\n-----------') for link in self.success: self.frmwk.print_success(link) else: self.frmwk.print_error('---------\nNot Found!\n---------')