Code snippet sensitive authentication information detection method based on pre-training model
Through the code snippet detection method based on the pre-trained model, the problem of insufficient detection capabilities of sensitive information leakage in the prior art is solved, and automated detection with high accuracy and low false alarm rates is achieved, reducing manual review costs.
Patent Information
- Application Number
- CN202411002768.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-08
AI Technical Summary
Existing network systems have weak capabilities in detecting leakage of sensitive information, high false alarm rate, and are difficult to effectively prevent attacks.
The detection accuracy of the code snippet sensitive authentication information detection method is adopted based on the pre-trained model. By defining sensitive authentication information categories, preprocessing code snippets, building a CodeBERT model architecture, and using the CRF layer for sequence annotation, the detection accuracy is improved.
Automatic detection is realized, which reduces the time cost of manual detection, improves the accuracy of sensitive authentication information detection, and reduces the false alarm rate.
Smart Images

Figure CN118916877A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network security, and in particular relates to a method for detecting sensitive authentication information of code snippets based on a pre-training model. Background Art
[0002] With the rapid development of the Internet and information technology, information sharing and data communication have become more convenient and efficient. However, while technological progress has brought various benefits, people are also increasingly concerned about the leakage of sensitive information on the Internet. The leakage of sensitive information poses significant risks to individuals, enterprises and even the entire society, which may lead to financial losses, privacy violations and security threats. Therefore, in order to ensure data security and protect user privacy, it is crucial to detect and prevent the leakage of sensitive information.
[0003] In penetration testing and network attack and defense, attackers usually obtain application and server permissions by collecting sensitive authentication information such as usernames and passwords to facilitate subsequent penetration testing. Most of the existing network systems deploy automated vulnerability scanning tools, web application firewalls and other security devices that detect program vulnerabilities, but have weak detection capabilities for sensitive information leakage and high false positive rates.
[0004] Therefore, it is necessary to design a detection method that can efficiently scan the target system or network resources to detect whether there is potential sensitive information leakage, so as to make defense and cleanup in advance and reduce the risk of attack. Summary of the invention
[0005] The purpose of the present invention is to overcome at least one shortcoming of the prior art and provide a method for detecting sensitive authentication information of code snippets based on a pre-trained model.
[0006] The technical solution adopted by the present invention is:
[0007] A method for detecting sensitive authentication information in code snippets based on a pre-trained model comprises the following steps:
[0008] S1. Define sensitive authentication information categories;
[0009] S2. Crawl code snippets containing sensitive authentication information as training data, and preprocess and annotate the code snippets. The preprocessing step includes at least one of the following operations:
[0010] (1) Delete the lines with less than 5 characters and blank lines in the code snippet;
[0011] (2) Delete special characters except Chinese, English and symbols;
[0012] (3) Only the line containing sensitive authentication information and the code fragments of the two lines above and below it are retained;
[0013] (4) Replace the line break character with "\\n";
[0014] The purpose of the annotation is to obtain named entity labels for training;
[0015] S3. Build a model architecture based on the CodeBERT pre-trained model, train the model using the training data obtained in S2, and save the model. The network structure of the model is as follows:
[0016] (1) Basic model: CodeBERT is used, which is a model based on BERT.
[0017] (2) Dropout layer: A dropout layer is used on the output of BERT to prevent overfitting. The output is the representation of the hidden state of the last layer of BERT after randomly dropping some neurons.
[0018] (3) Fully connected layer: used to convert the output of the Dropout layer into logits of the required number of labels;
[0019] (4) CRF layer: Conditional random field layer, used for labeling sequence tasks and improving the consistency of predicted labels;
[0020] S4. Use the trained model to detect the code snippet to be tested and extract sensitive authentication information;
[0021] S5. Filter the sensitive authentication information and output the sensitive authentication information.
[0022] In some examples of code snippet sensitive authentication information detection methods, in S2, the preprocessing steps are:
[0023] (1) Delete the lines with less than 5 characters and blank lines in the code snippet;
[0024] (2) Delete special characters except Chinese, English and symbols;
[0025] (3) Only the line containing sensitive authentication information and the code fragments of the two lines above and below it are retained;
[0026] (4) Replace the line break character with “\\n”.
[0027] In some examples of code snippet sensitive authentication information detection methods, in S5, when more than one password is extracted, the similarity values of these passwords are calculated. If the similarity value is greater than a predefined similarity threshold, it is a non-real password and is discarded, otherwise it is retained.
[0028] In some examples of the code snippet sensitive authentication information detection method, in S5, the quick_ratio algorithm is used to calculate the passwords in pairs, and the calculation result is divided by the number of calculations to obtain the password similarity value.
[0029] In some examples of code snippet sensitive authentication information detection methods, in S5, the similarity threshold is calculated by taking at least 500, preferably 800 or 1000 real passwords, password hashes, tokens, and keys, calculating the similarity values of the four types of information, and taking the maximum value as the similarity threshold.
[0030] In some examples of code snippet sensitive authentication information detection methods, in S3, the CRF layer in the torchcrf library was used for sequence labeling tasks during model training.
[0031] In some examples of code snippet sensitive authentication information detection methods, the negative log-likelihood loss of the CRF layer is directly used when calculating the loss.
[0032] In some examples of code snippet sensitive authentication information detection methods, in S2, the annotation method is NamedEntity Recognition annotation.
[0033] In some examples of code snippet sensitive authentication information detection methods, in S2, the annotated tags include O, O-KEY, O-IP, O-PORT, O-UNAME, O-SECRET, I-KEY, I-IP, I-PORT, I-UNAME, and I-SECRET.
[0034] In some examples of the code snippet sensitive authentication information detection method, in S1, the defined sensitive authentication information includes target address, port, user name, and password.
[0035] In some examples of code snippet sensitive authentication information detection methods, in S1, the password includes a user-defined password, a password hash, a token, and a key.
[0036] In some examples of the method for detecting sensitive authentication information in code snippets, in S2, the keywords include "password", "password", "secret", "pwd", "passwd", "key", "private", "sec", and "token".
[0037] In some examples of the code snippet sensitive authentication information detection method, in S4, the extracted sensitive authentication information is stored in a dictionary form.
[0038] In some examples of code snippet sensitive authentication information detection methods, in S2, the method for obtaining training data of code snippets containing sensitive authentication information is to use the Gshark tool to search for relevant codes in the GitHub code repository by keywords, and perform manual judgment and filtering.
[0039] The above features can be combined arbitrarily unless they conflict with each other.
[0040] The beneficial effects of the present invention are:
[0041] The detection methods of some examples of the present invention use machine learning technology to achieve automated detection and reduce the time cost of manual detection;
[0042] The detection method of some examples of the present invention utilizes the powerful programming language understanding ability of the CodeBERT pre-trained model to transform the detection problem into a named entity recognition problem. Coupled with the CRF layer optimization, not only the characteristics of sensitive authentication information but also the semantic characteristics of the context can be considered in the detection process, thereby improving the accuracy of detecting sensitive authentication information from code snippets. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a method for detecting sensitive authentication information of code snippets based on a pre-trained model of the present invention.
[0044] Figure 2 This is a flowchart of code fragment preprocessing in step S2 of the present invention.
[0045] Figure 3 This is the model architecture diagram of step S3 of the present invention.
[0046] Figure 4 It is a flow chart of filtering sensitive authentication information. DETAILED DESCRIPTION
[0047] A method for detecting sensitive authentication information in code snippets based on a pre-trained model comprises the following steps:
[0048] S1. Define sensitive authentication information categories;
[0049] S2. Crawl code snippets containing sensitive authentication information as training data, and preprocess and annotate the code snippets. The preprocessing step includes at least one of the following operations:
[0050] (1) Delete the lines with less than 5 characters and blank lines in the code snippet;
[0051] (2) Delete special characters except Chinese, English and symbols;
[0052] (3) Only the line containing sensitive authentication information and the code fragments of the two lines above and below it are retained;
[0053] (4) Replace the line break character with "\\n";
[0054] The purpose of the annotation is to obtain named entity labels for training;
[0055] S3. Build a model architecture based on the CodeBERT pre-trained model, train the model using the training data obtained in S2, and save the model. The network structure of the model is as follows:
[0056] (1) Basic model: CodeBERT is used, which is a model based on BERT.
[0057] (2) Dropout layer: A dropout layer is used on the output of BERT to prevent overfitting. The output is the representation of the hidden state of the last layer of BERT after randomly dropping some neurons.
[0058] (3) Fully connected layer: used to convert the output of the Dropout layer into logits of the required number of labels;
[0059] (4) CRF layer: Conditional random field layer, used for labeling sequence tasks and improving the consistency of predicted labels.
[0060] The advantage of this model is that it uses the CodeBert pre-trained model as the basic model, which has excellent code language understanding capabilities; the use of the CRF layer is able to consider the global dependencies of the label sequence, rather than just making predictions based on the local context, which improves prediction accuracy and consistency, while simplifying the design and training process of the entire model.
[0061] S4. Use the trained model to detect the code snippet to be tested and extract sensitive authentication information;
[0062] S5. Filter sensitive authentication information and output sensitive authentication information. By automatically filtering out useless sensitive authentication information such as test information and forged information, the time cost of manual review is reduced and the detection accuracy is improved.
[0063] In some examples of code snippet sensitive authentication information detection methods, in S2, the preprocessing steps are:
[0064] (1) Delete the lines with less than 5 characters and blank lines in the code snippet;
[0065] (2) Delete special characters except Chinese, English and symbols;
[0066] (3) Only the line containing sensitive authentication information and the code fragments of the two lines above and below it are retained;
[0067] (4) Replace the line break character with “\\n”.
[0068] The advantage of the preprocessing operation is that it can reduce the impact of irrelevant data, reduce the amount of training and time cost, make the model pay more attention to the part of the code containing sensitive information, and incorporate a certain range of context into the training data, thereby enhancing the model's ability to understand the context of sensitive information.
[0069] Considering the authenticity of the password, when the similarity of the extracted passwords is very high, it is determined that these passwords are forged, tested, and other passwords that cannot be used in reality. In some examples of the code snippet sensitive authentication information detection method, in S5, when more than one password is extracted, the similarity values of these passwords are calculated. If the similarity value is greater than a predefined similarity threshold, it is a non-real password and is discarded, otherwise it is retained.
[0070] In some examples of the code snippet sensitive authentication information detection method, in S5, the quick_ratio algorithm is used to calculate the passwords in pairs, and the calculation result is divided by the number of calculations to obtain the password similarity value.
[0071] In some examples of code snippet sensitive authentication information detection methods, in S5, the similarity threshold is calculated by taking at least 500, preferably 800 or 1000 real passwords, password hashes, tokens, and keys, calculating the similarity values of the four types of information, and taking the maximum value as the similarity threshold. The more real passwords, password hashes, tokens, and keys used, the more conducive it is to obtain a similarity threshold close to the actual situation. Calculations show that the similarity values calculated based on 500 real passwords, password hashes, tokens, and keys can already well exclude passwords that cannot be used in reality. The similarity values calculated based on more than 1000 real passwords, password hashes, tokens, and keys have no obvious effect on the judgment of the authenticity of the password. Therefore, when calculating the similarity threshold, selecting 500 to 1000 can obtain satisfactory discrimination, and at the same time it is beneficial to reduce the complexity of the calculation.
[0072] In some examples of code snippet sensitive authentication information detection methods, in S3, the CRF layer in the torchcrf library was used for sequence labeling tasks during model training.
[0073] In some examples of code snippet sensitive authentication information detection methods, the negative log-likelihood loss of the CRF layer is directly used when calculating the loss.
[0074] In some examples of code snippet sensitive authentication information detection methods, in S2, the annotation method is NamedEntity Recognition annotation.
[0075] In some examples of code snippet sensitive authentication information detection methods, in S2, the annotated tags include O, O-KEY, O-IP, O-PORT, O-UNAME, O-SECRET, I-KEY, I-IP, I-PORT, I-UNAME, and I-SECRET.
[0076] In some examples of code snippet sensitive authentication information detection methods, in S1, the defined sensitive authentication information includes target address, port, user name, and password. These are common sensitive authentication information, and specific sensitive authentication information can be configured accordingly according to specific needs.
[0077] In some examples of code snippet sensitive authentication information detection methods, in S1, the password includes a user-defined password, a password hash, a token, and a key.
[0078] In some examples of the method for detecting sensitive authentication information in code snippets, in S2, the keywords include "password", "password", "secret", "pwd", "passwd", "key", "private", "sec", and "token".
[0079] In some examples of the code snippet sensitive authentication information detection method, in S4, the extracted sensitive authentication information is stored in a dictionary form.
[0080] In some examples of code snippet sensitive authentication information detection methods, in S2, the method for obtaining training data of code snippets containing sensitive authentication information is to use the Gshark tool to search for relevant codes in the GitHub code repository by keywords and perform manual judgment and filtering. Of course, other methods can also be used to obtain training data.
[0081] The above features can be combined arbitrarily unless they conflict with each other.
[0082] The technical solutions in the embodiments of the present invention are described clearly and completely 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, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0083] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention, so the present invention is not limited to the specific embodiments disclosed below;
[0084] like Figure 1 As shown, the embodiment of the present invention discloses a method for detecting sensitive authentication information of a code snippet based on a pre-trained model, comprising the following steps:
[0085] S1. Define sensitive authentication information categories;
[0086] S2, crawling code snippets containing sensitive authentication information as training data, preprocessing and annotating the code snippets;
[0087] S3. Build a model architecture based on the CodeBERT pre-trained model, train the model using the training data, and save the model.
[0088] S4. Use the trained model to detect the code snippet to be tested and extract sensitive authentication information;
[0089] S5, filtering the sensitive authentication information and outputting the sensitive authentication information;
[0090] In step S1, the defined sensitive authentication information includes the target address, port, user name, and password, wherein the password includes a user-defined password, password hash, token, and key;
[0091] In step S2, the method for crawling code snippets containing sensitive authentication information is to use the Gshark tool to search for relevant codes in the GitHub code repository by keywords, and perform manual judgment and filtering; the keywords include "password", "password", "secret", "pwd", "passwd", "key", "private", "sec", and "token". Of course, other methods can also be used to obtain a dataset of code snippets containing sensitive authentication information for model training.
[0092] like Figure 2 As shown, in step S2, the step of preprocessing the code snippet includes:
[0093] S2-1 Delete the lines with less than 5 characters and blank lines in the code snippet;
[0094] S2-2 Delete special characters except Chinese, English and symbols;
[0095] S2-3 only retains the code snippet of the line where the sensitive authentication information is located and the two lines above and below it;
[0096] S2-4 replaces the line break character with "\\n";
[0097] Take the following code as an example:
[0098] $mail=new PHPMailer;
[0099] / / $mail->SMTPDebug=3; / / Enable verbose debug output
[0100] $mail->isSMTP(); / / Set mailer to use SMTP
[0101] $mail->Host='smtp.googlemail.com'; / / Specify main and backup SMTPservers
[0102] $mail->SMTPAuth=true; / / Enable SMTP authentication
[0103] $mail->Username= <email>; / / SMTP username
[0104] $mail->password = "@PASSWORD@"; / / SMTP password
[0105]
[0106] $mail->SMTPSecure ='ssl'; / / Enable TLS encryption, `ssl` also accepted
[0107]
[0108] $mail->Port = 465; / / TCP port to connect to
[0109] $mail->From = 'no- reply@caesarsystems.com '
[0110] $mail->FromName = 'Registration|PetroVR';
[0111] $mail->addAddress($email); / / Add a recipient
[0112] $mail->addReplyTo('no- reply@caesarsystems.com ', 'No Reply');
[0113] After steps S2-1, S2-2, and S2-3, the following code snippet is obtained:
[0114] $mail->SMTPAuth = true; / / Enable SMTP authentication
[0115] $mail->Username = <email>; / / SMTP username
[0116] $mail->password="@PASSWORD@"; / / SMTP password
[0117] $mail->SMTPSecure='ssl'; / / Enable TLS encryption,`ssl`also accepted
[0118] $mail->Port=465; / / TCP port to connect to
[0119] $mail->SMTPAuth=true; / / Enable SMTP authentication
[0120] $mail->Username= <email>; / / SMTP username
[0121] $mail->password="@PASSWORD@"; / / SMTP password
[0122] $mail->SMTPSecure='ssl'; / / Enable TLS encryption,`ssl`also accepted
[0123] $mail->Port=465; / / TCP port to connect to
[0124] After steps S2-4, the following code snippet is obtained:
[0125] $mail->SMTPAuth=true; / / Enable SMTP authentication\\n$mail->Username= <email>;\\nSMTP username$mail->password="@PASSWORD@"; / / SMTPpassword\\n$mail->SMTPSecure="ssl'; / / Enable TLS encryption,`ssl`also accepted\\n$mail->Port="465; / / TCP port to connect to
[0126] In the step S2, the code snippet is annotated by Named Entity Recognition.
[0127] The marked tags include O, O-KEY, O-IP, O-PORT, O-UNAME, O-SECRET, I_KEY, I-IP, I-PORT, I-UNAME, I-SECRET;
[0128] Take the following code snippet as an example:
[0129] password="@PASSWORD@\";\\\\nPort=465;
[0130] After step S2, the labels are as follows:
[0131] ["B-KEY","I-KEY","I-KEY","I-KEY","I-KEY","I-KEY","I-KEY","I-KEY","O","O ","O","O","B-SECRET","I-SECRET","I-SECRET","I-SECRET","I-SECRET","I-SECR ET","I-SECRET","I-SECRET","I-SECRET","I-SECRET","O","O","O","O","O","B- KEY","I-KEY","I-KEY","I-KEY","O","O","O","B-PORT","I-PORT","I-PORT","O"]
[0132] like Figure 3 As shown, in step S3, the model architecture consists of a CodeBERT pre-trained model and a CRF layer;
[0133] Specifically, the network structure of the model is as follows:
[0134] (1) Basic model: CodeBERT is used, which is a model based on BERT.
[0135] (2) Dropout layer: A dropout layer is used on the output of BERT to prevent overfitting;
[0136] (3) Fully connected layer: used to convert BERT's output into the required number of logits;
[0137] (4) CRF layer: Conditional random field layer, used for labeling sequence tasks and improving the consistency of predicted labels;
[0138] In S3, the CRF layer in the torchcrf library was used for sequence labeling tasks during model training; when calculating the loss, the negative log-likelihood loss of the CRF layer was directly used.
[0139] CodeBERT is a pre-trained model for programming languages and natural languages based on the Transformer network structure. It can learn a general representation through pre-training to support downstream applications related to programming languages, and has a strong understanding of programming languages. It regards various password authentication information as various entities in programming languages, fine-tunes the CodeBERT model, and adds a CRF layer as the output layer, fully considering the dependencies between labels, so as to further improve the model's ability to accurately identify entity boundaries.
[0140] The specific implementation code is as follows:
[0141]
[0142]
[0143] In step S4, the trained model is used to detect the code snippet to be tested and to extract sensitive authentication information; the extracted sensitive authentication information is stored in a dictionary form; for example:
[0144] {"ip":"127.0.0.1","port":3306,"username":"root","password":["root","pass123","ABC@888"]}
[0145] like Figure 4 As shown, in step S5, considering the authenticity of the password, when the similarity of the extracted passwords is very high, these passwords are judged to be forged, tested, and other passwords that cannot be used in reality; therefore, when more than one password is extracted, the similarity values of these passwords are calculated, and if the similarity value is greater than a predefined similarity threshold, it is a non-real password and is discarded, otherwise it is retained;
[0146] In step S5, the quick_ratio algorithm is used to calculate the passwords in pairs, and the calculation result is divided by the number of calculations to obtain the password similarity value;
[0147] In step S5, the similarity threshold is calculated by taking 1000 real passwords, password hashes, tokens, and keys, respectively, and using the calculation method in claim 10 to calculate the similarity values of the four types of information, and taking the maximum value as the similarity threshold;
[0148] In step S5, the quick_ratio algorithm formula is as follows:
[0149] Using the fast estimate of the number of matching characters and the total length of the two sequences, n is the number of matching characters, l1 is the length of sequence 1, and l2 is the length of sequence 2, the similarity is calculated according to the following formula:
[0150]
[0151] Take the following password as an example:
[0152] {"password":["root","abcroot11","root@123"]}
[0153] After calculation:
[0154] quick_ratio(root,abcroot11)=0.6153846153846154
[0155] quick_ratio(root,root@123)=0.6666666666666666
[0156] quick_ratio(abcroot11,root@123)=0.5882352941176471
[0157] The similarity of the extracted passwords is:
[0158] (0.6153846153846154+0.666666666666666666+0.5882352941176471) / 3=0.6234288587229764
[0159] The experiment shows that the similarity threshold is 0.8322. If 0.6234288587229764<0.8322, the password information will be retained and output.
[0160] The detection methods of some examples of the present invention utilize machine learning technology to achieve automated detection and reduce the time cost of manual detection.
[0161] The detection method of some examples of the present invention utilizes the powerful programming language understanding ability of the CodeBERT pre-trained model to transform the detection problem into a named entity recognition problem. Coupled with the CRF layer optimization, not only the characteristics of sensitive authentication information but also the semantic characteristics of the context can be considered in the detection process, thereby improving the accuracy of detecting sensitive authentication information from code snippets.
[0162] The above is a further detailed description of the present invention, which should not be regarded as a limitation on the specific implementation of the present invention. For ordinary technicians in the technical field to which the present invention belongs, simple deduction or replacement without departing from the concept of the present invention is within the protection scope of the present invention.< / email> < / email> < / email> < / email>
Claims
1. A method for detecting sensitive authentication information in code snippets based on a pre-trained model. It is characterized in that The steps include: S1. Define sensitive authentication information categories; S2. Crawl code snippets containing sensitive authentication information as training data, and preprocess and annotate the code snippets. The preprocessing step includes at least one of the following operations: (1) Delete the lines with less than 5 characters and blank lines in the code snippet; (2) Delete special characters except Chinese, English and symbols; (3) Only the line containing sensitive authentication information and the code fragments of the two lines above and below it are retained; (4) Replace the line break character with "\\n"; The purpose of the annotation is to obtain named entity labels for training; S3. Build a model architecture based on the CodeBERT pre-trained model, train the model using the training data obtained in S2, and save the model. The network structure of the model is as follows: (1) Basic model: CodeBERT is used, which is a model based on BERT. (2) Dropout layer: A dropout layer is used on the output of BERT to prevent overfitting. The output is the representation of the hidden state of the last layer of BERT after randomly dropping some neurons. (3) Fully connected layer: used to convert the output of the Dropout layer into logits of the required number of labels; (4) CRF layer: Conditional random field layer, used for labeling sequence tasks and improving the consistency of predicted labels; S4. Use the trained model to detect the code snippet to be tested and extract sensitive authentication information; S5. Filter the sensitive authentication information and output the sensitive authentication information.
2. The method for detecting sensitive authentication information of a code snippet according to claim 1, It is characterized in that In S5, when more than one password is extracted, the similarity values of these passwords are calculated. If the similarity value is greater than a predefined similarity threshold, it is a non-authentic password and is discarded, otherwise it is retained.
3. The method for detecting sensitive authentication information of a code snippet according to claim 2, It is characterized in that In S5, the quick_ratio algorithm is used to calculate the passwords in pairs, and the calculation result is divided by the number of calculations to obtain the password similarity value.
4. The method for detecting sensitive authentication information of a code snippet according to claim 3, It is characterized in that In S5, the similarity threshold is calculated by taking at least 500 real passwords, password hashes, tokens, and keys, calculating the similarity values of the four types of information, and taking the maximum value as the similarity threshold.
5. The method for detecting sensitive authentication information of a code snippet according to claim 1, It is characterized in that In S3, the CRF layer in the torchcrf library is used for sequence labeling during model training; and / or the negative log-likelihood loss of the CRF layer is directly used when calculating the loss.
6. The method for detecting sensitive authentication information of a code snippet according to claim 1, It is characterized in that In S2, the annotation method is Named Entity Recognition annotation.
7. The method for detecting sensitive authentication information of a code snippet according to claim 1 or 6, It is characterized in that In S2, the annotated tags include O, O-KEY, O-IP, O-PORT, O-UNAME, O-SECRET, I-KEY, I-IP, I-PORT, I-UNAME, and I-SECRET.
8. The method for detecting sensitive authentication information of a code snippet according to claim 1, It is characterized in that In S1, the defined sensitive authentication information includes the target address, port, user name, and password.
9. The method for detecting sensitive authentication information of a code snippet according to claim 8, It is characterized in that In S1, passwords include user-defined passwords, password hashes, tokens, and keys.
10. The method for detecting sensitive authentication information of a code snippet according to claim 1, It is characterized in that In S2, the keywords include "password", "password", "secret", "pwd", "passwd", "key", "private", "sec", "token".
Citation Information
Cited By
Any code snippet labeling method and retrieval system thereof
CN119576388A
