http/http流量分析器
我想开发一个 C++ 应用程序,它将列出电脑内访问的所有 url 及其响应时间。这可能对用户来说是透明的,因此它将是一个 dll。
任何人都可以给我一些关于上述问题的示例代码或教程。 或任何提示和建议?!...
非常感谢:))
i would like to develop a c++ application that would list all url accessed with its response time within the pc. this probably would be transparent to the user, so it would be a dll.
can anyone gve me some sample codes or tutorials on th said matter.
or any tips and suggestion?!..
thanks alot:))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该查看 fiddler 插件。这不是一个简单的练习。您需要进行依赖项注入来捕获 wininet 调用。即便如此,并非所有应用程序都使用高级 Windows API 来发起连接。建立 TCP 连接的应用程序可能会持续很长时间,因为并非所有 TCP 调用都是简单的 Web 请求。
You should take a look at the fiddler plug-ins. This is not a trivial exercise. You need to do dependency injection to capture the wininet calls. Even so not all apps use the high level windows api to initiate connections. Applications that make TCP connections might last for a long time since not all TCP calls are simple web requests.
正如拜伦所说,这是一个不平凡的练习。您可以使用 libpcap http://sourceforge.net/projects/libpcap/ 安装 < Windows 上的 href="http://www.winpcap.org/" rel="nofollow noreferrer">http://www.winpcap.org/。使用 libpcap 的教程已经存在,您需要学习过滤除 http/https 流量之外的所有内容,尽管一旦您到达该阶段,它应该不会太难。尝试 http://yuba.stanford.edu/~casado/pcap/section1.html 对于初学者或 http://systhread.net/texts/200805lpcap1.php 。两个教程看起来都很合理。
我还觉得我应该指出“对用户透明”和“dll”不是等价的想法。 DLL 是一组独立于应用程序的库函数,可供许多应用程序使用 - 请参阅 http ://en.wikipedia.org/wiki/Dynamic-link_library。如果运行“标准”可执行文件(即以 .exe 结尾的文件),它仍然对用户是透明的,例如作为 Windows 服务,这可能更符合您的需求。
As Byron has said, this is a non-trivial exercise. You could do it using libpcap http://sourceforge.net/projects/libpcap/ having installed http://www.winpcap.org/ on Windows. Tutorials for using libpcap are around and you'd need to learn to filter out everything but http/https traffic, although once you've got to that stage it shouldn't be too hard. Try http://yuba.stanford.edu/~casado/pcap/section1.html for starters or http://systhread.net/texts/200805lpcap1.php. Both tutorials look reasonable.
I also feel I should point out that "transparent to the user" and "dll" are not equivalent ideas. A DLL is a set of library functions separate from an application that can be used by many applications - see http://en.wikipedia.org/wiki/Dynamic-link_library. A "standard" executable file (i.e. file ending in .exe) can still be transparent to the user if run, for example, as a Windows Service, which might be more what you are looking for.