Exemple #1
0
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
Exemple #2
0
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()
Exemple #3
0
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),
Exemple #4
0
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
Exemple #5
0
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
Exemple #6
0
 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
Exemple #7
0
 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
Exemple #8
0
def git_check(u):
    if requests.get(u.value + '.git/').status_code != 404:
        ColorPrint.green('.GIT/'),
Exemple #9
0
def dir_check(url):
    u = common.URL(url)
    for _ in DIR_LIST:
        if requests.get(u.value + _[1:]).status_code != 404:
            ColorPrint.green(_),
Exemple #10
0
def file_check(url):
    u = common.URL(url)
    for _ in FILE_LIST:
        if requests.get(u.value + _).status_code != 404:
            ColorPrint.green(_),
Exemple #11
0
def git_check(url):
    u = common.URL(url)
    if requests.get(u.value + '.git/').status_code != 404:
        ColorPrint.green('.GIT/'),