def florid_import_modules(): if common.WebInfo.modules is None: return False # Load modules list if 'ALL' in common.WebInfo.modules: common.WebInfo.modules.remove('ALL') for __module in glob.glob('mod/*.py'): if '__init__' not in __module: common.WebInfo.modules.append(__module[4:].replace('.py', '')) common.WebInfo.modules.remove('spider') common.WebInfo.modules.remove('sqli') # Import modules from the list above && initialize every module print '__MODS__' for _ in common.WebInfo.modules: print '\t\_%s\t' % _, sys.stdout.flush() try: _m = __import__('mod.' + _, fromlist=["*.py"]) _m_init_result = _m.init() if _m_init_result[0]: ColorPrint.green(_m_init_result[1] + '\n') common.WebInfo.modules_list[_] = _m sys.stdout.flush() else: ColorPrint.red(_m_init_result[1]) continue except: pass print '\n' return common.WebInfo.modules_list
def check_and_print(head, tail): if tail.startswith('/'): req_u = head + tail[1:] else: req_u = head + tail if requests.get(req_u).status_code != 404: ColorPrint.green(tail + ' ') sys.stdout.flush()
def svn_check(u): re = '' check_url = u.value + '.svn/' if requests.get(check_url).status_code != 404: re = '.SVN/' for _ in SVN_DIR: if requests.get(check_url + _).status_code != 404: re = re + _ + ' ' ColorPrint.green(re),
def do_vim_down(url, filename, suffix): try: r = requests.get(url, timeout=3) if r.status_code != 404: fp = open(common.LOG_DICT + filename + suffix, 'wb') fp.write(r.content) fp.close() ColorPrint.green('VIM ') sys.stdout.flush() except: pass
def back_down(u_obj): url_down = u_obj.scheme + '://' + u_obj.netloc + u_obj.path + u_obj.filename + '.bak' try: r = requests.get(url_down) if r.status_code != 404: _f = open(common.LOG_DICT + u_obj.filename + '.bak', 'wb') _f.write(r.content) ColorPrint.green('BAK ') sys.stdout.flush() return True except: pass
def download(self): url_down = self.check_url + '~' try: r = requests.get(url_down) if r.status_code == 200: _f = open(common.LOG_DICT + self.basename + '.bak', 'wb') _f.write(r.content) ColorPrint.green('BAK') return True else: pass except: pass return False
def download(self): for _ in SUFFIX_ARRAY: url_down = self.dirname + '/.' + self.basename + _ try: r = requests.get(url_down, timeout=3) if r.status_code == 200: _f = open(common.LOG_DICT + self.basename + _, 'wb') _f.write(r.content) ColorPrint.green('VIM') return True else: pass except: pass return False
def git_check(u): if requests.get(u.value + '.git/').status_code != 404: ColorPrint.green('.GIT/'),
def dir_check(url): u = common.URL(url) for _ in DIR_LIST: if requests.get(u.value + _[1:]).status_code != 404: ColorPrint.green(_),
def file_check(url): u = common.URL(url) for _ in FILE_LIST: if requests.get(u.value + _).status_code != 404: ColorPrint.green(_),
def git_check(url): u = common.URL(url) if requests.get(u.value + '.git/').status_code != 404: ColorPrint.green('.GIT/'),