【正文】
], char *protocol){ if (getservbyport (htons (portn), protocol) != NULL){ strcpy(portch, getservbyport(htons(portn),protocol)s_name)。 } else{ //短暫端口等找不到名稱時(shí) sprintf (portch, e)。 } } 現(xiàn)在介紹一下 getportname()函數(shù)。此函數(shù)完成的是取得端口號和區(qū)別 TCP/UDP類別的兩個(gè)參數(shù)并返回端口名稱的工作。 getportname()函數(shù)的核心是調(diào)用getservbyport()函數(shù)。用這個(gè)函數(shù)來檢索與端口相關(guān)的信息,吧結(jié)果作為指向servent型的結(jié)構(gòu)體的指針并返回。 servent型的結(jié)構(gòu)體在 明。在這里使用的 s_name成員。把端口名稱賦給 s_name。 getportname()函數(shù)檢索端口名稱失敗時(shí),返回 NULL。這是因?yàn)榈玫降亩丝谔柺嵌虝憾丝谔?,沒有檢索到它的端口名稱。這時(shí),常把端口號作為端口的名稱來用。 5 程序運(yùn)行與測試 測試環(huán)境 硬件環(huán)境 處理器 P3 800Mhz 以上;內(nèi)存 128M 以上;多臺普通搭載網(wǎng)卡的 PC、經(jīng)過 集線器 互聯(lián)。 程序 運(yùn)行環(huán)境 安裝有 Libpcap 以上版本的 Linux 操作系統(tǒng)。 測試步驟 首先,用多臺 PC搭建局域網(wǎng)絡(luò)。其次,選定一臺 PC 對 數(shù)據(jù)包捕獲 模塊、 規(guī)則過濾 模塊 、協(xié)議分析模塊 進(jìn)行功能測試 。 然后 對每個(gè)功能模塊進(jìn)行數(shù)據(jù)合 法性檢查、數(shù)據(jù)一致性檢查。 最后 對關(guān)鍵模塊進(jìn)行回歸測試。 測試結(jié)果評價(jià) 本設(shè)計(jì)在 Fedora Core 4 環(huán)境試運(yùn)行下,編碼后經(jīng)過多次測試并將發(fā)現(xiàn)的錯(cuò)誤及時(shí)修改,系統(tǒng)運(yùn)行正常,基本達(dá)到設(shè)計(jì)目標(biāo),運(yùn)行結(jié)果比較良好。圖 51是程序 運(yùn)行時(shí)的 界面。 圖 51 程序運(yùn)行界面 結(jié) 論 在研究了網(wǎng)絡(luò)監(jiān)聽技術(shù)和協(xié)議分析技術(shù)的基礎(chǔ)上,本文設(shè)計(jì)和實(shí)現(xiàn)了一個(gè)網(wǎng) 絡(luò)數(shù)據(jù)包的議分析程序,該程序具有以下特點(diǎn): (1)將能夠監(jiān)聽局域網(wǎng)中的數(shù)據(jù)。 (2)能夠識別應(yīng)用層協(xié)議。 與此同時(shí),隨著網(wǎng)絡(luò)技術(shù)的快速發(fā)展, 網(wǎng)絡(luò)帶寬越來越寬,網(wǎng)絡(luò)規(guī)模越來越大,網(wǎng)絡(luò)結(jié)構(gòu)越來越復(fù)雜,可以從以下三個(gè)方面對本系統(tǒng)做改進(jìn)和更進(jìn)一步的深入研究。 (1)增強(qiáng)監(jiān)聽系統(tǒng)的控制功能。目前本系統(tǒng)只能被動的接收網(wǎng)絡(luò)數(shù)據(jù),并不能對監(jiān)聽點(diǎn)進(jìn)行控制,如果能夠增加控制功能比如可以設(shè)定監(jiān)聽程序的啟動 /暫停 ,無疑會使得更加靈活強(qiáng)大。 (2)與硬件相結(jié)合開發(fā)成熟產(chǎn)品。在高速寬帶的網(wǎng)絡(luò)中進(jìn)行監(jiān)聽時(shí),由于受限于目前網(wǎng)絡(luò)接口、計(jì)算機(jī)總線結(jié)構(gòu)、 CPU處理能力、磁盤 I/O性能等的影響,不可避免會出現(xiàn)丟包、無法實(shí)時(shí)控制等情況,這時(shí)應(yīng)類似于網(wǎng)絡(luò)分析儀一樣結(jié)合硬件充分發(fā)揮系統(tǒng)的潛 能開發(fā)成熟產(chǎn)品。 (3)分布式發(fā)展。把數(shù)據(jù)報(bào)捕獲、協(xié)議分析、數(shù)據(jù)分析、相應(yīng)控制等都集中在一起必然對整個(gè)系統(tǒng)的性能存在影響,所以可以把各個(gè)組件分散設(shè)計(jì)并協(xié)同工作,甚至一個(gè)組件比如數(shù)據(jù)報(bào)捕獲組件都可以部署在多個(gè)監(jiān)控點(diǎn)。 可見網(wǎng)絡(luò)數(shù)據(jù)包的監(jiān)聽技術(shù)在今天的網(wǎng)絡(luò)信息時(shí)代是重要的、長期的研發(fā)課題,它的研究成功將具有重要的社會效益和理論研究意義。 參考文獻(xiàn) [1] 小高知宏 [日 ].TCP/IP數(shù)據(jù)包分析程序篇 [M].葉明譯 .北京:科學(xué)出版社 ,2021。 [2] W Richard [M].范建華 胥光輝 張濤譯 .北京:機(jī)械工業(yè)出版社 , 2021。 [3] 謝希仁 .計(jì)算機(jī)網(wǎng)絡(luò) [M].北京:電子工業(yè)出版社 , 2021。 [4] 劉文濤 .網(wǎng)絡(luò)安全開發(fā)包詳解 [M].北京:電子工業(yè)出版社 , 2021。 [5] Libpcap的數(shù)據(jù)結(jié)構(gòu)和函數(shù)介紹 [OL].LinuxAid網(wǎng)站 . [6] 王學(xué)磊 .網(wǎng)絡(luò)數(shù)據(jù)包截獲與分析研究 [D].沈陽:東北大學(xué) [碩士論文 ],2021。 [7] 王皓 .遠(yuǎn)程網(wǎng)絡(luò)數(shù)據(jù)包監(jiān)聽技術(shù)的研究 [D].大連:大連理工大學(xué) [碩士論文 ],2021。 致 謝 本文是在歐曉聰老師的熱情關(guān)心和指導(dǎo)下完成的,他淵博的知識和嚴(yán)謹(jǐn)?shù)闹螌W(xué)作風(fēng)使我受益匪淺,對順利完成本課題起到了極大的作用。在此向他表示我最衷心的感謝! 在論文完成過程中,本人還得到了金虎老師的悉心指導(dǎo)。金老師多次詢問研究進(jìn)程,并為我指點(diǎn)迷津,幫助我開拓 研究思路,精心點(diǎn)撥、熱忱鼓勵。金老師一絲不茍的作風(fēng),嚴(yán)謹(jǐn)求實(shí)的態(tài)度,踏踏實(shí)實(shí)的精神,不僅授我以文,而且教我做人,雖歷時(shí)三載,卻給以終生受益無窮之道。對金老師的感激之情是無法用言語表達(dá)的。 感謝我的爸爸媽媽,焉得諼草,言樹之背,養(yǎng)育之恩,無以回報(bào),你們永遠(yuǎn)健康快樂是我最大的心愿。 最后向在百忙之中評審本文的各位專家、老師表示衷心的感謝! 作者簡介 姓 名: 沈也明 性別: 男 出生年月: 1985 年 8 月 民族: 漢 Email: 聲 明 本論文的工作是 2021 年 02 月至 2021 年 06 月在成都信息工程學(xué)院 系完成的。文中除了特別加以標(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é)??梢圆捎糜坝 ⒖s印或其他復(fù)制方式保存學(xué)位論文。 ( 3)學(xué)??梢詫W(xué)術(shù)交流為目的復(fù)制、贈送和交換學(xué)位論文。 ( 4)學(xué)??稍试S學(xué)位論文被查閱或借閱。 ( 5)學(xué)??梢怨紝W(xué)位論文的全部或部分內(nèi)容(保密學(xué)位論文在解密后遵守此規(guī)定)。 除非另有科研合同和其他法律文書的制約,本論文的科研成果屬于成都信息工程學(xué)院。 特此聲明! 作者簽名: 年 月 日 Piga39。 was a fine word. It sounded exactly as the mand to fire should sound or the announcement of a hit. 39。M39。uzuri39。, meaning good, well, better, had sounded too much like the name of a state for a long time, and walking I used to make up sentences in Swahili with Ar kansas and M39。usuri in them, but now it seemed natural, no longer to be italicized, just as all the words came to seem the proper and natural words and there was nothing odd or unseemly in the stretching of the ears, in the tribal scars, or in a man carrying a spear. The tribal marks and the tattooed places seemed natural and handsome adornments and I regretted not having any of my own. My own scars were all informal, some irregular and sprawling, others simply puffy welts. I had one on my forehead that people still mented on, asking if I had bumped my head, but Droop had handsome ones beside his cheekbones and others, symmetrical and decorative, on his chest and belly. I was thinking that I had one good one, a sort of embossed Christmas tree, on the bottom of my right foot that only served to wear out soc ks, when we jumped two reedbuck. They went off through the trees and then stood at sixty yards, the thin, graceful buck looking bac k, and I shot him high and a touch behind the shoulder. He gave a jump and went off very fast.39。Piga.39。 Droopy smiled. We had both hea rd the w hunk of the bullet.39。Kufa,39。 I told him. 39。Dead.39。But when we came up to him, lying on his side, his heart was still beating strongly, although to all appearances he was dead. Droopy had no skinning knife and I had only a penknife to stic k him with. I felt for the heart behind the foreleg with my fingers and feeling it beating under the hide slipped the knife in but it was short and pushed the heart away. I could feel it, hot and rub bery against my fingers, and feel the knife push it, but I felt around and cut the big artery and the blood came hot against my fingers. Once bled, I started to open him, w ith the little knife, still showing off to Droopy, and emptying him neatly took out the liver, cut away the gall, and laying the liver on a hummock of grass, put the kidneys beside asked for the knife. N ow he was going to show me something. Skilfully he slit open the stomach and turned it inside, tripe side, out, emptying the grass in it on the ground, shook it, then put the liver and kidneys inside it and w ith the knife cut a switch from the tree the buc k lay under and sewed the stomach together with the withe so that the tripe made a bag to carry the other delicacies in. Then he cut a pole and put the bag on the end of it, running it through the flaps, and put it over his shoulder in the way tramps carried their property in a handkerchief on the end of a stic k in Blue Jay corn plaster advertisements w hen we were children. It was a good trick and I thought how I w ould show it to John Staib in Wyoming some time and he would smile his deaf man39。s smile