通过脚本偷窥你的IE剪贴板

digg.com一篇文章

Do you use IE? I bet I can tell you what in on your clipboard!

引起了我的注意。

原文演示在这里:http://www.jerryandmissy.com/work/clipboard.htm

通过IE自带的一个脚本API,你可以直接读取用户当前剪贴板中的内容,如果用户IE的权限设置为默认的话。我用自己的IE测试了一下,显然,这招很管用。你可以通过脚本访问用户的剪贴板,无论用户从哪里copy的数据,你都可以通过一个脚本命令访问到。这恐怕是一个不大不小的问题,如果可以的话,你可以做一个小程序,收集所有人的剪贴板中的内容,搞个数据挖掘什么的。

其实代码很简单,仅仅一句话:
document.getElementById("textbox").innerText = window.clipboardData.getData("Text");

此代码在mozilla下不会运行的。

作者当然也提供了解决这个安全问题的办法,似乎很简单:

To turn off this "feature" in Internet Explorer:

1. Go to Tools -> Internet Options -> Security
2. Click on the Custom Level Security Setting and uncheck the option "Allow Paste Operations via Script.”


你可能感兴趣的:(脚本,IE,Security,internet,textbox,mozilla)