·
miarroba.com
Me hackearon!
 
Índice de subforos · Espacio WEB · PHP
Foros · Noticias · Buscar · Usuarios · Fisgona
Mensaje Autor 
#1 ·
Me hackearon!

Hola amigos, mi problema es urgente, me han hackeado mi upload, necesito un codigo para protejerlo, el codigo php del upload no es mio, yo solo le modifique artas cosas, todos mis codigos dentro de mi upload son:

upload.php:

<?php
$varrand = substr(md5(uniqid(rand())),0,10);  
$varallw = $varallw = array("image/bmp","image/gif","image/jpeg","image/pjpeg","image/png","image /x-png");
$varpath = "
http://xxx.webcindario.com/img/";
$varstat = "";

if ($_POST["action"] == "upload") {
 if (is_uploaded_file($_FILES["imagen"]["tmp_name"])) {
  $varname = $_FILES["imagen"]['name'];
  $vartemp = $_FILES['imagen']['tmp_name'];
  $vartype = $_FILES['imagen']['type'];
  
  if (in_array($vartype, $varallw) && $varname != "") {
   $arrname = explode(".", $varname);
   $varname = $varrand.".".$arrname[1];
   if (copy($vartemp, "img/".$varname)) {
    $varpath = $varpath.$varname;
    $varstat = "ok";
   } else {
    $varstat = "Error al subir el archivo.";
   }
  } else {
   $varstat = "Tipo de archivo no valido.";
  }
 }
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ProUpload ~ Tu hosting de imagenes</title>
<link href="style-def.css" rel="stylesheet" type="text/css" />
<body style="background-color:transparent">
</head>
<body>
<a target="_self" border="0" href="
http://xxx.webcindario.com/upload.php">Inicio</a> |&nbsp;<a border="0" href="http://xxx.webcindario.com/gallery.php">Galeria</a>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="413" height="40"><span style="font-size: small"><strong>Titulo</strong></span></td>
  </tr>
  <tr>
    <td>Tu Hosting de Imagenes</td>
  </tr>
  <tr>
  <form action="upload.php" method="post" enctype="multipart/form-data">
    <td height="50" valign="top">
      <input name="imagen" type="file" id="imagen" size="35" />
      <input name="enviar" type="submit" id="enviar" value="Subir Imagen" />
   <input name="action" type="hidden" value="upload" />   </td>
 </form>
  </tr>
  <td>Maximo peso: 1 MB.<br />
  Tipos de archivos: jpg,jpeg,png,gif,bmp.</td>
  <?php if ($varstat == "ok") { ?>
  <tr>
    <td><img alt="" src="linea.png" /><br /><strong>Confirmaci&oacute;n:</strong><br>
 Archivo subido satisfactoriamente. Puedes utilizar las siguientes opciones para enlazarlo:<br>
 <strong>Enlace Directo:</strong><br>
 <input name='txt1' type='text' onClick="javascript:select();" value='<?php echo $varpath; ?>' size='60'>
 <br>
 <strong>Enlace Para ver la IMG:</strong><br>
 <input name='txt2' type='text' onClick="javascript:select();" value='http://xxx.webcindario.com/view.php?image=<?php echo $varname; ?>' size='60'>
 <br>
 <strong>Enlace HTML:</strong><br>
 <input name='txt3' type='text' onClick="javascript:select();" value='<a href="
http://xxx.webcindario.com/view.php?image=<?php echo $varname; ?>"><img src="<?php echo $varpath; ?>" border="0" /></a>' size='60'>
 <br>
 <strong>Enlace BBCode:</strong><br>
 <input name='txt4' type='text' onClick="javascript:select();" value='[URL=http://xxx.webcindario.com/view.php?image=<?php echo $varname; ?>][img]<?php echo $varpath; ?>[/img][/URL]' size='60'></td>
  </tr>
  <?php } else { ?>
   <?php if ($varstat != "") { ?>
   <tr>
  <td><img alt="" src="linea.png" /><br /><strong>Error:</strong><br>
     <?php echo $varstat; ?></td>
   </tr>
   <?php } ?>
  <?php } ?>
</table>
<?php if ($varstat == "ok") { ?>
<p align="center"><br /><span style="font-size: 1px">&nbsp;</span><a target="_blank" href="<?php echo $varpath; ?>"><img alt="<?php echo $_GET['image']; ?>" height="100" src="img/<?php echo $varname; ?>"></a></p>
<?php } ?>
<?php if ($_GET['image'] != "") { ?>
<p align="center"><br /><span style="font-size: 1px">&nbsp;</span><a target="_blank" href="<?php echo $varpath; ?>"><img alt="<?php echo $_GET['image']; ?>" height="100" src="img/<?php echo $_GET['image']; ?>"></a></p>
<?php } ?>
</body>
</html>

gallery.php:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ProUpload ~ Tu hosting imagenes</title>
<link href="style-def.css" rel="stylesheet" type="text/css" />
<body style="background-color:transparent">
</head>
<body>
<a target="_self" border="0" href="
http://xxx.webcindario.com/upload.php">Inicio</a> |&nbsp;<a border="0" href="http://xxx.webcindario.com/gallery.php">Galeria</a>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="413" height="40"><span style="font-size: small"><strong>Titulo</strong></span></td>
  </tr>
  <tr>
    <td>Tu Hosting de Imagenes<br /><img alt="" src="linea.png" /><br /><strong>Galeria de Imagenes:</strong><br>
 Las imagenes que usted puede ver son propiedad de los usuarios que han publicado esta imagenes en ProUpload.<br></td>
</tr>
  <tr>
    <td>
<?php
 if ($gestor = opendir('img')) {
     while (false !== ($arch = readdir($gestor))) {
     if ($arch != "." && $arch != "..") {
      echo "<a href="view.php?image=".$arch."" class="linkli">".$arch."</a><br />";
     }
     }
     closedir($gestor);
 }
?>
  </td>
  </tr>

view.php:

<?php
$varrand = substr(md5(uniqid(rand())),0,10);  
$varallw = $varallw = array("image/bmp","image/gif","image/jpeg","image/pjpeg","image/png","image /x-png");
$varpath = "
http://xxx.webcindario.com/img/";
$varstat = "";

if ($_POST["action"] == "upload") {
 if (is_uploaded_file($_FILES["imagen"]["tmp_name"])) {
  $varname = $_FILES["imagen"]['name'];
  $vartemp = $_FILES['imagen']['tmp_name'];
  $vartype = $_FILES['imagen']['type'];
  
  if (in_array($vartype, $varallw) && $varname != "") {
   $arrname = explode(".", $varname);
   $varname = $varrand.".".$arrname[1];
   if (copy($vartemp, "img/".$varname)) {
    $varpath = $varpath.$varname;
    $varstat = "ok";
   } else {
    $varstat = "Error al subir el archivo.";
   }
  } else {
   $varstat = "Tipo de archivo no valido.";
  }
 }
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ProUpload ~ Tu hosting de imagenes</title>
<link href="style-def.css" rel="stylesheet" type="text/css" />
<body style="background-color:transparent">
</head>
<body>
<a target="_self" border="0" href="
http://xxx.webcindario.com/upload.php">Inicio</a> |&nbsp;<a border="0" href="http://xxx.webcindario.com/gallery.php">Galeria</a>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="413" height="40"><span style="font-size: small"><strong>Titulo</strong></span></td>
  </tr>
  <tr>
    <td>Tu Hosting de Imagenes</td>
  </tr>
  <?php if ($varstat == "") { ?>
  <tr>
    <td><img alt="" src="linea.png" /><br /><strong>Ver la Imagen:</strong><br>
 Archivo alojado gratis en xxx. Puedes utilizar las siguientes opciones para enlazarlo:<br>
 <strong>Enlace Directo:</strong><br>
 <input name='txt1' type='text' onClick="javascript:select();" value='http://xxx.webcindario.com/img/<?php echo $_GET['image']; ?>' size='60'>
 <br>
 <strong>Enlace Para ver la IMG:</strong><br>
 <input name='txt2' type='text' onClick="javascript:select();" value='http://xxx.webcindario.com/view.php?image=<?php echo $_GET['image']; ?>' size='60'>
 <br>
 <strong>Enlace HTML:</strong><br>
 <input name='txt3' type='text' onClick="javascript:select();" value='<a href="
http://xxx.webcindario.com/view.php?image=<?php echo $_GET['image']; ?>"><img src="http://xxx.webcindario.com/img/<?php echo $_GET['image']; ?>" border="0" /></a>' size='60'>
 <br>
 <strong>Enlace BBCode:</strong><br>
 <input name='txt4' type='text' onClick="javascript:select();" value='[URL=http://xxx.webcindario.com/view.php?image=<?php echo $_GET['image']; ?>][img]http://xxx.webcindario.com/img/<?php echo $_GET['image']; ?>[/img][/URL]' size='60'></td>
  </tr>
  <?php } else { ?>
   <?php if ($varstat != "") { ?>
   <tr>
  <td><img alt="" src="linea.png" /><br /><strong>Error:</strong><br>
     <?php echo $varstat; ?></td>
   </tr>
   <?php } ?>
  <?php } ?>
</table>
<?php if ($varstat == "ok") { ?>
<p align="center"><br /><span style="font-size: 1px">&nbsp;</span><a target="_blank" href="img/<?php echo $_GET['image']; ?>"><img alt="<?php echo $_GET['image']; ?>" height="100" src="img/<?php echo $_GET['image']; ?>"></a></p>
<?php } ?>
<?php if ($_GET['image'] != "") { ?>
<p align="center"><br /><span style="font-size: 1px">&nbsp;</span><a target="_blank" href="img/<?php echo $_GET['image']; ?>"><img alt="<?php echo $_GET['image']; ?>" height="100" src="img/<?php echo $_GET['image']; ?>"></a></p>
<?php } ?>

Espero que me ayuden es urgente, gracias!


tHeEkiZdeHtHeEkiZdeH
Usuario habitual
Usuario habitual

Mensajes: 20
Desde: 19/Jul/2009
18/Oct/2009 22:51 GMT+1
#2 ·
RE: Me hackearon!

Si el codigo del upload no es tuyo, que problema hay?. Tu modificastes ciertas cosas pero de ese uploader que no es tuyo. Sigo sin entender lo del "hackeo" y el motivo de cabreo ...Saludos.


aerialss88aerialss88
Machacateclados
Machacateclados

Haz clic para ver el perfil del usuario
Mensajes: 269
Desde: 13/Ene/2009
18/Oct/2009 23:52 GMT+1
#3 ·
RE: Me hackearon!

Te hackearon pero estas mostrando tu codigo a todo el mundo


jony-8000jony-8000
Usuario habitual
Usuario habitual

Mensajes: 23
Desde: 09/Nov/2008
04/Nov/2009 02:04 GMT+1
#4 ·
RE: Me hackearon!

Creo que estas Jodido , ademas no muestres el cogido de esa manera xD , yo tu haria mi propio codigo !!!

 

Te ayudo si quieres

 

Salu2


Yamil_RodriguezYamil_Rodriguez
Usuario Novato
Usuario Novato

Mensajes: 2
Desde: 16/Nov/2009
16/Nov/2009 15:10 GMT+1
Índice de subforos · Espacio WEB · PHP
Temas similares
Asunto Autor#VisitasÚltima respuesta
Me Hackearon!!! Desde la web.05/Ago/2009, 00:14
anarmohuanarmohu
221305/Ago/2009, 20:27
anarmohuanarmohu Ir al último mensaje del tema
Opciones:
Versión imprimible del tema
Subscríbete a este tema
Date de baja de este tema
Ir al subforo:  

TU NO PUEDES Escribir nuevos temas en este foro
TU NO PUEDES Responder a los temas en este foro
TU NO PUEDES Editar tus propios mensajes en este foro
TU NO PUEDES Borrar tus propios mensajes en este foro
Todas las fechas y horas son GMT+1. Ahora son las 19:39
Miarroba Networks, S.L. C/ 18 de Julio, 21 Bajo, 39610 Astillero (CANTABRIA) - CIF B-39512736
Inscrita en el Registro Mercantil de Cantabria, tomo 743, folio 161, libro 0, hoja S-12428, Inscripción 1ª