阻止网站的应用程序如何工作?

发布于 2024-09-05 01:31:36 字数 284 浏览 4 评论 0原文

我只知道一种阻止网站的低级方法 - 主机文件。然而,显然主流程序还有其他一些方法来实现这一点。

我对这种程序的新模型有一个想法,但如果没有阻止网站的可能性,它是没有用的:(

阻止是一个问题,另一个问题是过滤和替换网络浏览器中的内容。有任何线索吗?

编辑:

我发现,许多过滤程序都使用开源库 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 技术交流群。

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

发布评论

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

评论(3

笑梦风尘 2024-09-12 01:31:36

WinPcap 用于两件事:嗅探数据包和发送数据包。它无法阻止数据包到达或发送。

您可以使用 WinPcap 干扰某些连接以中断或更改它们。

示例:

  1. 在 TCP 中发送 RST(重置)数据包以断开 TCP 连接。
  2. 在 HTTP GET 数据包上发送包含您的信息的响应数据包,以获得不同的结果并忽略实际结果。

它不会阻止数据包发送或到达,但它可以使客户端或服务器忽略其他数据包并使用您的数据包。

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:

  1. Send RST (reset) packets in TCP to break a TCP connection.
  2. Send response packets on HTTP GET packets with your information to get a different result and ignore the actual result.

It won't prevent packets from being sent or arrive, but it can make the client or server ignore other packets and use yours.

靖瑶 2024-09-12 01:31:36

您始终可以编写浏览器插件,但插件很容易被用户禁用。我不确定您是否可以阻止带有附加组件的网站,但您确实可以阻止页面上加载和显示的内容(想想 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.

帅气称霸 2024-09-12 01:31:36

根据相关环境,如果您处于每个人共享相同 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.

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