Network detection method, device, electronic device and storage medium

By parsing LAN traffic packets and terminal MAC addresses, combined with port scanning and flag field continuity judgment, unsafe terminals are quickly identified and blocked, solving the complexity and accuracy problems of LAN security detection in the existing technology, and achieving simplification network security management.

CN113938460BActive Publication Date: 2024-08-27HUBEI TIANRONGXIN NETWORK SECURITY TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111414030.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2024-08-27
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

Existing technology is difficult to quickly and accurately detect and ensure terminal security within a LAN within an enterprise or unit, especially when terminals are diverse and the network structure is complex, and firewalls cannot be widely deployed to ensure LAN security.

Method used

By obtaining the traffic packets of the LAN, parsing the session information and the MAC address of the communication terminal, judging the IP address change to determine the terminal security status, and identifying unsafe terminals by scanning the ports that are not allowed to be opened and the continuity of the flag field, constructing RST or Port unreachable message to block communication.

Benefits of technology

It can quickly detect and identify unsafe terminals in the LAN without deploying complex firewalls, improving detection accuracy and network security, and simplifying network management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113938460B
    Figure CN113938460B
Patent Text Reader

Abstract

The embodiment of the present application provides a network detection method, device, electronic device and storage medium, the method comprising: obtaining a local area network flow message; obtaining session information in the flow message; determining the communication terminal corresponding to the session information; judging whether the MAC address of the communication terminal in the flow message has changed; if so, obtaining the security status of the communication terminal according to the change status of the IP address of the communication terminal. By implementing the embodiment of the present application, unsafe terminals can be quickly detected in the local area network without deploying complex firewalls.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a network detection method, device, electronic device and computer-readable storage medium. Background Art

[0002] At present, the Internet is developing rapidly, and the network has brought great convenience to people's lives and work, but it also brings network security issues. Network security issues cannot be ignored. Network security within the LAN is still the top priority. Typical vulnerability attacks such as "Eternal Blue" and OpenSSL "Heartbleed" still pose a huge threat to the network. Terminal security is very important. Privately accessing routers or opening network proxy sharing networks in the network also brings inconvenience to network management. At present, the diversity of terminals within enterprises or units makes it inconvenient to uniformly install software management, and the network structure is complex, so it is impossible to widely deploy firewalls to ensure the security of the LAN. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a network detection method, device, electronic device and storage medium, which do not require the deployment of complex firewalls, and only require simple analysis to determine unsafe terminals in the local area network, thereby ensuring the security of the network.

[0004] In a first aspect, an embodiment of the present application provides a network detection method, the method comprising:

[0005] Get the traffic packets of the LAN;

[0006] Obtaining session information from the traffic message;

[0007] Determining a communication terminal corresponding to the session information;

[0008] Determine whether the MAC address of the communication terminal in the traffic message has changed;

[0009] If so, the security status of the communication terminal is obtained according to the change status of the IP address of the communication terminal.

[0010] In the above implementation process, the flow message of the local area network is obtained, the session information is determined in the flow message, and the communication terminal corresponding to the session is further determined. The MAC address of each terminal device is unchanged. If the MAC address of the communication terminal obtained in the flow message changes, it can be preliminarily determined that the terminal is an unknown terminal, and the IP address of the unknown terminal is further detected to determine whether the unknown terminal is an unsafe terminal. Compared with the existing technology, there is no need to deploy a complex firewall, and only a simple analysis is needed to determine the unsafe terminal in the local area network, and the unsafe terminal can be quickly detected in the local area network.

[0011] Further, after the step of determining the communication terminal corresponding to the session information, the method further includes:

[0012] Obtaining the communication protocol of the traffic message;

[0013] If the communication protocol is TCP, send a TCP-SYN message to the port that the communication terminal is not allowed to open; determine whether a response message of the port that the communication terminal is not allowed to open is obtained; if not, determine the communication terminal as an unsafe terminal;

[0014] If the communication protocol is UDP, determine whether a port unreachable message sent by a port that the communication terminal does not allow to be opened is obtained; if so, determine the communication terminal as an unsafe terminal.

[0015] In the above implementation process, by scanning the ports that are not allowed to be opened, it can be determined whether the communication terminal has opened the ports that are not allowed to be opened. If so, it can be determined that the terminal is an unsafe terminal. Based on the above implementation, the accuracy of detection can be improved.

[0016] Further, after the step of obtaining the communication protocol of the flow message, it also includes:

[0017] Determine whether the values ​​corresponding to the flag fields of the plurality of flow messages in the data packet corresponding to the flow message are continuous;

[0018] If not, the communication terminal is determined to be an unsafe terminal.

[0019] In the above implementation process, under normal circumstances, each time the terminal sends a message, the value corresponding to the flag field in the message is increased by 1. When the terminal is communicating with the network normally, the value corresponding to the flag field of the flow message in each data packet is continuous. However, if the terminal is a dynamic address NAT, address port translation NAPT, or uses another person's proxy to connect to the network in the local area network, the value corresponding to the flag field of the data packet flow message is not continuous. The continuity of this field value can be used to determine whether there are multiple terminals under the IP address, whether it is a dynamic address NAT, address port translation NAPT, or a network proxy is enabled in the local area network.

[0020] Furthermore, the communication terminal includes: a receiving end and a transmitting end;

[0021] After the step of determining the communication terminal as an unsafe terminal, the method further includes:

[0022] If the communication protocol is TCP, construct a RST data packet and send it to the receiving end;

[0023] If the communication protocol is UDP, a port unreachable message is constructed and sent to the sending end.

[0024] In the above implementation process, for communication terminals that use the TCP protocol for communication, a RST data packet is constructed and sent to the receiving end. Compared with the sending end, the receiving end in the LAN can reach the terminal before the connection is established, thereby blocking the connection. For communication terminals that use UDP for communication, a UDP port unreachable message is constructed and sent to the sending end, which can achieve the effect of blocking communication.

[0025] In a second aspect, an embodiment of the present application provides a network detection device, the device comprising:

[0026] An acquisition module is used to acquire traffic messages of a local area network;

[0027] A session information acquisition module, used to acquire session information from the traffic message;

[0028] A determination module, used to determine the communication terminal corresponding to the session information;

[0029] A determination module, used to determine whether the MAC address of the communication terminal in the traffic message has changed;

[0030] A status acquisition module is used to acquire the security status of the communication terminal according to the change status of the IP address of the communication terminal when the judgment result of the judgment module is yes.

[0031] In the above implementation process, the acquisition module acquires the flow message of the local area network, determines the session information in the flow message, and the session information acquisition module further determines the communication terminal corresponding to the session. The MAC address of each terminal device in the determination module is unchanged. If the MAC address of the communication terminal obtained in the flow message changes, it can be preliminarily determined that the terminal is an unknown terminal. The state acquisition module further detects the IP address of the unknown terminal to determine whether the unknown terminal is an unsafe terminal. Compared with the existing technology, there is no need to deploy a huge firewall, and only a simple analysis is needed to determine the unsafe terminal.

[0032] Furthermore, the acquisition module is also used to acquire the communication protocol of the flow message;

[0033] The device also includes a sending module, which is used to send a TCP-SYN message to the port that the communication terminal is not allowed to open when the communication protocol is TCP; the judging module is also used to judge whether a response message of the port that the communication terminal is not allowed to open is obtained; if not, the communication terminal is determined as an unsafe terminal;

[0034] The judgment module is also used to judge whether a port unreachable message sent by a port that the communication terminal does not allow to be opened is obtained when the communication protocol is UDP; if so, determine the communication terminal as an unsafe terminal.

[0035] In the above implementation process, by scanning the ports that are not allowed to be opened, it can be determined whether the communication terminal has opened the ports that are not allowed to be opened. If so, it can be determined that the terminal is an unsafe terminal. Based on the above implementation, the accuracy of detection can be improved.

[0036] Furthermore, the judgment module is also used to judge whether the values ​​corresponding to the flag fields of multiple traffic messages in the data packet corresponding to the traffic message are continuous; if not, the communication terminal is determined as an unsafe terminal.

[0037] In the above implementation process, under normal circumstances, each time a terminal sends a message, the value corresponding to the flag field in the message is increased by 1. When two terminals are connected to the network normally, the value corresponding to the flag field in the IP data packet header in each data packet is continuous. However, if the terminal is a dynamic address NAT, address port translation NAPT, or uses another person's proxy to connect to the network in the local area network, the value corresponding to the flag field in the IP data packet header in the IP data packet is not continuous. The continuity of this field value can be used to determine whether there are multiple terminals under the IP address, whether it is a dynamic address NAT, address port translation NAPT, or a network proxy is enabled in the local area network.

[0038] Furthermore, the communication terminal includes: a receiving end and a transmitting end;

[0039] The sending module is also used to construct an RST data packet and send it to the receiving end when the communication protocol is TCP; and to construct a port unreachable message and send it to the sending end when the communication protocol is UDP.

[0040] In the above implementation process, for communication terminals that use the TCP protocol for communication, the sending module constructs an RST data packet and sends it to the receiving end. Relative to the sending end, the receiving end in the local area network can reach the terminal before the connection is established, thereby blocking the connection. For communication terminals that use UDP for communication, the blocking module constructs a UDP port unreachable message and sends it to the sending end, which can achieve the effect of blocking communication.

[0041] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first aspects when executing the computer program.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method as described in any one of the first aspects.

[0043] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method as described in any one of the first aspects.

[0044] Other features and advantages disclosed in the present application will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technology disclosed in the present application.

[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A flowchart of a network detection method provided in an embodiment of the present application;

[0048] Figure 2 A structural diagram of a network detection device provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0051] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0052] Example 1

[0053] See also Figure 1, the embodiment of the present application provides a network detection method, including:

[0054] S1: Get the traffic message of LAN;

[0055] S2: Get session information from traffic packets;

[0056] S3: Determine the communication terminal corresponding to the session information;

[0057] S4: Determine whether the MAC address of the communication terminal in the traffic message has changed; if so, execute S5;

[0058] S5: Obtain the security status of the communication terminal according to the change status of the IP address of the communication terminal.

[0059] In a possible implementation, traffic packets within the local area network may be obtained through bypass deployment.

[0060] In the above implementation process, the traffic message of the local area network is obtained, the session information is determined in the traffic message, and the communication terminal corresponding to the session is further determined. The MAC (Media Access Control Address) address of each terminal device is unchanged. If the MAC address of the communication terminal obtained in the traffic message changes, it can be preliminarily determined that the terminal is an unknown terminal, and the IP address of the unknown terminal is further detected to determine whether the unknown terminal is an unsafe terminal. Compared with the existing technology, there is no need to deploy a large firewall, and only a simple analysis is needed to determine the unsafe terminal.

[0061] In a possible implementation, in S4, the traffic message in the data packet is parsed to determine whether the MAC addresses in the multiple data messages in the data packet are different. If they are different, it is determined that the MAC address of the communication terminal has changed.

[0062] In a possible implementation, S5 includes: determining whether the IP address of the communication terminal has changed, and if so, determining that the communication terminal is an unsafe terminal.

[0063] In the above embodiment, the specific step of determining whether the IP address (Internet Protocol Address) of the communication terminal has changed is to determine whether the IP addresses obtained in multiple messages in a data packet are different. For example, in a data packet, there are two data messages, and the source addresses or destination addresses parsed from the two data messages are different. If the source addresses are different, then the terminal device corresponding to the source address is an unsafe terminal, and if the destination addresses are different, then the terminal device corresponding to the destination address is an unsafe terminal.

[0064] See also Figure 2 In a possible implementation manner, after S3, the method further includes:

[0065] Obtain the communication protocol of the traffic message;

[0066] If the communication protocol is TCP (Transmission Control Protocol), send a TCP-SYN (Transmission Control Protocol-synchronous, TCP-SYN) message to the port that the communication terminal is not allowed to open; determine whether a response message of the port that the communication terminal is not allowed to open is obtained; if not, determine the communication terminal as an unsafe terminal;

[0067] If the communication protocol is UDP (User Datagram Protocol), it is determined whether a port unreachable message sent by a port that is not allowed to be opened by the communication terminal is obtained; if so, the communication terminal is determined to be an unsafe terminal.

[0068] In the above implementation process, by scanning the ports that are not allowed to be opened, it can be determined whether the communication terminal has opened the ports that are not allowed to be opened. If the communication terminal has opened an unsafe port, it can be determined that the terminal may be invaded by a virus and the terminal can be determined to be an unsafe terminal. Based on the above implementation, the accuracy of detection can be improved.

[0069] In a possible implementation manner, after the step of obtaining the communication protocol of the traffic message, the method further includes:

[0070] Determine whether the values ​​corresponding to the flag fields of multiple flow messages in the data packet corresponding to the flow message are continuous;

[0071] If not, the communication terminal is determined to be an unsafe terminal.

[0072] In the above implementation process, under normal circumstances, each time the terminal sends a message, the value corresponding to the flag field in the message is increased by 1. When the terminal is communicating with the network normally, the value corresponding to the flag field in the flow message of each data packet is continuous. However, if the terminal is a dynamic address NAT (Network Address Translation), address port translation NAPT (Network Address Port Translation), or uses another person's proxy for network connection in the local area network, the value corresponding to the flag field in the data packet flow message is not continuous. The continuity of this field value can be used to determine whether there are multiple terminals under the IP address, whether it is a dynamic address NAT, address port translation NAPT, or a network proxy is enabled in the local area network.

[0073] In a possible implementation, the communication terminal includes: a receiving end and a transmitting end;

[0074] After the step of determining the communication terminal as an unsafe terminal, the method further includes:

[0075] If the communication protocol is TCP, construct a reset (Reset, RST) data packet and send it to the receiving end;

[0076] If the communication protocol is UDP, a port unreachable message is constructed and sent to the sending end.

[0077] In the above implementation process, for communication terminals that use the TCP protocol for communication, a RST data packet is constructed and sent to the receiving end. Compared with the sending end, the receiving end in the LAN can reach the terminal before the connection is established, thereby blocking the connection. For communication terminals that use UDP for communication, a UDP port unreachable message is constructed and sent to the sending end, which can achieve the effect of blocking communication.

[0078] Example 2

[0079] See also Figure 2 , the embodiment of the present application provides a network detection device, including:

[0080] Acquisition module 1, used to acquire traffic messages of the local area network;

[0081] Session information acquisition module 2, used to obtain session information in the traffic message;

[0082] Determining module 3, used to determine the communication terminal corresponding to the session information;

[0083] A judgment module 4 is used to judge whether the MAC address of the communication terminal in the traffic message has changed;

[0084] The status acquisition module 5 is used to acquire the security status of the communication terminal according to the change status of the IP address of the communication terminal when the judgment result of the judgment module 4 is yes.

[0085] In the above implementation process, the acquisition module 1 acquires the flow message of the local area network, determines the session information in the flow message, the session information acquisition module 2 further determines the communication terminal corresponding to the session, and the MAC address of each terminal device in the determination module 3 is unchanged. If the MAC address of the communication terminal obtained in the flow message changes, it can be preliminarily determined that the terminal is an unknown terminal, and the IP address of the unknown terminal is further detected to determine whether the unknown terminal is an unsafe terminal. Compared with the prior art, the embodiment of the present application does not need to deploy a large firewall, and only needs simple analysis to determine the unsafe terminal.

[0086] Furthermore, the acquisition module 1 is also used to acquire the communication protocol of the flow message;

[0087] The device further comprises a sending module, which is used to send a connection establishment message to the port that is not allowed to be opened by the communication terminal when the communication protocol is TCP; the judging module 4 is also used to judge whether a response message of the port that is not allowed to be opened by the communication terminal is obtained; if not, the communication terminal is determined as an unsafe terminal;

[0088] The judgment module 4 is also used to judge whether a port unreachable message sent by a port that the communication terminal does not allow to be opened is obtained when the communication protocol is UDP; if so, determine the communication terminal as an unsafe terminal.

[0089] By scanning the ports that are not allowed to be opened, it is possible to determine whether the communication terminal has opened the ports that are not allowed to be opened, and if so, it can be determined that the terminal is an unsafe terminal. Based on the above implementation, the accuracy of detection can be improved.

[0090] The judging module 4 is further used to judge whether the values ​​corresponding to the flag fields of the plurality of flow messages in the data packet corresponding to the flow message are continuous; if not, the communication terminal is determined as an unsafe terminal.

[0091] In the above implementation process, under normal circumstances, each time a terminal sends a message, the value corresponding to the flag field in the message is increased by 1. When two terminals are connected to the network normally, the value corresponding to the flag field in the IP data packet header in each data packet is continuous. However, if the terminal is a dynamic address NAT, address port translation NAPT, or uses another person's proxy to connect to the network in the local area network, the value corresponding to the flag field in the IP data packet header in the IP data packet is not continuous. The continuity of this field value can be used to determine whether there are multiple terminals under the IP address, whether it is a dynamic address NAT, address port translation NAPT, or a network proxy is enabled in the local area network.

[0092] Furthermore, the communication terminal includes: a receiving end and a transmitting end;

[0093] The sending module is also used to construct an RST data packet and send it to the receiving end when the communication protocol is TCP; and to construct a port unreachable message and send it to the sending end when the communication protocol is UDP.

[0094] In the above implementation process, for the communication terminal using TCP protocol for communication, the data packet of the sending module RST is sent to the receiving end. Relative to the sending end, the receiving end in the local area network can reach the terminal before the connection is established, thereby blocking the connection. For the communication terminal using UDP for communication, the blocking module constructs a UDP port unreachable message and sends it to the sending end, which can achieve the effect of blocking communication.

[0095] Example 3

[0096] like Figure 3 As shown, an embodiment of the present application also provides an electronic device, which may include a processor 31, a communication interface 32, a memory 33 and at least one communication bus 34. Among them, the communication bus 34 is used to realize the direct connection and communication of these components. Among them, the communication interface 32 of the device in the embodiment of the present application is used to communicate signaling or data with other node devices. The processor 31 can be an integrated circuit chip with signal processing capabilities.

[0097] The processor 31 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor 31 can also be any conventional processor, etc.

[0098] The memory 33 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory 33 stores computer readable instructions. When the computer readable instructions are executed by the processor 31, the device can execute the above-mentioned Figure 1 The method embodiment involves various steps.

[0099] Optionally, the electronic device may further include a storage controller and an input / output unit. The memory 33, the storage controller, the processor 31, the peripheral interface, and the input / output unit are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via one or more communication buses 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the device.

[0100] The input and output unit is used to provide users with the task creation and to create an optional time period or preset execution time for the task to enable interaction between the user and the server. The input and output unit can be, but is not limited to, a mouse and a keyboard.

[0101] Understandably, Figure 3 The structure shown is for illustration only. The electronic device may also include Figure 3 More or fewer components as shown, or with Figure 3 Different configurations are shown. Figure 3 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0102] The embodiment of the present application also provides a computer-readable storage medium having instructions stored thereon. When the instructions are run on a computer, the computer program is executed by a processor to implement the method described in the method embodiment. To avoid repetition, it will not be described here.

[0103] Example 4

[0104] An embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer is caused to execute the method described in Embodiment 1.

[0105] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0107] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0108] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0110] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A network detection method, characterized in that: The method comprises: Get the traffic packets of the LAN; Obtaining session information from the traffic message; Determining a communication terminal corresponding to the session information; Determine whether the MAC address of the communication terminal in the traffic message has changed; If so, obtaining the security status of the communication terminal according to the change status of the IP address of the communication terminal; The specific steps of obtaining the security status of the communication terminal according to the change status of the IP address of the communication terminal are: whether the IP addresses obtained in multiple messages in a data packet are different; if there are two data messages in a data packet, the source addresses parsed from the two data messages are different, then the terminal device corresponding to the source address is an unsafe terminal, and the destination addresses parsed from the two data messages are different, then the terminal device corresponding to the destination address is an unsafe terminal; The determining whether the MAC address of the communication terminal in the traffic message has changed includes: Parsing the data packets in the data packet to determine whether the MAC addresses in the multiple data packets in the data packet are different, and if they are different, determining that the MAC address of the communication terminal has changed; The communication terminal includes: a receiving end and a transmitting end; When it is determined that the communication terminal is an unsafe terminal, if the communication protocol is TCP, construct an RST data packet and send it to the receiving end; If the communication protocol is UDP, a port unreachable message is constructed and sent to the sending end.

2. The network detection method according to claim 1, characterized in that: After the step of determining the communication terminal corresponding to the session information, the method further includes: Obtaining the communication protocol of the traffic message; If the communication protocol is TCP, send a TCP-SYN message to the port that the communication terminal is not allowed to open; determine whether a response message of the port that the communication terminal is not allowed to open is obtained; if not, determine the communication terminal as an unsafe terminal; If the communication protocol is UDP, determine whether a port unreachable message sent by a port that the communication terminal does not allow to be opened is obtained; if so, determine the communication terminal as an unsafe terminal.

3. The network detection method according to claim 2, characterized in that: After the step of obtaining the communication protocol of the flow message, the method further includes: Determine whether the values ​​corresponding to the flag fields of the plurality of flow messages in the data packet corresponding to the flow message are continuous; If not, the communication terminal is determined to be an unsafe terminal.

4. A network detection device, characterized in that: The device comprises: An acquisition module is used to acquire traffic messages of a local area network; A session information acquisition module, used to acquire session information from the traffic message; A determination module, used to determine the communication terminal corresponding to the session information; A judgment module, used to judge whether the MAC address of the communication terminal in the traffic message has changed; a status acquisition module, configured to acquire the security status of the communication terminal according to the change status of the IP address of the communication terminal when the judgment result of the judgment module is yes; The specific steps of obtaining the security status of the communication terminal according to the change status of the IP address of the communication terminal are: whether the IP addresses obtained in multiple messages in a data packet are different; if there are two data messages in a data packet, the source addresses parsed from the two data messages are different, then the terminal device corresponding to the source address is an unsafe terminal, and the destination addresses parsed from the two data messages are different, then the terminal device corresponding to the destination address is an unsafe terminal; The communication terminal includes: a receiving end and a transmitting end; The device further includes: a sending module, the sending module is used to construct an RST data packet and send it to the receiving end when the communication protocol is TCP; when the communication protocol is UDP, construct a port unreachable message and send it to the sending end; The determining whether the MAC address of the communication terminal in the traffic message has changed includes: The data message in the data packet is parsed to determine whether the MAC addresses in the multiple data messages in the data packet are different. If they are different, it is determined that the MAC address of the communication terminal has changed.

5. The network detection device according to claim 4, characterized in that: The acquisition module is also used to acquire the communication protocol of the flow message; The sending module is further used to send a TCP-SYN message to the port that the communication terminal is not allowed to open when the communication protocol is TCP; the judging module is further used to judge whether a response message of the port that the communication terminal is not allowed to open is obtained; if not, the communication terminal is determined as an unsafe terminal; The judgment module is also used to judge whether a port unreachable message sent by a port that the communication terminal does not allow to be opened is obtained when the communication protocol is UDP; if so, determine the communication terminal as an unsafe terminal.

6. The network detection device according to claim 5, characterized in that: The judgment module is also used to judge whether the values ​​corresponding to the flag fields of multiple flow messages in the data packet corresponding to the flow message are continuous; if not, the communication terminal is determined as an unsafe terminal.

7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the network detection method according to any one of claims 1 to 3 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer is enabled to execute the network detection method according to any one of claims 1 to 3.