Skip to content

Instantly share code, notes, and snippets.

@0xbharath
Last active July 16, 2018 12:41
Show Gist options
  • Save 0xbharath/cb7ade214d39c6977d8dd7a78d72ae0e to your computer and use it in GitHub Desktop.
Save 0xbharath/cb7ade214d39c6977d8dd7a78d72ae0e to your computer and use it in GitHub Desktop.
SELECT distinct issuer_ca_id, COUNT(*) FROM certificate_identity ci WHERE ci.NAME_TYPE = 'dNSName' AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower('%gov.in')) GROUP BY issuer_ca_id ORDER BY COUNT(*) desc;
SELECT certificate_id,issuer_o,issuer_cn FROM ccadb_certificate WHERE certificate_id IN(SELECT distinct certificate_id FROM certificate_identity ci WHERE ci.NAME_TYPE = 'dNSName' AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower('%appsecco.com')));
SELECT distinct ca.name, COUNT(*) count FROM certificate_identity ci, ca ca WHERE ci.NAME_TYPE = 'dNSName' AND reverse(lower(ci.NAME_VALUE)) LIKE reverse(lower('%gov.in')) AND ca.id=ci.issuer_ca_id GROUP BY ca.name ORDER BY count desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment