当前位置:网站首页>The CTF introduction of PHP file contains
The CTF introduction of PHP file contains
2022-08-02 04:02:00 【SevenCold】
One.php pseudo-protocol execution code
byAs can be seen from the figure, the include function can be triggered only by sending the url variable through the get request. The initial idea was to directly use the file name of the flag, such as flag.php, etc., and then all failed. Then I thought of the file inclusion vulnerability and exploited phpPseudo agreement.
https://blog.csdn.net/yao_xin_de_yuan/article/details/108326427 php pseudoProtocol introduction
There are two methods here:
1.url=data://text/plain, Find directory by wildcardAll files under 
Two files were found, ctf_go_go_goThe file is flag
2. Construct url=data:text/plain,")?> Then use a kitchen knife or ant sword to connect.


The connection is successful, just open the relevant file.
2. Log injection
Title and aboveThe same, but using the php pseudo protocol is to find an error, so it should filter php, and then log injection can be performed.The server can ask nginx, so its log directories are /var/log/nginx/access.log and /var/log/nginx/error.log
Therefore construct url=/var/log/nginx/access.log
It is found that the log will record the request method and user-agent. Because the request method cannot be changed, we can insert the php code at the user-agent, and use bp to change the user-agent field to After sending, it is found that the ua in the log file is empty, this is because the php code will run directly and will not be displayed.Then we can use a kitchen knife or ant sword to connect, but pay attention to the url
After entering, just flip through to find the flag.
3.php pseudo-protocol read file

The title url is as shown, because there is no clearPrompt, so you can use the php pseudo-protocol to read the content of the file and take a look
Construct url: ?file=php://filter/read=convert.base64-encode/resource=flag.php

You can see that the file content is encoded by base64, we decode itClick to get the flag
边栏推荐
- 命令执行漏洞
- 12.什么是JS
- Introduction to PHP (self-study notes)
- Summary of php function vulnerabilities
- 文件上传漏洞
- (6) Design of student information management system
- [league/climate] A robust command-line function manipulation library
- The focus of the Dom implementation input triggers
- Praying: 1 vulnhub walkthrough
- Advanced Operations on Arrays
猜你喜欢
随机推荐
hackmyvm-random walkthrough
Alfa: 1 vulnhub walkthrough
Batch replace file fonts, Simplified -> Traditional
1. Beginning with PHP
Kali环境下Frida编写脚本智能提示
敏感信息泄露
PHP入门(自学笔记)
Introduction to PHP (self-study notes)
web安全之目录遍历
DarkHole: 2 vulnhub walkthrough
(2) 顺序结构、对象的布尔值、选择结构、循环结构、列表、字典、元组、集合
[sebastian/diff] A historical change extension library for comparing two texts
Praying: 1 vulnhub walkthrough
MySql Advanced -- Constraints
How to calculate the distance between two points on the earth (with formula derivation)
c语言用栈实现计算中缀表达式
Pycharm packages the project as an exe file
(2) Thinkphp6 template engine ** tag
kali安装IDEA
hackmyvm: may walkthrough




![[sebastian/diff] A historical change extension library for comparing two texts](/img/c7/ea79db7a5003523ece7cf4f39e4987.png)




