Created
January 15, 2015 15:37
-
-
Save chliny/b632003d96d0029237b3 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
#-*- coding=utf-8 -*- | |
import requests | |
def checkCrt(ip): | |
try: | |
requests.get("https://%s" % ip, verify=True) | |
except requests.exceptions.SSLError as e: | |
ret_list = str(e).replace(",","").split("'") | |
domain_list = ret_list[4:] | |
except Exception as e: | |
print (e) | |
return False | |
for domain in domain_list: | |
domain = domain.strip() | |
if domain: | |
print (ip,domain) | |
if __name__ == "__main__": | |
import sys | |
ip = sys.argv[1] | |
checkCrt(ip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment