{"id":698,"date":"2021-10-31T09:51:57","date_gmt":"2021-10-31T08:51:57","guid":{"rendered":"https:\/\/www.labtinker.net\/?p=698"},"modified":"2021-10-31T09:51:57","modified_gmt":"2021-10-31T08:51:57","slug":"licence-revoked","status":"publish","type":"post","link":"https:\/\/labtinker.net\/?p=698","title":{"rendered":"Licence Revoked"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Apparently the Bond film &#8216;Licence to Kill&#8217; was originally going to be called &#8216;Licence Revoked&#8217; but the producers were worried that the general public wouldn&#8217;t know what &#8216;revoked&#8217; meant. (The use of &#8216;apparently&#8217; in this sentence denotes a lack of fact checking). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To revoke means to withdraw or cancel and in TLS, certificate revocation is the mechanism by which the owner of a certificate can let the world know that a certificate should no longer be trusted. There are three ways a client can check whether a certificate has been revoked:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Certificate Revocation Lists (CRLs)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are URLs contained within a TLS certificate which tell the client where to download a list of certificate serial numbers of revoked certificates. To check whether a certificate has been revoked a client (usually a browser) downloads this list  (which can be thousands of lines) and reads through it to see if the serial number of the relevant certificate is there. Strictly speaking it needs to do this for the certificate&#8217;s root and intermediate certificates too. It is very time consuming and modern browsers don&#8217;t like the latency this entails.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Onilne Certificate Status Procotol<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Contained with the TLS cert is the address of an OCSP Responder which the client can query using OCSP to find out whether the certificate has been revoked. The Responder will reply with a response (signed by the Certificate Authority).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>OCSP Stapling<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Similar to the above but the server hosting the certificate makes queries to the Certificate Authority&#8217;s OCSP responder at pre-determined intervals for the certificate&#8217;s revocation status and passes a time-stamped response to the client (if queried). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The Lab<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">My idea was a simple one: mint a certificate then revoke it and see how long it takes three different browsers: (Mozilla, Edge and Chrome) to notice. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The certificate in question was<em> <\/em><strong>revoke.labtinker.net <\/strong>issued by Let&#8217;s Encrypt:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"399\" height=\"297\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/cert-sn.png\" alt=\"\" class=\"wp-image-708\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/cert-sn.png 399w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/cert-sn-300x223.png 300w\" sizes=\"auto, (max-width: 399px) 100vw, 399px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I span up a Linux box with an Apache webserver on it and attached the certificate to it:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"160\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/site.png\" alt=\"\" class=\"wp-image-703\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/site.png 602w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/site-300x80.png 300w\" sizes=\"auto, (max-width: 602px) 100vw, 602px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> I then revoked the certificate via the certbot utility (which I&#8217;d used to provision the cert too)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"150\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/revoke-certificate-1024x150.png\" alt=\"\" class=\"wp-image-704\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/revoke-certificate-1024x150.png 1024w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/revoke-certificate-300x44.png 300w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/revoke-certificate-768x112.png 768w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/revoke-certificate-1536x225.png 1536w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/revoke-certificate.png 1681w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I checked in SSL labs (<a href=\"https:\/\/www.ssllabs.com\/ssltest\/\">https:\/\/www.ssllabs.com\/ssltest\/<\/a>)  that it had been revoked:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"771\" height=\"619\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/Licence-revoked-in-SSL-Labs.png\" alt=\"\" class=\"wp-image-705\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Licence-revoked-in-SSL-Labs.png 771w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Licence-revoked-in-SSL-Labs-300x241.png 300w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Licence-revoked-in-SSL-Labs-768x617.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I then tried to browse to the site using Mozilla (version 93.0)  Edge (Version 95.0.1020.40) and Chrome (Version 95.0.4638.69) .<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was about thirty minutes after I&#8217;d revoked the certificate that I made my first attempt and Mozilla immediately detected that the certificate had been revoked:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"344\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2-1024x344.png\" alt=\"\" class=\"wp-image-706\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2-1024x344.png 1024w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2-300x101.png 300w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2-768x258.png 768w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2-1536x517.png 1536w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/Mozilla-Browser-Revoked2.png 1573w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It had detected this by using OCSP to make a query to the OCSP responder URL published in the cert:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"337\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/image-4.png\" alt=\"\" class=\"wp-image-709\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/image-4.png 395w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/image-4-300x256.png 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">&#8230;as can be seen in the Wireshark capture below. Here&#8217;s the OCSP request:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"172\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/image-3.png\" alt=\"\" class=\"wp-image-707\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/image-3.png 780w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/image-3-300x66.png 300w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/image-3-768x169.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And here&#8217;s the response&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"284\" src=\"http:\/\/18.135.13.153\/wp-content\/uploads\/2021\/10\/ocsp-revoked.png\" alt=\"\" class=\"wp-image-712\" srcset=\"https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/ocsp-revoked.png 723w, https:\/\/labtinker.net\/wp-content\/uploads\/2021\/10\/ocsp-revoked-300x118.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Excellent. Full marks to Mozilla.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I tried Edge and Chrome and received no warnings. I tried six hours later. Same. I tried thirty six hours later and still no warnings. These browsers do have their own mechanisms for doing revocation (beyond the scope of this lab) but they weren&#8217;t effective to get a pass here. (You can also modify these browsers&#8217; settings to change revocation-checking behaviour &#8211; I was using vanilla settings)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Returning to the tenuous conceit of the post, in the above instance only Mozilla would be asking 007 for his licence and gun back!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mozilla will actually soft-fail &#8211; which means if it doesn&#8217;t get a response from the OCSP responder it will allow access to the site. A summary of how different browsers deal with revoked certificates is here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-ssl-com wp-block-embed-ssl-com\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"1H0VF15auy\"><a href=\"https:\/\/www.ssl.com\/blogs\/how-do-browsers-handle-revoked-ssl-tls-certificates\/\">How Do Browsers Handle Revoked SSL\/TLS Certificates?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"\u201cHow Do Browsers Handle Revoked SSL\/TLS Certificates?\u201d \u2014 SSL.com\" src=\"https:\/\/www.ssl.com\/blogs\/how-do-browsers-handle-revoked-ssl-tls-certificates\/embed\/#?secret=UrkvMImJT6#?secret=1H0VF15auy\" data-secret=\"1H0VF15auy\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Apparently the Bond film &#8216;Licence to Kill&#8217; was originally going to be called &#8216;Licence Revoked&#8217; but the producers were worried that the general public wouldn&#8217;t know what &#8216;revoked&#8217; meant. (The use of &#8216;apparently&#8217; in this sentence denotes a lack of fact checking). To revoke means to withdraw or cancel and in TLS, certificate revocation is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-encryption"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/labtinker.net\/index.php?rest_route=\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labtinker.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labtinker.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labtinker.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labtinker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=698"}],"version-history":[{"count":0,"href":"https:\/\/labtinker.net\/index.php?rest_route=\/wp\/v2\/posts\/698\/revisions"}],"wp:attachment":[{"href":"https:\/\/labtinker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labtinker.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labtinker.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}