'; $data = []; $hostname = mb_strtolower(get($_GET['host'])); $hostname = parse_hostname($hostname); $host = $hostname['hostname']; $port = get($_GET['port'], '443'); if ( !is_numeric($port) ) { $port = 443; } if ($hostname['multiple_ip']) { choose_endpoint($hostname['multiple_ip'], $host, $port, $_GET['fastcheck']); } if($_GET['fastcheck'] == 1) { $fastcheck = 1; } else { $fastcheck = 0; } $ip = $hostname['ip']; $data["data"] = check_json($host,$ip,$port,$fastcheck); if(isset($data["data"]["error"])) { $data["error"] = $data["data"]["error"]; unset($data["data"]); } $chain_length = count($data["data"]["chain"]); $chain_data = $data["data"]["chain"]; if ($chain_length >= 1 && $chain_length < 10) { ?> "; echo "
"; echo "
"; // if ajax-ed, don't show header again if(empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { echo "
"; echo ""; // set back to 1 after debugging $write_cache = 1; if (!is_dir('results')) { mkdir('results'); } $epoch = date('U'); $random_bla = md5(uniqid(rand(), true)); } if ( !empty($host) ) { if ( !empty($data["error"]) ) { echo "" . htmlspecialchars($data["error"][0]) . ""; echo "
"; $write_cache = 0; } else { $hostfilename = preg_replace("([^\w\s\d\-_~,;:\[\]\(\).])", '', $host); $hostfilename = preg_replace("([\.]{2,})", '', $host); $hostfilename = preg_replace("([^a-z0-9])", '', $host); $cache_filename = (string) "results/saved." . $hostfilename . "." . $epoch . "." . $random_bla . ".html"; $cache_filename_json = (string) "results/saved." . $hostfilename . "." . $epoch . "." . $random_bla . ".json"; echo "

This tool does not make conclusions. Please check the data and define the validity yourself!

"; if ($write_cache == 1) { echo "

This result is saved at most 60 days on the following URL. Do note that this might be deleted earlier if space runs out.

"; } echo ""; echo "

Receive notifications when this certificate is about to expire with my other service, Certificate Monitor.

"; // connection data echo "
"; echo "

Connection Data for " . htmlspecialchars($host) . " / " . htmlspecialchars($ip) . "

"; ssl_conn_metadata($data["data"]["connection"], $fastcheck); if ($_GET['fastcheck'] == 1) { echo "

Fast check selected, therefore Connection Data enumeration is limited.

"; } echo "
"; // certificates foreach ($data["data"]["chain"] as $key => $value) { echo "
"; echo "

Certificate for '". htmlspecialchars($value["cert_data"]["subject"]["CN"]) ."'

"; cert_parse($value); echo "
"; } // submit to certificate transparency if ($_GET['fastcheck'] == 0) { echo "
"; echo "

Certificate Transparency Submission

"; echo "

Information about Certificate Transparency

"; foreach ($data["data"]['certificate_transparency'] as $ct_url => $ct_result) { echo ""; echo ""; if (is_array($ct_result)) { foreach ($ct_result as $key => $value) { if (is_bool($key)) { $key = ($key) ? 'True' : 'False'; } if (is_bool($value)) { $value = ($value) ? 'True' : 'False'; } echo ""; } } else { echo ""; } } echo "
CT Log URL" . htmlspecialchars($ct_url) . "
" . htmlspecialchars(ucfirst(str_replace('_', ' ', $key))) . "" . wordwrap(htmlspecialchars($value), 65, "
", 1) . "
ErrorNo result returned
"; echo "
"; } else { echo "
"; echo "

Certificate Transparency Submission

"; echo "Fast check selected, therefore Certificate Transparency submission is disabled."; echo "


"; } } } elseif (!empty($_GET['csr']) ) { $data = csr_parse_json($_GET['csr']); echo "

This tool does not make conclusions. Please check the data and define the validity yourself!
\n  

"; $cache_filename = (string) "results/saved.csr." . $epoch . "." . $random_bla . ".html"; $cache_filename_json = (string) "results/saved.csr." . $epoch . "." . $random_bla . ".json"; if ($write_cache == 1) { echo "This result is saved at most 60 days on the following URL. Do note that this might be deleted earlier if space runs out."; } if (strpos($_GET['csr'], "BEGIN CERTIFICATE REQUEST") !== false) { echo "

Certificate Signing Request

"; csr_parse($data); } else { echo "

Certificate

"; cert_parse($data); } } else { echo " Host or Certificate required."; echo "


"; $write_cache = 0; } } echo "
"; echo "
"; echo "
"; require_once("inc/footer.php"); if ($write_cache == 1) { if (!file_exists($cache_filename)) { file_put_contents($cache_filename, ob_get_contents()); } if (is_array($data)) { $json_data = json_encode(utf8encodeNestedArray($data)); } if (!file_exists($cache_filename_json)) { file_put_contents($cache_filename_json, $json_data); } } ?>