A method, device and related equipment for detecting out-of-network connection of a terminal
By sending simulated UDP request messages and generating UDP response messages, the problem of detecting dumb terminals privately connecting to the external network via NAT is solved, enabling effective monitoring and access control of internal network terminals.
Patent Information
- Application Number
- CN202411266710.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-09-10
AI Technical Summary
Existing technologies struggle to detect whether dumb terminals that privately connect to the external network via NAT are engaging in internal network outreach activities, especially when the dumb terminal cannot install client software.
By sending a simulated UDP request message with the source IP being the public server and the source port being the target port of the public server, a UDP response message carrying the IP of the terminal to be detected is generated and sent to the public server through a NAT device. The public server parses the message and reports it to the internal server to determine whether the terminal has accessed the external network without authorization.
It enables the detection of internal network external connections of dumb terminals that privately connect to the external network via NAT, ensuring that the network access permissions of internal network terminals are controlled and preventing data leakage.
Smart Images

Figure CN119210808B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the network security technical field, in particular to a kind of detection terminal intranet connection method, device and related equipment. BACKGROUND
[0002] With the extensive demand of security monitoring and other businesses, various video monitoring networks are established in the nationwide, and through IP camera cooperate with video playback system to complete the functions such as pre-warning, real-time monitoring, post-investigation. Therefore, the monitoring demand of camera is gradually expanded, and in some occasions, it is necessary to prevent the intranet camera from connecting to the Internet, prevent the external network from accessing the intranet camera and the data leakage of camera to the external network.
[0003] Therefore, a technology is needed to timely find out whether the intranet camera is connected to the Internet. SUMMARY
[0004] The present application provides a kind of detection terminal intranet connection method, device and related equipment.
[0005] In the first aspect, the present application provides a kind of detection terminal intranet connection method, applied to the terminal to be detected, the method comprises:
[0006] receiving the 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, and the source port is the target port of the public network server, and the message content of the UDP request message is the instruction for obtaining the IP of the terminal to be detected;
[0007] parsing the UDP request message, and generating the 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, and 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 judges whether the UDP response message needs to be forwarded to the public network server, if the NAT device forwards the UDP response message to the public network server, the public network server parses the UDP response message based on the target port receiving the response message, obtains the IP of the terminal to be detected, and reports to the intranet server.
[0009] Optionally, the step of parsing the UDP request message and generating the UDP response message based on the UDP request message comprises:
[0010] parsing the UDP request message to obtain an instruction carried by the UDP request message to acquire the IP of the terminal to be detected;
[0011] generating, based on the source IP and the source port of the UDP request message, a UDP response message with the content of the message being the IP of the terminal to be detected.
[0012] Optionally, the instruction to acquire the IP of the terminal to be detected is an address request message of a preset protocol, and the terminal to be detected generates, based on the address request message, a response message of the preset protocol carrying its own IP after parsing the address request message, and takes the response message of the preset protocol as the content of the UDP response message.
[0013] Optionally, if the detection device is an intranet server, the intranet server is preconfigured with a detection strategy, the detection strategy includes an intranet IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the intranet server detects each terminal to be detected based on the detection strategy when receiving a detection start instruction.
[0014] If the detection device is a scanning device, the intranet server is preconfigured with a detection strategy, the detection strategy includes an intranet IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the intranet server sends the detection strategy to the scanning device when receiving a detection start instruction, 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, applied to a terminal to be detected, and the device comprises:
[0016] a receiving unit configured to receive a UDP request message sent by a detection device, wherein a source IP of the UDP request message is an IP of a public network server, a source port of the UDP request message is a target port of the public network server, and a content of the UDP request message is an instruction to acquire an 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 a destination IP of the UDP response message is the IP of the public network server, a destination port of the UDP response message is the target port, and a content of the UDP response message carries the IP of the terminal to be detected.
[0018] The sending unit is configured to send the UDP response message to the NAT device, so that the NAT device judges whether the UDP response message needs to be forwarded to the public network server, and if the NAT device forwards the UDP response message to the public network server, the public network server parses the UDP response message based on the response message received by the target port, obtains the IP of the terminal to be detected, and reports to the internal network server.
[0019] Optionally, when the UDP request message is parsed and the UDP response message is generated based on the UDP request message, the generating unit is specifically configured to:
[0020] The UDP request message is parsed to obtain an instruction for obtaining the IP of the terminal to be detected carried by the UDP request message.
[0021] The UDP response message with the content of the terminal IP to be detected is generated based on the source IP and the source port of the UDP request message.
[0022] Optionally, the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol, and the terminal to be detected generates a response message of the preset protocol carrying its own IP based on the address request message after parsing the address request message, and takes the response message of the preset protocol as the content of the UDP response message.
[0023] Optionally, if the detection device is an internal network server, the internal network server is pre-configured with a detection strategy, the detection strategy includes an internal network IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the internal network server detects each terminal to be detected based on the detection strategy when receiving a detection start instruction.
[0024] If the detection device is a scanning device, the internal network server is pre-configured with a detection strategy, the detection strategy includes an internal network IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the internal network server sends the detection strategy to the scanning device when receiving a detection start instruction, 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 internal network connection of a terminal, and the device comprises:
[0026] A memory is configured to store program instructions.
[0027] A processor is configured to invoke the program instructions stored in the memory, and execute the steps of the method according to any one of the above first aspect.
[0028] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium storing computer executable instructions for causing a computer to perform the steps of the method of any one of the first aspect.
[0029] In summary, the method for detecting terminal internal network external connection provided by the embodiments of the present application receives a UDP request message sent by a detection device, wherein the source IP of the UDP request message is an IP of a public network server, the source port is a 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; the UDP request message is parsed, and a UDP response message is generated 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; and the UDP response message is sent to a NAT device, so that the NAT device judges whether the UDP response message needs to be forwarded to the public network server, and if the NAT device forwards the UDP response message to the public network server, the public network server parses the UDP response message based on the target port receiving the response message, obtains the IP of the terminal to be detected, and reports to an internal network server.
[0030] The method for detecting terminal internal network external connection provided by the embodiments of the present application sends a UDP request message to a terminal to be detected, the UDP request message simulates a source IP of a public network server, a source port of a target port of the public network server, and carries an instruction for obtaining 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 the UDP response message to a public network server through a NAT device, so that the public network server can obtain the internal network terminal accessing the Internet through the NAT, thereby detecting whether there is a terminal in the internal network privately connecting the external network through the NAT. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the description of the embodiments of the present application or the prior art. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings of the embodiments of the present application.
[0032] Figure 1 A detailed flowchart of a method for detecting terminal internal network external connection provided by the embodiments of the present application;
[0033] Figure 2 A process diagram for detecting whether a terminal is connected to an intranet is provided for an embodiment of the present application.
[0034] Figure 3 A structure diagram of a device for detecting whether a terminal is connected to an intranet is provided for an embodiment of the present application.
[0035] Figure 4 A hardware architecture diagram of a device for detecting whether a terminal is connected to an intranet is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0036] The terminology used in the present application is merely for the purpose of describing particular embodiments and is not intended to be limiting of the present application. As used in the present application and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0037] It should be understood that although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited to these terms. These terms are only used to differentiate one piece of information from another piece of information. For example, a first information can also be referred to as a second information without departing from the scope of the present application, and similarly, a second information can also be referred to as a first information. Depending on the context, in addition, the word "if" used herein can be interpreted as "when" or "in response to determining" or "in response to ascertaining".
[0038] At present, with the rapid development of network technology, network security has become a top priority. Then, how to prohibit an intranet terminal from privately accessing an extranet has become a problem to be solved at present.
[0039] Method one: detecting intranet extranet connection by installing client software on the terminal. The server issues ACL (Access Control Lists) rules to the client, and the client controls network access permissions by executing ACL, which can prohibit the terminal from accessing the extranet. However, for dumb terminal type devices, client software cannot be installed, so the network access permission of the dumb terminal cannot be controlled by ACL.
[0040] The second mode is to detect by the ICMP (Internet Control Message Protocol) reflection principle. The scanner in the internal network sends an ICMP request message (the source IP is configured as the forensics server in the public network, and the message content carries the IP address of the terminal in the internal network) to the terminal to be detected in the internal network. The terminal in the internal network receives the ICMP request message, and sends an ICMP response message to the forensics server in the public network. The forensics server receives the ICMP response message from the internal network, obtains the IP address of the terminal in the internal network from the ICMP response message, and thus obtains the list of terminal IP addresses connecting to the external network. However, when the terminal in the internal network connects to the Internet through the NAT (Network Address Translation) mode, the terminal cannot be detected to connect to the external network.
[0041] The application provides a technical solution for detecting whether a terminal of a dumb terminal type (connecting to the external network through the NAT mode) exists in the internal network.
[0042] For example, referring to Figure 1 As shown in the detailed flowchart of the method for detecting the internal network connection of a terminal provided by the embodiment of the application, the method is applied to a terminal to be detected, and the method comprises the following steps:
[0043] Step 100: receiving a UDP request message sent by a detection device.
[0044] In the embodiment of the application, the source IP of the UDP request message is the IP of a public network server, and the source port is the target port of the public network server. The message content of the UDP request message is an instruction for obtaining the IP of the terminal to be detected.
[0045] In actual application, the detection device can be integrated on an internal network server, that is, the internal network server comprises a detection function module, and the detection can also be a third-party device independent of the internal network server. In the embodiment of the application, no specific limitation is made.
[0046] The first case: if the detection device is an internal network server, a detection strategy is configured on the internal network server in advance. Specifically, the detection strategy comprises an internal network IP segment to be detected, the IP of the public network server, and the target port of the public network server. Then, the internal network server detects each terminal to be detected based on the detection strategy when a detection starting instruction is received.
[0047] The second case: if the detection device is a scanning device, the detection policy is pre-configured on the intranet server, specifically, the detection policy 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 detection start instruction is received, the intranet server issues the detection policy to the scanning device, so that the scanning device detects each terminal to be detected based on the detection policy.
[0048] For the detection device, the way to start the intranet external connection detection task is to send a UDP request message to each intranet terminal to be detected based on the intranet IP segment 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 listening port of the server, and the UDP message content is the instruction to obtain the IP of the terminal to be detected.
[0050] Then, the detection device generates and sends a UDP request message to the terminal to be detected.
[0051] Step 110: parsing the UDP request message and generating 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, and the destination port is the target port. The message content of the UDP response message carries the IP of the terminal to be detected.
[0053] In the embodiment of the application, when the UDP request message is parsed and the UDP response message is generated based on the UDP request message, a preferred implementation is as follows:
[0054] The UDP request message is parsed to obtain the instruction to obtain the IP of the terminal to be detected carried by the UDP request message. Based on the source IP and the source port of the UDP request message, a UDP response message with the message content of the IP of the terminal to be detected is generated.
[0055] In the embodiment of the application, the instruction to obtain the IP of the terminal to be detected is an address request message of a preset protocol. After the address request message is parsed, the terminal to be detected generates a response message of the preset protocol carrying its own IP based on the address request message, and takes the response message of the preset protocol as the message content of the UDP response message.
[0056] For example, the message content of the UDP request message is a Probe message of the Onvif protocol, which is a UDP protocol for network cameras and other devices. After receiving the UDP request message and parsing the Probe message, the terminal to be detected generates a Probe Match message of the Onvif protocol, which is the message content of the UDP response message corresponding to the UDP request message. The Probe Match message carries the IP of the terminal to be detected.
[0057] As can be seen from the above, 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, when the UDP response message is generated, 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 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 parses the UDP response message based on the target port after receiving the response message, obtains the IP of the terminal to be detected, and reports it to the internal network server.
[0059] When the network accesses the Internet through the NAT device, the UDP response message needs to be sent to the public network (public network server) first. If the terminal to be detected does not access the public network privately, the NAT device will not forward the UDP response message, and the process ends. If the terminal to be detected accesses the public network through the NAT device privately, the NAT device performs address translation to 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 forwards it to the public network server.
[0060] In actual application, the NAT device does not detect whether there is a session corresponding to the UDP message, i.e., whether it receives the UDP request message corresponding to the UDP response message sent by the public network server, for the UDP response message. It will send the received UDP response message to the public network server according to the destination IP and port of the message, so that the public network server can receive the UDP response message.
[0061] The public network server listens to the received messages on the target port. After determining 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 internal network server.
[0062] In this way, the intranet server can determine which terminals in the intranet access the public network through the NAT and which terminals are illegally accessing the public network based on the data reported by the public network server.
[0063] The process of detecting whether a terminal (e.g., a camera) is outside the intranet provided by the embodiments of the application will be described in detail below in combination with a specific application scenario. For example, refer to Figure 2 Fig. 1 is a schematic diagram of a process of detecting whether a terminal is outside the intranet provided by the embodiments of the application; a server and a scanner need to be deployed in the internal local area network, and a forensic server is deployed on the public network. The intranet terminal accesses the Internet through a private NAT. The specific detection method is as follows:
[0064] 1. Configure a detection strategy on the intranet server, which can specifically include: (1) the IP address segment of the intranet, (2) the IP of the forensic server on the public network, and (3) the listening port of the forensic server on the public network;
[0065] 2. Listen to the UDP request message on the forensic server on the public network (the destination IP of the UDP request message is the IP of the forensic server on the public network; the destination port of the message is the listening port of the forensic server on the public network);
[0066] 3. Start the intranet outside connection detection task;
[0067] 4. The intranet server issues the detection strategy to the scanner;
[0068] The scanner sends the UDP message to each intranet terminal to be detected based on the IP address segment of the intranet in turn, and the content of the UDP message is as follows: the source address is the IP of the forensic server on the public network, the source port is the listening port of the forensic server on the public network, the destination address is the IP of the terminal to be detected, the destination port is 3702, and the message content of the UDP message is the Probe message of the Onvif protocol;
[0069] In actual application, after receiving the UDP request message sent by the scanner, the terminal to be detected parses the UDP request message to obtain the message content of the UDP request message and determine the response message content. The IP header and the UDP header of the UDP response message are constructed based on the corresponding headers of the received UDP message.
[0070] 5. The intranet terminal with a private NAT receives the UDP request message and responds to the Probe Match message of the Onvif to the forensic server on the public network;
[0071] Specifically, the Probe Match message of the Onvif is carried in the message content of the UDP response message and sent to the public network forensics server. For example, the UDP response message is sent to the public network forensics server through the NAT device.
[0072] 6. The public network forensics server receives the Probe Match message of the Onvif on the listening port, and parses the IP address of the terminal in the internal network according to the message content;
[0073] 7. The public network forensics server regularly reports the IP address of the internal network to the server in the internal network;
[0074] 8. If the internal network terminal without private connection of the NAT receives the UDP message, it will also respond to the Probe Match message of the Onvif to the public network server, but the message cannot reach the public network forensics server, so it is not considered to have external connection risk.
[0075] Based on the same inventive concept as the above-mentioned embodiments, for example, referring to Figure 3 The device for detecting the internal network external connection of the terminal provided by the embodiment of the application, which is applied to a terminal to be detected, comprises:
[0076] The receiving unit 30 is configured to receive the 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 for obtaining the IP of the terminal to be detected.
[0077] The generating unit 31 is 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.
[0078] The sending unit 32 is configured to send the UDP response message to the NAT device, so that the NAT device judges whether the UDP response message needs to be forwarded to the public network server. If the NAT device forwards the UDP response message to the public network server, the public network server parses the UDP response message based on the target port receiving the response message, obtains the IP of the terminal to be detected, and reports it to the internal network server.
[0079] Optionally, when the UDP request message is parsed and the UDP response message is generated based on the UDP request message, the generating unit 31 is specifically configured to:
[0080] parsing the UDP request message to obtain an instruction carried by the UDP request message for acquiring the IP of the terminal to be detected;
[0081] generating, based on the source IP and the source port of the UDP request message, a UDP response message with the content of the message being the IP of the terminal to be detected.
[0082] Optionally, the instruction for acquiring the IP of the terminal to be detected is an address request message of a preset protocol, and the terminal to be detected generates, based on the address request message, a response message of the preset protocol carrying its own IP after parsing the address request message, and takes the response message of the preset protocol as the content of the UDP response message.
[0083] Optionally, if the detection device is an intranet server, the intranet server is preconfigured with a detection strategy, the detection strategy includes an intranet IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the intranet server performs detection on each terminal to be detected based on the detection strategy when receiving a detection start instruction.
[0084] If the detection device is a scanning device, the intranet server is preconfigured with a detection strategy, the detection strategy includes an intranet IP segment to be detected, an IP of the public network server, and a target port of the public network server, and the intranet server sends the detection strategy to the scanning device when receiving a detection start instruction, so that the scanning device performs detection on each terminal to be detected based on the detection strategy.
[0085] The above units can be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For example, when a certain unit above is implemented in the form of a processing element scheduling code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can invoke program code. For another example, the units can be integrated together to implement in the form of a system on a chip (SOC).
[0086] Further, the device for detecting the terminal internal network external connection provided by the embodiment of the present application, from the hardware level, the hardware architecture diagram of the device for detecting the terminal internal network external connection can refer to Figure 4 As shown in the figure, the device for detecting the terminal internal network external connection can include a memory 40 and a processor 41,
[0087] The memory 40 is used for storing program instructions; the processor 41 calls the program instructions stored in the memory 40, and executes the above-mentioned method embodiments according to the obtained program instructions. The specific implementation and technical effects are similar, and will not be repeated here.
[0088] Optionally, the present application also provides a device for detecting the terminal internal network external connection, comprising at least one processing element (or chip) for executing the above-mentioned method embodiments.
[0089] Optionally, the present application also provides a program product, for example, a computer readable storage medium, which stores computer executable instructions for causing the computer to execute the above-mentioned method embodiments.
[0090] Here, the machine readable storage medium can be any electronic, magnetic, optical or other physical storage apparatus, which can contain or store information, such as executable instructions, data, etc. For example, the machine readable storage medium can be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state disk, any type of storage disk (such as optical disk, dvd, etc.), or similar storage medium, or combination thereof.
[0091] The system, device, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain function. A typical implementation device is a computer, and the specific form of the computer can be 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 device, 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 as various units respectively described in function. Of course, in the implementation of the present application, the functions of each unit can be implemented in the same or more software and / or hardware.
[0093] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable program code.
[0094] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams.
[0095] Also, these computer program instructions can be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams.
[0096] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in one or more of the flowchart illustrations and / or block diagrams.
[0097] The above description is embodied in the context of only preferred embodiments of the application and is not intended to limit the application, and any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the application should be included in the scope of protection of the application.
Claims
1. A method of detecting an off-network connection in a terminal, characterized by, The method applied to a terminal to be detected comprises the following steps: receiving 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; parsing the UDP request message and generating 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; sending the UDP response message to a NAT device, so that the NAT device judges whether to forward the UDP response message to the public network server, and if the NAT device forwards the UDP response message to the public network server, the public network server parses the UDP response message to obtain the IP of the terminal to be detected based on the target port receiving the response message, and reports to an internal network server; the instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol, and the terminal to be detected generates a response message of the preset protocol carrying its own IP based on the address request message after parsing the address request message, and takes the response message of the preset protocol as the message content of the UDP response message.
2. The method of claim 1, wherein, The step of parsing the UDP request message and generating a UDP response message based on the UDP request message comprises the following steps: parsing the UDP request message to obtain the instruction for obtaining the IP of the terminal to be detected carried by the UDP request message; generating a UDP response message with the message content being the IP of the terminal to be detected based on the source IP and the source port of the UDP request message.
3. The method of claim 1 or 2, wherein, If the detection device is an internal network server, the internal network server is pre-configured with a detection strategy, the detection strategy comprises an internal network IP segment to be detected, the IP of the public network server, and the target port of the public network server, and the internal network server detects each terminal to be detected based on the detection strategy when receiving a detection starting instruction; If the detection device is a scanning device, the internal network server is pre-configured with a detection strategy, the detection strategy comprises an internal network IP segment to be detected, the IP of the public network server, and the target port of the public network server, and the internal network server sends the detection strategy to the scanning device when receiving a detection starting instruction, so that the scanning device detects each terminal to be detected based on the detection strategy.
4. A device for detecting the internal network connection of a terminal, characterized in that, The device applied to a terminal to be detected comprises the following units: 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; The generating unit is configured to parse the UDP request message and generate a UDP response message based on the UDP request message, wherein a destination IP of the UDP response message is an IP of the public network server, a destination port is the target port, and a message content of the UDP response message carries an IP of the terminal to be detected. The sending unit is configured to send the UDP response message to the NAT device, so that the NAT device determines whether 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 parses the UDP response message based on the target port after receiving the response message, obtains the IP of the terminal to be detected, and reports the IP to the internal network server. The instruction for obtaining the IP of the terminal to be detected is an address request message of a preset protocol. After the terminal to be detected parses the address request message, the terminal 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.
5. The apparatus of claim 4, wherein, When the UDP request message is parsed and the UDP response message is generated based on the UDP request message, the generating unit is specifically configured to: Parse the UDP request message to obtain an instruction for obtaining the IP of the terminal to be detected carried by the UDP request message. Generate a UDP response message with the message content being the IP of the terminal to be detected based on a source IP and a source port of the UDP request message.
6. The apparatus of claim 4 or 5, wherein, If the detection device is an internal network server, a detection strategy is pre-configured on the internal network server, the detection strategy includes an internal network IP segment to be detected, an IP of the public network server, and a target port of the public network server. When the internal network server receives a detection start instruction, the internal network server detects each terminal to be detected based on the detection strategy. If the detection device is a scanning device, a detection strategy is pre-configured on the internal network server, the detection strategy includes an internal network IP segment to be detected, an IP of the public network server, and a target port of the public network server. When the internal network server receives a detection start instruction, the internal network server sends the detection strategy to the scanning device, so that the scanning device detects each terminal to be detected based on the detection strategy.
7. A device for detecting the internal network connection of a terminal, characterized in that, The device for detecting terminal internal network connection includes: A memory configured to store program instructions. A processor configured to invoke the program instructions stored in the memory and execute the steps of the method according to any one of claims 1-3.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions for causing the computer to execute the steps of the method according to any one of claims 1-3.
Citation Information
Patent Citations
Method and device for detecting illegal external connection of equipment
CN110768999A
Illegal external connection equipment detection method and device
CN116346429A