Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/06/2009, 14:31
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 16 años, 7 meses
Puntos: 139
Respuesta: Códigos maliciosos en url, miedo, ayuda!

Segun en un foro
puedes verificar si tu servidor podria sufrir de este tipo de problema con este codigo.
Código PHP:

if(!isset( $_GET "inyeccion" ])){ 
header "location: ?inyeccion='" ); 
} else { 
    echo 
'Tu servidor ' 
    if( 
$_GET "inyeccion" ] != "'" )echo 'no ' 
    echo 
'tiene problemas de inyección' 

y en caso de que tengas el problema

inyeccion.php

Código PHP:
<? 
// Evitamos la inyeccion SQL 

// Modificamos las variables pasadas por URL 
foreach( $_GET as $variable => $valor ){ 
$_GET $variable ] = str_replace "'" "'" $_GET $variable ]); 

// Modificamos las variables de formularios 
foreach( $_POST as $variable => $valor ){ 
$_POST $variable ] = str_replace "'" "'" $_POST $variable ]); 

?>
Y incluiremos este script en todas las páginas en las que realizemos consultas a la base de datos:

Código PHP:
<? 
// Evitamos la inyeccion SQL 
include 'inyeccion.php' 
// 
// Contenido de la página PHP 
// 
?>