Last active
September 23, 2019 01:49
-
-
Save mikeabreu/b2bcbfbb84443a831d9d204d57fb737d to your computer and use it in GitHub Desktop.
Revisions
-
mikeabreu revised this gist
Mar 9, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # Add these functions to your .bashrc or .zshrc and use from your terminal. get_certs_domains() { # Credit goes to Ronnie Flathers, taken from https://twitter.com/ropnop/status/972151279463124994 curl -s https://crt.sh\?q\=%25.$1 | awk -v pattern="<TD>.*$1" '$0 ~ pattern {gsub("<[^>]*>","");gsub(//,""); print}' | sort -u } get_certs() { -
mikeabreu revised this gist
Mar 9, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ get_certs() { curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 'N;N;N;s/\n/\t\t/g' } get_certs_to_csv() { echo 'ID,Logged At,Identity,Issuer Name' > $1.csv curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 's/,/;/g' | sed 'N;N;N;s/\n/,/g' | sed 's/,[ ]*/,/g' | sed 's/^[ ]*//g' >> $1.csv } @@ -27,7 +27,7 @@ $ get_certs mikeabreu.com # Example $ get_certs_to_csv mikeabreu.com $ cat mikeabreu.com.csv ID,Logged At,Identity,Issuer Name 328469607,2018-02-12,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 276563784,2017-12-12,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 221039748,2017-09-30,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 -
mikeabreu revised this gist
Mar 9, 2018 . 1 changed file with 11 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,12 +14,20 @@ get_certs_to_csv() { } # Example $ get_certs_domains mikeabreu.com www.mikeabreu.com api.mikeabreu.com # Example $ get_certs mikeabreu.com 328469607 2018-02-12 www.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 276563784 2017-12-12 www.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 221039748 2017-09-30 api.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 # Example $ get_certs_to_csv mikeabreu.com $ cat mikeabreu.com.csv ID,Issue Date,Domain,Issuer 328469607,2018-02-12,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 276563784,2017-12-12,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 221039748,2017-09-30,www.mikeabreu.com,C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3 -
mikeabreu revised this gist
Mar 9, 2018 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,10 @@ get_certs_domains() { get_certs() { curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 'N;N;N;s/\n/\t\t/g' } get_certs_to_csv() { echo 'ID,Issue Date,Domain,Issuer' > $1.csv curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 's/,/;/g' | sed 'N;N;N;s/\n/,/g' | sed 's/,[ ]*/,/g' | sed 's/^[ ]*//g' >> $1.csv } # Example get_certs_domains mikeabreu.com -
mikeabreu renamed this gist
Mar 9, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ #!/bin/bash # Add these functions to your .bashrc or .zshrc and use from your terminal. get_certs_domains() { # Credit goes to Ronnie Flathers, stolen from https://twitter.com/ropnop/status/972151279463124994 curl -s https://crt.sh\?q\=%25.$1 | awk -v pattern="<TD>.*$1" '$0 ~ pattern {gsub("<[^>]*>","");gsub(//,""); print}' | sort -u -
mikeabreu created this gist
Mar 9, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ get_certs_domains() { # Credit goes to Ronnie Flathers, stolen from https://twitter.com/ropnop/status/972151279463124994 curl -s https://crt.sh\?q\=%25.$1 | awk -v pattern="<TD>.*$1" '$0 ~ pattern {gsub("<[^>]*>","");gsub(//,""); print}' | sort -u } get_certs() { curl -s https://crt.sh\?q\=%25.$1 | awk '/\?id=[0-9]*/{nr[NR]; nr[NR+1]; nr[NR+3]; nr[NR+4]}; NR in nr' | sed 's/<TD style="text-align:center"><A href="?id=//g' | sed 's#">[0-9]*</A></TD>##g' | sed 's#<TD style="text-align:center">##g' | sed 's#</TD>##g' | sed 's#<TD>##g' | sed 's#<A style=["a-z: ?=0-9-]*>##g' | sed 's#</A>##g' | sed 'N;N;N;s/\n/\t\t/g' } # Example get_certs_domains mikeabreu.com www.mikeabreu.com api.mikeabreu.com # Example get_certs mikeabreu.com 328469607 2018-02-12 www.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 276563784 2017-12-12 www.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3 221039748 2017-09-30 api.mikeabreu.com C=US, O=Let's Encrypt, CN=Let's Encrypt Authority X3