Created
November 5, 2015 08:29
-
-
Save ts0818/43bd34d24c1881f3d7c8 to your computer and use it in GitHub Desktop.
パーフェクトPHP コマンド実行攻撃(Command Injection)
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 | |
/** | |
* このプログラムは脆弱性のサンプルです。 | |
* 公開サーバに設置しないでください | |
*/ | |
// 一覧を出力するディレクトリを$dir変数にセット | |
if (isset($_GET['dir']) === true) { | |
$dir = $_GET['dir']; | |
} else { | |
$dir = '/'; | |
} | |
// ディレクトリ内のファイル一覧を出力 | |
echo "<pre>"; | |
system('ls -la ' . $dir); | |
echo "</pre>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment