Skip to content

Instantly share code, notes, and snippets.

@achillean
Created February 17, 2015 23:38
Show Gist options
  • Save achillean/c1cd5c37acde6bce4fc1 to your computer and use it in GitHub Desktop.
Save achillean/c1cd5c37acde6bce4fc1 to your computer and use it in GitHub Desktop.
Get a list of duplicate SSL serial numbers.
#!/usr/bin/env python
import shodan
API_KEY = 'YOUR API KEY'
api = shodan.Shodan(API_KEY)
results = api.count('port:443,8443', facets=[('ssl.cert.serial', 100)])
for facet in results['facets']['ssl.cert.serial']:
print 'Serial %s occurs %s times' % (facet['value'], facet['count'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment