拦截网络数据包的方法一般有RAWSOCKET,SLP,NDIS等,具体方法与实现源码.

解决方案 »

  1.   

    请参见WINDOWS 2000 DDK/NETWORK Drivers/Part3 InterMedia NDIS Drivers
    使用它的例子框架
    1.Registering an Intermediate Driver as a Miniport
      修改与以下注册句柄相关的函数
      SendHandler Or SendPacketsHandler
      
    2.Registering an Intermediate Driver as a Protocol  
      修改与以下注册句柄相关的函数
      ReceiveHandler
      ReceivePacketHandler
      BindAdapterHandler
      SendComleteHandler  分析不同的数据包,你可以操纵所有经过 中间层驱动程序所绑定网卡 的数据
      
      

  2.   

    先留下EMAIL,资料与源码都可以发到这里.
    [email protected] 谢谢!!!!
      

  3.   

    去www.driverdevelop.com
    那里有NDIS的开发包,我就是基于这个开发包作出了“基于包过滤的防火墙”程序
    如果只要监听,则更简单
    但是代码在家里,现在没办法给你
      

  4.   

    这是一个IPHLP API 拦截数据包的例子.
    http://www.codeproject.com/internet/tcpinfo.asp
      

  5.   

    这是一个在WIN2000拦截数据包的例子.
    http://www.codeguru.com/network/ipmon.html
      

  6.   

    winpcap!不错的选择阿,要源代码找我!
      

  7.   

    winpcap确实不错,我用它已经实现了局域网数据的拦截,但是在进行拨号网络数据的拦截时,就出了问题,一启动,就上不了网了,似乎丢包很严重(90%),不知道是我用错了还是它确实有问题?关注
      

  8.   

    拨号网络所用的网络协议不是TCP/IP.
      

  9.   

    是啊。winpcap是啊,很好的,简单。
      

  10.   

    to cajonWinPCap文档里面说明在拨号网络里面是用会有问题的。
      

  11.   

    WinPCap的网址:http://winpcap.polito.it/
    下面有例子
      

  12.   

    Releases Summary
    Version 3.0 alpha, 09 aug 02
    New features and optimizations of the NPF device driver: 
    JIT compiler for the BPF virtual machine 
    Dump to disk from kernel mode 
    Buffered sends 
    System-related optimizations (timestamps, data copies, interaction with NDIS) 
    further low-level optimizations 
    New kernel-level monitoring system, that includes extensions to the BPF interpreter. 
    NOTE: this feature is experimental and not yet documented 
    Integration with the tcpdump.org sources: it's now possible to download the libpcap source code from www.tcpdump.org and compile it inside WinPcap. 
    Additions to the wpcap.dll API: 
    pcap_findalldevs() to obtain the installed devices and their parametrs 
    send queues for high-speed synchronized packet injection 
    pcap_read_ex(), an alternative the traditional callback system of libpcap 
    pcap_live_dump() to save traffic dumps from kernel mode 
    pcap_stats_ex() that reports the number of captured packets in addition to the statistics returned by pcap_stats(). Note that a new function was created to grant backward compatibility.  
    New developer's pack, with the new libraries and several additional samples 
    New doxygen-based documentation, that covers the whole API and the internals of WinPcap. A tutorial with several browsable samples is included 
    Improved ACPI support: now the driver continues to work after a system hybernation 
    Bug fixing: 
    different capture instances are now globally synchronizes 
    rename packet.a in libpacket.a for easier usage from cygwin 
    removed some memory leaks in the driver. The XP driver verifier doesn't complain any more. Moreover, all the memory allocations in the driver are now tagged for easier memory leak detection. 
    fixed a data structure overlapping that sometimes messed up the read event under WinNTx 
    Corrected a wrong registry path that caused PacketGetNetInfoEx() not to work properly under WinNT4 
    Version 2.3, 28 mar 02
    New installation applet based on Ghost installer. This should hopefully solve the large number of problems of the old Installshield version that we used previously. 
    Version numbers in the installation and in the binaries. 
    The code to retrieve the addresses of the adapters was updated, PacketGetNetInfo() was rewritten and a new function called PacketGetNetInfoEx() has been added to packet.dll.  
    The name of the WinPcap drivers has been changed from packet.sys/packet.vxd to npf.sys/npf.vxd. This is transparent to the applications and should avoid conflicts with other drivers. 
    Updates to the developer's pack, that is now based on the includes and libraries of WinPcap 2.3. Some bugs were corrected in the samples. 
    Bug fixing: 
    always start winsock during winpcap initialization 
    Correct use of the lookahead buffer in Packet_tap 
    Use of snprintf instead of sprintf in pcap-win32.c 
    fixed wrong memory accesses in bpf_filter_with_2_buffers() 
    m
      

  13.   

    替换socket的dll就可以了,这个是我知道的最简单的方法。具体的看
    www.vckbase.com
    =fly by=
      

  14.   

    拨号网络的数据与Ethetnet的MAC结构不同,所以无法用WinCap拦截,但是在NDIS层我拦截到了
      

  15.   

    NDIS层高于网卡驱动嘛,当然可以。但我想,效率方面来讲,应该是winpcap之类直接改写网卡驱动的开发包来的高
      

  16.   

    mooncat2000(三脚猫) 
    菲尔防火墙的源代码哪里有的免费下载?
    悄悄告诉我好了:)
    [email protected]
    =fly by=
      

  17.   

    也悄悄告诉我好不好??
    [email protected]
      

  18.   

    通过NDIS拦截IP包的例子可以参考2000/XPDDK中的PASSTHRU或PACKET32的例子.
      

  19.   

    悄悄给我一份费尔防火墙的源代码,谢谢了.
    [email protected]
      

  20.   

    up顺便问一下
    gz是什么意思?
      

  21.   

    我也要[email protected] //关注
      

  22.   

    如果大家感兴趣的话,请留下EMAIL,我整理一下大家的发言然后发送给大家.
      

  23.   

    还有我[email protected]
    我已经收藏了此帖!
      

  24.   

    对了楼主,我有那个 替代wsock32.dll的源码,但是好象Send()有点问题?欢迎MAIL我讨论
      

  25.   

    别忘了我哦
    [email protected]
      

  26.   

    也给我一份费尔防火墙的源代码:)
    [email protected]
    谢谢!
      

  27.   

    从简单到复杂,很多方法,我看很多人的眼光有问题,只是关注在winpcap、NDIS等上面,未免目光狭隘:)
    1、替换wsock32.dll,最简单的方法,简单又实用,为何不用。
    2、Api hook,至于怎么hook api,方法太多,不胜枚举。
    3、Winpcap,简单实用,我的一个网络包过滤程序就是这样做出来的。
    4、rawsocket,跟socket api同一级别的东西,编程简单。
    5、SPI(service provider interface),用户层dll,简单实用,安装稍微麻烦一点。
    6、NDIS驱动,这个估计是最麻烦的,好在微软DDK里面有现成的例子。以上所有方法我都用过,我在主页上公开了一些用这里提到的技术作出来的东西,http://www.oldworm.com谁有费尔防火墙源代码,能否给我一份?最好是2.0以上版本的,[email protected]
      

  28.   

    我也要非尔防火墙2.0的代码,嘿嘿
    [email protected]
      

  29.   

    费尔的原代码有多大?别把我的邮箱给撑破了!我想要一份发言精髓,
    [email protected]
      

  30.   

    http://winpcap.polito.it/misc/links.htm
    英雄哥哥
    偶们又见面了
    不知这有没有帮助
      

  31.   

    到处找不到费尔的代码,不如大家凑钱去买一分?一人10块,20个人就可以了。。;)
    -------------------------------
    =fly by=
      

  32.   

    防火墙的源码在csdn的主页上有啊,你们不看?
      

  33.   

    rujor(rujor) 
    老大,那个是广告,要钱的。我给他们写信过,竟然不肯赊账;(
    -------------------------------
    =fly by=
      

  34.   

    各位老大,费尔防火墙源代码,我也要一份呀!!!
    [email protected]
      

  35.   

    悄悄给我一份费尔防火墙的源代码,谢谢了.
    [email protected]
      

  36.   

    去www.driverdevelop.com
    里面有你想要的东西
      

  37.   

    rujor(rujor) 
    老大,那个是广告,要钱的。我给他们写信过,竟然不肯赊账;(______________
    你居然想到赊帐 :) ,佩服.
      

  38.   

    我也凑凑热闹!
    [email protected]
      

  39.   

    我也要,谢谢!!!!![email protected]
      

  40.   

    gz
    我也要非尔防火墙的代码,谢谢
    [email protected]
      

  41.   

    也给我一份费尔防火墙的源代码:)
    [email protected]
    谢谢!