当前位置:网站首页>Information Security Experiment 4: implementation of IP packet monitoring program
Information Security Experiment 4: implementation of IP packet monitoring program
2022-07-07 09:23:00 【Not enough to eat】
One 、 Purpose and requirements of the experiment
Students are familiar with the principle of network data communication as well as TCP/IP Principle of protocol structure On the basis of , Network packet monitoring technology realized by socket programming , Effectively detect the packet information transmitted on the network , Through the analysis and utilization of these information, it is helpful to maintain network security . requirement :
1. Familiar with the principle of network data communication as well as TCP/IP Principle of protocol structure .
2. master Ip Packet sending and receiving process .
3. Determine the experimental scheme on the basis of the learned knowledge , Draw a flow chart , Independent programming , Realize network listener .
4. Simply analyze the obtained data packets .
Two 、 Experimental content
Set the working mode of the network card to mixed mode . Get one in the LAN ( More than one ) The host MAC Address , Capture all packets passing through the network card , And the agreement can be analyzed 、IP source address 、IP Destination address 、TCP Source port number 、TCP Target port number, packet length and other information .
3、 ... and 、 Experimental environment
function windows Of PC machine , have JAVA、VC(windows) And other language compilation environments .
Four 、 Experimental steps and result analysis
1. Download and install WinPcap,WinPcap It can provide applications with the ability to access the bottom of the network . It is used for windows Direct network programming under the system .
2. download Jpcap.jar package , Used for the operation of packet capturing experiment ,jpcap In fact, it is not a real way to control the data link layer , It's a middleware ,JPCAP call winpcap/libpcap, And give JAVA Language provides a common interface , Thus, platform independence is realized
3. according to Jpcap.jar Package related classes and methods for experimental preparation
Bind network devices
NetworkInterface[] devices = JpcapCaptor.getDeviceList();
for (NetworkInterface n : devices) {
System.out.println(n.name + " | " + n.description);
}
Carry out the bag
int i = 0; while (i < 10) { Packet packet = jpcap.getPacket(); if (packet instanceof IPPacket && ((IPPacket) packet).version == 4) { i++; IPPacket ip = (IPPacket) packet;// Strong go System.out.println(" edition :IPv4"); System.out.println(" Priority :" + ip.priority); System.out.println(" Distinguish between service : Maximum throughput : " + ip.t_flag); System.out.println(" Distinguish between service : Highest reliability :" + ip.r_flag); System.out.println(" length :" + ip.length); System.out.println(" identification :" + ip.ident); System.out.println("DF:Don't Fragment: " + ip.dont_frag); System.out.println("NF:Nore Fragment: " + ip.more_frag); System.out.println(" Slice offset :" + ip.offset); System.out.println(" Time to live :" + ip.hop_limit); String protocol = ""; switch (new Integer(ip.protocol)) { case 1: protocol = "ICMP"; break; case 2: protocol = "IGMP"; break; case 6: protocol = "TCP"; break; case 8: protocol = "EGP"; break; case 9: protocol = "IGP"; break; case 17: protocol = "UDP"; break; case 41: protocol = "IPv6"; break; case 89: protocol = "OSPF"; break; default: break; } System.out.println(" agreement :" + protocol); System.out.println(" Source IP " + ip.src_ip.getHostAddress()); System.out.println(" Purpose IP " + ip.dst_ip.getHostAddress()); System.out.println(" Source host name : " + ip.src_ip); System.out.println(" Destination hostname : " + ip.dst_ip); System.out.println("----------------------------------------------"); } }
4. experimental result
Summary of the experiment : Through this experiment , I understand the principle of network data communication , Master master Ip Packet sending and receiving process , And pass Jpcap.jar Package call winpacp Realize the ability to access the bottom of the network , Reference... In a program jpcap The method in the class implements a pair of IP Package monitoring and analysis
边栏推荐
- Locust performance test 2 (interface request)
- PMP examination experience sharing
- What is the use of PMP certificate?
- Implementation of corner badge of Youmeng message push
- PMP Exam details after the release of the new exam outline
- 在EXCEL写VBA连接ORACLE并查询数据库中的内容
- [chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
- 正则匹配以XXX开头的,XXX结束的
- Postman data driven
- Full link voltage test of the e-commerce campaign Guide
猜你喜欢
Summary of PMP learning materials
Using JWT to realize login function
Postman data driven
STM32 serial port register library function configuration method
Postman interface test (I. installation and use)
Netease Cloud Wechat applet
Integer or int? How to select data types for entity classes in ORM
Implementation of corner badge of Youmeng message push
H3C vxlan configuration
Sublime Text4 download the view in bower and set the shortcut key
随机推荐
PMP experience learning and sharing process
Network request process
Original collection of hardware bear (updated on May 2022)
超十万字_超详细SSM整合实践_手动实现权限管理
【SVN】SVN是什么?怎么使用?
Regularly modify the system time of the computer
Install pyqt5 and Matplotlib module
十二、排序
C language pointer (Part 1)
Jenkins modifies the system time
四、机器学习基础
Pytest installation (command line installation)
Error: selenium common. exceptions. WebDriverException: Messag‘geckodriver‘ execute
Jenkins+ant+jmeter use
二叉树高频题型
華為HCIP-DATACOM-Core_03day
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme
Systick滴答定时器
在EXCEL写VBA连接ORACLE并查询数据库中的内容
信息安全实验四:Ip包监视程序实现