A port status covert scanning method and device based on dynamic estimation model

Through dynamic prediction model and IPID detection technology, it solves the problems of low efficiency and easy detection of existing port scanning technology, realizes efficient and covert port status scanning, and improves scanning efficiency and accuracy.

CN118282717BActive Publication Date: 2024-10-01NO 15 INST OF CHINA ELECTRONICS TECH GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410324426.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2024-10-01
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

Existing port scanning technology is inefficient and easy to detect when performing large-scale scanning tasks, affecting the accuracy of scanning results.

Method used

The port status covert scanning method based on the dynamic prediction model is adopted. By analyzing and segmenting the port range of the target terminal, the preset dynamic prediction model is used for port detection, and the time series of multiple IPID detection and sliding window autoregression are combined. Step prediction strategy, dynamic batch confirmation of port openings, and setting reasonable thresholds to improve scanning efficiency.

Benefits of technology

It achieves efficient and covert port scanning, improves scanning efficiency and accuracy, reduces detection traces of the target system, and enhances concealment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118282717B_ABST
    Figure CN118282717B_ABST
Patent Text Reader

Abstract

The present invention discloses a port status concealed scanning method and device based on a dynamic estimation model, the method comprising: using an active scanning host to perform a first IPID detection on a cooperative intermediate machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperative intermediate machine; using an active scanning host to perform a second IPID detection on a cooperative intermediate machine in a third-party remote system, and obtaining a sequence number IPID2 value of an IP data packet replied by the cooperative intermediate machine; processing the sequence number IPID1 value and the sequence number IPID2 value to obtain port status concealed scanning information; according to the port status concealed scanning information, detecting the port of the scanned target terminal to obtain port status information. The present invention adopts a stateless scanning method to carry out high-efficiency port scanning on the target IP address, thereby improving scanning efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of port status scanning, and in particular to a port status covert scanning method and device based on a dynamic estimation model. Background Art

[0002] Port scanning is mainly used to detect and identify the current status of the port of the target terminal device, and then identify the type of interactive protocol that the target terminal may use, the type of service provided, etc. The most common port scanning method is directional scanning, and common scanning methods include:

[0003] TCP full connection scanning: This is the most common port scanning method. The scanner attempts to establish a complete TCP connection with each port of the target host and waits for the target host's response. If the connection is successfully established, it means that the port is open.

[0004] SYN scanning: This scanning method uses the TCP three-way handshake process. The scanning program sends a SYN packet to each port of the target host. If a SYN / ACK packet is received as a response, it means that the port is open. This scanning method is faster than TCP full connection scanning because it does not have to complete the full TCP connection process.

[0005] UDP scanning: Unlike TCP scanning, UDP is a connectionless protocol. In UDP scanning, the scanner sends a UDP packet to the specified port of the target host. If an ICMP port unreachable message is received, it means that the port is closed. However, due to the characteristics of the UDP protocol, if there is no response, we cannot determine whether the port is open or filtered out.

[0006] NULL, FIN, and XMAS scans: These scans use a special combination of bits in the flag field of the TCP protocol. NULL scans send a TCP packet without any mark, FIN scans send a TCP packet with a FIN mark, and XMAS scans send a TCP packet with FIN, URG, and PSH marks. If an RST response is received, it means the port is closed; if there is no response, it means the port is open.

[0007] Existing port scanning technologies all have certain limitations.

[0008] TCP full connection scan:

[0009] Advantages: It can determine whether the port is open and the response time, and the result is more accurate.

[0010] Disadvantages: It requires a complete TCP connection to be established, which is slow and can easily leave unfinished connections on the target host, making it easy to be detected by firewalls and intrusion detection systems.

[0011] SYN Scan:

[0012] Advantages: Sending SYN packets without completing a full TCP connection is faster.

[0013] Disadvantages: Can only determine whether the port is open, but cannot determine the response time; may leave an unfinished connection on the target host.

[0014] UDP Scan:

[0015] Advantages: Suitable for scanning UDP protocol service and application ports; can determine whether the port is closed.

[0016] Disadvantages: Due to the characteristics of the UDP protocol, the scanning speed is slow, and it is impossible to determine whether the unresponsive ports are open or filtered out.

[0017] NULL, FIN, and XMAS scans:

[0018] Advantages: Bypasses detection by firewalls or intrusion detection systems by sending special TCP packets.

[0019] Disadvantages: May be ignored or filtered out on some operating systems or firewalls; can only determine whether the port is open, not the response time.

[0020] In short, with the development of network technology, traditional network security technology has been further developed, and a large number of effective detection methods and detection tools for scanning behaviors have emerged. When performing large-scale scanning tasks, traditional network detection technology has low execution efficiency and is easy to be discovered, resulting in the inability to obtain useful detection information, which greatly affects the accuracy of the scanning results. How to solve the anonymity of network detection and improve the efficiency of port detection scanning is one of the key issues facing current network detection. Summary of the invention

[0021] The technical problem to be solved by the present invention is to study the existing port scanning technology from the perspective of concealment and efficiency problems in network detection, explore an efficient passive port survival scanning technology, solve the problem that the existing network detection technology is inefficient and easy to be discovered when performing large-scale scanning tasks, and propose a port status covert scanning method and device based on a dynamic estimation model.

[0022] In order to solve the above technical problems, the first aspect of the embodiment of the present invention discloses a covert port status scanning method based on a dynamic estimation model, the method comprising:

[0023] S1, analyzing the port range of the scanned target terminal to obtain the port range information of the scanned target terminal;

[0024] S2, segmenting the port of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer;

[0025] S3, using a preset dynamic estimation model, sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information.

[0026] As an optional implementation, in the first aspect of the embodiment of the present invention, the method of using a preset dynamic estimation model to sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information includes:

[0027] S31, using an active scanning host, performing a first IPID detection on a cooperation middle machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperation middle machine;

[0028] S32, using an active scanning host, performing a second IPID detection on the cooperation middle machine in the third-party remote system, and obtaining the serial number IPID2 value of the IP data packet replied by the cooperation middle machine;

[0029] S33, processing the serial number IPID1 value and the serial number IPID2 value to obtain port status covert scanning information;

[0030] S34, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information.

[0031] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the active scanning host is used to perform a second IPID detection on the cooperation middle machine in the third-party remote system to obtain the sequence number IPID2 value of the IP data packet replied by the cooperation middle machine, including:

[0032] S321, using an active scanning host, sequentially sending a port status detection packet to each port segment of the scanned target terminal, and when a port of the scanned target terminal is open, the scanned target terminal replies with a first response data packet, otherwise replies with a second response data packet;

[0033] S322, using the active scanning host, performs a second IPID detection on the cooperative middle machine in the third-party remote system to obtain the serial number IPID2 of the IP data packet replied by the cooperative middle machine.

[0034] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the processing of the serial number IPID1 value and the serial number IPID2 value to obtain the port status covert scanning information includes:

[0035] S331, analyzing the sequence number IPID1 value and the sequence number IPID2 value. If the values ​​of the sequence number IPID1 value and the sequence number IPID2 value are both increased by 1 in all detection tasks, it means that all ports detected by this task are closed; if the number of detected ports is 1, and the difference between the sequence number IPID1 value and the sequence number IPID2 value is 2, it means that the port is open;

[0036] S332, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information.

[0037] As an optional implementation, in the first aspect of the embodiment of the present invention, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain the port status covert scanning information, including:

[0038] S3321, process the serial number IPID1 value and the serial number IPID2 value to obtain the port status IPDI information value;

[0039] S3322, compare the port status IPDI information value with the preset threshold. When the port status IPDI information value is less than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is small; when the port status IPDI information value is greater than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is large.

[0040] As an optional implementation manner, in the first aspect of the embodiment of the present invention, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information includes:

[0041] S341, when the number of ports opened by the currently scanned target terminal is small, the port range for this detection is divided to obtain a first port range and a second port range;

[0042] S342, using the active scanning host to detect the first port range to obtain first port status information;

[0043] S343, using the active scanning host to detect the second port range to obtain second port status information;

[0044] S344, when there are many open ports of the target terminal being scanned, use the first IPID detection model to detect the corresponding target port to obtain the IPID value;

[0045] S345, when the IPID value increment is 2, the port status information is in an open state, otherwise the port status information is in a closed state.

[0046] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the using the active scanning host to detect the first port range to obtain the first port status information includes:

[0047] S3421, dividing the first port range into blocks to obtain N port blocks, where N is a positive integer;

[0048] S3422, processing the N port blocks to obtain a middle port block mid;

[0049] The intermediate port block mid expression is:

[0050] mid=(left+right) / 2

[0051] Where left is the left boundary of the first port range, and right is the right boundary of the first port range;

[0052] S3423, comparing the opening and closing states of the intermediate port block and the port number of the minimum value of the segment, if they are consistent, judging the opening and closing states of the intermediate port block and the N port blocks to obtain opening and closing state information;

[0053] S3424, when the opening and closing state information exceeds a preset threshold, the middle port block is a demarcation point; otherwise, a demarcation point is determined within the range of the first half [left, mid] and the second half [mid, right] of the middle port block;

[0054] S3425: Perform detection using a first IPID detection model within the first half [left, mid] and the second half [mid, right] of the middle port block to obtain first port status information.

[0055] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the detection step of the first IPID detection model includes:

[0056] Using the active scanning host to send the first SYN+ACK packet to the cooperative middle machine in the third-party remote system, and record the initial IPID value;

[0057] Forging the IP source address of the SYN+ACK packet into the IP address of a cooperating middle machine in a third-party remote system and sending it to the scanned target terminal;

[0058] When the scanned target terminal returns a SYN+ACK packet to the cooperative middle machine in the third-party remote system, the scanned target terminal port is opened and the initial IPID value increases by 1;

[0059] When the scanned target terminal returns an RST response to the cooperation middle machine in the third-party remote system, the scanned target terminal port is closed;

[0060] Using active scanning host, send a second SYN+ACK packet to the cooperative middle machine in the third-party remote system, and find the second IPID value in the returned RST response;

[0061] The open / closed state of the port on the scanned target terminal is determined according to the second IPID value.

[0062] A second aspect of an embodiment of the present invention discloses a port status covert scanning device based on a dynamic estimation model, the device comprising:

[0063] The port analysis module is used to analyze the port range of the scanned target terminal to obtain the port range information of the scanned target terminal;

[0064] A port segmentation module, used for segmenting the port of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer;

[0065] The port dynamic estimation module is used to use a preset dynamic estimation model to perform port detection on the M port segments of the scanned target terminal in sequence to obtain port status information.

[0066] As an optional implementation, in the second aspect of the embodiment of the present invention, the method of using a preset dynamic estimation model to sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information includes:

[0067] S31, using an active scanning host, performing a first IPID detection on a cooperation middle machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperation middle machine;

[0068] S32, using an active scanning host, performing a second IPID detection on the cooperation middle machine in the third-party remote system, and obtaining the serial number IPID2 value of the IP data packet replied by the cooperation middle machine;

[0069] S33, processing the serial number IPID1 value and the serial number IPID2 value to obtain port status covert scanning information;

[0070] S34, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information.

[0071] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the active scanning host is used to perform a second IPID detection on the cooperation middle machine in the third-party remote system to obtain the sequence number IPID2 value of the IP data packet replied by the cooperation middle machine, including:

[0072] S321, using an active scanning host, sequentially sending a port status detection packet to each port segment of the scanned target terminal, and when a port of the scanned target terminal is open, the scanned target terminal replies with a first response data packet, otherwise replies with a second response data packet;

[0073] S322, using the active scanning host, performs a second IPID detection on the cooperative middle machine in the third-party remote system to obtain the serial number IPID2 of the IP data packet replied by the cooperative middle machine.

[0074] As an optional implementation, in the second aspect of the embodiment of the present invention, the processing of the serial number IPID1 value and the serial number IPID2 value to obtain the port status covert scanning information includes:

[0075] S331, analyzing the sequence number IPID1 value and the sequence number IPID2 value. If the values ​​of the sequence number IPID1 value and the sequence number IPID2 value are both increased by 1 in all detection tasks, it means that all ports detected by this task are closed; if the number of detected ports is 1, and the difference between the sequence number IPID1 value and the sequence number IPID2 value is 2, it means that the port is open;

[0076] S332, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information.

[0077] As an optional implementation, in the second aspect of the embodiment of the present invention, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain the port status covert scanning information, including:

[0078] S3321, process the serial number IPID1 value and the serial number IPID2 value to obtain the port status IPDI information value;

[0079] S3322, compare the port status IPDI information value with the preset threshold. When the port status IPDI information value is less than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is small; when the port status IPDI information value is greater than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is large.

[0080] As an optional implementation, in the second aspect of the embodiment of the present invention, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information includes:

[0081] S341, when the number of ports opened by the currently scanned target terminal is small, the port range for this detection is divided to obtain a first port range and a second port range;

[0082] S342, using the active scanning host to detect the first port range to obtain first port status information;

[0083] S343, using the active scanning host to detect the second port range to obtain second port status information;

[0084] S344, when there are many open ports of the target terminal being scanned, use the first IPID detection model to detect the corresponding target port to obtain the IPID value;

[0085] S345, when the IPID value increment is 2, the port status information is in an open state, otherwise the port status information is in a closed state.

[0086] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the using the active scanning host to detect the first port range to obtain the first port status information includes:

[0087] S3421, dividing the first port range into blocks to obtain N port blocks, where N is a positive integer;

[0088] S3422, processing the N port blocks to obtain a middle port block mid;

[0089] The intermediate port block mid expression is:

[0090] mid=(left+right) / 2

[0091] Where left is the left boundary of the first port range, and right is the right boundary of the first port range;

[0092] S3423, comparing the opening and closing states of the intermediate port block and the port number of the minimum value of the segment, if they are consistent, judging the opening and closing states of the intermediate port block and the N port blocks to obtain opening and closing state information;

[0093] S3424, when the opening and closing state information exceeds a preset threshold, the middle port block is a demarcation point; otherwise, a demarcation point is determined within the range of the first half [left, mid] and the second half [mid, right] of the middle port block;

[0094] S3425: Perform detection using a first IPID detection model within the first half [left, mid] and the second half [mid, right] of the middle port block to obtain first port status information.

[0095] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the detection step of the first IPID detection model includes:

[0096] Using the active scanning host to send the first SYN+ACK packet to the cooperative middle machine in the third-party remote system, and record the initial IPID value;

[0097] Forging the IP source address of the SYN+ACK packet into the IP address of a cooperating middle machine in a third-party remote system and sending it to the scanned target terminal;

[0098] When the scanned target terminal returns a SYN+ACK packet to the cooperative middle machine in the third-party remote system, the scanned target terminal port is opened and the initial IPID value increases by 1;

[0099] When the scanned target terminal returns an RST response to the cooperation middle machine in the third-party remote system, the scanned target terminal port is closed;

[0100] Using active scanning host, send a second SYN+ACK packet to the cooperative middle machine in the third-party remote system, and find the second IPID value in the returned RST response;

[0101] The open / closed state of the port on the scanned target terminal is determined according to the second IPID value.

[0102] The third aspect of the present invention discloses another port status covert scanning device based on a dynamic estimation model, the device comprising:

[0103] A memory storing executable program code;

[0104] a processor coupled to the memory;

[0105] The processor calls the executable program code stored in the memory to execute part or all of the steps in the port status covert scanning method based on the dynamic estimation model disclosed in the first aspect of the embodiment of the present invention.

[0106] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0107] The present invention proposes a port status covert scanning method based on a dynamic estimation model based on the demand for efficient and covert scanning and identification of the port status of an unknown target terminal. On the one hand, a detection data packet whose detection node IP address is the IP address of a third-party collaborative intermediate machine is constructed, and a stateless scanning method is used to carry out efficient port scanning on the target IP address. After sending the data packet, there is no need to wait for receiving a response packet, thereby improving the scanning efficiency. At the same time, due to the use of a false source IP address, passive and covert scanning based on identity forgery is realized. On the other hand, a dynamic estimation model is constructed, and a multi-step prediction strategy of a time series based on sliding window autoregression is constructed to dynamically batch confirm the port opening status within a certain range of the target. A reasonable threshold is set. If there are many closed ports in a certain section, the IPID is divided to determine the port closing status, and the execution time is short; if there are many open ports in a certain section, the first IPID detection model is used to determine the port opening status, thereby further improving the scanning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0108] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0109] Figure 1 It is a flow chart of a port status covert scanning method based on a dynamic estimation model disclosed in an embodiment of the present invention;

[0110] Figure 2 It is a flow chart of another method for covert port status scanning based on a dynamic estimation model disclosed in an embodiment of the present invention;

[0111] Figure 3 It is a structural schematic diagram of a port status covert scanning device based on a dynamic estimation model disclosed in an embodiment of the present invention;

[0112] Figure 4 It is a structural schematic diagram of another port status covert scanning device based on a dynamic estimation model disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0113] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0114] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.

[0115] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0116] The present invention discloses a port status covert scanning method and device based on a dynamic estimation model. The method includes: starting from the requirements of efficient and covert scanning and identification of the port status of an unknown target terminal, a port status covert scanning method based on a dynamic estimation model is proposed. On the one hand, a detection data packet whose detection node IP address is the IP address of a third-party collaborative intermediate machine is constructed, and a SYN / ACK and FIN stateless scanning method is used to carry out a high-efficiency port scan on the target IP address. After sending the data packet, there is no need to wait for the response packet to be received, thereby improving the scanning efficiency. At the same time, due to the use of a false source IP address, passive and covert scanning based on identity forgery is realized. On the other hand, a time series multi-step prediction strategy based on a dynamic estimation model and a sliding window autoregression is constructed to dynamically batch confirm the port opening status within a certain range of the target. A reasonable threshold is set. If there are many closed ports in a certain section, the port closing status is determined by directly dividing the IPID, and the execution time is short; if there are many open ports in a certain section, the port opening status is determined by the original IPID method, thereby further improving the scanning efficiency. The following are detailed descriptions.

[0117] Embodiment 1

[0118] See also Figure 1 , Figure 1 1 is a flow chart of a port status covert scanning method based on a dynamic estimation model disclosed in an embodiment of the present invention. Figure 1 The described port status covert scanning method based on the dynamic estimation model is applied to the field of network security technology to achieve anonymity and high efficiency in network detection, which is not limited in the embodiments of the present invention. Figure 1 As shown, the port status covert scanning method based on the dynamic estimation model may include the following operations:

[0119] S1, analyzing the port range of the scanned target terminal to obtain the port range information of the scanned target terminal;

[0120] Analyze the port range of the scanned target terminal. The port range is usually between 0-65535. The value will be different depending on the actual target terminal being scanned. It should be determined based on the actual situation.

[0121] S2, segmenting the port of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer;

[0122] In order to improve the scanning speed, the port detection is performed by segmenting the ports of the scanned target terminal. The number of segments is determined according to the actual situation.

[0123] According to the port information of M port segments, set the number of concurrent tasks;

[0124] S3, using a preset dynamic estimation model, sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information.

[0125] Optionally, the using of a preset dynamic estimation model to sequentially perform port detection on M port segments of the scanned target terminal to obtain port status information includes:

[0126] S31, using an active scanning host, performing a first IPID detection on a cooperation middle machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperation middle machine;

[0127] S32, using an active scanning host, performing a second IPID detection on the cooperation middle machine in the third-party remote system, and obtaining the serial number IPID2 value of the IP data packet replied by the cooperation middle machine;

[0128] S33, processing the serial number IPID1 value and the serial number IPID2 value to obtain port status covert scanning information;

[0129] S34, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information.

[0130] Optionally, the active scanning host is used to perform a second IPID detection on the cooperation middle machine in the third-party remote system to obtain the sequence number IPID2 value of the IP data packet replied by the cooperation middle machine, including:

[0131] S321, using an active scanning host, sequentially sending a port status detection packet to each port segment of the scanned target terminal, and when a port of the scanned target terminal is open, the scanned target terminal replies with a first response data packet, otherwise replies with a second response data packet;

[0132] Optionally, the first response data packet is a SYN / ACK packet, and the second response data packet is a RST packet.

[0133] S322, using the active scanning host, performs a second IPID detection on the cooperative middle machine in the third-party remote system to obtain the serial number IPID2 of the IP data packet replied by the cooperative middle machine.

[0134] Optionally, the processing of the serial number IPID1 value and the serial number IPID2 value to obtain the port status covert scanning information includes:

[0135] S331, analyzing the sequence number IPID1 value and the sequence number IPID2 value. If the values ​​of the sequence number IPID1 value and the sequence number IPID2 value are both increased by 1 in all detection tasks, it means that all ports detected by this task are closed; if the number of detected ports is 1, and the difference between the sequence number IPID1 value and the sequence number IPID2 value is 2, it means that the port is open;

[0136] S332, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information.

[0137] Optionally, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information, including:

[0138] S3321, process the serial number IPID1 value and the serial number IPID2 value to obtain the port status IPDI information value;

[0139] The calculation method of the port status IPDI information value is:

[0140] Calculate the difference between the serial number IPID1 value and the serial number IPID2 value;

[0141] Calculate the task concurrency of this task;

[0142] Multiply the difference between the serial number IPID1 value and the serial number IPID2 value by the task concurrency of this task, then multiply it by the time interval between the first detection and the second detection, and then multiply it by the time of the first data packet communication between the active scanning host and the cooperative intermediate machine in the third-party remote system to obtain the port status IPDI information value.

[0143] S3322, compare the port status IPDI information value with the preset threshold. When the port status IPDI information value is less than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is small; when the port status IPDI information value is greater than the preset threshold, the port status covert scanning information indicates that the number of open ports of the currently scanned target terminal is large.

[0144] The calculation method of the preset threshold is:

[0145] Obtain the historical scheduling records of the scanned target terminal;

[0146] The historical scheduling records are analyzed to obtain the historical record values ​​of the serial number IPID1 values ​​of the IP data packets replied by the cooperative middle machine, and the historical record values ​​of the obtained serial number IPID1 values ​​are averaged and the obtained average value is used as the threshold.

[0147] Optionally, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain the port status information includes:

[0148] S341, when the number of ports opened by the currently scanned target terminal is small, the port range for this detection is divided to obtain a first port range and a second port range;

[0149] S342, using the active scanning host to detect the first port range to obtain first port status information;

[0150] S343, using the active scanning host to detect the second port range to obtain second port status information;

[0151] The method for detecting the second port range is the same as the method for detecting the first port range.

[0152] S344, when there are many open ports of the target terminal being scanned, use the first IPID detection model to detect the corresponding target port to obtain the IPID value;

[0153] S345, when the IPID value increment is 2, the port status information is in an open state, otherwise the port status information is in a closed state.

[0154] Optionally, the actively scanning the host to detect the first port range to obtain the first port status information includes:

[0155] S3421, dividing the first port range into blocks to obtain N port blocks, where N is a positive integer;

[0156] S3422, processing the N port blocks to obtain a middle port block mid;

[0157] The intermediate port block mid expression is:

[0158] mid=(left+right) / 2

[0159] Where left is the left boundary of the first port range, and right is the right boundary of the first port range;

[0160] S3423, comparing the opening and closing states of the intermediate port block and the port number of the minimum value of the segment, if they are consistent, judging the opening and closing states of the intermediate port block and the N port blocks to obtain opening and closing state information;

[0161] S3424, when the opening and closing state information exceeds a preset threshold, the middle port block is a demarcation point; otherwise, a demarcation point is determined within the range of the first half [left, mid] and the second half [mid, right] of the middle port block;

[0162] The threshold is obtained by actual experimental calculation and is not limited in this embodiment.

[0163] S3425: Perform detection using a first IPID detection model within the first half [left, mid] and the second half [mid, right] of the middle port block to obtain first port status information.

[0164] Optionally, the method of using the active scanning host to detect the first port range to obtain the first port status information is:

[0165] Sorting the first port range to obtain the port sorting information, wherein the left boundary is left1 and the right boundary is right1, and calculating and obtaining the middle port mid1 of the first port range;

[0166] Find a random port between the left boundary left1 and the right boundary right1;

[0167] Compare the left boundary with the randomly found port for port opening and closing status. If they are consistent, determine whether the random port is on the left or right of the middle port in the first port range. If it is on the left, use the first IPID detection model to detect between [left1, mid1] to obtain the first port status information; if it is on the right, use the first IPID detection model to detect between [mid1, right1] to obtain the first port status information.

[0168] Optionally, the detection step of the first IPID detection model includes:

[0169] Using the active scanning host to send the first SYN+ACK packet to the cooperative middle machine in the third-party remote system, and record the initial IPID value;

[0170] Forging the IP source address of the SYN+ACK packet into the IP address of a cooperating middle machine in a third-party remote system and sending it to the scanned target terminal;

[0171] When the scanned target terminal returns a SYN+ACK packet to the cooperative middle machine in the third-party remote system, the scanned target terminal port is opened and the initial IPID value increases by 1;

[0172] When the scanned target terminal returns an RST response to the cooperation middle machine in the third-party remote system, the scanned target terminal port is closed;

[0173] Using active scanning host, send a second SYN+ACK packet to the cooperative middle machine in the third-party remote system, and find the second IPID value in the returned RST response;

[0174] The open / closed state of the port on the scanned target terminal is determined according to the second IPID value.

[0175] It can be seen that the present invention proposes a port status covert scanning method based on a dynamic estimation model based on the demand for efficient and covert scanning and identification of the port status of an unknown target terminal. On the one hand, a detection data packet whose detection node IP address is the IP address of a third-party collaborative intermediate machine is constructed, and a stateless scanning method is used to carry out efficient port scanning on the target IP address. After sending the data packet, there is no need to wait for the response packet to be received, thereby improving the scanning efficiency. At the same time, due to the use of a false source IP address, passive and covert scanning based on identity forgery is realized. On the other hand, a dynamic estimation model is constructed, and a multi-step prediction strategy of a time series based on sliding window autoregression is constructed to dynamically batch confirm the port opening status within a certain range of the target. A reasonable threshold is set. If there are many closed ports in a certain section, the IPID is divided to determine the port closing status, and the execution time is short; if there are many open ports in a certain section, the first IPID detection model is used to determine the port opening status, thereby further improving the scanning efficiency.

[0176] Embodiment 2

[0177] See also Figure 2 , Figure 2 1 is a flow chart of another method for covert port status scanning based on a dynamic estimation model disclosed in an embodiment of the present invention. Figure 2 The described port status covert scanning method based on the dynamic estimation model is applied to the field of network security technology to achieve anonymity and high efficiency in network detection, which is not limited in the embodiments of the present invention. Figure 2 As shown, the port status covert scanning method based on the dynamic estimation model may include the following operations:

[0178] 1) The active scanning host performs the first IPID detection on the cooperative middle machine in the third-party remote system, obtains the serial number IPID of the IP data packet replied by the cooperative middle machine in the third-party remote system and records it.

[0179] 2) Analyze the port range of the scanned target terminal, classify the ports in the range of 0-1023 as common ports, and classify the ports in the range of 1024 to 65535 as random ports. Since there are relatively more open ports for common ports, a smaller number of concurrent detection tasks (such as 15) is set for ports in the range of 0-1023 each time, and since there are relatively fewer open ports for random ports, a larger number of concurrent detection tasks (such as 80, which is less than the scanning threshold of most detection software) is set for ports in the range of 1024 to 65535 each time.

[0180] 3) According to the preset number of segments, the number of concurrent tasks is set. For multiple ports of the preset number of segments of the currently scanned target terminal, the active scanning host disguises itself as a cooperative middle machine in a third-party remote system and sends a port status detection packet to the corresponding port of the scanned target terminal. If a port of the scanned target terminal is open, the scanned target terminal replies with a SYN / ACK packet, otherwise it replies with a RST packet.

[0181] 4) The active scanning host performs a second IPID detection on the cooperative middle machine in the third-party remote system, obtains the serial number IPID of the IP data packet replied by the cooperative middle machine in the third-party remote system and records it.

[0182] 5) Compare the serial numbers IPID of the two detected IP packets. If the previous and next IPID values ​​in all detection tasks increase by 1, it means that all ports detected in this task are closed.

[0183] 6) Compare the serial numbers IPID of the two detected IP data packets. If the detected port number is 1 and the difference between the serial numbers IPID of the two detected IP packets is 2, it indicates that the port is open.

[0184] 7) Based on the dynamic estimation model, compare the serial numbers IPID of the two detected IP packets. If the number of detected ports is greater than 1, calculate the ratio a of the increment of the two IPID values ​​to the concurrent amount of this task, and set a threshold A;

[0185] 8) Based on the dynamic estimation model, determine whether the ratio a is greater than the threshold A. If a is less than the threshold A, it means that there are fewer open ports in the multiple port ranges of the predetermined number of segments of the target terminal being scanned. In this case, the direct binary IPID method is used to divide the port range of this detection into two parts, and return to step 1) to use the same method to detect again.

[0186] 9) Based on the dynamic estimation model, determine whether the ratio a is greater than the threshold A. If a is greater than or equal to the threshold A, it means that there are many open ports in the multiple port ranges of the predetermined number of segments of the target terminal being scanned. Then, the original IPID method is used to perform subsequent detection on the corresponding target port to obtain the IPID value. If the IPID value increases by 2, it indicates that the port is in an open state, otherwise it is in a closed state.

[0187] Among them, the port type classification method is divided into two categories: common ports and random ports

[0188] In computer networks, port is a logical concept used to distinguish different services or processes. According to the usage habits and regulations of port numbers, ports can be divided into the following two categories:

[0189] Well-known Ports, range: 0 to 1023

[0190] Description: These port numbers are usually assigned by the Internet Assigned Numbers Authority (IANA) to specific services. For example, HTTP services usually use port 80, HTTPS uses 443, FTP uses 21, and so on. These ports are usually associated with some of the most commonly used network services and protocols.

[0191] Random ports (Dynamic Ports or Private Ports), range: 1024 to 65535

[0192] Description: These ports are not officially assigned by IANA to any specific service and are typically used for transient communications by client software, such as temporarily established network sessions and communications between internal processes of the operating system. They are also called "ephemeral ports" or "private ports".

[0193] In addition to the above two categories, there is another category called registered ports, ranging from 1024 to 49151.

[0194] Description: Although these ports are not assigned to specific services by IANA, they are used for certain well-known services and have a wide range of uses in different applications. The use of registered ports requires application to IANA to avoid conflicts.

[0195] In network programming, servers usually listen for connection requests from clients on common ports, while clients initiate connections using random ports. This classification of ports helps maintain order in network communications and ensures that specific services can be accessed through standard ports.

[0196] The serial number IPID of the IP data packet: IPID refers to Internet Protocol Identification, also known as the IP identifier, which is a 16-bit binary number represented in the identification field of the IP message header.

[0197] In the Internet Protocol (IP), the sequence number of an IP packet, also known as the IP identifier (IPID), is an important field used to identify different fragments belonging to the same original datagram during the fragmentation and reassembly process of an IP datagram. The sequence number of an IP packet is part of the IP header and has the following characteristics:

[0198] 1. Size: The IPID field is a 16-bit value, which means its value range is 0 to 65535.

[0199] 2. Position: In the IPv4 header, the IPID field follows the total length field and is located between the 4th and 5th bytes of the IP header.

[0200] 3. Function: When an original IP datagram is too large to pass through a link on the network, it will be fragmented. Each fragment will become a new IP datagram containing part of the data of the original datagram, and the IPID field is used to ensure that these fragments can be correctly reassembled into the original datagram at the destination. The destination host will use IPID to match and reassemble all fragments belonging to the same original datagram.

[0201] 4. Fragment reassembly: The host that receives the fragments will check the IPID value and combine the fragments with the same IPID. Once all necessary fragments have arrived, the datagram can be reassembled and delivered to the upper layer protocol.

[0202] 5.IPID generation: IPID can be incremental or randomly generated, depending on the implementation of the operating system or network device. Incremental IPIDs can help the receiver reassemble fragments sequentially, but in some cases may bring security risks because they can be used to infer network traffic patterns or perform certain types of network attacks.

[0203] 6. Changes in IPv6: In IPv6, fragmentation is usually not required due to the improved header format. There is no IPID field in the IPv6 basic header, and fragmentation information (if necessary) is handled through a special fragmentation extension header.

[0204] IPID is one of the key mechanisms to ensure data integrity in network communications. It enables data to be correctly assembled and processed in complex network environments even if data transmission is fragmented.

[0205] Dynamic estimation method: Based on historical scheduling records, dynamically batch confirm the port opening status within a certain range of the target.

[0206] If there are many closed ports in a certain segment, the direct binary IPID is used to determine the port closing status, which saves execution time; if there are many open ports in a certain segment, the original IPID method is used to determine the port opening status.

[0207] Dynamic Estimation Implementation Model:

[0208] 1. Data collection: Collect historical and real-time data related to the estimated target. Ensure the quality and accuracy of the data, including data cleaning and preprocessing.

[0209] 2. Data cleaning and preprocessing

[0210] Missing value handling: Deletion: If the data set is large and there are not many missing values, you can directly delete the rows or columns containing missing values.

[0211] Filling: Missing values ​​can be estimated and filled using statistical values ​​(such as mean, median, mode) or using other algorithms (such as K nearest neighbors).

[0212] Outlier handling:

[0213] Identification: Identify outliers through visualization (e.g., box plot) or statistical methods (e.g., IQR, Z-score).

[0214] Treatment: You can decide to remove outliers, replace them, or keep them but flag and treat them specially.

[0215] Unified data format: Ensure that all data fields follow a unified format, such as date and time format, currency unit, measurement unit, etc.

[0216] Standardization / Normalization: Making data fit a specific range or distribution, such as scaling the data to the interval 0, 10, 1 (normalization) or making it have zero mean and unit variance (standardization).

[0217] Logarithmic transformation: used to process right-skewed data, which can make the data distribution closer to normal distribution.

[0218] Feature encoding: Convert categorical data into numerical data, such as using One-Hot Encoding or Label Encoding.

[0219] Merge data: When merging data sets from different sources or in different formats, you need to pay attention to key value matching and data alignment issues.

[0220] Deduplication: Delete duplicate records to ensure the uniqueness of data.

[0221] Feature extraction: extract new features from existing data to increase the dimensionality of the data.

[0222] Feature selection: Select the most meaningful features for model training and remove noise and irrelevant features.

[0223] Text preprocessing (if the dataset contains text):

[0224] Word segmentation: split continuous text into words or phrases. Text cleaning: remove punctuation, numbers, special characters, etc. Stop word removal: remove common meaningless words, such as "and", "the", etc. Stemming / lemmatization: convert words into basic forms. Word frequency statistics: count the frequency of word occurrences to prepare for subsequent text analysis.

[0225] Preprocessing specific to time series data:

[0226] Timestamp conversion: Ensure that all time data is in a consistent and accurate format.

[0227] Interpolation of missing time data: For time series data, missing time points may need to be filled by interpolation.

[0228] Time Series Decomposition: Decompose a time series into trend, seasonality, and residual components.

[0229] Through these steps, the data can be cleaned and transformed into a form more suitable for analysis and modeling.

[0230] 3. Model selection:

[0231] Select a suitable statistical model or machine learning model according to the estimated target. The present invention adopts a deep belief network (DBN) learning model.

[0232] 1) Parameter adjustment: Initialize the model parameters by analyzing historical data. Adjust the model parameters according to real-time feedback to adapt to environmental changes.

[0233] 2) Model parameter initialization: use Xavier initialization method.

[0234] The Xavier initialization method reasonably selects the initial value of the weight according to the dimensions of the input and output of the network layer. In the Xavier initialization method, the weights are randomly initialized to values ​​in a fixed range of uniform distribution or Gaussian distribution, so that the variance of the input and output can be kept consistent. Then, the weights can be sampled according to the Gaussian distribution or uniform distribution with a mean of 0 and a standard deviation of σ. Depending on the specific structure of the network, different activation functions and layer structures can be used to select the appropriate Xavier initialization method variant. The advantage of the Xavier initialization method is that it can better maintain the stability of the gradient during forward and backward propagation, which helps to train the neural network faster and more stably, and reduce the problem of gradient disappearance or gradient explosion.

[0235] The Xavier initialization method is suitable for traditional neural networks using bilinear activation functions (such as tanh, sigmoid). For networks using activation functions such as ReLU, other adaptive initialization methods may be needed to better initialize the weights.

[0236] Assume the number of neurons in the previous layer is n, and the number of neurons in the next layer is m, then:

[0237] For uniformly distributed Xavier initialization (uniform version):

[0238] The weight matrix W is randomly initialized from a uniform distribution in the range [-a, a], where a = sqrt(6 / (n+m)).

[0239] For Xavier initialization of Gaussian distribution (Gaussian version):

[0240] The weight matrix W is randomly initialized from a Gaussian distribution with a mean of 0 and a variance of variance, where variance = 2 / (n+m).

[0241] Model parameter tuning: Use the hyperparameter tuning tool Scikit-learn to perform parameter tuning during model training and subsequent feedback mechanism process.

[0242] Scikit-learn has implementations of grid search and random search. For both methods, scikit-learn trains and evaluates the model using K-fold cross validation on different parameter choices and returns the best model.

[0243] 1) Search implementation method

[0244] Random Search: Use GridSearchCV to run a search on some random combination of parameters.

[0245] Grid Search: Run a search over all parameter sets in a grid with GridSearchCV.

[0246] 2) Training feedback tuning based on K-fold cross validation

[0247] The specific algorithm details of K-fold cross-validation are as follows:

[0248] (1) Data partitioning: The entire training data set is randomly divided into K subsets of roughly equal size.

[0249] (2) Model training and validation: For k = 1 to K, perform the following steps:

[0250] The kth subset is retained from the K subsets as the validation dataset, and the remaining K-1 subsets are used as the training datasets.

[0251] Train the model on K-1 training datasets.

[0252] Evaluate the model on the reserved validation dataset. Record evaluation metrics such as accuracy, F1 score, mean squared error, etc.

[0253] (3) Result aggregation: Aggregate the K evaluation indicator results, usually by calculating their mean and standard deviation. This can provide an unbiased estimate of the model performance.

[0254] The main advantage of K-fold cross validation is that it allows repeated use of K randomly divided subsets for training and validation, each subset is validated once, and each validation is performed on a different training set, which increases the accuracy of the evaluation.

[0255] When choosing a value for K, a common choice is 10, as it provides a good compromise between bias and variance. A smaller K (such as 2 or 3) generally results in an increase in the variance of the model estimate, while a larger K (close to the leave-one-out approach, where K is equal to the number of samples) results in a reduced bias in the estimate, but with a significantly higher computational cost.

[0256] 4. Rolling Estimates:

[0257] Implement rolling forecasts, that is, regularly update the forecast results to include the latest data points. Evaluate the size of the forecast window to determine how long the data span is used for each forecast. Rolling Forecast is a method for forecasting time series data. When rolling forecast is applied in a neural network, the network is used continuously to make a series of forecasts. After each forecast, the forecast results and / or new real data points are included in the training data set to update the model and make the next forecast. Here are some specific details of neural network rolling forecasts:

[0258] Data window: In rolling estimation, a fixed-size window is usually used to select the most recent data points as input features. When new data points are available, the window is rolled forward (i.e., the oldest data points are removed and the latest data points are added).

[0259] Model update: After each prediction step, the neural network model can be retrained (full or incremental training) with new data to adjust its weights, or remain unchanged and used directly for the next prediction step. The update strategy depends on the specific scenario and model performance.

[0260] Prediction strategy: Neural networks can make single-step predictions (predicting the value at the next time point) or multi-step predictions (predicting a sequence of multiple time points in the future). In multi-step predictions, the results of the neural network predictions can be fed back as part of the input for the next prediction.

[0261] 5. Multi-step forecasting of time series based on sliding window autoregression

[0262] Multi-step time series forecasting mainly uses a sliding window autoregression method.

[0263] 1) Convert to labeled data

[0264] Time series data is not labeled, and the training of supervised machine learning models requires the definition of input and output. The method to convert time series data into labeled form is:

[0265] First, convert the original sequence (after preprocessing) into annotated form. Starting from the autoregressive relationship, there is an autoregressive relationship between time series. Then, we can convert it into annotated data:

[0266] Sample Xt is the input of the model, which is determined by the timestamp t and the elements in the window of size s before it.

[0267] X t =[y t ,y t-1 ,…,y t-s+1 ]

[0268] Model input X t Corresponding output y t+1 ,Right now

[0269] y t+1 =f(X t )=f([y t ,y t-1 ,…,y t-s+1 ])

[0270] This method is called forcing teaching for training RNN neural networks in seq2seq tasks. It is also called self-supervised labeling. The size of the time window exists in the form of a hyperparameter, and it is also possible to consider automatically determining the size of the time window.

[0271] 2) Model training

[0272] For a sample with a window size of s, the model f learns the mapping of the data in the window to the next time step, y t+1 ←f(y t ,y t-1 ,…,y t-s+1 )

[0273] 3) Recursive multi-step prediction

[0274] When predicting, multi-step prediction is completed by sliding a fixed window. If the prediction model used is a neural network, there is no explicit feature calculation process.

[0275] Retraining frequency:

[0276] Depending on the performance of the model and the speed at which the data changes, you can choose an appropriate retraining frequency. In some cases, you may need to update the model frequently (such as every time you get new data), while in other cases, you can update less frequently.

[0277] Evaluation metrics: You can use evaluation metrics such as mean square error (MSE), root mean square error (RMSE), or mean absolute error (MAE) to predict performance and adjust model parameters as needed.

[0278] Hyperparameter tuning: The hyperparameters of the neural network, such as learning rate, number of layers, number of neurons, batch size, etc., can be adjusted based on the prediction performance. In practice, the optimal hyperparameter combination may be found through cross-validation or other parameter search techniques.

[0279] Processing of forecast results: In some cases, the forecast results may need further processing, such as denormalization or adjustment through business logic, to ensure the feasibility and rationality of the forecast results in practical applications. The key to the neural network rolling forecast method is to deal with the autocorrelation and non-stationarity of time series data and to adapt to the changes in data over time. The effectiveness of this method is highly dependent on the quality of model design, hyperparameter selection, and data preprocessing.

[0280] Performance monitoring: Monitor the performance of the estimation model using metrics such as mean square error (MSE), root mean square error (RMSE), or other suitable evaluation metrics. Perform model evaluation and validation regularly to check the accuracy of the estimation results.

[0281] Feedback mechanism: Establish a feedback mechanism to use the deviation of the estimated results to adjust the model or strategy. Make dynamic adjustments based on the accuracy of the estimate, such as adjusting the estimate frequency, model complexity, etc.

[0282] Direct binary IPID method: If there are many closed ports in a certain segment, the direct binary IPID method is used to determine the port closure status, which takes less execution time.

[0283] Port detection scanning steps based on direct binary IPID method:

[0284] 1. Preprocessing stage (blocking):

[0285] For a given ordered array (or list) of scanned target ports, they are first divided into continuous, smaller port blocks or port sub-arrays.

[0286] The size of each port block can be fixed or dynamically determined according to the characteristics of the port number data set. After block division, the port number data in each port block usually needs to be sorted so that the binary search algorithm can be used later.

[0287] The minimum element of the next block is recorded at the beginning of each port block, which allows fast jumping between port blocks.

[0288] Inside each port block, one or more key indicators (such as the minimum value, maximum value, or index of the element within the port block) are recorded.

[0289] 2. One-time execution phase

[0290] 1) Using parallel detection, for multiple ports in a port block of the scanned target terminal (a certain range of port number segments), a single port scan based on the original IPID method is used at the same time, and the IPID value of each response data packet is recorded;

[0291] 2) Calculate the difference between the two identification numbers (IPID) obtained by the detection scan of each port in the port block. If the difference results are all 1, it means that all ports in a port block of the scanned target terminal are in a closed state;

[0292] 3) Otherwise, the ports in a port block of the scanned target terminal are both closed and open at the same time

[0293] 3. Re-blocking stage:

[0294] According to the closed and open states of the ports in the port block, a binary search algorithm is used in the port block to determine the boundary of the secondary block interval.

[0295] The specific approach is: first take the port number data element at the middle position of the port block (mid = (left + right) / 2), compare the port state corresponding to the port number with the port number state of the minimum value of the segment, if they are consistent, then count the state consistency between the above two port numbers, if it reaches a certain probability (such as 70% or other predefined values), then determine the port number as the dividing point; if it does not reach the established probability, then within the first half [left, mid-1] (or the second half [mid+1, right]), use the same method to determine a reasonable boundary.

[0296] Then, within the determined secondary block, parallel detection is performed in sequence according to the steps of the first execution phase.

[0297] 3. Loop execution phase:

[0298] Execute steps 2 and 3 repeatedly until the number of port numbers in the divided port block reaches a certain value (such as 1 or a user-defined value determined based on execution efficiency or execution time)

[0299] Original IPID method: If there are many open ports in a certain segment, the original IPID method is used to determine the port openness

[0300] The steps of the port scanning detection process based on the original IPID method are as follows:

[0301] 1. Obtain execution permissions of a third-party remote system through collaboration and other means. System features include:

[0302] The system is restricted and has no communication with other systems on the network. The system uses an increasing sequence of IPIDs.

[0303] 2. The active scanning host sends a SYN+ACK packet to the cooperative middle machine in the third-party remote system and records the initial IPID value.

[0304] 3. Forge the IP source address of the packet into the IP address of the cooperating middle machine in the third-party remote system and send it to the scanned target terminal.

[0305] 4. Depending on the port status of the scanned target terminal, there will be the following situations:

[0306] If the port is open, the scanned target terminal will assume that the cooperative middle machine in the third-party remote system sent the previous SYN request, and will return a SYN+ACK packet to the cooperative middle machine in the third-party remote system. Here, the cooperative middle machine in the third-party remote system will reply to this unknown SYN+ACK packet with a RST packet and increase the IPID value by 1.

[0307] If the port is closed, the scanned target terminal will assume that the cooperative middle machine in the third-party remote system sent the previous SYN request, and will return the RST response to the cooperative middle machine in the third-party remote system. If the IPID value increases by 1, then the port on the scanned target terminal is closed. If the IPID increases by 2, then the port on the scanned target terminal is open.

[0308] 5. The active scanning host sends another SYN+ACK packet to the cooperative middle machine in the third-party remote system and finds the last IPID value in the returned RST response. If the IPID value increases by 1, the port on the scanned target terminal is closed. If the IPID value increases by 2, the port on the scanned target terminal is open.

[0309] The above detection can be performed on each scanned target terminal port that you want to detect. Since the connection is not fully established, the stealthiness of the active scanning host can be increased without leaving too many scanning traces.

[0310] Embodiment 3

[0311] See also Figure 3 , Figure 3 1 is a schematic diagram of a structure of a port status covert scanning device based on a dynamic estimation model disclosed in an embodiment of the present invention. Figure 3 The described port status covert scanning device based on the dynamic estimation model is applied to the field of network security technology to achieve anonymity and high efficiency in network detection, which is not limited in the embodiments of the present invention. Figure 3 As shown, the port status covert scanning device based on the dynamic estimation model may include the following operations:

[0312] S301, a port analysis module, used to analyze the port range of the scanned target terminal to obtain the port range information of the scanned target terminal;

[0313] S302, a port segmentation module, configured to segment the ports of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer;

[0314] S303, a port dynamic estimation module is used to use a preset dynamic estimation model to perform port detection on the M port segments of the scanned target terminal in sequence to obtain port status information.

[0315] Embodiment 4

[0316] See also Figure 4 , Figure 4 is a schematic diagram of the structure of another port status covert scanning device based on a dynamic estimation model disclosed in an embodiment of the present invention. Figure 4 The described port status covert scanning device based on the dynamic estimation model is applied to the field of network security technology to achieve anonymity and high efficiency in network detection, which is not limited in the embodiments of the present invention. Figure 4 As shown, the port status covert scanning device based on the dynamic estimation model may include the following operations:

[0317] A memory 401 storing executable program codes;

[0318] a processor 402 coupled to the memory 401;

[0319] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the port status covert scanning method based on the dynamic estimation model described in the first and second embodiments.

[0320] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0321] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0322] Finally, it should be noted that the port status covert scanning method and device based on the dynamic estimation model disclosed in the embodiment of the present invention discloses only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A port status covert scanning method based on dynamic estimation model, It is characterized in that The method comprises: S1, analyzing the port range of the scanned target terminal to obtain the port range information of the scanned target terminal; S2, segmenting the port of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer; S3, using a preset dynamic estimation model, sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information, including: S31, using an active scanning host, performing a first IPID detection on a cooperation middle machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperation middle machine; S32, using an active scanning host, performs a second IPID detection on the cooperation middle machine in the third-party remote system, and obtains the sequence number IPID2 value of the IP data packet replied by the cooperation middle machine, including: S321, using an active scanning host, sequentially sending a port status detection packet to each port segment of the scanned target terminal, and when a port of the scanned target terminal is open, the scanned target terminal replies with a first response data packet, otherwise replies with a second response data packet; S322, using an active scanning host, performing a second IPID detection on the cooperation middle machine in the third-party remote system, and obtaining the sequence number IPID2 of the IP data packet replied by the cooperation middle machine; S33, processing the serial number IPID1 value and the serial number IPID2 value to obtain port status covert scanning information, including: S331, analyzing the sequence number IPID1 value and the sequence number IPID2 value. If the values ​​of the sequence number IPID1 value and the sequence number IPID2 value are both increased by 1 in all detection tasks, it means that all ports detected by this task are closed; if the number of detected ports is 1, and the difference between the sequence number IPID1 value and the sequence number IPID2 value is 2, it means that the port is open; S332, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information, including: S3321, process the serial number IPID1 value and the serial number IPID2 value to obtain the port status IPDI information value; The calculation method of the port status IPDI information value is: Calculate the difference between the serial number IPID1 value and the serial number IPID2 value; Calculate the task concurrency of this task; Multiply the difference between the serial number IPID1 value and the serial number IPID2 value by the task concurrency of this task, then multiply it by the time interval between the first detection and the second detection, and then multiply it by the time of the first data packet communication between the active scanning host and the cooperative middle machine in the third-party remote system to obtain the port status IPDI information value; S3322, comparing the port status IPDI information value with a preset threshold value, when the port status IPDI information value is less than the preset threshold value, the port status covert scanning information indicates that the currently scanned target terminal has fewer open ports; when the port status IPDI information value is greater than the preset threshold value, the port status covert scanning information indicates that the currently scanned target terminal has more open ports; The calculation method of the preset threshold is: Obtain the historical scheduling records of the scanned target terminal; Analyze the historical scheduling records to obtain the historical record values ​​of the serial number IPID1 values ​​of the IP data packets replied by the cooperation middle machine, calculate the average value of the historical record values ​​of the serial number IPID1 values, and use the obtained average value as the threshold; S34, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain port status information, including: S341, when the number of ports opened by the currently scanned target terminal is small, the port range for this detection is divided to obtain a first port range and a second port range; S342, using the active scanning host to detect the first port range, and obtain first port status information, including: S3421, divide the ports in the first port range into blocks to obtain N port blocks, where N is a positive integer; S3422, processing the N port blocks respectively to obtain a middle port block mid; The intermediate port block mid expression is: mid=(left+right) / 2 Where left is the left boundary of the first port range, and right is the right boundary of the first port range; S3423, comparing the opening and closing states of the intermediate port block and the port number of the minimum value of the segment, if they are consistent, judging the opening and closing states of the intermediate port block and the N port blocks to obtain opening and closing state information; S3424, when the opening and closing state information exceeds a preset threshold, the middle port block is a demarcation point; otherwise, a demarcation point is determined within the range of the first half [left, mid] and the second half [mid, right] of the middle port block; S3425, performing detection using a first IPID detection model within the first half [left, mid] and the second half [mid, right] of the middle port block to obtain first port status information; S343, using the active scanning host to detect the second port range to obtain second port status information; S344, when there are many open ports of the target terminal being scanned, use the first IPID detection model to detect the corresponding target port to obtain the IPID value; S345, when the IPID value increment is 2, the port status information is in an open state, otherwise the port status information is in a closed state.

2. The port status covert scanning method based on the dynamic estimation model according to claim 1, It is characterized in that The detection steps of the first IPID detection model include: Using the active scanning host to send the first SYN+ACK packet to the cooperative middle machine in the third-party remote system, and record the initial IPID value; Forging the IP source address of the SYN+ACK packet into the IP address of a cooperating middle machine in a third-party remote system and sending it to the scanned target terminal; When the scanned target terminal returns a SYN+ACK packet to the cooperative middle machine in the third-party remote system, the scanned target terminal port is opened and the initial IPID value increases by 1; When the scanned target terminal returns an RST response to the cooperation middle machine in the third-party remote system, the scanned target terminal port is closed; Using active scanning host, send a second SYN+ACK packet to the cooperative middle machine in the third-party remote system, and find the second IPID value in the returned RST response; The open / closed state of the port on the scanned target terminal is determined according to the second IPID value.

3. A port status covert scanning device based on a dynamic estimation model, It is characterized in that The device comprises: The port analysis module is used to analyze the port range of the scanned target terminal to obtain the port range information of the scanned target terminal; A port segmentation module, used for segmenting the port of the scanned target terminal according to the port range information to obtain M port segments, where M is a positive integer; The port dynamic estimation module is used to use a preset dynamic estimation model to sequentially perform port detection on the M port segments of the scanned target terminal to obtain port status information, including: S31, using an active scanning host, performing a first IPID detection on a cooperation middle machine in a third-party remote system, and obtaining a sequence number IPID1 value of an IP data packet replied by the cooperation middle machine; S32, using an active scanning host, performs a second IPID detection on the cooperation middle machine in the third-party remote system, and obtains the sequence number IPID2 value of the IP data packet replied by the cooperation middle machine, including: S321, using an active scanning host, sequentially sending a port status detection packet to each port segment of the scanned target terminal, and when a port of the scanned target terminal is open, the scanned target terminal replies with a first response data packet, otherwise replies with a second response data packet; S322, using an active scanning host, performing a second IPID detection on the cooperation middle machine in the third-party remote system, and obtaining the sequence number IPID2 of the IP data packet replied by the cooperation middle machine; S33, processing the serial number IPID1 value and the serial number IPID2 value to obtain port status covert scanning information, including: S331, analyzing the sequence number IPID1 value and the sequence number IPID2 value. If the values ​​of the sequence number IPID1 value and the sequence number IPID2 value are both increased by 1 in all detection tasks, it means that all ports detected by this task are closed; if the number of detected ports is 1, and the difference between the sequence number IPID1 value and the sequence number IPID2 value is 2, it means that the port is open; S332, when the number of detected ports is greater than 1, the serial number IPID1 value and the serial number IPID2 value are processed to obtain port status covert scanning information, including: S3321, process the serial number IPID1 value and the serial number IPID2 value to obtain the port status IPDI information value; The calculation method of the port status IPDI information value is: Calculate the difference between the serial number IPID1 value and the serial number IPID2 value; Calculate the task concurrency of this task; Multiply the difference between the serial number IPID1 value and the serial number IPID2 value by the task concurrency of this task, then multiply it by the time interval between the first detection and the second detection, and then multiply it by the time of the first data packet communication between the active scanning host and the cooperative middle machine in the third-party remote system to obtain the port status IPDI information value; S3322, comparing the port status IPDI information value with a preset threshold value, when the port status IPDI information value is less than the preset threshold value, the port status covert scanning information indicates that the currently scanned target terminal has fewer open ports; when the port status IPDI information value is greater than the preset threshold value, the port status covert scanning information indicates that the currently scanned target terminal has more open ports; The calculation method of the preset threshold is: Obtain the historical scheduling records of the scanned target terminal; Analyze the historical scheduling records to obtain the historical record values ​​of the serial number IPID1 values ​​of the IP data packets replied by the cooperation middle machine, calculate the average value of the historical record values ​​of the serial number IPID1 values, and use the obtained average value as the threshold; S34, detecting the port of the scanned target terminal according to the port status covert scanning information to obtain port status information, including: S341, when the number of ports opened by the currently scanned target terminal is small, the port range for this detection is divided to obtain a first port range and a second port range; S342, using the active scanning host to detect the first port range, and obtain first port status information, including: S3421, divide the ports in the first port range into blocks to obtain N port blocks, where N is a positive integer; S3422, processing the N port blocks respectively to obtain a middle port block mid; The intermediate port block mid expression is: mid=(left+right) / 2 Where left is the left boundary of the first port range, and right is the right boundary of the first port range; S3423, comparing the opening and closing states of the intermediate port block and the port number of the minimum value of the segment, if they are consistent, judging the opening and closing states of the intermediate port block and the N port blocks to obtain opening and closing state information; S3424, when the opening and closing state information exceeds a preset threshold, the middle port block is a demarcation point; otherwise, a demarcation point is determined within the range of the first half [left, mid] and the second half [mid, right] of the middle port block; S3425, performing detection using a first IPID detection model within the first half [left, mid] and the second half [mid, right] of the middle port block to obtain first port status information; S343, using the active scanning host to detect the second port range to obtain second port status information; S344, when there are many open ports of the target terminal being scanned, use the first IPID detection model to detect the corresponding target port to obtain the IPID value; S345, when the IPID value increment is 2, the port status information is in an open state, otherwise the port status information is in a closed state.

4. A port status covert scanning device based on a dynamic estimation model, It is characterized in that The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the port status covert scanning method based on the dynamic estimation model as described in any one of claims 1-2.