解密php eval(base64_decode方法
发布网友
发布时间:2022-04-27 00:18
我来回答
共2个回答
热心网友
时间:2022-04-18 14:21
对于第一段:
eval(base64_decode('ZnVuY3Rpb24gdGhlbWVfZm9vdGVyX3QoKSB7IGlmICghKGZ1bmN0aW9uX2V4aXN0cygiY2hlY2tfdGhlbWVfZm9vdGVyIikgJiYgZnVuY3Rpb25fZXhpc3RzKCJjaGVja190aGVtZV9oZWFkZXIiKSkpIHsgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBkaWU7IH0gfSB0aGVtZV9mb290ZXJfdCgpOw=='));
你可以编写如下的测试程序:
<?php
exit(base64_decode('ZnVuY3Rpb24gdGhlbWVfZm9vdGVyX3QoKSB7IGlmICghKGZ1bmN0aW9uX2V4aXN0cygiY2hlY2tfdGhlbWVfZm9vdGVyIikgJiYgZnVuY3Rpb25fZXhpc3RzKCJjaGVja190aGVtZV9oZWFkZXIiKSkpIHsgdGhlbWVfdXNhZ2VfbWVzc2FnZSgpOyBkaWU7IH0gfSB0aGVtZV9mb290ZXJfdCgpOw=='));
?>
在命令行执行上面的测试程序,输出结果如下:
function theme_footer_t() { if (!(function_exists("check_theme_footer") && function_exists("check_theme_header"))) { theme_usage_message(); die; } } theme_footer_t();
上面输出的结果,可以替换测试你的第一段代码,它们完全等效,或者说就是解密后的代码,你掌握这个方法,PHP根本就是不可能真正加密的,都是欺负初学者而已。来自:求助得到的回答
热心网友
时间:2022-04-18 15:39
兄弟,今天的关于这种类型的解码的都是你发的吧。其实很简单,就是把eval换成echo 就知道解出来的是什么了。
<?
function theme_footer_t() {
if (!(function_exists("check_theme_footer") && function_exists("check_theme_header"))) {
theme_usage_message();
die;
}
}
theme_footer_t();
function functions_file_exists() {
if (!file_exists(dirname(__file__) . "/functions.php") || !function_exists("theme_usage_message") ) {
echo ("<p style=\"padding:10px; margin: 10px; text-align:center; border: 2px dashed Red; font-family:arial; font-weight:bold; background: #fff; color: #000;\">This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters.</p>");
die();
}
}
functions_file_exists();
function check_theme_footer() {
$l = 'Free <a href="http://www.bestincellphones.com">T-Mobile Phones</a> on Sale | Thanks to <a href="http://www.thepiggybanker.com/best-cd-rates/">CD Rates</a>, <a href="http://www.mlm123.net">Best New Business</a> and <a href="http://www.registrysoftwarereviewed.com/">Registry Software</a>';
$f = dirname(__file__) . "/footer.php";
$fd = fopen($f, "r");
$c = fread($fd, filesize($f)); fclose($fd);
if (strpos($c, $l) == 0) {
theme_usage_message();
die();
}
}
check_theme_footer();
check_theme_header();
function check_theme_header() {
if (!(function_exists("functions_file_exists") && function_exists("theme_footer_t"))) {
theme_usage_message();
die();
}
}
参考资料:http://zhidao.baidu.com/question/132492516.html