Beispiel #1
0
def main():
    ip = settings.IP_ADDRESS
    scanner = Scanner(ip)
    scanner.scan(settings.START_PORT, settings.END_PORT)
    for port in scanner.open_ports:
        try:
            grabber = Grabber(ip, port)
            print(f'{port}: {grabber.read()}')
            grabber.close()
        except Exception as e:
            print('Error', e)
def main():
    ip = '127.0.0.1'
    portrange = (1, 1001)
    scanner = Scanner(ip)
    scanner.scan(*portrange)
    for port in scanner.open_ports:
        try:
            grabber = Grabber(ip, port)
            print(grabber.read())
            grabber.close()
        except Exception:
            print("Error", e)
def main():
    ip = '192.168.42.42'
    portrange = (1, 65535)
    scanner = Scanner(ip)
    scanner.scan(*portrange)
    for port in scanner.open_ports:
        try:
            grabber = Grabber(ip, port)
            print('Result is {} on port: {}'.format(grabber.read(), port))
            grabber.close()
        except Exception as e:
            print('Result is Blocking on port: {}'.format(port))