【正文】
HEAD_LEN。 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)。 ... 數(shù)據(jù)的顯示 在完成了數(shù)據(jù)包的捕獲、分析后,我們使用 AddData 函數(shù),調(diào)用列表控件變量使分析結(jié)果顯示在界面的列表中,結(jié)果輸出代碼如下: 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 是與列表控件關(guān)聯(lián)的一個變量,列表控件用于顯示對數(shù)據(jù)包的分析結(jié)果。 嗅探器的測試 網(wǎng)絡(luò)嗅探器程序設(shè)計完成后,在 Windows 平臺下進(jìn)行運(yùn)行調(diào)試,修改錯誤,使其能完成捕獲數(shù)據(jù)包和分析數(shù)據(jù)包的功能 , 并將 解析結(jié)果在 MFC 界面顯示出來 ,如圖 47 所示: 圖 47 分析結(jié)果在界面中的顯示情況 網(wǎng)絡(luò)嗅探器能完成預(yù)期的要求,進(jìn)行 數(shù)據(jù) 包截獲、 分析,顯示出分析結(jié)果。由圖 47 可以觀察到捕獲模塊能夠?qū)崿F(xiàn)將網(wǎng)絡(luò)接口設(shè)置為混雜模式,同時捕獲局域網(wǎng)內(nèi)的數(shù)據(jù)包,在這里還可以觀察到網(wǎng)絡(luò)狀態(tài)及網(wǎng)絡(luò)數(shù)據(jù)的流動情況,供網(wǎng)絡(luò)分析之用。 結(jié) 論 本次課題的 主要研究內(nèi)容是利用套接字開發(fā)網(wǎng)絡(luò)嗅探器的程序設(shè)計,設(shè)計要求完成對流經(jīng)本地網(wǎng)卡的所有數(shù)據(jù)包的捕獲,分析協(xié)議類型,并根據(jù)不同的協(xié)議類型對數(shù)據(jù)包進(jìn)行了進(jìn)一步的分析,包括分析數(shù)據(jù)包的源 IP 地址、目的 IP 地址、 源端口號、目的端口號、大 小等。設(shè)計完成后經(jīng)測試能實(shí)現(xiàn)預(yù)期要求的功能。但是仍然存在一些不足之處,例如: ,只對數(shù)據(jù)包作了簡單分析,分析內(nèi)容不是很全面; ,而對于 諸如交換機(jī)這類設(shè)備 , 由于它能夠阻止廣播,所以就不能夠?qū)ψ泳W(wǎng)內(nèi)其他的機(jī)器進(jìn)行監(jiān)聽,若想要對此子網(wǎng)進(jìn)行監(jiān)聽,就必須處于與此交換機(jī)同級的包交換網(wǎng)絡(luò)中。 通過對該課題的研究,讓我對嗅探技術(shù)有了進(jìn)一步的了解,對其兩面性在網(wǎng)絡(luò)中產(chǎn)生的影響有了更深的認(rèn)識,為了打破以上局限性,還需要結(jié)合已學(xué)知識對網(wǎng)絡(luò)嗅探技術(shù)方面的知識作進(jìn)一 步的學(xué)習(xí)。 參考文獻(xiàn) [1] 求是科技,王正軍 .Visual C++ 程序設(shè)計從入門到精通 [M].北京:人民郵電出版社 ,2021。 [2] 鄭莉,董淵 .C++語言程序設(shè)計(第二版) [M].北京:清華大學(xué)出版社, 2021。 [3] 張仕斌,譚三,易勇,蔣毅 .網(wǎng)絡(luò)安全技術(shù) [M].北京:清華大學(xué)出版社, 2021。 [4] 劉志祥 . Linux系統(tǒng)安全性研究及其新型 Sniffer設(shè)計與實(shí)現(xiàn) [D]. 南昌:南昌大學(xué) [碩士論文 ], 2021。 [5] 李渤 .嗅探技術(shù)的研究與應(yīng)用開發(fā) [D].北京:中國地質(zhì)大學(xué) [碩士論 文 ], 2021。 [6] 劉勝斐 .多 Agent 分布式入侵檢測系統(tǒng)中通信機(jī)制和數(shù)據(jù)分析方法研究 [D].江蘇:南開大學(xué) [碩士論文 ], 2021。 [7] 郝坤 .BP神經(jīng)網(wǎng)絡(luò)在網(wǎng)絡(luò)入侵檢測系統(tǒng)中的應(yīng)用 [D].南京:南京理工大學(xué) [碩士論文 ],2021。 [8] 孫晶艷 .面向校園網(wǎng)的網(wǎng)絡(luò)監(jiān)聽技術(shù)研究 [D].黑龍江:哈爾濱工業(yè)大學(xué) [碩士論文 ],2021。 致 謝 本文是在趙攀老師和盛志偉老師的熱情關(guān)心和指導(dǎo)下完成的,他們淵博的知識和嚴(yán)謹(jǐn)?shù)闹螌W(xué)態(tài)度使我受益匪淺,對順利完成本課題起到了極大的作用。在此向他表示我最衷心 的感謝! 在論文完成過程中,本人還得到了張仕斌老師和陳偉同學(xué)的熱心幫助,本人向他們表示深深的謝意! 最后向在百忙之中評審本文的各位專家、老師表示衷心的感謝! 作者簡介: 姓 名:鄭 莉 性別:女 出生年月: 1985 年 1 月 民族:漢 Email: 聲 明 本論文的工作是 2021 年 2 月至 2021 年 6 月在成都信息工程學(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é)校可以采用影印、縮印或其他復(fù)制方式保存學(xué)位論文。 ( 3)學(xué)??梢詫W(xué)術(shù)交流為目的復(fù)制、贈送和交換學(xué)位論文。 ( 4)學(xué)校可允許學(xué)位論文被查閱或借閱。 ( 5)學(xué)校可以公布學(xué)位論文的全部或部分內(nèi)容(保密學(xué)位論文在解密后遵守此規(guī) 定)。 除非另有科研合同和其他法律文書的制約,本論文的科研成果屬于成都信息工程學(xué)院。 特此聲明! 作者簽名: 年 月 日 12Visafree policy brings Chengdu biz, tourism boost. Making national headlines several times, Chengdu39。s 72hour visafree policy has attracted wide attention from both Chinese and foreign experts and businessmen since it took effect on Sept 1 last year. The program permits citizens from 51 countries and regions including the United States, Australia, Canada and Japan who have valid visas and flight tickets to a third country to spend three days in the city. The capital of Sichuan province is the first city in the western region of China to offer foreign tourists a threeday visa and the fourth nationwide to adopt the policy following Shanghai, Beijing and Guangzhou. Li Zhiyong, deputy dean of the tourism institute at Sichuan University, said the move contributes to a large increase in the number of overseas tourists and raises the city39。s level of internationalization. The policy will also bring direct economic revenue, Li said. Chengdu has many cultural legacies and is also a paradise for panda lovers with the world39。s largest breeding and research center. Three days are long enough for foreign visitors to visit those iconic tourist spots, he noted. The city is home to the remains of the Jin sha civilization that dates back more than 3,000 years as well a s the Qing cheng Mountains and the Du jiang yan irrigation system. Qing cheng has long been recognized as the birthplace of Taoism, China39。s ancient indigenous religion, while Du jiang yan is considered to be the oldest functioning watercontrol project in the world. Chengdu ranked third in tourist facilities, management and services among 60 Chinese cities in a customer satisfaction survey released last year. But, Li added that efforts are still needed to develop more tourism products, improve English services and provide accurate translation of traffic signs and scenic billboards. Zhao Yun, chairwoman of British Chamber of Commerce Southwest China, told China Daily that his colleagues found the policy very convenient. A British client once flew here and stayed for just one day to check her ordered goods, she said. Zhao was born in Shanxi province, but she has lived in Ch