Created
July 29, 2024 09:26
-
-
Save pwndev/606e0d8ab5508dede7b3e2e1ddb54e10 to your computer and use it in GitHub Desktop.
List all certificates with the most important information from an octo admin panel's HTTP response.
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 json | |
| from datetime import datetime | |
| with open('certs-response.json') as file: | |
| data = json.load(file) | |
| for item in data["Items"]: | |
| scn = item["SubjectCommonName"] | |
| thumbprint = item["Thumbprint"] | |
| expiry_date = datetime.strptime(item["NotAfter"], "%Y-%m-%dT%H:%M:%S.%f%z") | |
| print(scn, expiry_date.strftime("%A, %B %d, %Y %I:%M %p %z"), thumbprint) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment