Last active
July 4, 2016 15:06
-
-
Save corny/caad25970428e19e4daabb5bcefe6d22 to your computer and use it in GitHub Desktop.
IPv6-scan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import re | |
import os | |
import sys | |
if len(sys.argv) != 2: | |
sys.stderr.write('device angeben!\n') | |
sys.exit(1) | |
device = sys.argv[1] | |
known = set() | |
while True: | |
# Alle die auf einen Ping6 antworten | |
for host in re.findall(r'(fe80::\S*): ', os.popen("ping6 -L -I " + device + " ff02::1 -c 2").read()): | |
if host not in known: | |
print(host) | |
known.add(host) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment