当前位置:网站首页>[wustctf2020] plain
[wustctf2020] plain
2022-07-16 05:42:00 【Bnessy】

Nothing , Directory scan found robots.txt
After the visit , Tell me , This is not flag,emmmm
Grab a bag and have a look , Find out fl4g.php
Access to the source code
<?php
header('Content-type:text/html;charset=utf-8');
error_reporting(0);
highlight_file(__file__);
//level 1
if (isset($_GET['num'])){
$num = $_GET['num'];
if(intval($num) < 2020 && intval($num + 1) > 2021){
echo " I inadvertently looked at my Rolex , I don't want to see the time , Just want to inadvertently , Let you know I'm better than you .</br>";
}else{
die(" Money can't solve the essential problem of the poor ");
}
}else{
die(" Go to Africa ");
}
//level 2
if (isset($_GET['md5'])){
$md5=$_GET['md5'];
if ($md5==md5($md5))
echo " Think of this CTFer Get flag after , grateful , Run to Donglan bank , Find a restaurant , Get the chef out of here , Stir fry two special dishes by yourself , Pour a glass of white wine in bulk , How to get rich , Don't be a little violent .</br>";
else
die(" I quickly called my fair weather friend , He made a phone call , Put his family in Africa ");
}else{
die(" Go to Africa ");
}
//get flag
if (isset($_GET['get_flag'])){
$get_flag = $_GET['get_flag'];
if(!strstr($get_flag," ")){
$get_flag = str_ireplace("cat", "wctf2020", $get_flag);
echo " Think of it here. , I'm full and happy , The happiness of rich people is often so simple and unadorned , And it's boring .</br>";
system($get_flag);
}else{
die(" It's almost Africa ");
}
}else{
die(" Go to Africa ");
}
?>
Take a general look at , There are three places to bypass
- level 1
if (isset($_GET['num'])){
$num = $_GET['num'];
if(intval($num) < 2020 && intval($num + 1) > 2021){
echo " I inadvertently looked at my Rolex , I don't want to see the time , Just want to inadvertently , Let you know I'm better than you .</br>";
}else{
die(" Money can't solve the essential problem of the poor ");
}
}else{
die(" Go to Africa ");
}
num To be less than 2020, To be satisfied again num+1 Greater than 2021, Here we need to make use of intval Function intval: Get the integer value of the variable , If intval The function parameters are filled in the string of scientific counting method , Will e The preceding number is used as the return value for scientific counting + The number will return the string type
Pass in num=1e4 Successfully bypassed 
- level 2
if (isset($_GET['md5'])){
$md5=$_GET['md5'];
if ($md5==md5($md5))
echo " Think of this CTFer Get flag after , grateful , Run to Donglan bank , Find a restaurant , Get the chef out of here , Stir fry two special dishes by yourself , Pour a glass of white wine in bulk , How to get rich , Don't be a little violent .</br>";
else
die(" I quickly called my fair weather friend , He made a phone call , Put his family in Africa ");
}else{
die(" Go to Africa ");
}
Need to find a value ,MD5 Before encryption and MD5 After encryption, the value is the same , What we use here is ==, Weak type comparison , Then find a value that is 0e start ,MD5 After encryption, it's also 0e Just the beginning :0e215962017
- get flag
if (isset($_GET['get_flag'])){
$get_flag = $_GET['get_flag'];
if(!strstr($get_flag," ")){
$get_flag = str_ireplace("cat", "wctf2020", $get_flag);
echo " Think of it here. , I'm full and happy , The happiness of rich people is often so simple and unadorned , And it's boring .</br>";
system($get_flag);
}else{
die(" It's almost Africa ");
}
}else{
die(" Go to Africa ");
}
Will the incoming $get_flag Execute as an order , But the spaces are filtered , And will put cat Replace with wctf2020
Space use $IFS$1 To bypass ,cat No use , Then use nl, First ls See if there is flag file 
It should be this fllllllllllllllllllllllllllllllllllllllllaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaag
Read and have a look 
边栏推荐
- Buuctf backdoor killing
- Steps for JS parsing engine to execute JS code
- [yellow code] PHP saves remote resources locally
- [2021] node连接oracle数据库示例[使用oracle官方组件]
- 40.js--同名标识符提升问题
- [Huang ah code] fastadmin accesses wechat payment and Alipay payment
- 千亿参数的广告模型,是怎样炼成的?
- 组件化编程之组件基础
- 【黄啊码】PHP将远程资源保存到本地
- Svelte 官方入门教程(1)—— 简介
猜你喜欢
随机推荐
[node] node create server +mysql store data minimalist demo
38.js--原型练习案例(校招面试题)
BUUCTF webshell后门
Component foundation of component-based programming
BUUCTF 神秘龙卷风
[yellow code] PHP saves remote resources locally
Ant Design upload component custom upload
Sécurité des réseaux intervention d'urgence - technologie de collecte de données électroniques
网络安全应急响应-电子数据取证技术
Single file component
【黄啊码】MySQL入门—1、SQL 的执行流程
[Huang ah code] fastadmin accesses wechat payment and Alipay payment
Understanding service governance in distributed development
Clues in buuctf packets
Implementation principle of new keyword in JS
37.js--对象的成员操作和原型对象的操作(主要是相关程序举例)
js中new关键字的实现原理
Svelte 官方入门教程(4)—— 模板逻辑
BUUCTF 数据包中的线索
[2021] node连接oracle数据库示例[使用oracle官方组件]





![[Huang ah code] wechat applet +php realizes instant messaging chat function](/img/c4/d571f10588b7b4679105f9552bb727.png)



