Last active
November 5, 2015 08:32
-
-
Save ts0818/d5a3a8cafa45cfd32ebb to your computer and use it in GitHub Desktop.
パーフェクトPHP パス・ディスクロージャ
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 | |
/** | |
* このプログラムは脆弱性のサンプルです。 | |
* 公開サーバに設置しないでください | |
*/ | |
// GET変数で指定があった場合は、出力する$string変数にセット | |
if (isset($_GET['string']) === true) { | |
$string = $_GET['string']; | |
} else { | |
$string = ''; | |
} | |
// $string変数をエスケープして出力 | |
echo htmlspecialchars($string, ENT_QUOTES, 'utf-8'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment