api = censys.certificates.CensysCertificates(api_id=self.api_id, api_secret=self.secret)
fields = ["parsed.subject_dn", "parsed.fingerprint_sha256", "parsed.validity"]
for cert in api.search("tags: trusted and parsed.names: {}".format(fqdn), fields=fields):
self.utility.print_message(OK, "Certification info: {}".format(cert))
self.utility.write_log(20, "[Out] Search Censys [{}].".format(self.file_name))
After Change
self.utility.write_log(20, "[In] Search Censys [{}].".format(self.file_name))
api = censys.ipv4.CensysIPv4(api_id=self.api_id, api_secret=self.secret)
self.utility.print_message(OK, "Check open web ports.")
for result in api.search("ip:{}".format(ip_addr)):
self.utility.print_message(WARNING, "Open web ports: {}".format(result["protocols"]))
// Check cloud service name.
if protocol == "https":
self.utility.print_message(OK, "Check certification.")
api = censys.certificates.CensysCertificates(api_id=self.api_id, api_secret=self.secret)
fields = ["parsed.subject_dn", "parsed.validity", "parsed.signature_algorithm", "parsed.subject"]
for cert in api.search("tags: trusted and parsed.names: {}".format(fqdn), fields=fields):