Пример #1
0
def runDiscovery(targets, options):
    fingerengine = FingerEngine()
    fingerengine.options = options

    """Run a fingerprint on each host/port/platform combination"""
    for host in targets:
        utility.Msg("Beginning discovery scan on host %s" % (host))
        for platform in state.supported_platforms:
            for port in targets[host]:
                for fp in doFingerprint(host, port[0], port[1], platform):
                    utility.Msg("\t%s (version %s port %s)" % (fp.title, fp.version, port[0]), LOG.SUCCESS)
Пример #2
0
def run(options):
    """ Parse up our hosts and run fingerprinting/exploitation
    on each one
    """

    servers = []
    if options.input_list:
        with open(options.input_list, 'r') as f:
            for ip in f.readlines():
                if ip.count('.') < 3:
                    rip = utility.resolve_host(ip.strip())
                    if rip:
                        servers.append(rip)
                    else:
                        utility.Msg(
                            "Host %s could not be resolved.  Skipping." %
                            ip.strip(), LOG.DEBUG)
                else:
                    servers.append(ip.strip())

        utility.Msg("Loaded %d servers." % len(servers))
    else:
        if options.ip.count('.') < 3:
            ip = utility.resolve_host(options.ip)
            if ip:
                servers.append(ip)
            else:
                utility.Msg("Could not resolve hostname %s" % options.ip,
                            LOG.ERROR)
                return
        else:
            servers.append(options.ip)

    utility.Msg("Servers' OS hinted at %s" % options.remote_os)
    # iterate through all servers, fingerprint and load auxengine
    for server in servers:
        fingerengine = FingerEngine()
        fingerengine.options = options
        fingerengine.options.ip = server

        fingerengine.run()
        if len(fingerengine.fingerprints) is 0:
            continue

        utility.Msg("Fingerprinting completed.", LOG.UPDATE)

        # We've got the host fingerprinted, now kick off the
        # exploitation engine for the service
        utility.Msg("Loading auxiliary for '%s'..." % fingerengine.service,
                    LOG.DEBUG)

        # execute the auxiliary engine
        auxengine(fingerengine)
Пример #3
0
def runDiscovery(targets, options):
    fingerengine = FingerEngine()
    fingerengine.options = options
    '''Run a fingerprint on each host/port/platform combination'''
    for host in targets:
        utility.Msg("Beginning discovery scan on host %s" % (host))
        for platform in state.supported_platforms:
            for port in targets[host]:
                for fp in doFingerprint(host, port[0], port[1], platform):
                    utility.Msg(
                        "\t%s (version %s port %s)" %
                        (fp.title, fp.version, port[0]), LOG.SUCCESS)
Пример #4
0
def run(options):
    """ Parse up our hosts and run fingerprinting/exploitation
    on each one
    """

    servers = []
    if options.input_list:
        with open(options.input_list, 'r') as f:
            for ip in f.readlines():
                if ip.count('.') < 3:
                    rip = utility.resolve_host(ip.strip())
                    if rip:
                        servers.append(rip)
                    else:
                        utility.Msg("Host %s could not be resolved.  Skipping." % 
                                                            ip.strip(), LOG.DEBUG)
                else:
                    servers.append(ip.strip())
                    
        utility.Msg("Loaded %d servers." % len(servers))
    else:
        if options.ip.count('.') < 3:
            ip = utility.resolve_host(options.ip)
            if ip:
                servers.append(ip)
            else:
                utility.Msg("Could not resolve hostname %s" % options.ip, LOG.ERROR)
                return
        else:
            servers.append(options.ip)

    utility.Msg("Servers' OS hinted at %s" % options.remote_os)
    # iterate through all servers, fingerprint and load auxengine
    for server in servers:
        fingerengine = FingerEngine()
        fingerengine.options = options
        fingerengine.options.ip = server

        fingerengine.run()
        if len(fingerengine.fingerprints) is 0:
            continue

        utility.Msg("Fingerprinting completed.", LOG.UPDATE)

        # We've got the host fingerprinted, now kick off the
        # exploitation engine for the service
        utility.Msg("Loading auxiliary for '%s'..." % fingerengine.service,
                                                      LOG.DEBUG)

        # execute the auxiliary engine
        auxengine(fingerengine)