MS Office 文件扩展名

发布于 2024-07-08 08:05:23 字数 325 浏览 5 评论 0原文

不久前我有了一个发现。 只需按照以下步骤操作:

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

匿名。 2024-07-15 08:05:23

您是否打开了“查看已知类型的扩展”选项?

编辑:@评论....
是的,这是一个愚蠢/侮辱性的问题,但是在解决问题时,我学会了不做任何假设,并且 0% 信任用户。

但是,我试过了,你是对的。 微软有这种行为是愚蠢的,它只会导致安全漏洞,这导致我寻找你的答案。

来自 http://seclists.org/fulldisclosure/2007/Jan/0444 的帖子。 html

“你偶然发现了一个古老的
Windows 的奇怪行为。 办公室
文档格式基于
标准 Windows 容器格式、OLE
结构化存储文件,也称为
作为“文档文件”。 文档文件的名称和
扩展名无关紧要 - 文件
从概念上讲,是一个序列化
一个 OLE 对象,和所有对象一样
它包含的序列化格式
应用程序的标识符
以 OLE 的形式生成它
类 ID(GUID 格式)在此
案件。 您可以轻松验证它
不适用于较新的 Office XML
格式”

确实不适用于 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

"You have stumbled on an age-old
quirky behavior of Windows. Office
document formats are based on a
standard Windows container format, OLE
structured storage files, also known
as "docfiles". A docfile's name and
extension are irrelevant - the file
is, conceptually, a serialization of
an OLE object, and like all
serialization formats it contains the
identifier of the application that
produced it, in the form of an OLE
class id (in GUID format) in this
case. You can easily verify that it
doesn't work with the newer Office XML
formats"

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.

誰認得朕 2024-07-15 08:05:23

我现在似乎无法做到这一点,但我知道我看到了 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文