E-mail gateway vulnerability detection method and device, electronic equipment and medium

By obtaining and mutating email samples, using the parsing component test group to filter out effective test samples, and automatically detect vulnerabilities at the mail protocol level, solving the problems of single detection types and low efficiency in the existing technology, and improving the vulnerability detection efficiency of the mail gateway system and coverage.

CN119094235AActive Publication Date: 2024-12-06TSINGHUA UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411385399.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-06
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The existing email gateway system lacks sufficient consideration for the email protocol level when detecting vulnerabilities. The detection type is single and the testing efficiency is inefficient, so it is impossible to effectively identify vulnerabilities at the email protocol level.

Method used

By obtaining an email sample set that meets preset legal conditions, mutate the samples using random variation strategies and predefined rules, generate multiple different forms of malformed email samples, and filter out effective test email samples using the parsing component test group to automate Construct test mail samples to detect vulnerabilities at the mail protocol level.

Benefits of technology

It improves the efficiency and coverage of vulnerability detection in the mail gateway system, and can systematically and automatically identify vulnerabilities at the mail protocol level, solving the problems of single detection types and low testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094235A_ABST
    Figure CN119094235A_ABST
Patent Text Reader

Abstract

The invention relates to an E-mail gateway vulnerability detection method and device, electronic equipment and a medium. The method comprises the following steps: acquiring an E-mail sample set meeting a preset legal condition; carrying out random mutation operation on the e-mail sample set by utilizing a preset sample mutation strategy to predict the form of a malformed mail sample and obtain a plurality of different forms of malformed mail samples; screening the plurality of abnormal mail samples in different forms by using a preset analysis component test group to obtain effective test mail samples; and sending the effective test mail sample to a preset test account, and obtaining a detection result of the gateway vulnerability according to feedback data of the preset test account. Therefore, by automatically constructing the test mail sample based on the mail protocol standard, the mail protocol level vulnerability in the existing gateway can be systematically and automatically detected, the problems of single vulnerability detection type and low test efficiency in the prior art are solved, and the vulnerability detection efficiency and coverage rate of the mail gateway system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a method, device, electronic device and medium for detecting email gateway vulnerabilities. Background Art

[0002] Email plays a vital role in daily communication, work exchanges and file transfer in modern society. However, the openness of the email system provides convenience while also providing a channel for the spread of malicious content. The attack method of spreading malicious content through email attachments poses a huge security threat to users. Email security gateway is the mainstream solution to deal with such threats. The security gateway uses the content detection engine to conduct a comprehensive scan of the email content to identify and block emails containing malicious attachments from entering the user's inbox. Over the past few decades, the content detection engine has undergone a technical evolution from feature library scanning, heuristic analysis to artificial intelligence detection. Its scanning capabilities have expanded from simple files to multiple dimensions such as compressed packages, memory, processes, boot sectors, and even developed active defense technologies. These advances have significantly improved the efficiency and accuracy of the detection engine, enabling it to more effectively deal with unknown threats.

[0003] In the related technology, with regard to the working principle of the email gateway system, some propose to use whether the email content is similar to well-known websites, whether the email sender is a trusted contact, etc. to detect whether it is a phishing email; some propose a cross-site scripting injection vulnerability detection tool for Web (World Wide Web) email system for detection.

[0004] However, existing methods are often limited to comprehensive scanning and accurate detection at the email content level, lack sufficient consideration of vulnerabilities at the email protocol level, detect a single vulnerability type, and have low testing efficiency, which needs to be urgently addressed. Summary of the invention

[0005] The present application provides a method, device, electronic device and medium for detecting vulnerabilities in an email gateway, so as to solve the problems of the existing technology of single vulnerability detection type and low testing efficiency, and to improve the efficiency and coverage of vulnerability detection in the email gateway system.

[0006] To achieve the above-mentioned purpose, the first embodiment of the present application proposes a method for detecting an email gateway vulnerability, comprising the following steps:

[0007] Obtain a sample set of emails that meet pre-set legal conditions;

[0008] Performing a random mutation operation on the email sample set using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to a predefined rule;

[0009] Using a preset parsing component test group to screen the plurality of deformed email samples in different forms to obtain valid test email samples;

[0010] The valid test email sample is sent to a preset test account, and the detection result of the gateway vulnerability is obtained according to the feedback data of the preset test account.

[0011] According to an embodiment of the present application, obtaining a sample set of emails that meet a preset legal condition includes:

[0012] Get the syntax rules and semantic specifications of predefined email protocols;

[0013] Based on the grammatical rules and the semantic specifications, the email sample set that meets the preset legal conditions is obtained.

[0014] According to an embodiment of the present application, the method of performing a random mutation operation on the email sample set using a preset sample mutation strategy to obtain a plurality of deformed email samples in different forms includes:

[0015] Using the random mutation strategy in the preset sample mutation strategy, respectively performing deletion operations, insertion operations, and / or modification operations on the email content and structure of the email sample set, to obtain a first form of deformed email sample;

[0016] Using the mutation strategy according to predefined rules in the preset sample mutation strategy, the email sample set is transformed based on the preset rules to obtain a deformed email sample of a second form;

[0017] The plurality of deformed mail samples in different forms are obtained according to the deformed mail samples in the first form and the deformed mail samples in the second form.

[0018] According to an embodiment of the present application, the method of screening the deformed email samples using a preset parsing component test group to obtain a valid test email sample includes:

[0019] Analyzing the abnormal email sample using the preset analysis component test group to obtain multiple groups of analysis results;

[0020] Based on the multiple groups of analysis results, the deformed email samples corresponding to the analysis results that meet the preset abnormality processing conditions are selected as the valid test email samples.

[0021] According to an embodiment of the present application, sending the valid test email sample to a preset test account, and obtaining the detection result of the gateway vulnerability according to the feedback data of the preset test account, includes:

[0022] Injecting a malicious payload into the valid test email sample to obtain an email with a malicious attachment;

[0023] The preset test account is configured for multiple client environments, and connected to a target mailbox server, the email with the malicious attachment is sent to the preset test account, and feedback information, email reception status, and attachment extraction results sent by the preset test account are received;

[0024] Based on the feedback information of the email sending, the email receiving status and the attachment extraction result, the detection result of the gateway vulnerability is obtained.

[0025] According to the detection method of email gateway vulnerability proposed in the embodiment of the present application, by obtaining an email sample set that meets the preset legal conditions, and using the preset sample mutation strategy to perform random mutation operations on the email sample set to predict the form of the deformed email sample, a plurality of deformed email samples in different forms are obtained; then the preset parsing component test group is used to screen the plurality of deformed email samples in different forms to obtain valid test email samples; the valid test email samples are sent to the preset test account, and the detection result of the gateway vulnerability is obtained according to the feedback data of the preset test account. Therefore, by automatically constructing the test email sample based on the email protocol standard, the email protocol level vulnerability in the existing gateway can be systematically and automatically detected, which solves the problem of the single vulnerability type and low test efficiency of the existing technology, and improves the efficiency and coverage of email gateway system vulnerability detection.

[0026] To achieve the above-mentioned purpose, the second embodiment of the present application proposes a detection device for email gateway vulnerabilities, including:

[0027] An acquisition module is used to acquire a sample set of emails that meet preset legal conditions;

[0028] A mutation module, used to perform a random mutation operation on the email sample set using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to a predefined rule;

[0029] A screening module, used to screen the plurality of deformed email samples in different forms by using a preset parsing component test group to obtain valid test email samples;

[0030] The testing module is used to send the valid test email sample to a preset test account, and obtain the detection result of the gateway vulnerability according to the feedback data of the preset test account.

[0031] According to one embodiment of the present application, the acquisition module is specifically used to:

[0032] Get the syntax rules and semantic specifications of predefined email protocols;

[0033] Based on the grammatical rules and the semantic specifications, the email sample set that meets the preset legal conditions is obtained.

[0034] According to one embodiment of the present application, the mutation module includes:

[0035] Using the random mutation strategy in the preset sample mutation strategy, respectively performing deletion operations, insertion operations, and / or modification operations on the email content and structure of the email sample set, to obtain a first form of deformed email sample;

[0036] Using the mutation strategy according to predefined rules in the preset sample mutation strategy, the email sample set is transformed based on the preset rules to obtain a deformed email sample of a second form;

[0037] The plurality of deformed mail samples in different forms are obtained according to the deformed mail samples in the first form and the deformed mail samples in the second form.

[0038] According to one embodiment of the present application, the screening module is specifically used for:

[0039] Analyzing the abnormal email sample using the preset analysis component test group to obtain multiple groups of analysis results;

[0040] Based on the multiple groups of analysis results, the deformed email samples corresponding to the analysis results that meet the preset abnormality processing conditions are selected as the valid test email samples.

[0041] According to one embodiment of the present application, the test module is specifically used for:

[0042] Injecting a malicious payload into the valid test email sample to obtain an email with a malicious attachment;

[0043] The preset test account is configured for multiple client environments, and connected to a target mailbox server, the email with the malicious attachment is sent to the preset test account, and feedback information, email reception status, and attachment extraction results sent by the preset test account are received;

[0044] Based on the feedback information of the email sending, the email receiving status and the attachment extraction result, the detection result of the gateway vulnerability is obtained.

[0045] According to the detection device for email gateway vulnerabilities proposed in the embodiment of the present application, by obtaining an email sample set that meets the preset legal conditions, and using a preset sample mutation strategy to perform random mutation operations on the email sample set, a plurality of deformed email samples in different forms are obtained to predict the form of the deformed email sample; then a preset parsing component test group is used to screen the plurality of deformed email samples in different forms to obtain valid test email samples; the valid test email samples are sent to a preset test account, and the detection results of the gateway vulnerability are obtained based on the feedback data of the preset test account. Therefore, by automatically constructing test email samples based on the email protocol standard, the email protocol level vulnerabilities in the existing gateway can be systematically and automatically detected, which solves the problem of the single vulnerability type and low test efficiency of the existing technology, and improves the efficiency and coverage of email gateway system vulnerability detection.

[0046] To achieve the above-mentioned objectives, the third aspect embodiment of the present application proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for detecting email gateway vulnerabilities as described in the above-mentioned embodiment.

[0047] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the method for detecting email gateway vulnerabilities as described in the above-mentioned embodiment.

[0048] To achieve the above objectives, the fifth aspect of the present application proposes a computer program product, which includes a computer program, which, when executed by a processor, is used to implement the method for detecting email gateway vulnerabilities as described in the above embodiments.

[0049] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0051] Figure 1 A flowchart of a method for detecting an email gateway vulnerability provided according to an embodiment of the present application;

[0052] Figure 2A schematic diagram of a system for detecting email gateway vulnerabilities according to an embodiment of the present application;

[0053] Figure 3 A block diagram of an email gateway vulnerability detection device provided according to an embodiment of the present application;

[0054] Figure 4 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0055] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0056] The following describes the email gateway vulnerability detection method, device, electronic device and medium proposed in accordance with the embodiments of the present application with reference to the accompanying drawings.

[0057] Figure 1 The present invention is a flowchart of a method for detecting an email gateway vulnerability according to an embodiment of the present invention.

[0058] Before introducing the method for detecting email gateway vulnerabilities proposed in the embodiment of the present application, the relevant technical principles are first introduced.

[0059] It should be noted that the email protocol itself has a complex structure and rules. At the email transmission level, the SMTP (Simple Mail Transfer Protocol) protocol, which was born with the Internet, has gradually undergone many updates and expansions during the decades of evolution to meet the increasingly rich functional and security requirements; different products have also proposed various command types in addition to the unified standard based on their own design concepts. At the level of email content structure, the Multipurpose Internet Mail Extensions (MIME) protocol is widely used in modern email. The MIME protocol is defined in RFC (Request for Comments) 2045-2049, which stipulates that the email structure includes the header, body and attachment parts. Each part has a special header information to identify the data type, encoding method, name and other details.

[0060] However, the complexity of the protocol structure has brought new security threats to the mail gateway: the parsing and processing of mail protocols by different mail components may have various non-standard behaviors, such as parsing differences or program crashes, which can cause various logical vulnerabilities and memory security vulnerabilities, providing a possibility for malicious mail samples to attack the gateway system. For example, when the security gateway fails to correctly parse and extract malicious content in the mail attachment, the detection engine may mistakenly judge it as non-threatening and release the mail, while the client may correctly parse the malicious content in the mail when receiving it, causing the user to be threatened. Researchers have discovered and verified the security risks that may be caused by this protocol parsing problem, and have confirmed its effectiveness in some popular email products.

[0061] In terms of the working principle of the mail gateway system, the gateway products currently used are often limited to focusing on comprehensive scanning and accurate detection at the mail content level, but lack sufficient consideration of vulnerabilities at the mail protocol level. Some technologies use whether the malicious content feature library of the gateway is updated in a timely manner, whether the scanning technology applied by the content detection engine is advanced, and whether the scanning efficiency is excellent to detect whether there is a possibility of bypass. Some technologies use whether the mail content is similar to well-known websites, whether the sender of the mail is a trusted contact, etc. to detect whether it is a phishing mail. On the other hand, in terms of vulnerability detection of the email system itself, a cross-site scripting injection vulnerability detection tool for Web mail systems is provided. However, this tool only involves the Web application level module of the mail client and fails to cover the comprehensive mail transmission process, and the type of vulnerability detected is single. In addition, the existing mail gateway vulnerability testing methods mainly use manual testing, which has low testing efficiency, is prone to omissions, and lacks automated testing methods.

[0062] It is precisely based on the above problems that the embodiment of the present application proposes a method for detecting email gateway vulnerabilities. By automatically constructing test email samples based on the email protocol standard, it can systematically and automatically detect email protocol-level vulnerabilities in existing gateways, solving the problems of the existing technology of single vulnerability detection type and low testing efficiency, and improving the efficiency and coverage of email gateway system vulnerability detection.

[0063] Next, a method for detecting email gateway vulnerabilities in an embodiment of the present application is introduced.

[0064] For example, Figure 1 As shown, the detection method of the email gateway vulnerability includes the following steps:

[0065] In step S101, a sample set of emails satisfying a preset legal condition is obtained.

[0066] The email sample set that meets the preset legal conditions refers to bulk emails that meet the email format standards and have correct content.

[0067] It is understandable that as a widely used communication tool, the design and implementation of the structure of email must strictly follow a series of established specifications. These specifications not only ensure the smooth transmission and reception of emails, but also ensure the integrity and security of the email content. Therefore, the embodiment of the present application first needs to obtain a sample set of emails that meet preset legal conditions (i.e., follow certain specifications).

[0068] As a possible implementation method, in some embodiments, obtaining a sample set of emails that meet preset legal conditions includes: obtaining grammatical rules and semantic specifications of a predefined email protocol; and obtaining a sample set of emails that meet preset legal conditions based on the grammatical rules and semantic specifications.

[0069] Specifically, since the email structure itself needs to follow certain specifications, the specifications that the email structure should follow, namely, grammatical rules and semantic specifications, can be extracted from the email protocol RFC document. Among them, the grammatical rules define the arrangement and format requirements of each component of the email, which can be modified by the ABNF (Augmented Backus-Naur Form) paradigm (a formal grammar rule) and other rules in the RFC document; in the process of generating email samples, the ABNF paradigm is used to construct a syntax tree, which is a tree-shaped data structure. Similar to the ABNF paradigm, the formal characteristics of different structural types are recursively defined. The syntax tree used in the sample generation component also starts from a root node and expands layer by layer. Each node has a tree structure with several optional substructure combinations in turn. Each leaf node corresponds to a string in the final email content, and other nodes correspond to abstract structures at different levels in the email. This syntax tree is used as a grammatical rule to guide the construction of the email sample structure, making the email sample generation process more orderly and ensuring that the generated email sample conforms to the requirements of the RFC document in terms of structure. However, the syntax tree obtained only from the ABNF paradigm can only guarantee the legal structure of the generated email sample. In the standards of the SMTP protocol and MIME protocol of email, the legal email sample should also comply with the semantic specifications, that is, the logical relationship and control relationship that needs to be followed between the different parts of a complete email content, such as the format of the email header, the encoding method of the email body, the processing of attachments, etc. These specifications ensure that the email will not be misunderstood or damaged during transmission, and also improve the readability and processability of the email. Therefore, a series of logical control flows need to be added in the process of generating legal email samples. These control flows are responsible for adding additional constraints when expanding nodes at specific positions, thereby obtaining a set of email samples that meet the preset legal conditions, that is, the generated email samples are not only legal in structure, but also in content that meets the semantic specifications.

[0070] For example, when constructing an email header, it is necessary to ensure that fields such as "From", "To", and "Subject" exist and are in the correct format; when adding attachments, it is necessary to consider factors such as the type and size of the attachment and whether it needs to be encoded. By adding these logical control flows, a sample set of emails that meet the preset legal conditions can be obtained.

[0071] It can be seen that during the testing process of the embodiment of the present application, the sample construction module can combine the grammatical rules and semantic constraints in the MIME standard to batch and automatically construct email samples without the need to use expert knowledge to construct high-quality initial test cases, which greatly improves the efficiency of vulnerability mining and reduces the difficulty of testing.

[0072] In step S102, a random mutation operation is performed on the email sample set using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to predefined rules.

[0073] That is to say, after obtaining a set of email samples that meet the preset legal conditions, a random mutation operation can be performed on a batch of email samples that meet the preset legal conditions, that is, deliberately modifying the email sample form to make it abnormal, in order to explore the deformed sample form that may cause parsing problems, thereby obtaining deformed email samples in different forms to test whether the parsing system makes mistakes when facing these deformed emails. The sample mutation strategies used in the mutation process are divided into two types: random mutation strategy and mutation strategy according to predefined rules. The random mutation strategy refers to modifying the email sample randomly instead of following specific rules; the mutation strategy according to predefined rules is more purposeful, and the mutation part and method can be customized as needed to more accurately test the weaknesses of the email parsing system.

[0074] As a possible implementation method, in some embodiments, a preset sample mutation strategy is used to perform a random mutation operation on an email sample set to obtain multiple deformed email samples in different forms, including: using a random mutation strategy in the preset sample mutation strategy to perform deletion operations and / or insertion operations and / or modification operations on the email content and structure of the email sample set to obtain a first form of deformed email sample; using a mutation strategy according to predefined rules in the preset sample mutation strategy to transform the email sample set based on preset rules to obtain a second form of deformed email sample; and obtaining multiple different forms of deformed email samples based on the first form of deformed email sample and the second form of deformed email sample.

[0075] Specifically, the random mutation strategy can simulate deformed email samples by randomly changing certain parts of the email sample. This strategy includes operations on the leaf node level of the email sample structure, that is, operations on the content of the email sample set, such as deleting, inserting, modifying, etc., and operations on the subtree level of the email sample structure, such as deleting, inserting, modifying, etc., a certain part of the structure of the email sample (such as attachments or header information), thereby obtaining the first form of deformed email samples. The mutation strategy based on predefined rules is a more targeted mutation method. The email sample can be changed according to various pre-set rules to obtain the second form of deformed email samples, so as to provide more targeted and flexible analysis and preprocessing abnormal situation exploration. The mutation strategy based on predefined rules can more accurately simulate those deformed email samples with specific attack intentions. According to the first form of deformed email samples and the second form of deformed email samples obtained by the two mutation strategies, multiple deformed email samples of different forms can be obtained.

[0076] It can be seen that, during the testing process, the embodiment of the present application applies random mutation to the automatically constructed email sample set, which can cover a wide range of test sample space and is conducive to selecting test cases that are most likely to trigger vulnerabilities.

[0077] In step S103, a plurality of malformed email samples of different forms are screened using a preset parsing component test group to obtain valid test email samples.

[0078] The preset parsing component test group refers to a group of popular library functions or email clients with email parsing capabilities.

[0079] It is understandable that the deformed email samples that have undergone mutation operations cannot be directly applied to vulnerability testing. On the one hand, the mutation process is carried out randomly, and there may be excessively deformed email samples that severely damage the email structure and cannot be parsed. This type of deformed email sample has no testing significance; on the other hand, the email sample set produced by the email sample construction module contains a large number of email samples, and it costs a lot to use all of them for actual email product testing, and sending a large number of deformed email samples to the same test account may result in the blocking of incoming emails. Therefore, in order to ensure the efficiency and accuracy of the actual email product testing, it is necessary to reduce the size of the sample set to be tested by screening deformed email samples. The embodiment of the present application can use a preset parsing component test group to screen multiple deformed email samples in different forms, so as to obtain effective test email samples.

[0080] As a possible implementation method, in some embodiments, a preset parsing component test group is used to screen the deformed email samples to obtain valid test email samples, including: using the preset parsing component test group to parse the deformed email samples to obtain multiple groups of parsing results; based on the multiple groups of parsing results, selecting the deformed email samples corresponding to the parsing results that meet the preset abnormal processing conditions as valid test email samples.

[0081] It should be noted that the basic idea of ​​using the preset parsing component test group to screen malformed email samples is that most email products do not develop parsing functions from scratch when processing emails, but use some existing tools or libraries. Therefore, if processing anomalies are found in these mainstream library functions or clients (such as parsing ambiguity, program crash, unexpected results, etc.), then these anomalies are likely to occur in actual email products. By using the preset parsing component test group for testing, an effective test environment can be simulated at a lower cost.

[0082] Specifically, the preset parsing component test group integrates a variety of preset parsing scenarios, aiming to simulate various abnormal situations that may be encountered in the actual email processing process. When faced with a large number of deformed email samples, the preset parsing component test group can quickly and accurately parse them and generate multiple sets of detailed parsing results. Based on multiple sets of parsing results, the key step is to screen out samples that meet the preset processing exception conditions. The conditions are often based on past experience and empirical research, including but not limited to parsing ambiguity, program crashes, unexpected results, etc., and remove excessively deformed email samples that cannot be parsed, thereby obtaining effective test email samples.

[0083] It can be seen that during the testing process, the embodiment of the present application introduced a parsing component test group to filter deformed email samples, which can prevent a large number of invalid samples or excessively deformed samples from entering the actual gateway testing stage, thereby reducing the testing cost and the load pressure on the gateway product.

[0084] In step S104, a valid test email sample is sent to a preset test account, and a detection result of a gateway vulnerability is obtained according to feedback data from the preset test account.

[0085] Among them, the preset test account refers to an email account specially set up for testing purposes. This account will receive various valid test email samples, and the performance of the email gateway can be evaluated by observing the response of this account.

[0086] That is to say, after screening and obtaining valid test email samples, the valid test email samples can be sent to a preset test account. According to the feedback data of the preset test account (i.e., feedback information sent by the preset test account, email reception status and attachment extraction results, etc.), the performance and security of the email product can be evaluated, and the detection results of the gateway vulnerability can be obtained.

[0087] As a possible implementation method, in some embodiments, a valid test email sample is sent to a preset test account, and the detection result of the gateway vulnerability is obtained based on the feedback data of the preset test account, including: injecting malicious payloads into the valid test email sample to obtain an email with a malicious attachment; configuring a preset test account for multiple client environments, and connecting to the target mailbox server, sending an email with a malicious attachment to the preset test account, and receiving feedback information, email reception status and attachment extraction results sent by the preset test account; based on the feedback information of email sending, email reception status and attachment extraction results, the detection result of the gateway vulnerability is obtained.

[0088] Specifically, in order to test the effectiveness of the malicious content detection engine, the embodiment of the present application can add malicious payloads (i.e. simulated malicious content) to the effective test samples to simulate emails with malicious attachments. The malicious payload will not really cause damage, but is designed to be a test material that can trigger a security alarm. For example, the EICAR (European Institute For Computer Antivirus Research, European Anti-Computer Virus Association) test file can be used as a malicious payload. This is a solution developed by the European Anti-Computer Virus Association EICAR and the Computer Antivirus Research Organization (Computer Antivirus Research Organization, full name CARO) for testing the response status of anti-virus software. It allows testing anti-virus software without computer viruses. It will not really damage the system, but can simulate virus behavior to trigger the alarm of security software. In addition, in order to comprehensively test the vulnerabilities of the target mailbox product under various application conditions, the test needs to cooperate with the receiving server to collect emails and extract attachments in different client environments, including Web interfaces, desktop client programs, and mobile device client applications. Configure the information of the preset test account on the client, connect to the target mailbox server, and send the email with malicious attachments to the preset test account to simulate the process of real users receiving emails and attachments. During the entire testing process, it is necessary to record the feedback information sent by the preset test account, email reception status and attachment extraction results, and obtain the detection results of the gateway vulnerability based on these feedback data.

[0089] Among them, according to the feedback information sent by the preset test account, the email reception status and the attachment extraction results, the test results of the valid test email samples are divided into five categories:

[0090] (1) Bypass: The client can successfully download the attachment containing malicious content without receiving any malicious content warning.

[0091] (2) Receiving: The email can be successfully received on the client, and no malicious content warning is received; however, the extracted attachment content is not the original valid malicious content payload, or the attachment cannot be parsed.

[0092] (3) Warning: You can download attachments containing malicious content on the client, but you will also receive a malicious content warning, or the product's security gateway has already rendered the email harmless and deleted the malicious content.

[0093] (4) Rejection: Emails containing malicious content cannot reach the inbox, which is manifested as receiving a rejection SMTP response during the email sending process, or not receiving a rejection response during the sending process, but the email cannot be received through any client.

[0094] (5) Program crash or hang: The gateway cannot continue to deliver emails to the mailbox and cannot perform normal detection of subsequent incoming emails.

[0095] Based on the test results of the above valid test email samples, the detection results of gateway vulnerabilities (i.e. security assessment content) can be obtained, including:

[0096] (1) Based on the frequency of "bypass" or "program crash or hang" results in all test results, give the target email product's overall protocol parsing vulnerability security rating;

[0097] (2) Based on the frequency of "bypass" or "program crash or hang" results when using different clients, a list of client combinations that are prone to security issues is given;

[0098] (3) Based on the frequency with which different valid test email samples trigger the "bypass" or "program crash or hang" results, the email sample types that pose a greater security threat to this email product are given.

[0099] Based on the above security assessment content, corresponding security measures can be improved for email products.

[0100] It can be seen that during the testing process, the embodiment of the present application compares the parsing results of the valid test email samples that have passed the gateway detection on the popular client with the original malicious payload. No human intervention is required for judgment, and the vulnerabilities in the email gateway parser can be automatically identified and accurately located, thereby improving the efficiency of vulnerability mining.

[0101] In order to facilitate those skilled in the art to further understand the detection method of email gateway vulnerability proposed in the embodiment of the present application, the following is combined with Figure 2 For further elaboration.

[0102] For example, Figure 2 As shown, Figure 2 The email gateway vulnerability detection system involved in the email gateway vulnerability detection method includes a sample construction module, an effective sample filtering module, a product testing module and a test result collection and reporting module, wherein the sample construction module includes a constructor and a mutator, the constructor includes the grammatical rules and semantic specifications of the predefined email protocol, and the mutator includes a strategy for randomly mutating legal samples; the effective sample screening module includes a parsing component test group, the parsing component test group is composed of multiple email clients or parsing library functions with email parsing functions, and by comparing the parsing conditions of the test group to the samples, such as whether there is parsing inconsistency, whether the processing process crashes, whether other unexpected output results are generated, etc., the test samples that can effectively trigger the processing vulnerability are determined; the product testing module includes a tester and an email gateway, which can send test samples containing malicious content payloads to the email product to be tested without using the sender's email server or client; the test result collection and reporting module includes a validator, which is responsible for receiving emails on the client and counting the email reception and attachment extraction conditions, and completing the gateway product protocol layer vulnerability assessment.

[0103] In summary, the email gateway vulnerability detection method proposed in the embodiment of the present application has the following advantages:

[0104] (1) High vulnerability mining efficiency: The embodiments of the present application can efficiently detect protocol-level parsing and processing problems of email content between email gateway products and popular clients, greatly improving detection efficiency compared to traditional manual or semi-automatic detection methods.

[0105] (2) Comprehensive vulnerability coverage: The embodiments of the present application use a variety of means, such as an email sample generator based on MIME standard specifications, a random mutator, and a mutation strategy scheduler based on parsing result feedback. The email samples are highly diversified and cover a wide range of spaces, which can achieve comprehensive and sufficient protocol layer parsing vulnerability detection.

[0106] (3) Enhanced network security: The embodiments of the present application can quickly and accurately detect email gateway parsing vulnerabilities that may be exploited by attackers, help email gateway developers to identify possible bypass methods, fix parser problems, improve the level of email system security, and protect user privacy and property safety.

[0107] (4) Low cost: Compared with traditional manual or semi-automatic detection methods, the embodiments of the present application adopt an automated testing method, avoiding a large amount of expert knowledge and manual detection input; at the same time, an effective sample screening module based on a general parsing library is introduced to reduce the test scale and load pressure of the actual gateway product. Overall, the cost of testing can be greatly reduced to ensure actual availability.

[0108] According to the detection method of email gateway vulnerability proposed in the embodiment of the present application, by obtaining an email sample set that meets the preset legal conditions, and using the preset sample mutation strategy to perform random mutation operations on the email sample set to predict the form of the deformed email sample, a plurality of deformed email samples in different forms are obtained; then the preset parsing component test group is used to screen the plurality of deformed email samples in different forms to obtain valid test email samples; the valid test email samples are sent to the preset test account, and the detection result of the gateway vulnerability is obtained according to the feedback data of the preset test account. Therefore, by automatically constructing the test email sample based on the email protocol standard, the email protocol level vulnerability in the existing gateway can be systematically and automatically detected, which solves the problem of the single vulnerability type and low test efficiency of the existing technology, and improves the efficiency and coverage of email gateway system vulnerability detection.

[0109] Next, a device for detecting email gateway vulnerabilities according to an embodiment of the present application will be described with reference to the accompanying drawings.

[0110] Figure 3 It is a block diagram of an email gateway vulnerability detection device according to an embodiment of the present application.

[0111] like Figure 3 As shown, the email gateway vulnerability detection device 10 includes: an acquisition module 100, a mutation module 200, a screening module 300 and a testing module 400.

[0112] The acquisition module 100 is used to acquire a sample set of emails that meet preset legal conditions;

[0113] The mutation module 200 is used to perform random mutation operation on the email sample set by using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to a predefined rule;

[0114] The screening module 300 is used to screen a plurality of malformed email samples in different forms using a preset parsing component test group to obtain valid test email samples;

[0115] The testing module 400 is used to send a valid test email sample to a preset test account, and obtain a detection result of a gateway vulnerability according to feedback data from the preset test account.

[0116] Furthermore, in some embodiments, the acquisition module 100 is specifically configured to:

[0117] Get the syntax rules and semantic specifications of predefined email protocols;

[0118] Based on grammatical rules and semantic specifications, a sample set of emails that meet the preset legal conditions is obtained.

[0119] Furthermore, in some embodiments, the mutation module 200 includes:

[0120] Using a random mutation strategy in a preset sample mutation strategy, respectively performing a deletion operation, an insertion operation, and / or a modification operation on the email content and structure of the email sample set, to obtain a first form of deformed email samples;

[0121] Using a mutation strategy according to a predefined rule in a preset sample mutation strategy, the email sample set is transformed based on the preset rule to obtain a deformed email sample of a second form;

[0122] A plurality of deformed mail samples in different forms are obtained according to the deformed mail sample in the first form and the deformed mail sample in the second form.

[0123] Furthermore, in some embodiments, the screening module 300 is specifically configured to:

[0124] Use the preset parsing component test group to parse the abnormal email samples and obtain multiple groups of parsing results;

[0125] Based on multiple groups of analysis results, the deformed email samples corresponding to the analysis results that meet the preset abnormal processing conditions are selected as valid test email samples.

[0126] Furthermore, in some embodiments, the testing module 400 is specifically configured to:

[0127] Inject malicious payloads into valid test email samples to obtain emails with malicious attachments;

[0128] Configure preset test accounts in various client environments and connect to the target mailbox server, send emails with malicious attachments to the preset test accounts, and receive feedback information, email reception status, and attachment extraction results from the preset test accounts;

[0129] Based on the feedback information of email sending, email receiving status and attachment extraction results, the detection results of gateway vulnerabilities are obtained.

[0130] It should be noted that the above explanations of the embodiment of the method for detecting email gateway vulnerabilities are also applicable to the device for detecting email gateway vulnerabilities of this embodiment, and will not be repeated here.

[0131] According to the detection device for email gateway vulnerabilities proposed in the embodiment of the present application, by obtaining an email sample set that meets the preset legal conditions, and using a preset sample mutation strategy to perform random mutation operations on the email sample set, a plurality of deformed email samples in different forms are obtained to predict the form of the deformed email sample; then a preset parsing component test group is used to screen the plurality of deformed email samples in different forms to obtain valid test email samples; the valid test email samples are sent to a preset test account, and the detection results of the gateway vulnerability are obtained based on the feedback data of the preset test account. Therefore, by automatically constructing test email samples based on the email protocol standard, the email protocol level vulnerabilities in the existing gateway can be systematically and automatically detected, which solves the problem of the single vulnerability type and low test efficiency of the existing technology, and improves the efficiency and coverage of email gateway system vulnerability detection.

[0132] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0133] Memory 401 , processor 402 , and a computer program stored in the memory 401 and executable on the processor 402 .

[0134] When the processor 402 executes the program, the email gateway vulnerability detection method provided in the above embodiment is implemented.

[0135] Furthermore, the electronic device further comprises:

[0136] The communication interface 403 is used for communication between the memory 401 and the processor 402 .

[0137] The memory 401 is used to store computer programs that can be executed on the processor 402 .

[0138] The memory 401 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0139] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0140] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can communicate with each other through an internal interface.

[0141] The processor 402 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0142] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for detecting email gateway vulnerabilities.

[0143] The embodiment of the present application also provides a computer program product, which includes a computer program, and when the program is executed by a processor, it implements the method for detecting email gateway vulnerabilities as in the above embodiment.

[0144] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0145] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0146] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for detecting an email gateway vulnerability, characterized in that: The following steps are involved: Obtain a sample set of emails that meet pre-set legal conditions; Performing a random mutation operation on the email sample set using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to a predefined rule; Using a preset parsing component test group to screen the plurality of deformed email samples in different forms to obtain valid test email samples; The valid test email sample is sent to a preset test account, and the detection result of the gateway vulnerability is obtained according to the feedback data of the preset test account.

2. The method according to claim 1, characterized in that The step of obtaining a sample set of emails that meet the preset legal conditions includes: Get the syntax rules and semantic specifications of predefined email protocols; Based on the grammatical rules and the semantic specifications, the email sample set that meets the preset legal conditions is obtained.

3. The method according to claim 1, characterized in that The preset sample mutation strategy is used to perform random mutation operations on the email sample set to obtain multiple deformed email samples in different forms, including: Using the random mutation strategy in the preset sample mutation strategy, respectively performing deletion operations, insertion operations, and / or modification operations on the email content and structure of the email sample set, to obtain a first form of deformed email sample; Using the mutation strategy according to predefined rules in the preset sample mutation strategy, the email sample set is transformed based on the preset rules to obtain a deformed email sample of a second form; The plurality of deformed mail samples in different forms are obtained according to the deformed mail samples in the first form and the deformed mail samples in the second form.

4. The method according to claim 1, characterized in that: The method of screening the deformed email samples by using the preset parsing component test group to obtain valid test email samples includes: Analyzing the abnormal email sample using the preset analysis component test group to obtain multiple groups of analysis results; Based on the multiple groups of analysis results, the deformed email samples corresponding to the analysis results that meet the preset abnormality processing conditions are selected as the valid test email samples.

5. The method according to claim 1, characterized in that The sending of the valid test email sample to a preset test account and obtaining the detection result of the gateway vulnerability according to the feedback data of the preset test account include: Injecting a malicious payload into the valid test email sample to obtain an email with a malicious attachment; The preset test account is configured for multiple client environments, and connected to a target mailbox server, the email with the malicious attachment is sent to the preset test account, and feedback information, email reception status, and attachment extraction results sent by the preset test account are received; Based on the feedback information of the email sending, the email receiving status and the attachment extraction result, the detection result of the gateway vulnerability is obtained.

6. A device for detecting an email gateway vulnerability, characterized in that: include: An acquisition module is used to acquire a sample set of emails that meet preset legal conditions; A mutation module, used to perform a random mutation operation on the email sample set using a preset sample mutation strategy to predict the form of the deformed email sample and obtain a plurality of deformed email samples in different forms, wherein the preset sample mutation strategy includes a random mutation strategy and a mutation strategy according to a predefined rule; A screening module, used to screen the plurality of deformed email samples in different forms by using a preset parsing component test group to obtain valid test email samples; The testing module is used to send the valid test email sample to a preset test account, and obtain the detection result of the gateway vulnerability according to the feedback data of the preset test account.

7. The device according to claim 6, characterized in that The acquisition module is specifically used for: Get the syntax rules and semantic specifications of predefined email protocols; Based on the grammatical rules and the semantic specifications, the email sample set that meets the preset legal conditions is obtained.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for detecting an email gateway vulnerability as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for detecting an email gateway vulnerability as described in any one of claims 1 to 5.

10. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, is used to implement the method for detecting an email gateway vulnerability as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Email security protection detection technology based on multiple factors

    CN109474611A

  • Apparatus for providing mail security service using hierarchical architecture based on security level and operation method therefor

    US20240007498A1