Пример #1
0
def dump_data(files, path):
    hosts_path = path + "/hosts"
    os.mkdir(hosts_path)
    services_path = path + "/services"
    os.mkdir(services_path)

    hosts = nmap.parse_hosts(files, True)
    with open(path + "/hosts.txt", 'w') as f:
        for host in hosts:
            f.write(host + '\n')

    for host in hosts:
        with open(hosts_path + "/" + host + ".txt", 'w') as f:
            found = nmap.parse_ports_for_address(files, host)
            for port in found:
                f.write(port + '\n')

    services = nmap.parse_unique_services(files)
    with open(path + "/services.txt", 'w') as f:
        for service in services:
            f.write(service + '\n')

    for service in services:
        with open(services_path + "/" + service.replace('/', '_') + ".txt",
                  'w') as f:
            found = nmap.parse_service(files, service)
            for host in found:
                f.write(host + '\n')
Пример #2
0
def dump_data(files, path):
    hosts_path = path + "/hosts"
    os.mkdir(hosts_path)
    services_path = path + "/services"
    os.mkdir(services_path)

    hosts = nmap.parse_hosts(files, True)
    with open(path + "/hosts.txt", 'w') as f:
        for host in hosts:
            f.write(host + '\n')

    for host in hosts:
        with open(hosts_path + "/" + host + ".txt", 'w') as f:
            found = nmap.parse_ports_for_address(files, host)
            for port in found:
                f.write(port + '\n')

    services = nmap.parse_unique_services(files)
    with open(path + "/services.txt", 'w') as f:
        for service in services:
            f.write(service + '\n')

    for service in services:
        with open(services_path + "/" + service.replace('/', '_') + ".txt",
                  'w') as f:
            found = nmap.parse_service(files, service)
            for host in found:
                f.write(host + '\n')
Пример #3
0
def print_report(files):
    print('##############')
    print('# LIVE HOSTS #')
    print('##############')
    print('')
    hosts = nmap.parse_hosts(files, True)
    for host in hosts:
        print(host)

    print('')
    print('###################')
    print('# UNIQUE SERVICES #')
    print('###################')
    print('')
    services = nmap.parse_unique_services(files)
    for service in services:
        print(service)

    print('')
    print('############')
    print('# SERVICES #')
    print('############')
    print('')
    for service in services:
        print("== %s ==" % service)
        found = nmap.parse_service(files, service)
        for host in found:
            print(host)
        print('')
Пример #4
0
def print_report(files):
    print('##############')
    print('# LIVE HOSTS #')
    print('##############')
    print('')
    hosts = nmap.parse_hosts(files, True)
    for host in hosts:
        print(host)

    print('')
    print('###################')
    print('# UNIQUE SERVICES #')
    print('###################')
    print('')
    services = nmap.parse_unique_services(files)
    for service in services:
        print(service)

    print('')
    print('############')
    print('# SERVICES #')
    print('############')
    print('')
    for service in services:
        print("== %s ==" % service)
        found = nmap.parse_service(files, service)
        for host in found:
            print(host)
        print('')