我在谷歌上搜索了很多次,直到我创建了这个问题,所以如果那里有一些教程,请原谅。我没有找到他们。
如何在 Windows 中编写防火墙应用程序代码?我考虑过在每个进程中使用内联 Hook 的用户模式防火墙,但问题是我无法在 Windows 7 中 Hook csrss.exe(它创建新进程)。第二件事是它不是很干净并且会肯定被检测为恶意软件。
所以我认为我应该在内核模式下将 API 作为驱动程序挂接。但是有3个问题。
- 首先我不知道内核 API
对于 Windows socket 。
- 其次,我在内核方面没有任何经验
模式 Hook 。
- 第三个我不知道
这是正确的方法。
别担心,我知道这并不容易,而且我不是一个只有想法的初学者 ;)。如果有人有好的信息,请分享。
哦,我想为 x86 系统编写 ;)。
你需要Windows Filtering Platform (世界粮食计划署)。
With the WFP API, developers can
implement firewalls, intrusion
detection systems, antivirus programs,
network monitoring tools, and parental
controls. WFP integrates with and
provides support for firewall features
such as authenticated communication
and dynamic firewall configuration
based on applications' use of sockets
API (application-based policy). WFP
also provides infrastructure for IPsec
policy management, change
notifications, network diagnostics,
and stateful filtering.