【正文】
if ( (UdpData[i]33) amp。amp。 (UdpData[i]122) ) printf(%3c [%3x], UdpData[i], UdpData[i])。 else printf( [%3x], abs(UdpData[i]))。 } printf(\n [DATA END]\n\n\n)。 } return true。 } ICMP 解包函數(shù) int DecodeIcmpPack(char * IcmpBuf, int iBufSize) { ICMP_HEADER * pIcmpHeader。 pIcmpHeader = (ICMP_HEADER * )IcmpBuf。 第 17 頁 共 27 頁 int iIcmpType = pIcmpHeaderi_type。 int iIcmpCode = pIcmpHeaderi_code。 //對類型進(jìn)行過濾 if ((iPortFilter) amp。amp。 (iIcmpType!=iPortFilter)) return true。 printf(%s , szProtocol)。 printf(%15s %15s , szSourceIP, szDestIP)。 printf(TTL=%3d , iTTL)。 printf(Type%2d,%d ,iIcmpType,iIcmpCode)。 printf(bytes=%4d, iBufSize)。 printf(\n)。 //對于包含數(shù)據(jù)段的包進(jìn)行數(shù)據(jù)分析 if ((ParamDecode) amp。amp。 (iBufSize28)) { char * IcmpData=IcmpBuf+4。 //分析 ICMP 數(shù)據(jù)段 printf( [DATA])。 for(unsigned int i=0。i(iBufSizesizeof(ICMP_HEADER))。i++) { if (!(i%8)) printf(\n)。 if ( (IcmpData[i]33) amp。amp。 (IcmpData[i]122) ) printf(%3c [%3x], IcmpData[i], IcmpData[i])。 else printf( [%3x], abs(IcmpData[i]))。 } printf(\n [DATA END]\n\n\n)。 } return true。 } 5 功能測試 數(shù)據(jù)包截獲程序設(shè)計(jì)完成后,在 Windows平臺下進(jìn)行運(yùn)行調(diào)試,修改錯誤,使其能完成截獲數(shù)據(jù)包和分析數(shù)據(jù)包的功能。現(xiàn)在用開發(fā)出的數(shù)據(jù)包截獲程序 作 幾 個(gè) 功 能演示 。 第 18 頁 共 27 頁 UDP 數(shù)據(jù)包 截獲局域網(wǎng)中 IP為 的計(jì)算機(jī) 發(fā)出的 UDP數(shù)據(jù)包 ,如圖 9: 圖 9 顯示 UCP數(shù)據(jù)包解析的結(jié)果 如圖 9中顯示,截獲了 UDP數(shù)據(jù)包,并分析出 了 協(xié)議類型,源地址,源端口,目的地址,目的端口和生存時(shí)間, UDP長度,數(shù)據(jù)包大小等信息。 TCP 包 截獲并分析網(wǎng)絡(luò)中 本機(jī)( IP為 )的 TCP數(shù)據(jù)包 .如圖 10: 圖 10 顯示 TCP數(shù)據(jù)包解析的結(jié)果 如圖 10中顯示,截獲了經(jīng)過本機(jī)的 TCP數(shù)據(jù)包,分析出了協(xié)議類型,源地址,源端口,目的地址, 目的端口 和生存時(shí)間,標(biāo)志位,數(shù)據(jù)包大小,數(shù)據(jù)段。 截獲 ICMP 包 在 局域網(wǎng)中, IP為 的計(jì)算機(jī) S1, IP為 的計(jì)算機(jī) S2,計(jì)算機(jī) S2 運(yùn)用 PING命令 PING 計(jì)算機(jī) S1,在計(jì)算機(jī) S1 上截獲到的 ICMP 數(shù)據(jù)包,演示如圖 第 19 頁 共 27 頁 11: 圖 11 顯示 ICMP數(shù)據(jù)包解析的結(jié)果 如圖 11顯示,截獲到了經(jīng)過 ICMP數(shù)據(jù)包,并分析出了協(xié)議類型 ,源地址,目的地址 , 和生存時(shí)間,類型,數(shù)據(jù)包大小,數(shù)據(jù)段 。 數(shù)據(jù)包截獲程序 能完成預(yù)期的要求,進(jìn)行 數(shù)據(jù) 包截獲、 分析,顯示出分析結(jié)果。由上面 3個(gè)圖可以觀察到截獲模塊能夠?qū)崿F(xiàn)將網(wǎng)絡(luò)接口設(shè)置為混雜模式,同時(shí)截獲局域網(wǎng)內(nèi)的數(shù)據(jù)包,在這里還可以觀察到網(wǎng)絡(luò)狀態(tài)及網(wǎng)絡(luò)數(shù)據(jù)的流動情況,供網(wǎng)絡(luò)分析之用。 第 20 頁 共 27 頁 結(jié) 論 數(shù)據(jù)包 截獲 技術(shù)是開發(fā)網(wǎng)絡(luò)管理工具軟件的重要基礎(chǔ)之一,因?yàn)樵S多故障及入侵判斷都是建立在網(wǎng)絡(luò)流量或數(shù)據(jù)的分析基礎(chǔ)上的。具體來說 ,數(shù)據(jù)包 截獲 可以應(yīng)用在檢測網(wǎng)絡(luò)流量,分析網(wǎng)絡(luò)故障;網(wǎng)絡(luò)協(xié)議工作原理及過程分析;非法數(shù)據(jù) 截獲 與入侵檢測;網(wǎng)絡(luò)設(shè)備開發(fā)。 本文首先介紹了 TCP/IP 基礎(chǔ)知識 ,以及數(shù)據(jù)包截獲的基本原理,研究了數(shù)據(jù)包截獲的機(jī)制。其后說明了本設(shè)計(jì)的設(shè)計(jì)思想和具體實(shí)現(xiàn), 本 設(shè)計(jì)是 以原始套接字方式對網(wǎng)絡(luò)數(shù)據(jù)進(jìn)行 截獲, 實(shí)現(xiàn)起來比較簡單,尤其是不需要編寫 VxD 虛擬設(shè)備驅(qū)動程序就可以實(shí)現(xiàn) 截獲數(shù)據(jù)包 ,使得其編寫過程變的非常簡便 。 設(shè)計(jì)完成后經(jīng)測試能實(shí)現(xiàn)預(yù)期要求的功能。但是仍然存在一些不足之處,例如: ,只對數(shù)據(jù)包作了簡單分 析,分析內(nèi)容不太全面,所截獲分析的數(shù)據(jù)包信息也未能存儲下來。 2.本設(shè)計(jì)沒有實(shí)現(xiàn)在 MFC界面顯示,操作不夠簡便。 通過對該課題的研究,讓我對 數(shù)據(jù)包截獲 有了進(jìn)一步的了解,對其兩面性在網(wǎng)絡(luò)中產(chǎn)生的影響有了更深的認(rèn)識,為了打破以上局限性,還需要結(jié)合已學(xué)知識對數(shù)據(jù)包截獲技術(shù)方面的知識作進(jìn)一步的學(xué)習(xí)。 由于 本人水平有限和時(shí)間倉促,很多問題考慮不周全甚至可能有錯誤。所以請老師多多指正。 第 21 頁 共 27 頁 參考文獻(xiàn) [1]譚思亮 .監(jiān)聽與隱藏 網(wǎng)絡(luò)偵聽與數(shù) 據(jù)保護(hù)技術(shù) [M ].北京 : 人民郵電出版社 ,2021 [2] Rafeeq Rehman .Intrusion Detection with SNORT: Advanced IDS Techniques Using SNORT, Apache, MySQL, PHP, and ACID[M],清華大學(xué)出版社 ,2021 [3] William and Inter Security,機(jī)械工業(yè)出版社 ,Mar 2021 [4] 張仕斌 .網(wǎng)絡(luò)安全技術(shù) [M],清華大學(xué)出版社 ,2021(8) [5] 熊華、郭世澤等 .網(wǎng)絡(luò)安全 —— 取證與蜜罐 [M],電子工業(yè)出版社 ,2021(7) [6] 唐正軍 .網(wǎng)絡(luò)入侵檢測系統(tǒng) 的 設(shè)計(jì)與實(shí)現(xiàn) [M],電子工業(yè)出版社 ,2021 (5) [7] 劉文濤 .網(wǎng)絡(luò) 入侵檢測系統(tǒng)詳解 [M],電子工業(yè)出版社 ,2021(10) [8]莊春興, 彭奇志 .“ 網(wǎng)絡(luò)竊聽及其防范 ” ,《網(wǎng)絡(luò)安全技術(shù)與應(yīng)用》, 2021.(7) [9]莊春興, 彭奇 .“ 基于 Winpcap 的網(wǎng)絡(luò)嗅探程序設(shè)計(jì) ” ,《計(jì)算機(jī)與現(xiàn)代化》, 2021.(5) [10]董玉格 , 金海等 . 攻擊與防護(hù) 網(wǎng)絡(luò)安全與實(shí)用防護(hù)技術(shù) [M ].北京 :人民郵電出版社 ,2021. 第 22 頁 共 27 頁 致 謝 本文是在吳震老師的熱情關(guān)心和指導(dǎo)下完成的,他淵博的知識和嚴(yán)謹(jǐn)?shù)闹螌W(xué)作風(fēng)使我受益匪淺,對順利完成本課題起到了極大的作用。在此向他表示我最衷心的感謝! 在論文完成過程中,本人還得到了同事和同學(xué)的熱心幫助,本人向他們表示深深的謝意! 最后向在百忙之中評審本文的各位專家、老師表示衷心的感謝! 作者簡介: 姓 名:黃敏 性別:男 出生年月: 1984年 5月 27 日 民族:漢 Email: 第 23 頁 共 27 頁 聲 明 本論文的工作是 2021 年 2月至 2021 年 6月在成都信息工程學(xué)院網(wǎng)絡(luò)工程系完成的。文中除了特別加以標(biāo)注地方外,不包含他人已經(jīng)發(fā)表或撰寫過的研究成果,也不包含為獲得成都信息工程學(xué)院或其他教學(xué)機(jī)構(gòu)的學(xué)位或證書而使用過的材料。除非另有說明,本文的工作是原始性工作。 關(guān)于學(xué)位論文使用權(quán)和研究成果知識產(chǎn)權(quán)的說明: 本人完全了解成都信息工程學(xué)院有關(guān)保管使用學(xué)位論文的規(guī)定,其中包括: ( 1)學(xué)校有 權(quán)保管并向有關(guān)部門遞交學(xué)位論文的原件與復(fù)印件。 ( 2)學(xué)??梢圆捎糜坝?、縮印或其他復(fù)制方式保存學(xué)位論文。 ( 3)學(xué)??梢詫W(xué)術(shù)交流為目的復(fù)制、贈送和交換學(xué)位論文。 ( 4)學(xué)??稍试S學(xué)位論文被查閱或借閱。 ( 5)學(xué)??梢怨紝W(xué)位論文的全部或部分內(nèi)容(保密學(xué)位論文在解密后遵守此規(guī)定)。 除非另有科研合同和其他法律文書的制約,本論文的科研成果屬于成都信息工程學(xué)院。 特此聲明! 作者簽名: 2021年 07月 25日 第 24 頁 共 27 頁 s. Ath. Clearly you and I will have to declare that those whom we oldmen adjudge victors ought to win。 for our ways are far and away betterthan any which at present exist anywhere in the world. Cle. Certainly. Ath. Thus far I too should agree with the many, that theexcellence of music is to be measured by pleasure. But the pleasuremu st not be that of chance persons。 the fairest music is that whichdelights the best and best educated, and especially that whichdelights the one man who is pre eminent in virtue and education. Andtherefore the judges must be men of character, for they will requireboth wisdom and coura ge。 the true judge must not draw hisinspiration from the theatre, nor ought he to be unnerved by theclamour of the many and his own incapacity。 nor again, knowing thetruth, ought he through cowardice and unmanliness carelessly todeliver a lying judgment, with the very same lips which have justappealed to the Gods before he judged. He is sitting not as thedisciple of the theatre, but, in his proper place, as theirinstructor, and he ought to be the enemy of all pandering to thepleasure of the spectators. The ancient and mon custo m of Hellas,which still prevails in Italy and Sicily, did certainly leave thejudgment to the body of spectators, w ho determined the victor byshow of hands. But this custom has been the destruction of thepoets。 for they are now in the habit of posing w ith a view toplease the bad taste of their judges, and the result is that thespectators instruct themselves。and also it has been the ruin of thetheatre。 they ought to be having characters put before them betterthan their own, and so receiving a higher pleasure,