Method and device for detecting intranet external connection of terminal and related equipment
By sending simulated UDP request packets and detecting through NAT devices, the problem of intranet terminals privately accessing the external network is solved, and network access rights control for dumb terminal-type devices is realized, ensuring network security.
Patent Information
- Application Number
- CN202411266710.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The prior art is difficult to detect whether an intranet terminal is privately connected to the external network through NAT, especially when dumb terminal-type devices cannot install client software, and their network access rights cannot be effectively prohibited.
By sending simulated UDP request packets, the source IP is the public network server, the source port is the target port of the public network server, the message content is to obtain the IP instruction of the terminal to be detected, the terminal to be detected generates a UDP response packet and passes NAT The device is sent to the public network server. If the NAT device forwards, the public network server will receive and report it to the intranet server to determine whether the terminal is privately connected to the external network.
It realizes detection of whether intranet terminals are privately connected to the external network through NAT, ensuring network security and avoiding data leakage, and is suitable for dumb terminal-type devices that cannot be installed with client software.
Smart Images

Figure CN119210808A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a method, device and related equipment for detecting terminal intranet external connection. Background Art
[0002] With the widespread demand for security monitoring and other services, various video monitoring networks have been established across the country, using IP cameras and video playback systems to complete pre-warning, real-time monitoring, post-investigation and other functions. Therefore, the demand for camera monitoring has gradually expanded. In some cases, it is necessary to prevent the intranet cameras from being connected to the Internet, to prevent external networks from accessing the intranet cameras and to prevent the camera data from leaking to the external network.
[0003] This requires a technology to promptly detect whether the intranet camera is connected to the Internet. Summary of the invention
[0004] The present application provides a method, device and related equipment for detecting terminal intranet external connection.
[0005] In a first aspect, the present application provides a method for detecting terminal intranet external connection, which is applied to a terminal to be detected, and the method includes:
[0006] Receive a UDP request message sent by a detection device, wherein the source IP of the UDP request message is the IP of a public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected;
[0007] Parse the UDP request message, and generate a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected;
[0008] The UDP response message is sent to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
[0009] Optionally, the step of parsing the UDP request message and generating a UDP response message based on the UDP request message includes:
[0010] Parsing the UDP request message, and obtaining the instruction for obtaining the IP address of the terminal to be detected carried in the UDP request message;
[0011] Based on the source IP and source port of the UDP request message, a DPU response message is generated, the message content of which is the IP of the terminal to be detected.
[0012] Optionally, the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing the address request message, the device to be detected generates a response message of the preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
[0013] Optionally, if the detection device is an intranet server, a detection strategy is pre-configured on the intranet server, and the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. Then, when the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy.
[0014] If the detection device is a scanning device, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, the detection strategy is sent to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
[0015] In a second aspect, the present application provides a device for detecting an intranet external connection of a terminal, which is applied to a terminal to be detected, and the device includes:
[0016] A receiving unit, configured to receive a UDP request message sent by a detection device, wherein the source IP of the UDP request message is the IP of a public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected;
[0017] A generating unit, configured to parse the UDP request message, and generate a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected;
[0018] A sending unit is used to send the UDP response message to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
[0019] Optionally, when parsing the UDP request message and generating a UDP response message based on the UDP request message, the parsing unit is specifically used to:
[0020] Parsing the UDP request message, and obtaining the instruction for obtaining the IP address of the terminal to be detected carried in the UDP request message;
[0021] Based on the source IP and source port of the UDP request message, a DPU response message is generated, the message content of which is the IP of the terminal to be detected.
[0022] Optionally, the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing the address request message, the device to be detected generates a response message of the preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
[0023] Optionally, if the detection device is an intranet server, a detection strategy is pre-configured on the intranet server, and the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. Then, when the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy.
[0024] If the detection device is a scanning device, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, the detection strategy is sent to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
[0025] In a third aspect, an embodiment of the present application provides a device for detecting an intranet external connection of a terminal, the device comprising:
[0026] A memory for storing program instructions;
[0027] The processor is used to call the program instructions stored in the memory, and execute the steps of the method as described in any one of the first aspects above according to the obtained program instructions.
[0028] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method described in any one of the first aspects above.
[0029] In summary, the method for detecting terminal intranet external connection provided in the embodiment of the present application receives a UDP request message sent by a detection device, wherein the source IP of the UDP request message is the IP of a public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected; parses the UDP request message, and generates a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected; sends the UDP response message to a NAT device, so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
[0030] The terminal intranet external connection detection method provided in the embodiment of the present application is adopted, by sending a UDP request message to the terminal to be detected, with the simulated source IP being a public network server, the source port being the target port of the public network server, and the message content carrying an instruction to obtain the IP of the terminal to be detected. The terminal to be detected generates a UDP response message carrying its own IP based on the content of the UDP request message, and sends it to the public network server through the NAT device, so that the public network server can obtain the intranet terminal that accesses the Internet through NAT, thereby detecting whether there is a terminal in the intranet that privately connects to the external network through NAT. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0032] Figure 1 A detailed flow chart of a method for detecting an external connection to an intranet of a terminal provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a process for detecting whether a terminal is connected to an intranet or an external network provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of the structure of a device for detecting an external connection of an intranet of a terminal provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of the hardware architecture of a device for detecting an external connection to an intranet of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0037] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination".
[0038] At present, with the rapid development of network technology, network security has become a top priority. So, how to prevent the internal network terminals from privately accessing the external network has become a problem that needs to be solved urgently.
[0039] Method 1: Install client software on the terminal to detect intranet external connections. The server sends ACL (Access Control Lists) rules to the client, and the client controls network access rights by executing ACL, which can prohibit the terminal from accessing the external network. However, for dumb terminal type devices, client software cannot be installed, so the network access rights of dumb terminals cannot be controlled by ACL.
[0040] Method 2: Detection through the ICMP (Internet Control Message Protocol) reflection principle. The intranet scanner sends an ICMP request message to the intranet terminal to be detected (the source IP is configured as the public network evidence server, and the message content carries the IP address of the intranet terminal). After receiving the ICMP request message, the intranet terminal sends an ICMP response message to the public network evidence server. After receiving the ICMP response message from the intranet, the evidence server obtains the intranet terminal IP address from the ICMP response message, thereby obtaining a list of terminal IP addresses privately connected to the external network. However, when the intranet terminal is privately connected to the Internet through NAT (Network Address Translation), it is impossible to detect that the terminal is connected externally.
[0041] The present application proposes a technical solution for detecting whether a dumb terminal type terminal (privately connected to the external network through NAT) has an intranet external connection.
[0042] For example, see Figure 1 , which is a detailed flow chart of a method for detecting an intranet external connection of a terminal provided in an embodiment of the present application, the method is applied to a terminal to be detected, and the method includes the following steps:
[0043] Step 100: Receive a UDP request message sent by a detection device.
[0044] In an embodiment of the present application, the source IP of the UDP request message is the IP of the public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction to obtain the IP of the terminal to be detected.
[0045] In actual applications, the detection device can be integrated into the intranet server, that is, the intranet server includes a detection function module. The detection can also be a third-party device independent of the intranet server. In the embodiments of the present application, no specific limitation is made here.
[0046] The first case: if the detection device is an intranet server, the detection strategy is pre-configured on the intranet server. Specifically, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy.
[0047] The second situation: If the detection device is a scanning device, a detection strategy is pre-configured on the intranet server. Specifically, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, it sends the detection strategy to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
[0048] For the detection device, the method of starting the intranet external connection detection task is: based on the intranet IP segment to be detected, send a UDP request message to each intranet terminal to be detected. The content of the DUDP request message is as follows:
[0049] The source address is the IP of the public network forensic server, the source port is the listening port of the public network forensic server, the destination IP is the IP of the terminal to be detected, the destination port is the terminal port corresponding to the server's listening port, and the UDP message content is the instruction to obtain the IP of the terminal to be detected.
[0050] Then, the detection device generates a UDP request message to be sent to the terminal to be detected, and the device to be detected receives the UDP request message.
[0051] Step 110: Parse the UDP request message, and generate a UDP response message based on the UDP request message.
[0052] The destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected.
[0053] In the embodiment of the present application, when parsing the UDP request message and generating a UDP response message based on the UDP request message, a preferred implementation method is:
[0054] Parse the UDP request message to obtain the instruction for obtaining the IP of the terminal to be detected carried in the UDP request message; and generate a DPU response message whose message content is the IP of the terminal to be detected based on the source IP and source port of the UDP request message.
[0055] In the embodiment of the present application, the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing and obtaining the address request message, the device to be detected generates a response message of a preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
[0056] For example, the message content of the DPU request message is the Probe message of the Onvif protocol, which is a UDP protocol used for devices such as network cameras. After the terminal to be detected receives the UDP request message and parses the Probe message, it will generate the Probe Match message of the Onvif protocol. The Probe Match message will be used as the message content of the UDP response message corresponding to the UDP request message. The Probe Match message carries the IP address of the terminal to be detected.
[0057] From the above, it can be seen that since the source IP of the received UDP request message is the IP of the public network server, and the source port is the target port of the public network server, then when generating a UDP response message, the destination IP of the UDP response message is the IP of the public network server, and the destination port is the target port of the public network server. The message content of the UDP response message also carries the IP of the terminal to be detected.
[0058] Step 120: Send the UDP response message to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
[0059] The network is connected to the Internet through a NAT device. Therefore, when sending a UDP response message to the public network (public network server), the UDP response message needs to be sent to the NAT device first. If the terminal to be detected has not privately accessed the public network, the NAT device will not forward the UDP response message, and the process ends here; if the terminal to be detected privately accesses the public network through NAT, the NAT device will perform address translation, convert the source IP of the UDP response message from the IP of the terminal to be detected to the corresponding public network IP, and then forward it to the public network server.
[0060] In actual applications, the NAT device will not detect whether there is a session corresponding to the UDP response message, that is, whether it has received the UDP request message corresponding to the UDP response message sent by the public network server. It will send the received UDP response message to the public network server according to the destination IP and port of the message. Therefore, the public network server can receive the UDP response message.
[0061] The public network server listens to the received message on the target port, and after confirming that the UDP response message is received, it parses the message to obtain the message content (the IP of the terminal to be detected). Then, the public network server can report the IP of the terminal to be detected to the intranet server.
[0062] In this way, the intranet server can determine which terminals in the intranet have accessed the public network through NAT and which terminals have illegally accessed the public network based on the data reported by the public network server.
[0063] The following describes in detail the process of detecting whether a terminal (such as a camera) is connected to an external network in accordance with an embodiment of the present application in combination with a specific application scenario. Figure 2 As shown, it is a schematic diagram of a process for detecting whether a terminal is connected to the intranet or the external network provided by the embodiment of the present application; a server and a scanner need to be deployed in the internal LAN, and a forensic server is deployed on the public network. The intranet terminal is connected to the Internet through a private NAT. The specific detection method is as follows:
[0064] 1. Configure a detection strategy on the intranet server. The detection strategy may include: (1) the IP address segment of the intranet, (2) the IP address of the public network evidence server, and (3) the listening port of the public network evidence server.
[0065] 2. Listen for UDP request messages on the public network evidence server (the destination IP of the UDP request message is the IP of the public network evidence server; the destination port of the message is the listening port of the public network evidence server);
[0066] 3. Start the intranet external connection detection task;
[0067] 4. The intranet server sends the detection policy to the scanner;
[0068] The scanner sends UDP packets to each intranet terminal to be detected based on the intranet IP address segment in turn. The content of the UDP packet is as follows: the source address is the IP of the public network forensic server, the source port is the listening port of the public network forensic server, the destination address is the IP of the terminal to be detected, the destination port is 3702, and the message content of the UDP packet is the Probe message of the Onvif protocol;
[0069] In actual applications, after receiving the UDP request message sent by the scanner, the terminal to be detected parses the UDP message, obtains the message content of the UDP request message, and determines the content of the response message; the IP header and UDP header of the UDP response message are constructed based on the corresponding headers of the received UDP message.
[0070] 5. After receiving the UDP request message, the privately connected NAT internal terminal will respond with Onvif's Probe Match message to the public network forensics server;
[0071] Specifically, the Probe Match message of Onvif is carried in the message content of the UDP response message and sent to the forensic server on the public network. For example, the UDP response message is sent to the forensic server forwarded to the public network through a NAT device.
[0072] 6. After receiving the Onvif Probe Match message on the listening port, the public network forensic server parses the IP address of the terminal on the intranet according to the message content;
[0073] 7. The public network forensic server regularly reports the IP addresses of the intranet external connection to the intranet server;
[0074] 8. If an intranet terminal that is not privately connected to NAT receives a UDP message, it will also respond to the Onvif ProbeMatch message to the public network server. However, the message cannot reach the public network forensics server, so it is not considered to have an external connection risk.
[0075] Based on the same inventive concept as the above-mentioned embodiment of the invention, for example, refer to Figure 3 FIG. 1 is a schematic diagram of a structure of a device for detecting an intranet external connection of a terminal provided in an embodiment of the present application. The device is applied to a terminal to be detected, and the device includes:
[0076] The receiving unit 30 is used to receive a UDP request message sent by the detection device, wherein the source IP of the UDP request message is the IP of the public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction to obtain the IP of the terminal to be detected;
[0077] A generating unit 31 is used to parse the UDP request message and generate a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected;
[0078] The sending unit 32 is used to send the UDP response message to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
[0079] Optionally, when parsing the UDP request message and generating a UDP response message based on the UDP request message, the generating unit 31 is specifically used to:
[0080] Parsing the UDP request message, and obtaining the instruction for obtaining the IP address of the terminal to be detected carried in the UDP request message;
[0081] Based on the source IP and source port of the UDP request message, a DPU response message is generated, the message content of which is the IP of the terminal to be detected.
[0082] Optionally, the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing the address request message, the device to be detected generates a response message of the preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
[0083] Optionally, if the detection device is an intranet server, a detection strategy is pre-configured on the intranet server, and the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. Then, when the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy.
[0084] If the detection device is a scanning device, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, the detection strategy is sent to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
[0085] The above units may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a certain unit is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0086] Further, the device for detecting terminal intranet external connection provided in the embodiment of the present application, from the hardware level, the hardware architecture diagram of the device for detecting terminal intranet external connection can be seen in Figure 4 As shown, the device for detecting the terminal's intranet external connection may include: a memory 40 and a processor 41,
[0087] The memory 40 is used to store program instructions; the processor 41 calls the program instructions stored in the memory 40 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar and will not be repeated here.
[0088] Optionally, the present application also provides a device for detecting terminal intranet external connection, including at least one processing element (or chip) for executing the above method embodiment.
[0089] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the above method embodiments.
[0090] Here, the machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (RadomAccess Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.
[0091] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0092] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0093] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0097] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for detecting terminal intranet external connection, characterized in that: Applied to a terminal to be detected, the method comprises: Receive a UDP request message sent by a detection device, wherein the source IP of the UDP request message is the IP of a public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected; Parse the UDP request message, and generate a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected; The UDP response message is sent to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
2. The method according to claim 1, characterized in that The steps of parsing the UDP request message and generating a UDP response message based on the UDP request message include: Parsing the UDP request message, and obtaining the instruction for obtaining the IP address of the terminal to be detected carried in the UDP request message; Based on the source IP and source port of the UDP request message, a DPU response message is generated, the message content of which is the IP of the terminal to be detected.
3. The method according to claim 1 or 2, characterized in that The instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing the address request message, the device to be detected generates a response message of a preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
4. The method according to claim 1 or 2, characterized in that: If the detection device is an intranet server, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server, then when the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy; If the detection device is a scanning device, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, the detection strategy is sent to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
5. A device for detecting terminal intranet external connection, characterized in that: Applied to a terminal to be detected, the device comprises: A receiving unit, configured to receive a UDP request message sent by a detection device, wherein the source IP of the UDP request message is the IP of a public network server, the source port is the target port of the public network server, and the message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected; A generating unit, configured to parse the UDP request message, and generate a UDP response message based on the UDP request message, wherein the destination IP of the UDP response message is the IP of the public network server, the destination port is the target port, and the message content of the UDP response message carries the IP of the terminal to be detected; A sending unit is used to send the UDP response message to the NAT device so that the NAT device determines whether it is necessary to forward the UDP response message to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server receives the response message based on the target port, parses the UDP response message, obtains the IP of the terminal to be detected, and reports it to the intranet server.
6. The device according to claim 5, characterized in that When parsing the UDP request message and generating a UDP response message based on the UDP request message, the parsing unit is specifically used to: Parsing the UDP request message, and obtaining the instruction for obtaining the IP address of the terminal to be detected carried in the UDP request message; Based on the source IP and source port of the UDP request message, a DPU response message is generated, the message content of which is the IP of the terminal to be detected.
7. The device according to claim 5 or 6, characterized in that The instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After parsing the address request message, the device to be detected generates a response message of a preset protocol carrying its own IP based on the address request message, and uses the response message of the preset protocol as the message content of the UDP response message.
8. The device according to claim 5 or 6, characterized in that If the detection device is an intranet server, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server, then when the intranet server receives the detection start instruction, it detects each terminal to be detected based on the detection strategy; If the detection device is a scanning device, and a detection strategy is pre-configured on the intranet server, the detection strategy includes the intranet IP segment to be detected, the IP of the public network server, and the target port of the public network server. When the intranet server receives the detection start instruction, the detection strategy is sent to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
9. A device for detecting terminal intranet external connection, characterized in that: The device for detecting terminal intranet external connection includes: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps of the method according to any one of claims 1 to 4 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable the computer to execute the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for detecting illegal external connection of equipment
CN110768999A
Method and device for detecting equipment with illegal external connection
CN111130931A
UDP (User Datagram Protocol) link monitoring method and system and electronic equipment
CN112838966A
Intranet IP address transmission method and system, and storage medium
CN114900494A
IPsec protocol message encryption and decryption method based on chip scheme
CN115333859A
Cited By
Method and device for detecting intranet external connection of terminal and related equipment
CN120151078A
