Skip to content

Instantly share code, notes, and snippets.

@thebigbad
Last active July 22, 2021 20:55
Show Gist options
  • Save thebigbad/f153344755783118bd293fffe2d37de2 to your computer and use it in GitHub Desktop.
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
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