Example #1
0
def run_method(langbuf, param):
    h = Helper()
    Logging.log(h.formatter(h.getlang(langbuf, 'running', None), [hostname]),
                LogLevel.CLI)
    print(' ')
    if param is not None:
        for p in param:
            if (p == '0'):
                render_tree(request_method(MethodAxfr(), 'AXFR'))
            elif (p == '1'):
                render_tree(request_method(MethodDnsQueries(), 'DNS Queries'))
            elif (p == '2'):
                render_tree(request_method(MethodVirusTotal(), 'VirusTotal'))
            elif (p == '3'):
                render_tree(request_method(MethodRobtex(), 'Robtex'))
            elif (p == '4'):
                render_tree(request_method(MethodCrtSh(), 'CRTSH'))
            elif (p == '5'):
                render_tree(
                    request_method(MethodCertificateDetails(),
                                   'CertificateDetails'))
            elif (p == '6'):
                render_tree(request_method(MethodGoogle(), 'Google CSE'))
            elif (p == '7'):
                render_tree(request_method(MethodBing(), 'Bing'))
            elif (p == '8'):
                render_tree(request_method(MethodDnsDumpster(),
                                           'DNS Dumpster'))
Example #2
0
def define_host(langbuf, param):
    global hostname
    h = Helper()
    if h.hostname_validate(param) is None:
        Logging.log(h.getlang(langbuf, 'errors', 'invalid-hostname'),
                    LogLevel.DANGER)
        exit(-1)
    else:
        hostname = param
Example #3
0
    def load_lang(self, langpath):
        h = Helper()

        if not h.langexists(langpath):
            Logging.log('Can\'t define language to show, exiting...',
                        LogLevel.DANGER)
            exit(-1)
        else:
            self.langbuf = lang_from_path(langpath)
            if not isinstance(self.langbuf, dict):
                Logging.log('- Error loading language file', LogLevel.DANGER)
                exit(-1)

        Logging.log(
            h.formatter(h.getlang(self.langbuf, 'header', None),
                        [h.version(), h.gettime()]), LogLevel.CLI)
Example #4
0
def run_filter(langbuf, param):
    h = Helper()
    if param is not None:
        res = []
        for p in param:
            if (p == '0'):
                if ((os.geteuid() == 0)
                        or (os.getenv('SUDO_USER') is not None)):
                    f = FilterRawPorts()
                    render_tree(request_filter(f.filter(hostname),
                                               'Raw Ports'))
                else:
                    Logging.log(h.getlang(langbuf, 'errors', 'root-required'),
                                LogLevel.DANGER)
            elif (p == '1'):
                f = FilterPorts()
                render_tree(request_filter(f.findPorts(hostname), 'Ports'))
            elif (p == '2'):
                f = FilterHttpServices()
                render_tree(
                    request_filter(f.findHttpServices(hostname),
                                   'Http Services'))
Example #5
0
def show_help(langbuf, param):
    h = Helper()
    Logging.log(h.getlang(langbuf, 'usage', None), LogLevel.CLI)