def main(): parser = argparse.ArgumentParser( prog='pyscanmap', description= 'PyScanMap makes it easy to scan your network hosts and their open ports', epilog='By Luiz Rosa & Renan Tashiro') parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + VERSION) parser.add_argument('-n', '--network', help='IPv4 address for the network', required=True) parser.add_argument( '-m', '--mask', help='Mask for the IPv4 address, expressed as an IPv4 address', required=True) args = parser.parse_args(sys.argv[1:]) validate_arguments(args.network, args.mask) network_scanner = NetworkScanner(args.network, args.mask) try: network_scanner.scan() except KeyboardInterrupt: sys.exit(0)
def scan_my_network(my_ip): network_scanner = NetworkScanner() full_wlan_ip_range = network_scanner.get_wlan_ip_from_ip(my_ip) print(f'[+] We will send ARP request to wlan ip :{full_wlan_ip_range}') answers = network_scanner.scan(full_wlan_ip_range) # We don't want router spoof_ip = answers[0][1].psrc answers = answers[2:] print('Here we go, list of avaible machines') network_scanner.print_result(answers) return answers, spoof_ip
def main(): args = parseArguments() ip = checkArgs(args) net = NetworkScanner(ip) w = Writer() while (True): clients = net.scan() devices = parseDevices(clients) csv_devices = w.getDevicesFromCSV() list_to_print = compareDevices(devices, csv_devices, net.getRouterIP()) printDevices(list_to_print) w.writeToCSV(devices) time.sleep(60 * args.time)
def main(): args = analisaArgs() ip = checaIPnosArgumentos(args) net = NetworkScanner(ip) w = Writer() while(True): clients = net.scan() devices = analisaDispositivos(clients) csv_devices = w.dispositivosDoCSV() list_to_print = comparaDispositivos( devices, csv_devices, net.getRouterIP()) mostraDispositivos(list_to_print) w.escreveCSV(devices) time.sleep(args.time)