Skip to content

Instantly share code, notes, and snippets.

@corny
Last active July 4, 2016 15:06
Show Gist options
  • Save corny/caad25970428e19e4daabb5bcefe6d22 to your computer and use it in GitHub Desktop.
Save corny/caad25970428e19e4daabb5bcefe6d22 to your computer and use it in GitHub Desktop.
IPv6-scan
#!/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