【正文】
絡(luò)工程專業(yè)的學(xué)生,熟悉常用的各種計(jì)算機(jī)相關(guān)軟件 ,特別是和網(wǎng)絡(luò)相關(guān)的軟件是應(yīng)該的。有些 sniffer 軟件往往嵌入許多并不怎么使用的功能在里面,增加了操作的復(fù)雜性,使用起來(lái)反而不便。所以我們可以清晰的認(rèn)識(shí)到網(wǎng)絡(luò)數(shù)據(jù)包捕獲功能的巨大作用和廣泛的應(yīng)用范圍。所以嘗試選擇了這個(gè)課題。因此,人們迫切的需要能夠分析、診斷和測(cè)試網(wǎng)絡(luò)的工具,以及保護(hù)我們的電腦盡可能的減少收到侵害的堡壘――防火墻。 通過(guò) VC++ 中 MFC編程實(shí)現(xiàn)通過(guò)一個(gè)完整界面來(lái)控制調(diào)用 Winpcap 中的函 數(shù)來(lái)實(shí)現(xiàn)對(duì)網(wǎng)卡信息的捕獲和循環(huán)捕獲數(shù)據(jù)包,然后通過(guò)預(yù)先對(duì)于 IP、 TCP、UDP 等數(shù)據(jù)包的定義和 TCP/IP 等協(xié)議來(lái)解析其中包含的內(nèi)容并返回顯示捕獲到數(shù)據(jù)包的信息,當(dāng)然也可以保存捕獲到的數(shù)據(jù)包到指定地點(diǎn)以便進(jìn)一步分析。 Winpcap是 Windows 平臺(tái)下一個(gè)專業(yè)網(wǎng)絡(luò)數(shù)據(jù)包捕獲開(kāi)發(fā)包,是為 Libpcap 在 Windows平臺(tái)下實(shí)現(xiàn)數(shù)據(jù)包捕獲而設(shè)計(jì)的。數(shù)據(jù)包的捕獲是實(shí)現(xiàn)防 火墻、網(wǎng)絡(luò)協(xié)議的分析或者網(wǎng)絡(luò)監(jiān)聽(tīng)等等功能的核心內(nèi)容,一般可以采用 Winsock 編程、Winpcap 或者 NDIS 網(wǎng)絡(luò)接口驅(qū)動(dòng)來(lái)實(shí)現(xiàn)。 學(xué)位論文 網(wǎng)絡(luò)數(shù)據(jù)包捕獲工具的設(shè)計(jì)與實(shí)現(xiàn) 論文作者姓名: 申請(qǐng)學(xué)位專業(yè): 申請(qǐng)學(xué)位類別: 指導(dǎo)教師姓名(職稱): 論文提交日期: 網(wǎng)絡(luò)數(shù)據(jù)包捕獲工具的設(shè)計(jì)與實(shí)現(xiàn) 摘 要 網(wǎng)絡(luò)數(shù)據(jù)包的捕獲對(duì)于網(wǎng)絡(luò)安全有著巨大的作用,為我們更好的分析網(wǎng)絡(luò)中的數(shù)據(jù)流提供了幫助。 本論文是基于 Windows 下開(kāi)發(fā)一個(gè)網(wǎng)絡(luò)監(jiān)聽(tīng)工具,側(cè)重點(diǎn)在于實(shí)現(xiàn)網(wǎng)絡(luò)數(shù)據(jù)包的捕獲,然后分析并顯示捕獲到的數(shù)據(jù)包信息這部分功能的實(shí)現(xiàn),如分析:IP 首部協(xié)議類型、源 IP、目的 IP 和端口號(hào)等。 采用的是 Winpcap( Windows Packet Capture)來(lái)實(shí)現(xiàn)的抓包功能。 Winpcap 功能更加強(qiáng)大,不僅具備了 Libpcap的功能,還具有一些其他功能。 關(guān)鍵詞 : Winpcap; NPF; VC++; TCP/IP;計(jì)算機(jī)網(wǎng)絡(luò); The Design and Implementation of Capture Tool of Network Data Packets Abstract The capture of work data packets plays an important part in work security, which is helpful for our better analysis of work data flow. This paper is about a work monitoring tool based on Windows system, which emphasizes particularly on realizing the capture and analysis of work data packets and then displays them. Take analysis as an example, it will check the type of the IP protocol, the source address of IP, the destination address of IP and the port number. The capture of data packets is the basis of realizing the analysis of work protocol and work monitoring. Generally it can be realized via Winsock and Winpcap programming, or NDIS. Use the Winpcap( Windows Packet Capture) to capture of data packets. Winpcap is a professional developing program based on Windows which is designed to help you to capture the data packs via Libpcap. Winpcap is much more powerful. It not only has integrated all the functions of Libpcap but also has some advanced functions. In MFC programming of VC++, the capture of work data packets can be realized via the invoking and control of the functions through a full control panel, and then the analysis of IP ,TCP,UDP and TCP/IP will be done before they are displayed. Certainly the information captured can be saved to the appointed destination in order to go through an advanced analysis. Key words: Winpcap; NPF; Visual C++; TCP/IP; Computer Network; 目 錄 論文總頁(yè)數(shù): 27 頁(yè) 1 引言 ............................................................................................................................. 1 課題背景 ............................................................................................................ 1 國(guó)內(nèi)外研究現(xiàn)狀 ................................................................................................. 1 課題研究的意義 ................................................................................................. 1 2 設(shè)計(jì)理論依據(jù) ............................................................................................................ 2 OSI與協(xié)議族 ..................................................................................................... 2 面向?qū)ο蠛涂梢暬幊?....................................................................................... 4 WINPCAP 開(kāi)發(fā)技術(shù)詳解 .......................................................................................... 5 Winpcap介紹 ……………………………………………………………………… .5 Winpcap 的組成 …………………………………………………………………… 5 Winpcap 數(shù)據(jù)結(jié)構(gòu) ………………………………………………………………… 7 Winpcap 函數(shù) ……………………………………………………………………… 8 3 設(shè)計(jì)方案與系統(tǒng)功能描述 ........................................................................................ 10 設(shè)計(jì)方案 .......................................................................................................... 10 功能描述 .......................................................................................................... 11 系統(tǒng)流程圖 ...................................................................................................... 12 4 編碼實(shí)現(xiàn) ................................................................................................................. 12 WINPCAP 環(huán)境設(shè)置 ............................................................................................... 12 MFC控件相關(guān) ................................................................................................... 14 定時(shí)器和系統(tǒng)時(shí)間的獲得 ................................................................................. 15 捕獲并顯示本機(jī)信息 ........................................................................................ 16 捕獲數(shù)據(jù)包及相關(guān)操作 ..................................................................................... 17 5 軟件測(cè)試與結(jié)果 ...................................................................................................... 22 網(wǎng)卡信息獲取 ................................................................................................... 22 整合到 MFC界面中的程序測(cè)試 .......................................................................... 23 結(jié) 論 ........................................................................................................................ 24 參考文獻(xiàn) ........................................................................................................................ 25 致 謝 ........................................................................................................................ 26 聲 明 ........................................................................................................................ 27 第 1 頁(yè) 共 27 頁(yè) 1 引言 課題背景 隨著網(wǎng)絡(luò)技術(shù)的飛 速發(fā)展,網(wǎng)絡(luò)的普及,給我們帶來(lái)了巨大的社會(huì)和經(jīng)濟(jì)效益,同時(shí)網(wǎng)絡(luò)安全問(wèn)題變得日益嚴(yán)重,計(jì)算機(jī)網(wǎng)絡(luò)的設(shè)計(jì)、維護(hù)難度日益增加,安全問(wèn)題正威脅著每一個(gè)網(wǎng)絡(luò)用戶,對(duì)網(wǎng)絡(luò)安全的研究也越來(lái)越重要。對(duì)于網(wǎng)絡(luò)數(shù)據(jù)包的捕獲現(xiàn)在也有著很多的實(shí)現(xiàn)方法,存在著許多開(kāi)源的 sniffer 軟件供我們參考,但是其中的某些細(xì)節(jié)上還是有一些問(wèn)題的存在,在效果和效率上都有一些問(wèn)題,分析上也并不是很方便。 國(guó)內(nèi)外研究 現(xiàn)狀 現(xiàn)在不論是網(wǎng)上的一些開(kāi)源的 Sniffer 軟件還是市面上出售的網(wǎng)絡(luò)監(jiān)聽(tīng)軟件,其實(shí)其基礎(chǔ)功能都是基于網(wǎng)絡(luò)數(shù)據(jù)包捕獲功能后擴(kuò)展開(kāi)的。