查看: 1703|回复: 0
收起左侧

[求助] 利用DropMyRights让IE更安全

[复制链接]
yxwxqflbyg
发表于 2007-10-2 15:50:51 | 显示全部楼层 |阅读模式
本人的XP1已测试成功...很安全...
喜欢源码的你赶快收藏起来吧..  
IE的0day满天飞,不过IE的粉丝还是不少地
在舒服地浏览网页的同时,不要忘了合理地规避风险
由于 很多IE的漏洞都会向system32目录下写入文件,都会去终止防火墙,AV。。而所有这些都需要有Administrator权限
基于这点,Michael Howard写了一个降低IE权限的小工具 DropMyRights
原理就是删除用户当前token的一些权限和SID,用处理过的token,去创建新进程,IE,OE,Firefox,FOXMAIL。。。
安装过程:
1.下载 DropMyRights.msi 本文最下方有下载
2.安装之后,把DropMyRights.exe copy到一个"安全的"目录 (设置好acl,不然又会有新的隐患 )
3.创建一个快捷方式,路经的格式类似下面这样:
C:/safeDIR/dropmyrights.exe "c:/program files/internet explorer/iexplore.exe"
4.快捷方式的名字默认是dropmyrights.exe ,最好改一下,搞个IE safe ,IE (non-admin)之类的,以示区别
5.在属性里改个看着舒服点的图标,最好就用IE的
ok了,以后你上网的时候就打开这个快捷方式,去调用ie,不要直接去点原来的IE
不过还有个小问题,一些地方直接调用ie(如MSN)去打开网页的话还是会直接调用原来的iexplore.exe
//当然这个工具实现起来也很简单,下面坐着提供的核心代码
以下是引用片段:
//////////////////////////////////////////////////////////////////////////////////  
DWORD wmain(int argc, wchar_t **argv) {  
  DWORD fStatus = ERROR_SUCCESS;  
  if (2 != argc && 3 != argc) {  
    Usage();  
    return ERROR_INVALID_PARAMETER;  
  }  
  // get the SAFER level  
  DWORD hSaferLevel = SAFER_LEVELID  
_NORMALUSER;  
  if (3 == argc && argv[2]) {  
    switch(argv[2][0]) {  
      case ’C’ :  
      case ’c’ : hSaferLevel = SAFER_LEVELID_CONSTRAINED;  
            break;  
      case ’U’ :  
      case ’u’ :   hSaferLevel = SAFER_LEVELID_UNTRUSTED;  
            break;  
      default :   hSaferLevel = SAFER_LEVELID_NORMALUSER;  
            break;  
    }  
  }  
  // get the command line, and make sure it’s not bogus  
  wchar_t *wszPath = argv[1];  
  size_t cchLen = 0;  
  if (FAILED(StringCchLength(wszPath,MAX_PATH,&cchLen)))  
    return ERROR_INVALID_PARAMETER;  
  SAFER_LEVEL_HANDLE hAuth  
zLevel = NULL;  
  if (SaferCreateLevel(SAFER_SCOPEID_USER,  
                hSaferLevel,  
                0,  
        &hAuthzLevel, NULL)) {  
    // Generate the restricted token we will use.  
    HANDLE hToken = NULL;  
    if (SaferComputeTokenFromLevel(  
        hAuthzLevel,   // SAFER Level handle  
        NULL,       // NULL is current thread token.  
        &hToken,     // Target token  
        0,         // No flags  
        NULL)) {     // Reserved  
      STARTUPINFO si;  
      ZeroMemory(&si, sizeof(STARTUPINFO));  
      si.cb = sizeof(STARTUPINFO);  
      si.lpDesktop = NULL;  
      
      // Spin up the new process  
      PROCESS_INFORMATION pi;  
      if (CreateProcessAsUser(  
        hToken,  
        wszPath, NULL,  
        NULL, NULL,  
        FALSE, CREATE_NEW_CONSOLE,  
        NULL, NULL,   
        &si, &pi)) {  
        &nbs  
p; CloseHandle(pi.hProcess);  
          CloseHandle(pi.hThread);  
      } else {  
        fStatus = GetLastError();  
        fwprintf(stderr,L"CreateProcessAsUser failed (%lu)/n",fStatus);  
      }  
    } else {  
      fStatus = GetLastError();  
    }  
    SaferCloseLevel(hAuthzLevel);  
  } else {  
    fStatus = GetLastError();  
  }  
  return fStatus;  
}
更详细的细节大家可以参考MSDN上的原文
以下是引用片段:

Michael Howard  
Microsoft Security Engineering  
November 15, 2004  
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure11152004.asp
ps:"c:/program files/internet explorer/iexplore.exe"
记得在快捷方式里iexplore.exe的路径加上引号
本文所需软件下载:http://down.wglm.net/Software/Catalog23/633.html
您需要登录后才可以回帖 登录 | 快速注册

本版积分规则

手机版|杀毒软件|软件论坛| 卡饭论坛

Copyright © KaFan  KaFan.cn All Rights Reserved.

Powered by Discuz! X3.4( 沪ICP备2020031077号-2 ) GMT+8, 2024-7-2 11:47 , Processed in 0.124620 second(s), 17 queries .

卡饭网所发布的一切软件、样本、工具、文章等仅限用于学习和研究,不得将上述内容用于商业或者其他非法用途,否则产生的一切后果自负,本站信息来自网络,版权争议问题与本站无关,您必须在下载后的24小时之内从您的电脑中彻底删除上述信息,如有问题请通过邮件与我们联系。

快速回复 客服 返回顶部 返回列表