当前位置:网站首页>Ctfshow question making web module web11~web14
Ctfshow question making web module web11~web14
2022-07-28 21:13:00 【Goodric】
ctfshow Problem. web modular web11~web14
——
web11
Open the environment , You can enter the password to log in .
And gives the source code , Filter these characters :
$regex = “/(select|from|where|join|sleep|and|\s|union|,)/i”;
When this condition is met , Output flag :
if($password==$_SESSION['password']){
echo $flag;

F12 Put PHPsession Get rid of the value of , Become empty .
Then log in without entering a password , Reach the value of password and session The values are equal , obtain flag .
——
——
web12
Open the environment , There is nothing on the interface , F12 Look at the source code for tips get The ginseng ?cmd=
test cmd Parameter effect :
?cmd=phpinfo();
See echo , The explanation can be in cmd Construct statements on the value of to execute commands .
Originally wanted to use system() Command of function :system(‘ls’) To read the existing file name , But this statement page has no echo .
Use here scandir() Function to view the files in the directory .
Construction statement :
?cmd=print_r(scandir(‘./’));
Get a long file name .
Another function can also read directory files : glob() function .
Such as :
glob("*") Match any file ;
glob("*.txt") Match with txt A file with a suffix .
So you can also use sentences :
?cmd=print_r(glob(“*”));
Show back the long file name in front .
Get the file name , Next, let's look at the contents of this document , Wanted to “url/ file name ” Direct view , however php The document doesn't seem to read , If it is .txt The document should be directly viewable .
So we need show_source() function : On the file PHP Syntax highlight .
sentence :
?cmd=show_source(“903c00105c0141fd37ff47697e916e53616e33a72fb3774ab213b3e2a732f56f.php”);
or
?cmd=highlight_file(“903c00105c0141fd37ff47697e916e53616e33a72fb3774ab213b3e2a732f56f.php”);
show_source The function is highlight_file() Alias for function
obtain flag .
——
——
web13
Open the environment , It is the question type of file upload .
First, simply try to pass .php In a word, Trojans , The echo : error file zise , The back end has restrictions on file suffixes . Passed a lot , It's no use .
Here is a source file ,upload.php.bak , Visit to download .
Source code requirements , The size of the file should be less than or equal to 24, The length of the name is less than or equal to 9, The suffix length is less than or equal to 3, And the file name and suffix of the uploaded file cannot contain php The word .
The method of this problem should be to analyze the file .
First write a sentence into 1.txt In the text ,
Upload again **.user.ini** file
.user.ini It is PHP Support per directory INI File configuration , And if your PHP Run in a modular way Apache in , Then use .htaccess Files have the same effect .
The content is
auto_prepend_file=1.txt

auto_prepend_file Is to set the header and footer , You can ensure that they are loaded before and after each page .
Use these instructions to include files like include() Statement contains the same file .
With this conditional command . We can execute 1.txt Content. .
Then upload these two files .
After uploading , First use ?a=phpinfo(); test , See that you can successfully access .
Now you can use parameters a It's working .
Look at all the files in the directory :
?a=system(‘ls’);
or
a=print_r(glob(“*”));

After seeing all the files , You can view the contents of the specified file .
a=highlight_file(‘903c00105c0141fd37ff47697e916e53616e33a72fb3774ab213b3e2a732f56f.php’);
obtain flag .
——
——
web14
Open the environment , The page displays a string of codes .
The content of the source code is get The ginseng c , also c The value of sleep() Within the function , That is, what is the value , The page will sleep for how many seconds .
And different value pages will echo different contents , There are some characters ’@[email protected]‘ , There are some characters '$url ’ , Correctly, it should echo variables $url .
Pass in ?c=3 when , Get a file name .
Access this file , Is a query page , Click to query the content in url Parameters of query It shows that .
Therefore, it is concluded that the parameter query After the sql Inject .
F12 You can see that many characters are filtered in the query statement , Yes information_schema ,.tables, .columns, linestring , Space ,polygon/is .
Try first 
Execute statement , Space with /**/ Instead of , The echoed content will pop up JavaScript Mode appears .
Here we use burp Convenient view .
Try to check the data block version first :
?query=-1/**/union/**/select/**/version()
Statement executed successfully , Get the version number 10.2.26-MariaDB-log
use load_file() Function to access the file you saw at the beginning of a string of code just before opening the environment secret.php :
?query=-1/**/union/**/select/**/load_file('/var/www/html/secret.php')
secret.php The content shows that ,flag In another file /real_flag_is_here in .
The same access /real_flag_is_here file :
?query=-1/**/union/**/select/**/load_file('/real_flag_is_here')
obtain flag .
边栏推荐
- A 58 year old native of Anhui Province, he has become the largest IPO investor in Switzerland this year
- C language function program example (super complete)
- 什么是“安全感”?沃尔沃用它自己独特的理解以及行动来告诉你
- Eureka registers with each other, only showing each other or only showing problems in one
- Nacos principle
- 实习日记第一周
- Tested interviewed Zuckerberg: reveal more details of four VR prototypes
- SharkTeam完成Flow生态NFT市场MatrixMarket的安全审计
- setPreviewCallbackWithBuffer的出帧效率会变低
- 58岁安徽人,干出瑞士今年最大IPO 投资界
猜你喜欢

Nacos 原理

【云原生】什么是 CI/CD ? | 摆平交付障碍的 CI/CD

New development of letinar in Korea: single lens 4.55G, light efficiency up to 10%

DeiT:注意力Attention也能蒸馏

Efficientformer: lightweight vit backbone
![[tidb] importing TXT documents into the database is really efficient](/img/2a/d33849987a75c4a0d52d8f0ab767ca.png)
[tidb] importing TXT documents into the database is really efficient

Moco V1: the visual field can also be self supervised

How does lazada store make up orders efficiently? (detailed technical explanation of evaluation self-supporting number)

Integrating database Ecology: using eventbridge to build CDC applications

Ctfshow network lost track record (2)
随机推荐
MobileViT:挑战MobileNet端侧霸主
BUUCTF做题Upload-Labs记录pass-01~pass-10
Interpretation of netappp SP sensors output content
The EMC vnx5200 fault light is on, but there is no hardware fault prompt
Deit: attention can also be distilled
Nacos principle
如何度量软件架构
ctfshow 网络迷踪做题记录(1)
Moco V2: further upgrade of Moco series
微服务架构下的系统集成
【题目】两数相加
Cobal Strike的学习与使用
mysql梳理复习内容--附思维导图
Eureka registers with each other, only showing each other or only showing problems in one
使用缓冲的方式采集视频
Job CE
[Topic] add two numbers
Explain the camera in unity and its application
How to build internal Wikipedia
详细讲解C语言12(C语言系列)