https://10240ml/index.php,index.php · Gitee 极速下载/ssl-decoder - Gitee.com

error_reporting(E_ALL & ~E_NOTICE);

ob_start();

$write_cache = 0;

foreach (glob("functions/*.php") as $filename) {

include $filename;

}

?>

SSL Decoder

if ( isset($_GET['host']) && !empty($_GET['host'])) {

echo '

';

$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) {

?>

}

}

if (empty($_GET['host']) && empty($_GET['csr'])) {

require_once("inc/form.php");

} else {

echo "

";

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

echo(htmlspecialchars($current_folder) . $cache_filename);

echo "\">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 "

ErrorNo 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

echo(htmlspecialchars($current_folder) . $cache_filename);

echo "\">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);

}

}

?>

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值