Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save houey/3dfb4c16f7e7d300a36d7f49d51dcbf5 to your computer and use it in GitHub Desktop.
Save houey/3dfb4c16f7e7d300a36d7f49d51dcbf5 to your computer and use it in GitHub Desktop.
certstream utility to retrieve paypal and few other fraud keywords
import certstream
keywords = ['paypal', 'paypol']
def extract_domains(domains):
res = []
for domain in domains:
for keyword in keywords:
if keyword in domain:
res.append(domain)
return res
def print_callback(message, context):
domains = message['data']['leaf_cert']['all_domains']
res = extract_domains(domains)
if len(res) > 0:
print(res)
def on_open(instance):
# Instance is the CertStreamClient instance that was opened
print("Connection successfully established!")
def on_error(instance, exception):
# Instance is the CertStreamClient instance that barfed
print("Exception in CertStreamClient! -> {}".format(exception))
certstream.listen_for_events(print_callback, on_open=on_open, on_error=on_error)
@houey
Copy link
Author

houey commented May 30, 2018

yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment