| 26 | |
| 2009.12 |
相信大部分用过Everything的朋友们都再也离不开它了,我也一样。作为一个现今已不多见的“键盘流”,日常的大部分程序我基本都直接从Everything中启动,少了纷乱的快捷方式,桌面也清爽了不少。
Everything由于核心原理建立在NTFS的底层机制上,所以在Vista/Win7中不可避免的必须以提升的权限运行(UAC),不过这对与大多数PC玩家来说早已不算什么障碍。但你是否留意过,通过Everything启动的任何程序或打开的任何文件,也都继承了其拥有的提升权限,这对于重度依赖它的玩家来说,却是一个非常致命的隐患。当你从Everything中启动了Total Commander,又从Total Commander中启动其它应用,这整个程序链全都跑在不受约束的管理员权限下,对系统安全构成了严重的威胁。
那么,如何才能避免这种权限提升的传递呢?
好在Everything本身提供了非常全面的扩展机制,只要修改其everything.ini文件就可以修补这个安全漏洞了。打开ini文件,搜索“%1”便可以找到用于Everything启动其它程序的选项将其修改为:
explore_folder_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "%SystemRoot%\explorer.exe" /n,/e,"%1")
explore_folder_path_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "%SystemRoot%\explorer.exe" /n,/e,/select,"%1")
open_file_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "%1")
open_folder_path_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "%SystemRoot%\explorer.exe" /n,/e,"$parent(%1)")
open_folder_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "%SystemRoot%\explorer.exe" /n,/e,"%1")
如果你用的是Total Commander作为文件管理器,那么后两行需要改为:(别忘了把“X:\TotalCmd”替换为Total Commander的实际路径)
open_folder_path_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "X:\TotalCmd\TotalCmd.EXE" /t /o /r="$parent(%1)")
open_folder_command=$exec("%SystemRoot%\System32\runas.exe" /trustlevel:0x20000 "X:\TotalCmd\TotalCmd.EXE" /t /o /r="%1")
经过上述修改后,你再从Everything中启动的程序或打开的文件,就只有正常的受限权限了。但由于Windows自带的“runas.exe”使用console方式运行,会在启动瞬间弹出一个一闪即逝的“黑窗口”。如果你不习惯的话,可以去下载一个“Hidden Start”,然后将上述ini文件中的内容替换为:
explore_folder_command=$exec("X:\hstart.exe" /nonelevated ""%SystemRoot%\explorer.exe" /n,/e,"%1"")
explore_folder_path_command=$exec("X:\hstart.exe" /nonelevated ""%SystemRoot%\explorer.exe" /n,/e,/select,"%1"")
open_file_command=$exec("X:\hstart.exe" /d="$parent(%1)" /nonelevated "%1")
open_folder_path_command=$exec("X:\hstart.exe" /nonelevated ""%SystemRoot%\explorer.exe" /n,/e,"$parent(%1)"")
open_folder_command=$exec("X:\hstart.exe" /nonelevated ""%SystemRoot%\explorer.exe" /n,/e,"%1"")
或对于Total Commander:(别忘了把“X:\TotalCmd”替换为Total Commander的实际路径,“X:\HStart”替换为Hidden Start的实际路径)
open_folder_path_command=$exec("X:\HStart\HStart.exe" /nonelevated ""X:\TotalCmd\TotalCmd.EXE" /t /o /r="$parent(%1)"")
open_folder_command=$exec("X:\HStart\HStart.exe" /nonelevated ""X:\TotalCmd\TotalCmd.EXE" /t /o /r="%1"")
2010.6.25 更新: open_file_command 配置中给 hstart.exe 增加 /d 参数指定程序的启动路径为程序所在位置。

先祝老大新年快乐!
明天下载试一试这个是啥东西,我不用Total Commander,就不用修改了吧?
Reply
oasisfeng Reply:
January 2nd, 2010 at 10:01 AM
也需要修改,用不针对Total Commander的部分。
Reply
我最近在重玩台服的軒網 那個轩网·异眼我找很久也找不到 請問可以給我嗎?
Reply
在win7用里改了上面的语句,在everything内打开文件只是闪了一下黑框就没反应,感觉结果是只单独运行了”%SystemRoot%\System32\runas.exe”这一段,后面跟的trustlevel参数跟”%1″都没有发生作用,请问系统环境还有什么要修改的吗?
Reply
oasisfeng Reply:
March 6th, 2010 at 6:46 PM
trustlevel后面的数值可能因系统环境而异,请用“runas /showtrustlevels”找到在你的环境里可用的level数值。
Reply
abc Reply:
March 6th, 2010 at 8:27 PM
showtrustlevels结果只有一个0×20000 ,这方面应该没有不同。
在cmd里运行runas /turstlevel:0X20000 能作用,everything里面调用就有问题。
Reply
[PINGBACK] | 2010.7.8 1:22 PM
[...] Oasis Feng 原文:《安全的使用Everything》。 [...]
我用的不是administrator账户,修改后用everthing打开安装程序提示必须以administrator登陆才行。请指教。谢谢
Reply
oasisfeng Reply:
July 13th, 2010 at 9:58 AM
你是采用runas还是hstart的方式?前者可能需要你先用“runas /showtrustlevels”找到在你的环境里可用的level数值;后者应该不存在这个问题。
Reply
win7和搜索和使用已经很方便了,TC和everything基本已经淡出视线了。。。
Reply
这篇文章很重要。的确everything存在这样的问题。谢谢提醒
Reply
我不由自主地想起了linux,win什么时候搞个fork出来就好了
Reply
我也是Everything忠实用户
Reply
我的W7 64bit照文章的内容修改不对 runas.exe路径已经改成%SystemRoot%\SysWOW64\runas.exe
Reply
nMare Reply:
July 14th, 2010 at 10:18 PM
估计是因为win7 64bit的explorer.exe参数变了
Reply
nMare Reply:
July 14th, 2010 at 11:33 PM
刚刚的想法是错的
又有点新的想法
explore_folder_command=$exec(“%SystemRoot%\explorer.exe” /n,/e,”%1″)
explore_folder_path_command=$exec(“%SystemRoot%\explorer.exe” /n,/e,/select,”%1″)
open_folder_path_command=$exec(“%SystemRoot%\explorer.exe” /select,”%1″)
open_file_command=$exec(“%SystemRoot%\SysWOW64\runas.exe” /trustlevel:0×20000 “%1″)
open_folder_command=$exec(“%1″
Reply
oasisfeng Reply:
July 14th, 2010 at 10:52 PM
理论上Win7 x64的System32文件夹应该会自动映射到SysWOW64下吧?也就是说在SysWOW64下能找到的文件应该也能在System32下看到。
Reply
nMare Reply:
July 15th, 2010 at 8:19 AM
确实
explore_folder_command=$exec(“%SystemRoot%\explorer.exe” /n,/e,”%1″)
explore_folder_path_command=$exec(“%SystemRoot%\explorer.exe” /n,/e,/select,”%1″)
open_folder_path_command=$exec(“%SystemRoot%\explorer.exe” /select,”%1″)
open_file_command=$exec(“%SystemRoot%\SysWOW64\runas.exe” /trustlevel:0×20000 “%1″)
open_folder_command=$exec(“%1″)
我觉得应该照这样修改 你用高权限打开explorer.exe,也不会有权限的问题
Reply
Win7下,Everything不能在电脑启动后自动运行,因为它要管理员权限。即使把它放到自动运行中,也不行。请问有什么解决办法没?
Reply
oasisfeng Reply:
July 16th, 2010 at 12:53 AM
用“管理工具 – 任务计划程序”可以自动启动需要管理员权限的软件。
Reply
sinojelly Reply:
July 17th, 2010 at 12:08 PM
谢谢:)
Reply
[PINGBACK] | 2010.8.2 6:44 PM
[...] 安全的使用Everything 一文,我只是在其中补充一下 Win 7 [...]