当前位置:网站首页>[Code Audit] - PHP project class RCE and files include download and delete
[Code Audit] - PHP project class RCE and files include download and delete
2022-08-09 19:32:00 【haoaaao】
[Xiaodi Security] Day52 Code Audit-PHP project RCE and filesIncluding download and delete - BilibiliClick to view the full text>
https://www.bilibili.com/read/cv15169189?spm_id_from=333.999.0.0
0x00 knowledge point
1. Vulnerability keywords
#SQL Injection:
---select insert update mysql_query mysqli etc.
#File upload:
---$_FILES, type="file", upload, move_uploaded_file(), etc.
#XSS Cross-Site:
---print print_r echo sprintf die var_dump var_export etc.
#The file contains:
---include include_once require require_once etc.
#Code execution:
---eval assert preg_replace call_user_func call_user_func_array etc.
#Command execution:
---system exec shell_exec `` passthru pcntl_exec popen proc_open
#Variable override:
---extract() parse_str() importrequestvariables() $$ etc.
#Deserialization:
---serialize() unserialize() __construct __destruct etc.
#Other vulnerabilities:
---unlink() file_get_contents() show_source() file() fopen() etc.
2. General keywords
---$_GET,$_POST,$_REQUEST,$_FILES,$_SERVER etc.
---There may be loopholes in function point or keyword analysis
---Capture the package or search for keywords to find the source of the code and the corresponding file
---Track the filtered or accepted data function, and find the place where this function or code is triggered to trigger the test
http://192.168.0.102:91/?r=../../index.txt%00
http://192.168.0.102:94/admin/save.php?act=delfile
path=/upload/../install/install.lock
0x01 Case Ideas
1, xhcms-frameless-file includes cross-site-search or application-include
Overall ideas
///Analysis of general applications and url addresses may contain xss and security vulnerabilities
Capture the package to find the xss unfiltered code block and the file contains a suffix to bypass the code block
(See the link for the specific analysis process [Xiaodi Security] Day52 code audit - PHP project class RCE and file contains download and delete - Bilibili)
2, earmusic-frameless-file download-search or application function-down, etc.
Overall ideas
---Judging by application analysis or search that there may be file download operations
---Capture and analyze the download address to find the corresponding code block, the file download address is controlled by $file
---$file is known from the database query statement, tracking where such data can be updated or changed
---Try to modify the discovery filter, track the filter mechanism to analyze and bypass, and use the full path address to bypass
Analysis steps:
Enter the shooting range and observe the function
---Here is a possible loophole from the function of the member center:
There is a file download vulnerability in music download;
There is a file upload vulnerability in avatar and music upload;
Personal information modification may have SQL injection vulnerabilities;
Logs, footers may have XSS vulnerabilities;
There may be some other loopholes in the api to view the call;
View the packet transmission format, etc.
---According to the function of the website, take guesses about possible loopholes: biased towards social networking, injection, XSS more; music download, file download, upload loopholes more;
---Two ideas for file download vulnerability mining here:
(1) Functional test based on file download
(2) Search for related functions and keywords of file download and then capture and analyze the package
(3) Track the filtered or accepted data function, and find the place where this function or code is triggered to trigger the test
3, zzzcms-frameless-file delete RCE-search or apply-unlink,eval
Overall ideas
---File delete search keyword unlink, corresponding to the function del_file, see where this is called
---Background delfile function call, how to punish the delfile function, controlled by parameters, test
---The code executes the search keyword eval, the corresponding configuration template parses the file, and sees where this is called
---It is judged that the template file can be modified in the background, the template file is triggered in the foreground, and the payload is constructed for testing
Analysis steps:
---File deletion is generally used for white box auditing, you can delete the install.lock file
(For specific steps, see the link [Xiaodi Security] Day52 code audit - PHP project class RCE and file contains download and delete - Bilibili)
边栏推荐
猜你喜欢
Redis 定长队列的探索和实践
MASA Stack 第三期社区例会
WPF 实现柱形统计图
Sigrity PowerSI Characteristic Impedance and Coupling Simulation
.NET Community Toolkit 8.0.0 版本发布
How to adjust futures account opening process and handling fee
B45 - 基于STM32单片机的家庭防火防盗系统的设计
MySQL的索引你了解吗
110+ public professional datasets summarized
A48基于NRF24L01的无线心率血氧体温检测
随机推荐
【代码审计】——PHP项目类RCE及文件包含下载删除
dotnet 6 为什么网络请求不跟随系统网络代理变化而动态切换代理
测试/开发程序员喜欢跳槽?跳了就能涨工资吗?
Lagrange插值公式matlab实现
AlphaControls 控件 TsPanel TsGroupBox 块与组的结合
在 C# 中如何检查参数是否为 null
dichotomy
2.1、基于并行上下文注意网络的场景文本图像超分辨率
期货开户应该了解的行内知识
什么是控制板定制开发?
crm系统哪家好?好用的crm管理系统推荐
什么是硬件集成开发?硬件集成开发的核心有哪些?
央企施工企业数字化转型的灵魂是什么
现在,怎么挑选舞台租赁LED显示屏?
PADS生成位号图
3 Feature Binning Methods!
Print the star chart "Recommended Collection"
JMeter笔记6 | JMeter录制(配置代理)
物联网的作用和发展方向
程序员的专属浪漫——用3D Engine 5分钟实现烟花绽放效果