";
// 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 "CT Log URL | " . htmlspecialchars($ct_url) . " |
";
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 "" . htmlspecialchars(ucfirst(str_replace('_', ' ', $key))) . " | " . wordwrap(htmlspecialchars($value), 65, " ", 1) . " |
";
}
} else {
echo "Error | No result returned |
";
}
}
echo "
";
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 "
";
cert_parse($data);
}
} else {
echo " Host or Certificate required.";
echo "
";
$write_cache = 0;
}
}
echo "