当前位置:网站首页>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
边栏推荐
- Difference between interface iterator and iteratable
- 網易雲微信小程序
- [istio introduction, architecture, components]
- The essence of high availability
- Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
- MySql数据库-索引-学习笔记
- 徽商期货公司评级是多少?开户安全吗?我想开户,可以吗?
- 答案在哪里?action config/Interceptor/class/servlet
- Unity shader (to achieve a simple material effect with adjustable color attributes only)
- Regularly modify the system time of the computer
猜你喜欢
信息安全实验三 :PGP邮件加密软件的使用
Integer or int? How to select data types for entity classes in ORM
STM32 clock system
正则匹配以XXX开头的,XXX结束的
Two schemes of unit test
【SVN】SVN是什么?怎么使用?
Expérience de port série - simple réception et réception de données
信息安全实验四:Ip包监视程序实现
Connecting mobile phone with ADB
Interview question: general layout and wiring principles of high-speed PCB
随机推荐
Postman data driven
Jenkins automated email
Postman interface test (I. installation and use)
Confitest of fixture py
Systick滴答定时器
Jenkins task grouping
正则匹配以XXX开头的,XXX结束的
Do you have any certificates with high gold content?
What are the suggestions for PMP candidates?
Locust performance test 5 (analysis)
Add new item after the outbound delivery order of SAP mm sto document is created?
Druid monitoring - Introduction to JMX usage and principle
Expérience de port série - simple réception et réception de données
信息安全实验一:DES加密算法的实现
Jenkins modifies the system time
MySql数据库-索引-学习笔记
[chaosblade: delete pod according to the tag, pod domain name access exception scenario, pod file system i/o failure scenario]
The essence of high availability
Huawei hcip datacom core_ 03day
JVM 内存结构 详细学习笔记(一)