当前位置:网站首页>Attack and defense world web master advanced area web_ php_ include
Attack and defense world web master advanced area web_ php_ include
2022-07-29 00:17:00 【Ant200】
Tips : When the article is finished , Directories can be generated automatically , How to generate it, please refer to the help document on the right
Tools
firefox ,burpsuite
analysis

Code audit :
strstr(): Case sensitive
str_replace: Substitution function
Add :
The function prototype :mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] ) Parameter description :$search String to be replaced by search ,$replace The string to replace the search ,$subject String of operations ,&$count Number of replacements , The call function returns in $subject Search for $search Replace with $replace String or array of . In this string of code , take php:// Replace with "", The operation string is $page
Method 1 : Application php://input
reason :php://input It's a read-only stream that can access the requested raw data , Want to know more about this recommendation Blog
Because this can access the original data, we use burpsuite Grab its bag , Modify the order , To achieve our purpose
visit PHP://input

Start the bag.

You can find this package , Input <?php system('ls');?> , This is a php Code ,ls yes linux command

Query the file name

Input <?php system('cat fl4gisisish3r3.php');?>,cat Command details :

obtain flag:$flag="ctf{876a5fca-96c6-4cbd-9075-46f0c89475d2}";

Method 2 :data Fake protocol
data agreement
php5.2.0 rise , The data stream wrapper is starting to work , It is mainly used for reading data streams . If the incoming data is PHP Code , Will execute code usage :data://text/plain;base64,xxxx(base64 Encoded data )data Pseudo agreement only exists in php<5.3 And include=on You can write a Trojan horse .
Namely structure data://text/plain;base64,<?php system("ls")?>(base64 Encrypted value ) Note that there ls Use double quotes
namely data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=


Get the name and continue to encrypt , Note that many after the name should be deleted
data://text/plain;base64,<?php system("cat fl4gisisish3r3.php")?>
Encrypted data://text/plain;base64,PD9waHAgc3lzdGVtKCJjYXQgZmw0Z2lzaXNpc2gzcjMucGhwIik/Pg==
Found that there is no , Open source code , It should be hidden here , obtain flag

Refer to the connection ;
str_replace Function details _wangchaoqi1985 The blog of -CSDN Blog _str_replace
边栏推荐
- Install MySQL using Yum for Linux
- [applet project development -- JD mall] uni app commodity classification page (first)
- Oracle超全SQL,细节狂魔
- Dual for loop optimization
- 2022 network security learning route is very detailed, recommended Learning
- CV semantic segmentation model sketch (2)
- Network traffic monitoring tool iftop
- Web系统常见安全漏洞介绍及解决方案-sql注入
- Okaleido ecological core equity Oka, all in fusion mining mode
- “Method Not Allowed“,405问题分析及解决
猜你喜欢

Geth installation

Leetcode61. rotating linked list

【C】 Reverse string (two recursive ideas)

跳表的原理

SQL实现将多行记录合并成一行

CV target detection model sketch (2)

Leetcode63. Different paths II

Sword finger offer 64. find 1+2+... +n, logical operator short circuit effect

熊市下PLATO如何通过Elephant Swap,获得溢价收益?

Sword finger offer 55 - I. depth of binary tree
随机推荐
ZABBIX 5.0 uses its own redis template for monitoring
SQL实现将多行记录合并成一行
Application of Devops in Internet of things solutions
Oracle create tablespaces and users
Three years after graduation, write to you and me who may be confused [turn]
Solution: direct local.Aar file dependencies are not supported when building an aar
Field injection is not recommended solution
Leetcode64. Minimum path sum
JS advanced ES6 ~ es13 new features
ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
【微服务】Nacos集群搭建以及加载文件配置
SAP temporary tablespace error handling
laptop外接显示器
【C】 Drink soda and find a single dog
Sword finger offer 55 - I. depth of binary tree
Powercli batch add esxi to vCenter
[CNN] Why is the convolution kernel size of CNN usually odd
mysql索引失效的常见9种原因详解
Sword finger offer 41. median in data flow
Es6操作教程
