实验步骤:
Web应用程序文件包含安全攻防
任务环境说明:
服务器场景:WebServ2003(用户名:administrator;密码:空)
服务器场景操作系统:Microsoft Windows2003 Server
服务器场景安装服务/工具1:Apache2.2;
服务器场景安装服务/工具2:Php6;
服务器场景安装服务/工具3:Microsoft SqlServer2000;
服务器场景安装服务/工具4:EditPlus;
网络拓扑:01-WebServ2003--02-AttWinXp
windows server 2003
用户:administrator
密码:空
网络拓扑

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
实战
=========================================================================
访问WebServ2003服务器场景,"/"->" Display Uploaded's File Content",分析该页面源程序,找到提交的变量名,并将该变量名作为Flag(形式:name="变量名")提交;
查看server2003的ip地址

访问2003的http服务

可以使用万能用户、任意密码登录(密码我直接随便按了几个)
' union select * from users--

点击Submit,成功进入。


点击倒数第二个,也就是 Display Uploaded's File Content
右键,查看源文件

找到变量名

本题提交Flag:【 name="filename" 】
=========================================================================
对该任务题目1页面注入点进行渗透测试,通过php://filter协议使当前页面以Base64编码方式回显WebServ2003服务器场景访问日志文件:AppServ/Apache2.2/logs/flag.log的内容,并将注入语句作为Flag提交;
php://filter/read=convert.base64-encode/resource=../Apache2.2/logs/flag.log

本题提交Flag:【php://filter/read=convert.base64-encode/resource=../Apache2.2/logs/flag.log】
=========================================================================
对该任务题目2页面注入点进行注入以后,将当前页面以Base64编码方式回显内容作为Flag提交;

本题提交Flag:
【 V2l0aCBncmVhdCBwb3dlciBjb21lcyBncmVhdCByZXNwb25zaWJpbGl0eS4= 】
=========================================================================
通过PHP函数对题目3中Base64编码回显内容进行解码,并将解码内容作为Flag提交;
输入php://filter/read=convert-encode/resource=../Apache2.2/logs/flag.log
php://filter/read=convert-encode/resource=../Apache2.2/logs/flag.log

本题提交Flag:【 With great power comes great responsibility. 】
进入WebServ2003服务器场景的目录,找到DisplayFileCtrl.php文件,使用EditPlus工具打开并填写该文件中空缺的F1、F2、F3、F4的值,使之可以抵御文件包含渗透测试,并提交Flag(形式:F1|F2|F3|F4);
首先注释下面这段代码

修改上面这段

修改点和参数:
F1:..
F2:strstr
F3:empty
F4:@readfile
修改后:

再次对该任务题目1页面注入点进行渗透测试,验证此次利用该注入点对WebServ2003服务器场景进行文件包含渗透测试无效,并将回显页面源文件内容作为Flag提交;
再次进行渗透

本题提交Flag:
【 Illegal input!</br><a href='DisplayFile.php'>Display Uploaded's File Content</a></br>】
=========================================================================