An optimization method for large-scale weak password detection

By building a weak password correlation model and using machine learning to optimize the dictionary, the problem of low detection efficiency in large-scale weak password detection is solved, saving resources and improving detection efficiency.

CN118264446BActive Publication Date: 2024-09-27CHINESE PEOPLES LIBERATION ARMY UNIT 61660
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410340660.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-09-27
Estimated Expiration
2044-03-25

AI Technical Summary

Technical Problem

The existing technology cannot effectively utilize the correlation between weak passwords, resulting in low detection efficiency and high resource overhead in large-scale weak password detection, and cannot effectively reduce the number of detections.

Method used

Construct a weak password correlation model between different targets, and use machine learning methods to learn the weight of the correlation model from historical data to dynamically build a customized dictionary for the targets to be detected, reducing the number of password detections.

Benefits of technology

By dynamically constructing a customized dictionary, the efficiency of weak password detection is significantly improved, the number of detections is reduced, and the detection efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118264446B
    Figure CN118264446B
Patent Text Reader

Abstract

The present invention relates to an optimization method for large-scale weak password detection, belonging to the field of network security. In order to solve the problem that the existing method cannot effectively utilize the correlation between weak passwords, the present invention constructs a correlation model of weak passwords between different targets, divides all previous hit records into a historical record set, a training record set, a verification record set and a test record set, builds a customized dictionary for the target to be detected, builds an objective function of machine learning, and uses a stochastic gradient descent algorithm to perform machine learning so that the total number of detections is minimized. At this time, a customized dictionary for each target in the training record set is obtained. The present invention uses correlation and weak password detection historical records to dynamically build a more reasonable dictionary for each target to be detected. The dictionary constructed using this method can reduce the number of password detections, thereby effectively improving the efficiency of weak password detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network security, and in particular relates to an optimization method for large-scale weak password detection. Background Art

[0002] Currently, most application protocols (such as database management, remote management, file transfer, etc.) still use username and password as the main authentication method. One of the biggest threats to this authentication method is weak passwords, that is, administrators use simple username and password combinations, and attackers can easily obtain the correct username and password through brute force or guessing to achieve unauthorized access. Therefore, weak password detection is required when conducting security assessments on information systems (including applications, network devices, etc.) to prevent malicious attackers from using weak passwords to damage the system. The main method for weak password detection is to traverse common username and password combinations (dictionary).

[0003] The main challenge of weak password detection is how to balance the weak password detection rate and resource (such as detection time, network bandwidth, computing resources, etc.) overhead. In order to improve the weak password detection rate, it is necessary to try as many username and password combinations as possible, but too many attempts may lead to problems such as long detection time, excessive network overhead, and too high detection target load. Some systems even limit the number of incorrect attempts to defend against such attacks, such as locking accounts or blocking IP addresses.

[0004] One of the keys to solving the above problems is to build a reasonable dictionary. Existing dictionaries generally select N (maximum number of attempts) username and password combinations with high probability based on experience, historical data or publicly leaked passwords, and arrange them in descending order of probability. The main idea of ​​the above method is to try to use statistical laws to build dictionaries. However, in the practice of large-scale weak password detection for massive targets and periodicity, we found that there is also correlation between weak passwords of different targets. For example, the probability of the same weak password in the same LAN is greater than that in different network segments, and the probability of the same weak password for the same service and version is greater than that for different services or versions, etc. Existing methods cannot effectively utilize this correlation.

[0005] In view of the shortcomings of existing methods in large-scale weak password detection, the present invention proposes an optimization method for large-scale weak password detection. The method first constructs a correlation model of weak passwords between different targets, then uses machine learning methods to learn the weights of the correlation model from historical data, and finally dynamically constructs a customized dictionary for the target to be detected based on the historical data and the correlation model. The dictionary constructed by this method can reduce the number of password detections, thereby effectively improving the efficiency of weak password detection. Summary of the invention

[0006] 1. Technical issues to be resolved

[0007] The technical problem to be solved by the present invention is how to provide an optimization method for large-scale weak password detection to solve the problem that the existing methods cannot effectively utilize the correlation between weak passwords.

[0008] (II) Technical solution

[0009] In order to solve the above technical problems, the present invention proposes an optimization method for large-scale weak password detection, which includes the following steps:

[0010] Step S1: Construct a correlation model of weak passwords between different targets

[0011] Define two goals t i and t j The correlation P is the weighted sum of the network distance N and service similarity S of the two. t i and t j The definition is t , including: IP address, port, protocol type and version number, N is calculated by the IP addresses of the two targets, and S is calculated by the protocol type and version number of the two targets;

[0012] Step S2: Divide all previous hit records into a historical record set, a training record set, a verification record set, and a test record set, wherein the form of record h is < t , userpass>, t The target defined in S1, userpass is the target t Corresponding username and password;

[0013] Step S3: Build a customized dictionary for the target to be detected

[0014] Assuming the default dictionary is D, the process of building a customized dictionary is to calculate the value of H for each target T to be detected. 历史记录集 The relevance of any record in the , merged according to the username and password, and then sorted according to the relevance to generate a customized dictionary after the default dictionary is reordered; the function for constructing the customized dictionary is defined as D'=F(T,H 历史记录集 ,D);

[0015] Step S4: Constructing the objective function of machine learning

[0016] When using machine learning methods to learn the weights of a correlation model, we must first build the objective function of machine learning. For each target in the training record set, we use the S3 method to build a customized dictionary and obtain the number of times the target needs to be detected in the customized dictionary. The ultimate requirement of machine learning is to minimize the total number of detections.

[0017] Step S5: Use the stochastic gradient descent algorithm to perform machine learning so that the total number of detections is minimized. At this time, a customized dictionary for each target in the training record set is obtained.

[0018] Furthermore, in step S1, the specific definition of the correlation P is:

[0019]

[0020]

[0021]

[0022]

[0023] Among them, α, β, and γ are weighting coefficients.

[0024] Furthermore, for each target in the training record set, a customized dictionary is obtained using the historical record set; the validation record set is used to adjust the hyperparameter α of machine learning. 0 , β 0 , γ 0 , η 0 ; The test record set is used to test the final learning effect.

[0025] Furthermore, the learning effect indicator is: comparing the ratio of the number of weak password detections using the optimized customized dictionary to the number of detections under the default dictionary D.

[0026] Furthermore, the step S3 specifically includes the following steps:

[0027] S31, calculate correlation: use the correlation model in step S1 to calculate the target T and H to be detected 历史记录集 The correlation of any record in the , a new set DP is obtained;

[0028]

[0029] S32, merge the set DP, and for any two elements in the set DP DP i and DP j ,if DP i →userpass is equal to DP j → userpass, merge it into a new element DP k =<DP i → userpass, DP i Correlation P + DP j The correlation P >, Repeat the operation until no two elements have the same username and password. The merged set is recorded as DP';

[0030] S33, generate a customized dictionary, first sort the elements in DP' from large to small according to relevance, take out the username and password fields, and get a list HD, then concatenate the elements that belong to D but not to HD to HD, and the resulting list is the customized dictionary D'.

[0031] Furthermore, the objective function in step S4 is:

[0032]

[0033] Among them, F is a function for building a customized dictionary. Its parameters are the target to be detected, the historical record set, and the default dictionary. The return value is the customized dictionary. Count is a function for calculating the number of detections. Its parameters are the record and the customized dictionary. Its value is equal to the order in which the username and password in the record appear in the customized dictionary.

[0034] Furthermore, the step S5 specifically includes: firstly setting the initial values ​​of α, β, and γ to α 0 , β 0 , γ 0 , the learning rate is η 0 , by calculating the numerical gradient, the direction of gradient descent is found and the values ​​of α, β, and γ are continuously adjusted, so that the total number of detections is finally minimized, and the verification and test record sets are used for verification and testing.

[0035] Furthermore, the initial value of the parameter to be learned is set to α 0 =-1, β 0 =1,γ 0 =1.

[0036] Furthermore, setting the learning rate η 0 =0.5.

[0037] Furthermore, after step S5, the method further includes: using a customized dictionary D' to detect whether a target has a weak password during subsequent weak password detection.

[0038] (III) Beneficial effects

[0039] The present invention proposes an optimization method for large-scale weak password detection. The present invention utilizes correlation and weak password detection history records to dynamically construct a more reasonable dictionary for each target to be detected. The dictionary constructed by this method can reduce the number of password detections, thereby effectively improving the efficiency of weak password detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a flow chart of model training of the present invention;

[0041] Figure 2 This is a flow chart of the dynamic dictionary optimization of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0043] The present invention proposes an optimization method for large-scale weak password detection. Weak password detection is an important part of network security risk assessment and is of great significance for improving network security. The main method for weak password detection is to traverse the dictionary (common username and password combinations). The dictionary construction method is generally based on experience or statistical characteristics, selects a certain number of username and password combinations with greater probability, and arranges them from large to small according to the probability. However, in the practice of large-scale weak password detection for massive targets and periodicity, we found that there is a correlation between weak passwords of different targets. For example, the probability of the same weak password in the same local area network is greater than that of different network segments. The existing dictionary construction method cannot effectively utilize this correlation, so the detection efficiency is not high. The present invention proposes that this correlation and weak password detection history records can be used to dynamically construct a more reasonable dictionary for each detection target. The dictionary constructed by this method can reduce the number of password detections, thereby effectively improving the efficiency of weak password detection.

[0044] The purpose of the present invention is to improve the weak password detection efficiency in large-scale scenarios. To achieve the above purpose, the optimization method for large-scale weak password detection of the present invention utilizes the weak password correlation between different targets and dynamically optimizes the detection dictionary for each target to be detected. The method specifically comprises the following steps:

[0045] S1. Build a correlation model of weak passwords between different targets.

[0046] Based on practical experience, the present invention defines two goals: t i and t jThe correlation P is the weighted sum of the network distance N and service similarity S of the two, where the target t i and t j The definition is t , including: IP address, port, protocol type and version number, N is calculated by the IP addresses of the two targets, S is calculated by the protocol type and version number of the two targets, and α, β, and γ are weighted coefficients.

[0047]

[0048]

[0049]

[0050]

[0051] S2, divide all previous hit records into a historical record set, a training record set, a verification record set and a test record set, where the record h is in the form of < t , userpass>, t The target defined in S1, userpass is the target t Corresponding username and password; For each target in the training record set, use the historical record set to obtain a customized dictionary; The verification record set is used to adjust the hyperparameter α of machine learning 0 , β 0 , γ 0 , η 0 The test record set is used to test the final learning effect. The main indicator is the ratio of the number of weak password detections using the optimized customized dictionary to the number of detections under the default dictionary D.

[0052] S3. Build a customized dictionary for the target to be detected.

[0053] Assuming the default dictionary is D, the process of building a customized dictionary is to calculate the value of H for each target T to be detected. 历史记录集 The relevance of any record in the dictionary is merged according to the username and password, and then sorted according to the relevance to generate a customized dictionary after the default dictionary is reordered. The purpose of sorting is to make the username and password with greater probability appear at the front of the new dictionary, thereby reducing the number of detections. The function for building a customized dictionary is defined as D'=F(T,H 历史记录集 ,D), specifically including the following three steps:

[0054] S31, calculate the correlation, and use the correlation model in step S1 to calculate the target T and H to be detected 历史记录集The relevance of any record in , and get a new set DP.

[0055]

[0056] S32, merge the set DP, and for any two elements in the set DP DP i and DP j ,if DP i → userpass is equal to DP j → userpass, merge it into a new element DP k =<DP i → userpass, DP i Correlation P + DP j The correlation P > The physical meaning of merging is to merge the records with the same username and password. Repeat the operation until no two elements have the same username and password. The merged set is recorded as DP'.

[0057] S33. Generate a customized dictionary. First, sort the elements in DP' from large to small according to relevance, then take out the username and password fields to get a list HD. The purpose of sorting by relevance is to put the usernames and passwords with the highest probability in front as much as possible. Then, add the elements that belong to D but not HD to HD. The resulting list is the customized dictionary D'. The purpose of this step is to take into account that HD is generated using historical records and may be much smaller than the default dictionary. In order to ensure the accuracy of detection, other usernames and passwords still need to be added.

[0058] S4. Constructing the objective function of machine learning

[0059] When using machine learning methods to learn the weights of the correlation model, the objective function of machine learning must be constructed first. For each target in the training record set, the S3 method can be used to build a customized dictionary and obtain the number of times the target needs to be detected in the customized dictionary. The ultimate requirement of machine learning is to minimize the total number of detections, that is, the objective function is:

[0060]

[0061] Among them, F is a function for building a customized dictionary. Its parameters are the target to be detected, the historical record set, and the default dictionary. The return value is the customized dictionary. Count is a function for calculating the number of detections. Its parameters are the record and the customized dictionary. Its value is equal to the order in which the username and password in the record appear in the customized dictionary.

[0062] S5. Use the stochastic gradient descent algorithm for machine learning to minimize the total number of detections. At this point, a customized dictionary D' is obtained for each target in the training record set.

[0063] Specifically, first set the initial values ​​of α, β, and γ to α 0 , β 0 , γ 0 , the learning rate is η 0 , by calculating the numerical gradient, the direction of gradient descent is found and the values ​​of α, β, and γ are continuously adjusted, so that the total number of detections is finally minimized, and the verification and test record sets are used for verification and testing.

[0064] In one embodiment, the initial value α of the parameter to be learned is first set 0 =-1, β 0 =1,γ 0 =1, set the learning rate η 0 =0.5. Example 1

[0065] Figure 1 This is the model training process of the present invention. First, all previous hit records are divided into a historical record set, a training record set, a verification record set, and a test record set, and then the correlation function P( t i , t j ) parameters α, β, γ (the size of the initial value is a hyperparameter), for each record in the test set, you can use Figure 2 The method is used to obtain an optimized dictionary and the number of detections (the number of detections is the order in which the username and password of the record appear in the optimized dictionary), thereby obtaining the total number of detections of the test set data, and then the gradient descent algorithm is used to optimize the parameter values ​​of α, β, and γ to minimize the total number of detections of the test set data.

[0066] Figure 2 This is the dynamic dictionary optimization process of the present invention. Taking the Mysql service as an example, it is assumed that the target IP address to be detected is 1.1.1.1, the port is 3306, and the version is 8.0.

[0067] First, calculate the correlation between the target to be detected and all the hit records in history (assuming there are 1000 records, each record contains IP address, port, version number, username, password), and obtain a new set DP (the set size is 1000, and each element in the set contains username, password and correlation); then merge the records with the same username and password in DP to obtain a new set DP' (assuming the size of the merged set is 200); then sort the elements in DP' from large to small according to the correlation and take out the username and password fields to obtain a list HD (list length is 90); finally, concatenate the elements that belong to D (assuming the default dictionary length is 500) and do not belong to HD to HD, and the final list is D' (the length of the new dictionary is 500). In subsequent weak password detection, use the new customized dictionary D' to detect whether the target has a weak password.

[0068] The present invention utilizes correlation and weak password detection history records to dynamically construct a more reasonable dictionary for each target to be detected. The dictionary constructed using this method can reduce the number of password detections, thereby effectively improving the efficiency of weak password detection.

[0069] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. An optimization method for large-scale weak password detection, It is characterized in that The method comprises the following steps: Step S1: Construct a correlation model of weak passwords between different targets Define two targets t i and t j The correlation P is the weighted sum of the network distance N and service similarity S between the two; Among them, the target t i and t j is defined as t, including: IP address, port, protocol type and version number, N is calculated from the IP addresses of the two targets, and S is calculated from the protocol type and version number of the two targets; Step S2: Divide all previous hit records into a historical record set, a training record set, a verification record set, and a test record set, wherein the form of record h is<t,userpass> , t is the target defined in S1, userpass is the username and password corresponding to target t; Step S3: Build a customized dictionary for the target to be detected Assuming the default dictionary is D, the process of building a customized dictionary is to calculate the value of H for each target T to be detected. 历史记录集 The relevance of any record in the , merged according to the username and password, and then sorted according to the relevance, to generate a customized dictionary after the default dictionary is reordered; the function for constructing the customized dictionary is defined as D'=F(T,H 历史记录集 ,D); Step S4: Constructing the objective function of machine learning When using machine learning methods to learn the weights of a correlation model, we must first build the objective function of machine learning. For each target in the training record set, we use the S3 method to build a customized dictionary and obtain the number of times the target needs to be detected in the customized dictionary. The ultimate requirement of machine learning is to minimize the total number of detections. Step S5: Use the stochastic gradient descent algorithm to perform machine learning so that the total number of detections is minimized. At this time, a customized dictionary for each target in the training record set is obtained; in, In step S1, the specific definition of the correlation P is: t=<IP,port,protocol,version> P(t i ,t j )=α*N(t i ,t j )+β*S(t i ,t j )+γ Among them, α, β, and γ are weighting coefficients.

2. The optimization method for large-scale weak password detection as described in claim 1, It is characterized in that For each target in the training record set, a customized dictionary is obtained using the historical record set; the validation record set is used to adjust the hyperparameter α of machine learning 0 , β 0 , γ 0 , η 0 ; The test record set is used to test the final learning effect.

3. The optimization method for large-scale weak password detection as described in claim 2, It is characterized in that The learning effect indicator is: the ratio of the number of weak password detections using the optimized customized dictionary to the number of detections using the default dictionary D.

4. The optimization method for large-scale weak password detection according to any one of claims 1 to 3, It is characterized in that The step S3 specifically includes the following steps: S31, calculate correlation: use the correlation model in step S1 to calculate the target T and H to be detected 历史记录集 The correlation of any record in the , a new set DP is obtained; DP={<h i →userpass,P(T,h i →t)>:h i ∈H 历史记录集 } S32, merge the set DP, and merge any two elements DP in the set DP i and DP j , if DP i →userpass is equal to DP j →userpass, then merge it into a new element DP k = <DP i →userpass, DP i Correlation P+DP j The correlation P> is repeated until no two elements have the same username and password. The merged set is recorded as DP'; S33, generate a customized dictionary, first sort the elements in DP' from large to small according to relevance, take out the username and password fields, and get a list HD, then concatenate the elements that belong to D but not to HD to HD, and the resulting list is the customized dictionary D'.

5. The optimization method for large-scale weak password detection as described in claim 4, It is characterized in that The objective function in step S4 is: arg <α,β,γ> minΣCount(h i ,F(h i →t,H 历史记录集 ,D)),h i ∈H 训练记录集 Among them, F is a function for building a customized dictionary. Its parameters are the target to be detected, the historical record set, and the default dictionary. The return value is the customized dictionary. Count is a function for calculating the number of detections. Its parameters are the record and the customized dictionary. Its value is equal to the order in which the username and password in the record appear in the customized dictionary.

6. The optimization method for large-scale weak password detection as described in claim 5, It is characterized in that The step S5 specifically includes: firstly setting the initial values ​​of α, β, and γ to α 0 , β 0 , γ 0 , the learning rate is η 0 , by calculating the numerical gradient, the direction of gradient descent is found and the values ​​of α, β, and γ are continuously adjusted, so that the total number of detections is finally minimized, and the verification and test record sets are used for verification and testing.

7. The optimization method for large-scale weak password detection as described in claim 6, It is characterized in that Set the initial value of the parameter to be learned to be α 0 =-1, β 0 =1,γ 0 =1.

8. The optimization method for large-scale weak password detection as claimed in claim 6, It is characterized in that Set the learning rate η 0 =0.

5.

9. The optimization method for large-scale weak password detection as claimed in claim 6, It is characterized in that After step S5, the method further includes: using the customized dictionary D' to detect whether the target has a weak password during subsequent weak password detection.