From 17c30fc3007df960781d1d5845e06cc9e3e7b4ae Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 14:55:51 +0000 Subject: [PATCH 01/20] Update email.php Fix typo in message --- functions/email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/email.php b/functions/email.php index 6f0e1f3..7ab6e0c 100644 --- a/functions/email.php +++ b/functions/email.php @@ -107,7 +107,7 @@ function send_cert_expired_email($days, $domain, $email, $raw_cert) { $to = $email; $subject = "A certificate for " . htmlspecialchars($domain) . " expired " . htmlspecialchars($days) . " days ago"; - $message = "Hello,\r\n\r\nYou have a subscription to monitor the certificate of " . htmlspecialchars($domain) . " with the the Certificate Expiry Monitor. This is a service which monitors an SSL certificate on a website, and notifies you when it is about to expire. This extra notification helps you remember to renew your certificate on time.\r\n\r\nWe've noticed that the following domain has a certificate in it's chain that has expired " . htmlspecialchars($days) . " days ago:\r\n\r\nDomain: " . htmlspecialchars($domain) . "\r\nCertificate Common Name: " . htmlspecialchars($cert_cn) . "\r\nCertificate Subject: " . htmlspecialchars($cert_subject) . "\r\nCertificate Serial: " . htmlspecialchars($cert_serial) . "\r\nCertificate Valid From: " . htmlspecialchars(date("Y-m-d H:i:s T", $cert_validfrom_date)) . " (" . $cert_valid_days_ago . " days ago)\r\nCertificate Valid Until: " . htmlspecialchars(date("Y-m-d H:i:s T", $cert_expiry_date)) . " (" . $cert_valid_days_ahead . " days ago)\r\n\r\nYou should renew and replace your certificate right now. If you haven't set up the certificate yourself, please forward this email to the person/company that did this for you.\r\n\rThis website is now non-functional and displays errors to it's users. Please fix this issue as soon as possible.\r\n\r\nTo unsubscribe from notifications for this domain please click or copy and paste the below link in your browser:\r\n\r\n" . $unsublink . "\r\n\r\n\r\n Have a nice day,\r\nThe Certificate Expiry Monitor Service.\r\nhttps://" . $current_link . ""; + $message = "Hello,\r\n\r\nYou have a subscription to monitor the certificate of " . htmlspecialchars($domain) . " with the the Certificate Expiry Monitor. This is a service which monitors an SSL certificate on a website, and notifies you when it is about to expire. This extra notification helps you remember to renew your certificate on time.\r\n\r\nWe've noticed that the following domain has a certificate in its chain that has expired " . htmlspecialchars($days) . " days ago:\r\n\r\nDomain: " . htmlspecialchars($domain) . "\r\nCertificate Common Name: " . htmlspecialchars($cert_cn) . "\r\nCertificate Subject: " . htmlspecialchars($cert_subject) . "\r\nCertificate Serial: " . htmlspecialchars($cert_serial) . "\r\nCertificate Valid From: " . htmlspecialchars(date("Y-m-d H:i:s T", $cert_validfrom_date)) . " (" . $cert_valid_days_ago . " days ago)\r\nCertificate Valid Until: " . htmlspecialchars(date("Y-m-d H:i:s T", $cert_expiry_date)) . " (" . $cert_valid_days_ahead . " days ago)\r\n\r\nYou should renew and replace your certificate right now. If you haven't set up the certificate yourself, please forward this email to the person/company that did this for you.\r\n\rThis website is now non-functional and displays errors to it's users. Please fix this issue as soon as possible.\r\n\r\nTo unsubscribe from notifications for this domain please click or copy and paste the below link in your browser:\r\n\r\n" . $unsublink . "\r\n\r\n\r\n Have a nice day,\r\nThe Certificate Expiry Monitor Service.\r\nhttps://" . $current_link . ""; $message = wordwrap($message, 70, "\r\n"); $headers = 'From: noreply@' . $current_domain . "\r\n" . 'Reply-To: noreply@' . $current_domain . "\r\n" . @@ -190,4 +190,4 @@ function send_expires_in_email($days, $domain, $email, $raw_cert) { } -?> \ No newline at end of file +?> From 5885051f36ad814fcb6274213bb626784a8629de Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 14:57:51 +0000 Subject: [PATCH 02/20] Update README.md fix issues --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38098a2..f8d0f66 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,11 @@ First get the code and unpack it to your webroot: Create the database files, outside of your webroot. If you create these inside your webroot, everybody can read them. - touch /var/www/certificate-expiry-monitor-db/pre_checks.json - touch /var/www/certificate-expiry-monitor-db/checks.json - touch /var/www/certificate-expiry-monitor-db/deleted_checks.json - chown -R $wwwuser /var/www/certificate-expiry-monitor-db/*.json +echo '{}' > /var/www/certificate-expiry-monitor-db/pre_checks.json +echo '{}' > /var/www/certificate-expiry-monitor-db/checks.json +echo '{}' > /var/www/certificate-expiry-monitor-db/deleted_checks.json +chown -R $wwwuser /var/www/certificate-expiry-monitor-db/*.json + These files are used by the tool as database for checks. From 52883737a6bba43f2e50c4aa72b8518c1259a5fb Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 14:59:25 +0000 Subject: [PATCH 03/20] Update unsubscribe.php Visitor IP is missing when manually unsubscribing --- unsubscribe.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsubscribe.php b/unsubscribe.php index 09b57c7..e1cfa14 100644 --- a/unsubscribe.php +++ b/unsubscribe.php @@ -28,8 +28,8 @@ if ( isset($_GET['cron']) && !empty($_GET['cron']) ) { $cron = htmlspecialchars($_GET['cron']); } - if ($cron = "auto") { - $userip = "Removed automatically because to many errors occured."; + if ($cron == "auto") { + $userip = "Removed automatically because too many errors occured."; } $uuid_pattern = "/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/"; if (preg_match($uuid_pattern, $id)) { From 5d9f2a9cebb015e579a65d91f26bb9e0982e7dbc Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 15:00:50 +0000 Subject: [PATCH 04/20] Update confirm.php Adding listing feature --- confirm.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/confirm.php b/confirm.php index e89d836..30a49e1 100644 --- a/confirm.php +++ b/confirm.php @@ -52,8 +52,6 @@ echo ""; } -require('inc/faq.php'); - require('inc/footer.php'); ?> From 0b27369df1f048db8a67cbe22cc89046189b3264 Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 15:01:40 +0000 Subject: [PATCH 05/20] Create get_checks.php Adding listing feature --- functions/get_checks.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 functions/get_checks.php diff --git a/functions/get_checks.php b/functions/get_checks.php new file mode 100644 index 0000000..9508b82 --- /dev/null +++ b/functions/get_checks.php @@ -0,0 +1,26 @@ +. + function get_domain_checks() { + global $current_domain; + global $current_link; + global $check_file; + $file = file_get_contents($check_file); + if ($file === FALSE) { + return null; + } + $json_a = json_decode($file, true); + if ($json_a === null && json_last_error() !== JSON_ERROR_NONE) { + return null; + } + return $json_a; +} From 72c2114baf986e039b57fac68651e0450bd0fa9d Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 15:02:53 +0000 Subject: [PATCH 06/20] Update variables.php Adding listing feature --- functions/variables.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/variables.php b/functions/variables.php index 0dca401..b5551af 100644 --- a/functions/variables.php +++ b/functions/variables.php @@ -31,10 +31,14 @@ $current_domain = "certificatemonitor.org"; $current_link = "certificatemonitor.org"; +$showListOfDomains = false; +$showEmailsOnListOfDomains = false; +$showClickToUnsubscribeOnListOfDomains = false; + // set this to a location outside of your webroot so that it cannot be accessed via the internets. $pre_check_file = '/home/certmon/domains/certificatemonitor.org/cert-monitor/pre_checks.json'; $check_file = '/home/certmon/domains/certificatemonitor.org/cert-monitor/checks.json'; $deleted_check_file = '/home/certmon/domains/certificatemonitor.org/cert-monitor/deleted_checks.json'; -?> \ No newline at end of file +?> From 4e09a162af353ebb8fffc2e10ed19fec34ecb808 Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 15:03:47 +0000 Subject: [PATCH 07/20] Update faq.php --- inc/faq.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/faq.php b/inc/faq.php index 969700e..4223f2f 100644 --- a/inc/faq.php +++ b/inc/faq.php @@ -18,6 +18,12 @@
+View list of domains'; + } +?> +

FAQ

Is this service free?

@@ -66,4 +72,4 @@

Yes. You can check out Cipherli.st for secure server settings and guides. You can also use the SSL Decoder to check your current setup.


-


\ No newline at end of file +


From 2c489a521202be2b9991fb546bae7255bd7f2628 Mon Sep 17 00:00:00 2001 From: RCDaddy Date: Thu, 6 Dec 2018 15:04:32 +0000 Subject: [PATCH 08/20] Update header.php --- inc/header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/header.php b/inc/header.php index 4bab5b6..712d2a6 100644 --- a/inc/header.php +++ b/inc/header.php @@ -34,8 +34,8 @@ echo "
"; echo "
"; -echo "