Abnormal certificate detection method and system based on segmented information entropy

Through the detection method based on segmented information entropy, combined with the entropy value and baseline range of the certificate field, the problem of distinguishing malicious certificates and trusted certificates in the existing technology is solved, and the accurate identification and identification of self-signed certificates in the enterprise intranet are achieved. The detection of covert channels improves the sensitivity and accuracy of detection.

CN118677642APending Publication Date: 2024-09-20CHINESE-FUNDED NETWORK INFORMATION SECURITY TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410553173.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

It is difficult to effectively distinguish malicious certificates from trusted certificates with existing technology, especially when there are a large number of self-signed certificates in an enterprise intranet environment, and conventional detection methods cannot accurately identify abnormal certificates.

Method used

A detection method based on segmented information entropy is used to generate the trusted range of the certificate by calculating the entropy value of the certificate field and comparing it with the baseline range. It conducts comprehensive detection based on the issuer and validity period of the certificate to identify abnormal certificates.

Benefits of technology

It achieves accurate detection of malicious certificates and custom certificates, improves the detection sensitivity of covert SSL channels and illegal data transmission, and reduces the performance overhead of specific field detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677642A
    Figure CN118677642A
Patent Text Reader

Abstract

The invention discloses an abnormal certificate detection method and system based on segmented information entropy, and belongs to the technical field of flow detection. The method comprises the following steps: generating a credible range of a field according to entropy values of the field representing natural semantics in a plurality of normal certificates; acquiring a certificate diary of the certificate to be detected; and based on the certificate diary of the to-be-detected certificate, calculating an entropy value of a field representing natural semantics in the to-be-detected certificate, and obtaining a first detection result of the to-be-detected certificate in combination with the credible range of the corresponding field. According to the method, the abnormal certificate in the traffic is discovered in combination with key processes such as traffic identification and important certificate feature matching, so that the abnormal link is alarmed, and possible malicious links and hidden SSL channels are discovered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flow detection, and in particular to an abnormal certificate detection method and system based on segmented information entropy. Background Art

[0002] In network security protection, abnormal traffic detection is a very important part. Currently, most application layer data in the network is transmitted using HTTPs, and there is a trend of increasing use of SSL protocols in abnormal traffic. For example, many covert channels are beginning to be built using TLS / SSL protocols, and some private protocols are often encapsulated using TLS.

[0003] Due to the characteristics of TLS / SSL protocols, the payload is completely encrypted, and the header fields are mostly similar in structure, with no obvious content differences, making it difficult to distinguish between normal and abnormal traffic. Currently, the more common method is to detect whether there are abnormalities in traffic from the perspective of TLS header fingerprints, such as JA3 fingerprints; link behavior and IP domain name reputation, but the characteristics of such methods are not direct. For example, for malicious traffic, it is difficult to find a completely consistent JA3 fingerprint in online traffic, and link behavior may be interfered with by various mechanisms such as network fluctuations and browser cache.

[0004] In the encryption process, digital certificates are an indispensable part and can indicate the identity of the certificate user, so you can consider using digital certificates. In order to encrypt data, the TLS / SSL protocol needs to negotiate the keys of both parties, so SSL digital certificates are needed. In general, SSL certificates are issued by a trusted certificate authority to the audited certificate applicant and have strong security. If there is an abnormality in the digital certificate used, it means that the link may be untrustworthy.

[0005] Currently, detection of abnormal certificates generally involves verifying whether the signature source is credible, whether the certificate is expired, whether the subject domain name of the certificate is secure, etc.

[0006] However, in some business scenarios, software or service developers may use private certificates. For example, some legitimate websites use self-signed certificates or certificates issued by untrusted organizations to reduce website construction costs or reduce certificate exposure to improve security. Typical scenarios include that a company's internal business system may use a large number of self-signed certificates. In this case, the private certificates detected are not necessarily related to security incidents. Generally, when using private signatures, legitimate businesses tend to use the same certificate, including the same key, the same authorization agency, and the same user field; while malicious traffic, in order to evade inspections by various systems, prefers one certificate at a time, especially frequently changing fields such as the issuing agency and user of the certificate. It can be seen that there are a large number of self-signed certificates in the current business intranet environment, which leads to the problem that conventional methods of detecting certificate issuers cannot effectively distinguish between malicious certificates and trusted certificates. Summary of the invention

[0007] In view of the above problems, the present invention proposes an abnormal certificate detection method and system based on segmented information entropy, which can comprehensively judge the credibility of the certificate by combining multiple means.

[0008] To achieve the above object, the technical solution of the present invention includes the following contents.

[0009] A method for detecting abnormal certificates based on segmented information entropy, the method comprising:

[0010] Generate a trustworthy range of the field according to the entropy values ​​of the fields that express natural semantics in several normal certificates;

[0011] Get the certificate diary of the certificate to be tested;

[0012] Based on the certificate diary of the certificate to be detected, the entropy value of the field representing the natural semantics in the certificate to be detected is calculated, and combined with the credible range of the corresponding field, a first detection result of the certificate to be detected is obtained.

[0013] Furthermore, the fields expressing natural semantics include: certificate issuer field, certificate user field, common name field, organization field, city field, province field, country field, email field, other fields, validity period field and optional user field.

[0014] Furthermore, the generating of the threshold range of the field according to the entropy value of the field expressing natural semantics in a number of normal certificates includes:

[0015] Divide a number of normal certificates into M groups;

[0016] Calculate the average entropy value of each field value corresponding to each group of normal certificates;

[0017] Based on the average entropy value of each field value corresponding to each group of normal certificates, the threshold range of each field is obtained.

[0018] Furthermore, the calculation of the average entropy value of each field value corresponding to each group of normal certificates includes:

[0019] Through field statistics, a statistical list of each field value corresponding to each group of normal certificates is generated;

[0020] Calculate the entropy value of each field value based on the statistical list;

[0021] The entropy values ​​of each field value are averaged to obtain the average entropy value of each field value corresponding to each group of normal certificates.

[0022] Furthermore, before calculating the entropy value of each field value based on the statistical list, the method further includes:

[0023] Select the field length threshold;

[0024] Samples whose length is less than the length threshold are discarded.

[0025] Furthermore, the entropy value of the field value Among them, i represents the i-th letter symbol in the statistical list, with a total of n letters and symbols, Count i It represents the number of times the i-th letter symbol appears, and N represents the total number of normal certificates in this group.

[0026] Further, the obtaining of the certificate diary of the certificate to be tested includes:

[0027] Capture traffic on the specified server network card;

[0028] Use DPI technology to detect and filter out traffic using TLS / SSL protocols;

[0029] Assign a UID to each traffic using TLS / SSL protocol;

[0030] Calculate the certificate fingerprint to match the stream's UID;

[0031] Parse the fields in the certificate that represent natural semantics and save them as certificate logs.

[0032] Furthermore, the step of combining the trust range of the corresponding field to obtain the first test result of the certificate to be tested includes:

[0033] If the entropy value of the field representing natural semantics in the certificate to be tested falls within the credible range of the corresponding field, then the first test result of the certificate to be tested is normal;

[0034] If the entropy value of the field representing natural semantics in the certificate to be tested falls outside the credible range of the corresponding field, the first test result of the certificate to be tested is abnormal.

[0035] Furthermore, after calculating the entropy value of the field representing the natural semantics in the certificate to be tested and combining the credible range of the corresponding field to obtain the first test result of the certificate to be tested, the method further includes:

[0036] Obtaining a second test result of the certificate to be tested by testing the validity period field and the issuer field;

[0037] The first test result and the second test result are combined to obtain a final test result of the certificate to be tested.

[0038] An abnormal certificate detection system based on segmented information entropy, the system comprising:

[0039] A trusted range generation module, used to generate a trusted range of a field according to entropy values ​​of fields representing natural semantics in a number of normal certificates;

[0040] The certificate diary acquisition module is used to obtain the certificate diary of the certificate to be tested;

[0041] The first detection result generating module is used to calculate the entropy value of the field representing the natural semantics in the certificate to be detected, and obtain the first detection result of the certificate to be detected in combination with the credible range of the corresponding field.

[0042] Compared with the prior art, the present invention combines key processes such as traffic identification and important certificate feature matching to discover abnormal certificates in traffic, and then warn of abnormal links, discovering possible malicious links and hidden SSL channels. Its advantages are: it can accurately capture custom certificates that change once, has high sensitivity in detecting randomly generated certificates, has low performance overhead for detecting only specific fields, and has high application value in detecting hidden channels, illegal certificate issuance, and illegal data transmission in APT. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below through specific implementations and in conjunction with the accompanying drawings.

[0045] The present invention targets the intranet traffic of enterprise units and takes the encrypted traffic certificate as the entry point. Some malicious behaviors use one-time certificates or randomly generated certificates to evade inspection. At this time, the entropy value of its main field will change to a certain extent. By judging whether the entropy value is within the baseline range, the detection of abnormal certificates is realized. Figure 1 As shown, the specific steps are as follows:

[0046] Step 1: Extract certificate logs

[0047] Step 1.1 Capture traffic on the specified server network card;

[0048] Step 1.2: Detect and filter out TLS / SSL traffic using DPI technology;

[0049] Step 1.3 records the flows that use the TLS / SSL protocol and assigns a UID to each flow;

[0050] Step 1.4 calculates the certificate fingerprint to match the UID of the flow, providing a basis for subsequent positioning of abnormal traffic;

[0051] Step 1.5 parses the key fields of the certificate and saves them as a certificate log, including: issuer, issuer, common name, organization name, subject's alternate name, valid period, etc. Form a log log[s1,s2,s3,…,sn], where sn represents the nth field.

[0052] Step 2: Baseline model calculation

[0053] Perform normal traffic baseline model calculation. This step is mainly to calculate the general entropy value of the certificate issuer, user, alternative name and other fields in normal traffic.

[0054] Step 2.1 Collect certificate logs. Parse the certificate logs of the trusted target IP and extract the fields that can express "natural semantics", including: certificate issuer (Issuer), certificate user (SubjectName), and optional user (SubjectAltName). Decompose the sub-items in the field, including common name, organization and other fields, as shown in Table 1:

[0055]

[0056]

[0057] Table 1

[0058] Step 2.2 Statistical analysis. Statistic the above fields of the certificate issuer and user, generate a statistical list of each field value, and count its symbol space. In this example, the symbol space is az, 0-9, and uppercase and lowercase are not distinguished.

[0059] Step 2.3 selects the field length threshold. When the field is too short, calculating the information entropy is meaningless. For example, it is difficult to directly determine whether a four-character short domain name is a normal domain name without prior knowledge. In general, malicious certificate constructors often use longer fields for easy encoding. Therefore, it is necessary to select the minimum threshold T for field calculation and eliminate samples with a length less than the threshold. In the present invention, the length of T is set to 8 based on experience.

[0060] Step 2.4 calculates the entropy value of each field. The calculation formula is as follows: Among them, i represents the i-th letter symbol in the statistical table list of step 2.2, with a total of n symbols, Count i represents the number of times a symbol appears, and N represents the total number of samples.

[0061] Step 2.5 The entropy features of each field of the normal sample are divided into n groups, and the group average is calculated to calculate the entropy value of each group, and the entropy value range of all groups is selected as the threshold range of the normal field. Too low or too high values ​​are considered to be abnormal certificates.

[0062] The specific method is as follows: suppose there are 1000 normal certificates, divide them into 10 groups, and calculate the entropy value of each field. Each group has 100 certificates, and finally obtain 10 values, which are used as the trusted entropy value interval. For example, [2.5, 2.3, 2.4, 2.5, 2.6, 2.7, 3.3, 2.4, 2.8, 3.2], and finally take the baseline trusted interval as 2.3-3.3.

[0063] Of special note, for domain name components, only the domain name minus the suffix is ​​calculated (excluding the domain name component of the top domain).

[0064] Step 3: Abnormal certificate detection

[0065] Step 3.1 Repeat the calculation in step 2.4 for the new certificate to obtain the entropy value of each segment of the current domain name.

[0066] Step 3.2: Segment entropy abnormality judgment. If the value falls within the credible interval in step 2.4, it is considered normal; if it falls outside the interval, it is considered abnormal. If the entropy value is significantly higher than the normal value, it means that the probability that the field is randomly generated is high. Give an abnormal alarm.

[0067] Step 3.3 checks the regular Validity and Issuer fields to see whether it is self-signed or expired, and gives an abnormal alarm.

[0068] The above embodiments are provided only for the purpose of describing the present invention, and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims. Various equivalent substitutions and modifications made without departing from the spirit and principles of the present invention should all be included within the scope of the present invention.

Claims

1. A method for detecting abnormal certificates based on segmented information entropy, characterized in that: The method comprises: Generate a trustworthy range of the field according to the entropy values ​​of the fields that express natural semantics in several normal certificates; Get the certificate diary of the certificate to be tested; Based on the certificate diary of the certificate to be detected, the entropy value of the field representing the natural semantics in the certificate to be detected is calculated, and combined with the trust range of the corresponding field, a first detection result of the certificate to be detected is obtained.

2. The method according to claim 1, characterized in that The fields expressing natural semantics include: certificate issuer field, certificate user field, common name field, organization field, city field, province field, country field, email field, other fields, validity period field and optional user field.

3. The method according to claim 1, characterized in that The step of generating a threshold range of a field according to the entropy value of the field expressing natural semantics in a number of normal certificates includes: Divide a number of normal certificates into M groups; Calculate the average entropy value of each field value corresponding to each group of normal certificates; Based on the average entropy value of each field value corresponding to each group of normal certificates, the threshold range of each field is obtained.

4. The method according to claim 3, characterized in that The calculating the average entropy value of each field value corresponding to each group of normal certificates includes: Through field statistics, a statistical list of each field value corresponding to each group of normal certificates is generated; Calculate the entropy value of each field value based on the statistical list; The entropy values ​​of each field value are averaged to obtain the average entropy value of each field value corresponding to each group of normal certificates.

5. The method according to claim 4, characterized in that Before calculating the entropy value of each field value based on the statistical list, the method further includes: Select the field length threshold; Samples whose length is less than the length threshold are discarded.

6. The method according to claim 4, characterized in that Entropy of field values Among them, i represents the i-th letter symbol in the statistical list, with a total of n letters and symbols, Count i It represents the number of times the i-th letter symbol appears, and N represents the total number of normal certificates in this group.

7. The method according to claim 1, characterized in that The step of obtaining the certificate diary of the certificate to be tested includes: Capture traffic on the specified server network card; Use DPI technology to detect and filter out traffic using TLS / SSL protocols; Assign a UID to each traffic using TLS / SSL protocol; Calculate the certificate fingerprint to match the stream's UID; Parse the fields in the certificate that represent natural semantics and save them as certificate logs.

8. The method according to claim 1, characterized in that The step of obtaining a first test result of the certificate to be tested by combining the trustworthy range of the corresponding field includes: If the entropy value of the field representing natural semantics in the certificate to be tested falls within the credible range of the corresponding field, then the first test result of the certificate to be tested is normal; If the entropy value of the field representing natural semantics in the certificate to be tested falls outside the credible range of the corresponding field, the first test result of the certificate to be tested is abnormal.

9. The method according to any one of claims 1 to 8, characterized in that: After calculating the entropy value of the field representing the natural semantics in the certificate to be tested and combining the credible range of the corresponding field to obtain the first test result of the certificate to be tested, the method further includes: Obtaining a second test result of the certificate to be tested by testing the validity period field and the issuer field; The first test result and the second test result are combined to obtain a final test result of the certificate to be tested.

10. An abnormal certificate detection system based on segmented information entropy, characterized in that: The system comprises: A trusted range generation module, used to generate a trusted range of a field according to entropy values ​​of fields representing natural semantics in a number of normal certificates; The certificate diary acquisition module is used to obtain the certificate diary of the certificate to be tested; The first detection result generating module is used to calculate the entropy value of the field representing the natural semantics in the certificate to be detected, and obtain the first detection result of the certificate to be detected in combination with the credible range of the corresponding field.

Citation Information

Cited By

  • Food and drug safety intelligent supervision and analysis system and method based on big data

    CN121350116A