【正文】
EN。 totallen = ICMP_HEAD_LEN。 break。 } case IPPROTO_TCP: { pTCPHead=(struct TCPPacketHead *)(buf+HdrLen)。 sourport = ntohs(pTCPHeadSourPort)。 destport = ntohs(pTCPHeadDestPort)。 (%d,sourport)。 (%d,destport)。 HdrLen = (pTCPHeadHLen)4。 HdrLen *= 4。 pdata=((BYTE *)pTCPHead)+HdrLen。 totallen = HdrLen。 break。 } case IPPROTO_UDP: { pUDPHead=(struct UDPPacketHead *)(buf+HdrLen)。 sourport = ntohs(pUDPHeadSourPort)。 destport = ntohs(pUDPHeadDestPort)。 (%d,sourport)。 (%d,destport)。 pdata=((BYTE *)pUDPHead)+UDP_HEAD_LEN。 totallen = UDP_HEAD_LEN。 break。 } } if(pIpHeaderproto == IPPROTO_ICMP) (type:%d code:%d data:%s,pICMPHeadType,pICMPHeadCode,pdata)。 else ( %s,pdata)。 (%d,totallen)。 pDlgAddData(strProto,szSource,strSourPort,szDest,strDestPort,strSize,strData)。 ... 數據的顯示 在完成了數據包的捕獲、分析后,我們使用 AddData 函數,調用列表控件變量使分析結果顯 示在界面的列表中,結果輸出代碼如下: void CIpmonDlg::AddData(CString s0,CString s1, CString s2, CString s3, CString s4, CString s5, CString s6) { int index。 index = (0,s0)。 (index,1,LVIF_TEXT,s1, 0, 0, 0,0)。 (index,2,LVIF_TEXT,s2, 0, 0, 0,0)。 (index,3,LVIF_TEXT,s3, 0, 0, 0,0)。 (index,4,LVIF_TEXT,s4, 0, 0, 0,0)。 (index,5,LVIF_TEXT,s5, 0, 0, 0,0)。 (index,6,LVIF_TEXT,s6, 0, 0, 0,0)。 } m_ctrList 是與列表控件 關聯(lián)的一個變量,列表控件用于顯示對數據包的分析結果。 嗅探器的測試 網絡嗅探器程序設計完成后,在 Windows 平臺下進行運行調試,修改錯誤,使其能完成捕獲數據包和分析數據包的功能 , 并將 解析結果在 MFC 界面顯示出來 ,如圖 47 所示: 圖 47 分析結果在界面中的顯示情況 網絡嗅探器能完成預期的要求,進行 數據 包截獲、 分析,顯示出分析結果。由圖 47 可以觀察到捕獲模塊能夠實現將網絡接口設置為混雜模式,同時捕獲局域網內的數據包,在這里還可以觀察到網絡狀態(tài)及網絡數據的流動情況,供網絡分析之用。 結 論 本次課題的 主要研究內容是利用套接字開發(fā)網絡嗅探器的程序設計,設計要求完成對流經本地網卡的所有數據包的捕獲,分析協(xié)議類型,并根據不同的協(xié)議類型對數據包進行了進一步的分析,包括分析數據包的源 IP 地址、目的 IP 地址、 源端口號、目的端口號、大小等。設計完成后經測試能實現預期要求的功能。但是仍然存在一些不足之處,例如: ,只對數據包作了簡單分析,分析內容不是很全面; ,而對于 諸如交換機這類設備 , 由于它能夠阻止廣播,所以就不能夠對子網內其他的機器進 行監(jiān)聽,若想要對此子網進行監(jiān)聽,就必須處于與此交換機同級的包交換網絡中。 通過對該課題的研究,讓我對嗅探技術有了進一步的了解,對其兩面性在網絡中產生的影響有了更深的認識,為了打破以上局限性,還需要結合已學知識對網絡嗅探技術方面的知識作進一步的學習。 參考文獻 [1] 求是科技,王正軍 .Visual C++ 程序設計從入門到精通 [M].北京:人民郵電出版社 ,2021。 [2] 鄭莉,董淵 .C++語言程序設計(第二版) [M].北京:清華大學出版社, 2021。 [3] 張仕斌,譚三,易勇,蔣毅 .網絡安全技術 [M].北京:清華大學出版社, 2021。 [4] 劉志祥 . Linux系統(tǒng)安全性研究及其新型 Sniffer設計與實現 [D]. 南昌:南昌大學 [碩士論文 ], 2021。 [5] 李渤 .嗅探技術的研究與應用開發(fā) [D].北京:中國地質大學 [碩士論文 ], 2021。 [6] 劉勝斐 .多 Agent 分布式入侵檢測系統(tǒng)中通信機制和數據分析方法研究 [D].江蘇:南開大學 [碩士論文 ], 2021。 [7] 郝坤 .BP神經網絡在網絡入侵檢測系統(tǒng)中的應用 [D].南京:南京理工大學 [碩士論文 ],2021。 [8] 孫晶艷 .面向校園網的網 絡監(jiān)聽技術研究 [D].黑龍江:哈爾濱工業(yè)大學 [碩士論文 ],2021。 致 謝 本文是在趙攀老師和盛志偉老師的熱情關心和指導下完成的,他們淵博的知識和嚴謹的治學態(tài)度使我受益匪淺,對順利完成本課題起到了極大的作用。在此向他表示我最衷心的感謝! 在論文完成過程中,本人還得到了張仕斌老師和陳偉同學的熱心幫助,本人向他們表示深深的謝意! 最后向在百忙之中評審本文的各位專家、老師表示衷心的感謝! 作者簡介: 姓 名:鄭 莉 性別:女 出生年月: 1985 年 1 月 民族: 漢 Email: 聲 明 本論文的工作是 2021 年 2 月至 2021 年 6 月在成都信息工程學院 系完成的。文中除了特別加以標注地方外,不包含他人已經發(fā)表或撰寫過的研究成果,也不包含為獲得成都信息工程學院或其他教學機構的學位或證書而使用過的材料。除非另有說明,本文的工作是原始性工作。 關于學位論文使用權和研究成果知識產權的說明 本人完全了解成都信息工程學院有關保管使用學位論文的規(guī)定,其中包括: ( 1)學校有權保管并向有關部門遞交學位論文的原件 與復印件。 ( 2)學??梢圆捎糜坝?、縮印或其他復制方式保存學位論文。 ( 3)學??梢詫W術交流為目的復制、贈送和交換學位論文。 ( 4)學??稍试S學位論文被查閱或借閱。 ( 5)學校可以公布學位論文的全部或部分內容(保密學位論文在解密后遵守此規(guī)定)。 除非另有科研合同和其他法律文書的制約,本論文的科研成果屬于成都信息工程學院。 特此聲明! 作者簽名: 年 月 日 54 Of Vainglory It was prettily devised of Aesop。 the fly sat upon the axletree of the chariot wheel, and said. What a dust do I raise? So are there some vain persons, that whatsoever goeths indeed! They could tell us something worth hearing, if they only knew how to talk. It39。s really a pleasure now and then to bee a mere nothing, especially when a man is as highly placed as I am. And then to think that we all, even with patent lacquer, are nothing more than insects of a moment on that anthill the earth, though we may be insects with stars and garters, places and offices! One feels quite a novice beside these venerable millionyearold boulders. On last New Year39。s eve I was reading the book, and had lost myself in it so pletely, that I fot my usual New Year39。s diversion, namely, the wild hunt to Amack. Ah, you don39。t know what that is! The journey of the witches on broomsticks is well enough known that journey is taken on St. John39。s eve, to the Brocken。 but we have a wild journey, also which is national and modern, and that is the journey to Amack on the night of the New Year. All indifferent poets and poetesses, musicians, newspaper writers, and artistic notabilities, I mean those who are no good, ride in the New Year39。s night through the air to Amack. They sit backwards on their painting b all lapse of time, and had bee a cipher and a nothing. Then three alone, or moveth upon greater means, if they have never so little hand in it, they think it is they that carry it They that are glorious, must needs be factious。 for all bravery stands upon parisons. They must needs be violent, to make good their own vaunts. Neithe r can they be secret, and therefore not effectual。 but according to die French proverb。 beaucoup de bruit, peu de fruit: much bruit, little fruit Yet certainly there is use of this quality, in civil affairs. Where there is an opinion, and fame to be created, either of virtue, or greatness, these men are good trumpeters. Again, as Titus Livius noteth, in the case of Antiochus, and the Aetolians。 there are sometimes great effects of cross lies。 as if a man that negotiates between two p