MS Office 文件扩展名
不久前我有了一个发现。 只需按照以下步骤操作:
在 Office 2003 中创建一个 .doc/.xls/.ppt 文件。在其中保留一些测试数据并关闭该文件。 现在重命名该文件以将其文件扩展名更改为随机字符串,注意它是不关联的,例如 test.asdfghjkl 等。 双击该文件,它将在父应用程序中无缝打开。
现在,据我所知,Windows 检查文件的文件扩展名并使用它来执行操作,即打开应用程序并将文件传递给它来打开。 那么办公套件是如何做到这一点的呢?
编辑:当扩展名更改为与另一个应用程序关联的扩展名时,情况如何? 是否有优先级算法来处理这个问题?
I made a discovery some time back. Just follow these steps:
Create a .doc/.xls/.ppt file in office 2003. Keep some test data in there and close the file. Now rename the file to change it's file extension to a random string, taking care that it is unassociated, like test.asdfghjkl etc.
Double click the file and it opens seamlessly in the parent application.
Now AFAIK, windows checks the file extension of the file and uses it to do an action, viz open an application and pass the file to it to open. Then how does the office suite manage to do this?
EDIT: How about the case when the extension is changed to one that is associated with another application. Is there a priority algorithm in place for handling that ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否打开了“查看已知类型的扩展”选项?
编辑:@评论....
是的,这是一个愚蠢/侮辱性的问题,但是在解决问题时,我学会了不做任何假设,并且 0% 信任用户。
但是,我试过了,你是对的。 微软有这种行为是愚蠢的,它只会导致安全漏洞,这导致我寻找你的答案。
来自 http://seclists.org/fulldisclosure/2007/Jan/0444 的帖子。 html
确实不适用于 2007 *X 文件类型,但 2K3 仍然是一个问题。要解决这个问题...升级!=)
和 这里位于目录第 2 点下的安全焦点。
所以,就这样。
Do you have the "View extensions for known types" option on?
EDIT: @Comments....
Yes, it is a stupid/insulting question, but when troubleshooting a problem I have learned to assume nothing, and trust the users 0%.
BUT, I tried it, and you're right. It is stupid that MS has this kind of behavior, and it can only lead to security vulnerabilities, which led me on a search for your answer.
From the posts at http://seclists.org/fulldisclosure/2007/Jan/0444.html
Indeed it does not work for the 2007 *X file types, but 2K3 is still a problem. To solve this problem... Upgrade! =)
And here at security focus under TOC point 2.
So, there you go.
我现在似乎无法做到这一点,但我知道我看到了 Windows 读取 XML 处理指令< /a> 几年前。 也许这就是正在发生的事情?
I can't seem to make this happen now, but I know I saw Windows reading XML processing instructions a few years back. Maybe that is what's going on?