Created
November 5, 2015 08:07
-
-
Save ts0818/34db844ef89dcdb412f6 to your computer and use it in GitHub Desktop.
パーフェクトPHP eval攻撃対応方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'こたんたにたちたわた、世界!'; | |
// 入力された文字列が$string変数に含まれている場合だけ処理を行う | |
if (strpos($string, $_GET['keyword']) !== false) { | |
eval("echo htmlspecialchars(str_replace('".$_GET['keyword']. | |
"','', '".$string."'), ENT_QUOTES, 'UTF-8');"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment