1摘要网络监听技术是系统安全领域内一个非常敏感的话题,也是一项重要的技术,具有很强的现实应用背景。网络监听是网络监测、负载分析等管理活动常用的方法,同时也是黑客非法窃取信息的手段。网络监听工具通过网络传输介质的共享特性实现抓包,获得当前网络的使用状况,为网络管理员对网络中的信息进行实时的监测、分析提供一个合适的工具;同时也让黑客截获本网段的一些敏感信息,威胁网络安全。本文对网络监听技术的原理和实现进行了比较详细的介绍,讨论了监听技术在Windows下的多种实现,并主要介绍了如何在Win32环境中利用Winpcap开发包开发网络实时监听程序,给出了具体的设计与实现方法。详细描述Winpcap开发包的主要功能,分析网络监听程序的层次结构(从底到顶依次为NPF驱动程序,Winpcap的dll函数库),监听应用程序。最后就当前的监听技术的不足提出了分布式监听的观点,还引入了简单网络管理。关键字:网络监听,Winpcap,包捕获2AbstractNetworksnifferisanimportantissueandtechniqueinthedomainofsystemsecurity,soithasstrongrealismapplicationbackground.Networksnifferisawaywhichisusedinnetworkmonitor,loadanalysis;atthesametimeitisalsoawaywhichisusedbyhackertogettheinformationillegally.Networksniffertoolssnappacketstogetthenetwork’scurrentstatusbythesharedcharacteristicofthenetworktransmissionmedium.Itprovidesnetworkmanageranicetoolwhichcanhelptheminspectandanalysetheinformationofnetwork;simultaneouslyhackersalsogetsomeimportantinformation,sothreatensystemsecurity.Inthisarticle,wewillintroducetheprinciplesandimplementationsofthenetworksnifferindetails,discussmulti-implementationsofsniffertechniqueatwindows,andmainlyintroducehowtodevelopsnifferprogramatwin32byWinpcapdevelopmentkit,thedetaileddesignandimplementations.ParticularlywedescribethemainfunctionofWinpcap,analysetheframeworkofnetworksnifferprogramandthesnifferapplicationprogram.AtlastIbringforwarddistributedsnifferviewpointforthelackofcurrentsniffertechnique.Ialsoimportsimplenetworkmanagement.Keyword:networkmonitor,winpcap,packetsnap3目录前言.............................................................................................................................................1第1章系统概述..................................................................................................................................21.1系统目标..................................................................................................................................21.2相关理论与技术的简单介绍...............................................................................................21.2.1网络监听原理.........................................................................................................................21.2.2监听技术相关的实现方法...................................................................................................31.3系统需求..................................................................................................................................6第2章基于Winpcap开发的技术详解..........................................................................................82.1选用Winpcap技术的原因:...............................................................................................82.2Winpcap的结构分析.............................................................................................................82.3NDIS驱动开发技术............................................................................................................102.4DLL动态连接库技术.........................................................................................................11第3章系统功能描述.......................................................................................................................123.1监听子系统...........................................................................................................................123.2显示子系统...........................................................................................................................133.3管理子系统...........................................................................................................................143.4连接子系统...........................................................................................................................14第4章系统实现................................................................................................................................154.1协议驱动程序NPF的设计................................................................................................154.2动态连接库程序PACKET.DLL的设计.........................................................................174.3应用程序的结构设计..........................................................................................................204.3.1数据流图................................................................................................................................2044.3.2结构图....................................................................................................................................254.3.3源码分析................................................................................................................................294.4系统特色................................................................................................................................464.4.1分布式网络监听...................................................................................................................464.4.2简单网络管理.......................................................................................................................46第5章系统测试与使用说明书..................................