Skip to content

Instantly share code, notes, and snippets.

@pwndev
Created July 29, 2024 09:26
Show Gist options
  • Select an option

  • Save pwndev/606e0d8ab5508dede7b3e2e1ddb54e10 to your computer and use it in GitHub Desktop.

Select an option

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.
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