阻止网站的应用程序如何工作?
我只知道一种阻止网站的低级方法 - 主机文件。然而,显然主流程序还有其他一些方法来实现这一点。
我对这种程序的新模型有一个想法,但如果没有阻止网站的可能性,它是没有用的:(
阻止是一个问题,另一个问题是过滤和替换网络浏览器中的内容。有任何线索吗?
编辑:
我发现,许多过滤程序都使用开源库 WinPcap,这对于检查用户尝试打开哪些网站似乎很有用,但当然我需要有一些阻止网站的可能性,例如用信息替换请求的网站。关于阻塞,这可以用 WinPcap 实现吗?
I know only one low-level way of blocking websites - hosts file. However, it is obvious that main stream programs has some other way of achieving this.
I have an idea for new model of this kind of program, but without possibility of blocking sites it is useless :(
Blocking is one problem, another is filtering and replacing content in the webbrowser. Any clues?
Edit:
I discovered, that many filtering programs uses open Source library WinPcap. It seems be great for checking which sites user try to open. But of course I need to have some possibility of blocking sites, by for example replacing requested sites for sites with information about blocking. Is this possible to achieve with WinPcap?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
WinPcap 用于两件事:嗅探数据包和发送数据包。它无法阻止数据包到达或发送。
您可以使用 WinPcap 干扰某些连接以中断或更改它们。
示例:
它不会阻止数据包发送或到达,但它可以使客户端或服务器忽略其他数据包并使用您的数据包。
WinPcap is used for two things: Sniffing packets and sending packets. It can't prevent packets from arriving or being sent.
You can use WinPcap to interfere with some connections to break them or to change them.
Examples:
It won't prevent packets from being sent or arrive, but it can make the client or server ignore other packets and use yours.
您始终可以编写浏览器插件,但插件很容易被用户禁用。我不确定您是否可以阻止带有附加组件的网站,但您确实可以阻止页面上加载和显示的内容(想想 Adblock Plus)。
如果你想让它更加防弹,那么你必须制作一个程序,在数据流进入浏览器之前就可以利用它。这可能需要充分了解您的软件所针对的平台。
You can always write a browser add-on, but an add-on can easily be disabled by the user. I'm not sure if you can block sites with an add-on, but you sure can block what's loaded and displayed on a page (think Adblock Plus).
If you want to make it more bulletproof, then you'll have to make a program that taps into the data stream before it enters the browser. This probably requires a good understanding of the platform you're targeting with your software.
根据相关环境,如果您处于每个人共享相同 DNS 服务器的公司环境中,您可以考虑禁止各种 DNS 条目。这包括浏览器和其他实用程序,例如也可能发出 Web 请求的 AIR 应用程序。 WebSense 是我的雇主用来监控互联网流量的工具,尽管这对于您来说可能有点过分了正在思考。
Depending on the environment in question, you could consider banning various DNS entries if you were in a corporate environment where everyone shares the same DNS servers. This cover browsers and other utilities,e.g. AIR applications that may also make web requests. WebSense is what my employer uses for monitoring internet traffic though this may be overkill for what you are thinking.