Last active
July 22, 2021 20:55
-
-
Save thebigbad/f153344755783118bd293fffe2d37de2 to your computer and use it in GitHub Desktop.
script that takes a list of accounts and tries to webfinger an exemplar from each domain
This file contains hidden or 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
import requests | |
import urllib | |
import sys | |
domains = {} | |
for line in open(sys.argv[1], 'r'): | |
user = line.strip() | |
domains[user.split('@')[1]] = user | |
for domain, user in domains.items(): | |
url = 'https://%s/.well-known/webfinger?resource=%s' % (domain, user) | |
try: | |
unless [200, 404, 410].include?(requests.get(url).status_code): | |
print(user) | |
except requests.exceptions.RequestException: | |
print(user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment