Method, device, equipment and medium for generating phishing emails for testing
By building a test website and generating hyperlink phishing emails, the problem of low efficiency and insufficient security of phishing drills in the existing technology has been solved, efficient and covert phishing email testing has been achieved, and employees' security awareness and protection capabilities have been significantly improved. .
Patent Information
- Application Number
- CN202410141862.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-01
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-02-01
AI Technical Summary
Existing technology makes it difficult to conduct phishing drills efficiently, resulting in a high success rate for enterprises when faced with phishing attacks, and a lack of effective testing methods to improve employees' vigilance and response capabilities.
By building a test website, obtain the email address of the subject under test, generate a phishing email containing a hyperlink, use the hyperlink to point to the test website, monitor the request to identify the identification field, locate the subject under test, and improve the efficiency and accuracy of the test, and Reduces the security risks caused by using third-party libraries.
It realizes the automatic generation of highly targeted and highly concealed phishing emails, improves the authenticity and reliability of the test, significantly reduces the infection rate, saves storage resources, and improves operational efficiency by a hundred times.
Smart Images

Figure CN118157910B
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a method and device for generating a phishing email for testing, an electronic device, and a storage medium. Background Art
[0002] In recent years, according to relevant disclosure reports, social engineering attacks have become the main way for attackers to launch APT (Advanced Persistent Threat) attacks, and email is faced with the greatest threat of social engineering attacks. It has become the norm for attackers to use social engineering attack emails to carry out attacks against target individuals.
[0003] Phishing drills are to simulate real phishing emails to test the vigilance and response capabilities of individuals, companies or organizations to such emails. According to relevant data survey results, the average phishing rate is 23.88% without conducting phishing drills, which means that more than one-fifth of employees in an enterprise are threatened by social engineering and phishing fraud. However, through continuous and planned phishing drills, enterprises can significantly reduce the average phishing email rate in various industries. Therefore, how to conduct phishing drills efficiently has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above problems, the present application is proposed to provide a method and device for generating phishing emails for testing, an electronic device and a storage medium that overcome the above problems or at least partially solve the above problems. The technical solution is as follows:
[0005] In a first aspect, a method for generating a phishing email for testing is provided, comprising:
[0006] Build a test website and obtain the initial URL of the test website;
[0007] Obtaining respective email addresses of a plurality of tested objects, and configuring an identification field for identifying each email address for each email address;
[0008] Concatenate the initial URL with the identification field of each email address to obtain the concatenated URL corresponding to each email address;
[0009] Creating an initial text document containing the first type of characters, and decompressing the initial text document to obtain multiple decompressed files;
[0010] Obtaining a spliced URL corresponding to a target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the target email address, performing an editing operation on a specified file among the multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein a target of the hyperlink points to the spliced URL corresponding to the target email address;
[0011] Compressing the edited file to obtain a compressed file, and modifying the compressed file to a text format to obtain a target text document;
[0012] Based on the target email address and the target text document, a phishing email is generated to test the object under test corresponding to the target email address.
[0013] In a possible implementation, after generating a phishing email for testing the object under test corresponding to the target email address, the method further includes:
[0014] Obtaining a concatenated URL corresponding to the next email address of the target email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, performing an editing operation on a specified file among the multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein the target of the hyperlink points to the concatenated URL corresponding to the next email address;
[0015] Compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a next target text document;
[0016] Based on the next email address and the next target text document, a phishing email is generated to test the object under test corresponding to the next email address.
[0017] In a possible implementation, after generating a phishing email for testing the object under test corresponding to the next email address, the method further includes:
[0018] Continue to obtain the concatenated URL corresponding to the next email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein the target of the hyperlink points to the concatenated URL corresponding to the next email address;
[0019] Compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document;
[0020] Based on the following email address and the following target text document, a phishing email is generated to test the object under test corresponding to the following email address.
[0021] In a possible implementation, based on the obtained concatenated URL corresponding to the target email address, an editing operation is performed on a specified file among the multiple files, and content representing a hyperlink is added to the specified file, including:
[0022] Performing an editing operation on a first file among the multiple files, adding attribute content of a hyperlink element before a start tag of a first setting element, and adding an end tag of the hyperlink element between an end tag of the first setting element and an end tag of a second setting element;
[0023] Based on the obtained spliced URL corresponding to the target email address, an editing operation is performed on the second file among the multiple files, and a hyperlink relationship is added before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the spliced URL corresponding to the target email address.
[0024] In a possible implementation, when performing an editing operation on a first file among multiple files, the method further includes:
[0025] A set number of characters of the second category are added between the start tag and the end tag of the fourth set element.
[0026] In a possible implementation, generating a phishing email for testing a tested object corresponding to the target email address according to the target email address and the target text document includes:
[0027] According to the target email address and the target text document, a phishing email is generated for testing the object under test corresponding to the target email address, with the target email address as the recipient and the target text document as the attachment; or
[0028] Output the target text document as a document of a specified format, use the target email address as the recipient, and use the document of the specified format as an attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0029] In a possible implementation, after generating a phishing email for testing the object under test corresponding to the target email address, the method further includes:
[0030] Sending a phishing email of the object to be tested corresponding to the target email address to the target email address;
[0031] Monitoring requests for obtaining a test website; wherein, when the subject under test corresponding to the target email address receives a phishing email, if a target text document or a document of a specified format in the phishing email is triggered, a request for obtaining the test website is initiated;
[0032] If a request to obtain the test website is monitored, an identification field in the request for identifying each email address is identified;
[0033] Locate the object under test based on the identification field.
[0034] In a second aspect, a device for generating a phishing email for testing is provided, comprising:
[0035] Building modules, suitable for building test websites;
[0036] The acquisition module is suitable for obtaining the initial URL of the test website;
[0037] A configuration module, adapted to obtain the respective email addresses of the plurality of tested objects, and configure an identification field for identifying each email address for each email address;
[0038] A concatenation module, adapted to concatenate the initial URL with the identification field of each email address to obtain a concatenated URL corresponding to each email address;
[0039] A decompression module, adapted to create an initial text document containing the first type of characters, and decompress the initial text document to obtain a plurality of decompressed files;
[0040] The editing module is adapted to obtain a spliced URL corresponding to a target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the target email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein a target of the hyperlink points to the spliced URL corresponding to the target email address;
[0041] A compression module, adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document;
[0042] The generation module is suitable for generating a phishing email for testing the object under test corresponding to the target email address based on the target email address and the target text document.
[0043] In a possible implementation, the editing module is further adapted to, after the generation module generates a phishing email for testing the tested object corresponding to the target email address, obtain a spliced URL corresponding to the next email address of the target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the next email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the next email address;
[0044] The compression module is also adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a next target text document;
[0045] The generation module is further adapted to generate a phishing email for testing the object under test corresponding to the next email address based on the next email address and the next target text document.
[0046] In a possible implementation, the editing module is further adapted to, after the generation module generates a phishing email for testing the tested object corresponding to the next email address, continue to obtain a spliced URL corresponding to the next email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the next email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the next email address;
[0047] The compression module is also adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a subsequent target text document;
[0048] The generation module is further adapted to generate a phishing email for testing the object under test corresponding to the next email address based on the next email address and the next target text document.
[0049] In a possible implementation, the editing module is further adapted to:
[0050] Performing an editing operation on a first file among the multiple files, adding attribute content of a hyperlink element before a start tag of a first setting element, and adding an end tag of the hyperlink element between an end tag of the first setting element and an end tag of a second setting element;
[0051] Based on the obtained spliced URL corresponding to the target email address, an editing operation is performed on the second file among the multiple files, and a hyperlink relationship is added before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the spliced URL corresponding to the target email address.
[0052] In a possible implementation, the editing module is further adapted to:
[0053] When the first file among the multiple files is edited, a set number of characters of the second category are added between the start tag and the end tag of the fourth setting element.
[0054] In a possible implementation, the generating module is further adapted to:
[0055] According to the target email address and the target text document, a phishing email is generated for testing the object under test corresponding to the target email address, with the target email address as the recipient and the target text document as the attachment; or
[0056] Output the target text document as a document of a specified format, use the target email address as the recipient, and use the document of the specified format as an attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0057] In a possible implementation manner, the device further includes:
[0058] A sending module, adapted to send a phishing email of a tested object corresponding to a target email address to the target email address;
[0059] A monitoring module, adapted to monitor requests for obtaining a test website; wherein, when the subject under test corresponding to the target email address receives a phishing email, if a target text document or a document of a specified format in the phishing email is triggered, a request for obtaining the test website is initiated;
[0060] The identification module is adapted to identify the identification field used to identify each email address in the request if a request for obtaining the test website is monitored; and locate the object under test according to the identification field.
[0061] According to a third aspect, an electronic device is provided, comprising a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above-described methods for generating a phishing email for testing.
[0062] In a fourth aspect, a storage medium is provided, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above-mentioned methods for generating a phishing email for testing when running.
[0063] By means of the above technical scheme, the method and device for generating phishing emails for testing, the electronic device and the storage medium provided in the embodiment of the present application can build a test website, obtain the initial URL of the test website; obtain the email addresses of multiple tested objects, and configure the identification fields for each email address to identify each email address; splice the initial URL with the identification fields of each email address respectively to obtain the spliced URLs corresponding to each email address; create a new initial text document containing the first type of characters, and decompress the initial text document to obtain multiple decompressed files; obtain the spliced URL corresponding to the target email address from the spliced URLs corresponding to each email address, and based on the spliced URL corresponding to the obtained target email address, edit the specified file in the multiple files, add the content representing the hyperlink to the specified file, and obtain the edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the target email address; compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document; generate a phishing email for testing the tested object corresponding to the target email address according to the target email address and the target text document. It can be seen that the technical scheme provided in the embodiment of the present application can obtain the following technical effects:
[0064] (1) This embodiment can automatically generate a test website in accordance with actual needs, thereby improving the efficiency and accuracy of phishing testing; and by obtaining the email addresses of multiple test subjects, the initial URL of the test website is concatenated with the identification field of each email address to obtain the concatenated URL corresponding to each email address, and then the specified file is edited and the content representing the hyperlink is added to the specified file. The target of the hyperlink is pointed to the concatenated URL corresponding to the target email address, making the phishing email more targeted. In subsequent testing, the identification field can be accurately identified, the target email address can be located, and then the test subject corresponding to the target email address can be located, thereby educating and improving the security awareness of the test subject.
[0065] (2) In the existing method of adding a hyperlink by selecting text or characters and right-clicking to select a hyperlink, the color of the text or characters will change. However, the hyperlink in the target text document obtained by the method of this embodiment is no different from other non-hyperlinks in terms of font, color, and size, which can increase the confusion, making the generated phishing email more concealed and difficult to detect, thereby improving the authenticity and reliability of subsequent tests.
[0066] (3) When editing text documents using existing programming languages, third-party libraries are required to operate. The third-party libraries here refer to those libraries produced and provided by third-party developers to extend the functions of programming languages. These libraries usually provide some additional functions, tools or modules for developers to use when writing programs. By using third-party libraries, developers can complete programming tasks more efficiently, reduce repetitive code writing, and improve development efficiency. However, if the third-party library is maliciously poisoned, there will be serious security risks. The method of this embodiment does not use a third-party library, thereby reducing security risks.
[0067] In addition, the inventor of the present application compared the time consumed by using the method of the present embodiment to generate a phishing email for testing with the traditional method of using a third-party library to generate a phishing email for testing, and found that the overall time efficiency of the method of the present embodiment can be improved by about 100 times. In addition, the method of the present embodiment only adjusts part of the file content, greatly reducing storage space and saving storage resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0069] Figure 1 is a flow chart of a method for generating a phishing email for testing provided in an embodiment of the present application;
[0070] Figure 2 It is a schematic diagram of the storage file space size of the target text document generated by a third-party library;
[0071] Figure 3 is a schematic diagram of the storage file space size of a target text document generated by the method of this embodiment;
[0072] Figure 4 It is a structural diagram of a device for generating phishing emails for testing provided in an embodiment of the present application;
[0073] Figure 5 is a structural diagram of a device for generating phishing emails for testing provided by another embodiment of the present application;
[0074] Figure 6 A structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0075] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0076] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such use is interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the term "including" and its variants are to be interpreted as open-ended terms meaning "including but not limited to".
[0077] In order to solve the above technical problems, the present application embodiment provides a method for generating a phishing email for testing, such as Figure 1 As shown, the method for generating a phishing email for testing may include the following steps S101 to S107:
[0078] Step S101, build a test website and obtain the initial URL of the test website.
[0079] In this step, URL (Uniform Resource Locator) is an address format used to identify and locate resources on the Internet. It consists of a series of characters, including protocol, domain name, path, query parameters, anchor, etc. The main function of URL is to provide a standardized way to specify the location of a web page or other resources.
[0080] Step S102, obtaining respective email addresses of a plurality of tested objects, and configuring an identification field for identifying each email address for each email address.
[0081] In this step, the object to be tested can be an individual, an employee of an enterprise or organization, etc., and this embodiment does not limit this. For example, the number of multiple objects to be tested is 1000, and the email addresses of the 1000 objects to be tested can be obtained, which are ants1@xxxxxx.com to ants1000@xxxxxx.com; an identification field for identifying each email address can be configured for each email address, and these identification fields can be 00001, 00002, 00003...01000 in sequence. It should be noted that the enumeration here is only illustrative and does not limit this embodiment.
[0082] Step S103, concatenating the initial URL with the identification field of each email address to obtain a concatenated URL corresponding to each email address.
[0083] For example, the initial URL is https: / / phish.xxxxxx.com / recevice. The initial URL is concatenated with the identification field of each email address, and the concatenated URLs corresponding to each email address are:
[0084] https: / / phish.xxxxxx.com / recevice / 00001;
[0085] https: / / phish.xxxxxx.com / recevice / 00002;
[0086] https: / / phish.xxxxxx.com / recevice / 00003;
[0087] …
[0088] https: / / phish.xxxxxx.com / recevice / 01000.
[0089] It should be noted that the above examples are only illustrative and do not limit this embodiment.
[0090] Step S104: create an initial text document containing the first type of characters, and decompress the initial text document to obtain a plurality of decompressed files.
[0091] In this step, the first type of characters can be characters that guide the object under test to trigger, such as "Document damaged, click to view the original text", "No permission to view, click to view the reason" or "Document encryption protection, click to enter the password", etc. This embodiment does not limit this.
[0092] Step S105, obtaining the spliced URL corresponding to the target email address from the spliced URLs corresponding to the various email addresses, and based on the obtained spliced URL corresponding to the target email address, performing an editing operation on a specified file among multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the target email address.
[0093] Step S106, compressing the edited file to obtain a compressed file, and modifying the compressed file into a text format to obtain a target text document.
[0094] Step S107, generating a phishing email for testing the object under test corresponding to the target email address according to the target email address and the target text document.
[0095] It can be seen that the technical solutions provided in the above steps S101 to S107 can achieve the following technical effects:
[0096] (1) This embodiment can automatically generate a test website in accordance with actual needs, thereby improving the efficiency and accuracy of phishing testing; and by obtaining the email addresses of multiple test subjects, the initial URL of the test website is concatenated with the identification field of each email address to obtain the concatenated URL corresponding to each email address, and then the specified file is edited and the content representing the hyperlink is added to the specified file. The target of the hyperlink is pointed to the concatenated URL corresponding to the target email address, making the phishing email more targeted. In subsequent testing, the identification field can be accurately identified, the target email address can be located, and then the test subject corresponding to the target email address can be located, thereby educating and improving the security awareness of the test subject.
[0097] (2) In the existing method of adding a hyperlink by selecting text or characters and right-clicking to select a hyperlink, the color of the text or characters will change. However, the hyperlink in the target text document obtained by the method of this embodiment is no different from other non-hyperlinks in terms of font, color, and size, which can increase the confusion, making the generated phishing email more concealed and difficult to detect, thereby improving the authenticity and reliability of subsequent tests.
[0098] (3) When editing text documents using existing programming languages, third-party libraries are required to operate. The third-party libraries here refer to those libraries produced and provided by third-party developers to extend the functions of programming languages. These libraries usually provide some additional functions, tools or modules for developers to use when writing programs. By using third-party libraries, developers can complete programming tasks more efficiently, reduce repetitive code writing, and improve development efficiency. However, if the third-party library is maliciously poisoned, there will be serious security risks. The method of this embodiment does not use a third-party library, thereby reducing security risks.
[0099] In addition, the inventor of the present application compared the time consumed by using the method of the present embodiment to generate a phishing email for testing with the traditional method of using a third-party library to generate a phishing email for testing, and found that the overall time efficiency of the method of the present embodiment can be improved by about 100 times. In addition, the method of the present embodiment only adjusts part of the file content, greatly reducing storage space and saving storage resources.
[0100] The present application provides a possible implementation method. After generating a phishing email for the object under test corresponding to the target email address in step S107, the following steps A1 to A3 may be further included:
[0101] Step A1, obtaining a concatenated URL corresponding to the next email address of the target email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, performing an editing operation on a specified file among the multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein the target of the hyperlink points to the concatenated URL corresponding to the next email address;
[0102] Step A2, compressing the edited file to obtain a compressed file, and modifying the compressed file to a text format to obtain a next target text document;
[0103] Step A3, based on the next email address and the next target text document, generate a phishing email for testing the object under test corresponding to the next email address.
[0104] It can be seen that steps A1 to A3 here are essentially corresponding to the previous steps S105 to S107, except that step S105 obtains the spliced URL corresponding to the target email address, and the target of the hyperlink points to the spliced URL corresponding to the target email address. Steps S106 and S107 generate phishing emails for testing the object under test corresponding to the target email address; step A1 obtains the spliced URL corresponding to the next email address of the target email address, and the target of the hyperlink points to the spliced URL corresponding to the next email address. Steps A2 and A3 generate phishing emails for testing the object under test corresponding to the next email address, which improves the efficiency and automation of phishing email generation.
[0105] The present application provides a possible implementation method. After generating a phishing email for testing the next email address of the tested object in step A3, the following steps A4 to A6 may be further included:
[0106] Step A4, continuing to obtain the concatenated URL corresponding to the next email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, performing an editing operation on a specified file among the multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein the target of the hyperlink points to the concatenated URL corresponding to the next email address;
[0107] Step A5, compressing the edited file to obtain a compressed file, and modifying the compressed file to a text format to obtain the next target text document;
[0108] Step A6: Generate a phishing email for testing the object under test corresponding to the next email address according to the next email address and the next target text document.
[0109] It can be seen that steps A4 to A6 here are actually corresponding to steps A1 to A3 above, except that step A1 is to obtain the concatenated URL corresponding to the next email address of the target email address, and the target of the hyperlink points to the concatenated URL corresponding to the next email address. Steps A2 and A3 generate phishing emails for testing the object under test corresponding to the next email address; step A4 is to obtain the concatenated URL corresponding to the email address after the next email address, and the target of the hyperlink points to the concatenated URL corresponding to the next email address. Steps A5 and A6 generate phishing emails for testing the object under test corresponding to the next email address. In this way, by analogy, for the concatenated URLs corresponding to multiple email addresses, the concatenated URLs corresponding to the email addresses can be obtained in sequence to generate phishing emails for the objects under test corresponding to the corresponding email addresses.
[0110] For example, taking the concatenated URL corresponding to the email address listed above as an example, the concatenated URLs corresponding to multiple email addresses are:
[0111] https: / / phish.xxxxxx.com / recevice / 00001;
[0112] https: / / phish.xxxxxx.com / recevice / 00002;
[0113] https: / / phish.xxxxxx.com / recevice / 00003;
[0114] …
[0115] https: / / phish.xxxxxx.com / recevice / 01000.
[0116] First, get https: / / phish.xxxxxx.com / recevice / 00001, the target of the hyperlink points to https: / / phish.xxxxxx.com / recevice / 00001, and generate a phishing email for the object under test corresponding to ants1@xxxxxx.com;
[0117] Next, continue to obtain https: / / phish.xxxxxx.com / recevice / 00002, the target of the hyperlink points to https: / / phish.xxxxxx.com / recevice / 00002, and generate a phishing email of the object under test corresponding to ants2@xxxxxx.com;
[0118] Then, continue to obtain https: / / phish.xxxxxx.com / recevice / 00003, the target of the hyperlink points to https: / / phish.xxxxxx.com / recevice / 00003, and generate a phishing email of the object under test corresponding to ants3@xxxxxx.com;
[0119] Then, continue to obtain https: / / phish.xxxxxx.com / recevice / 00004, the target of the hyperlink points to https: / / phish.xxxxxx.com / recevice / 00004, and generate a phishing email of the tested object corresponding to ants4@xxxxxx.com;
[0120] And so on, finally we get https: / / phish.xxxxxx.com / recevice / 01000, the target of the hyperlink points to https: / / phish.xxxxxx.com / recevice / 01000, and generate a phishing email of the tested object corresponding to ants1000@xxxxxx.com.
[0121] The present application provides a possible implementation method. In the above step S105, based on the obtained concatenated URL corresponding to the target email address, the specified file among the multiple files is edited, and content representing a hyperlink is added to the specified file. Specifically, the following steps B1 and B2 may be included:
[0122] Step B1, editing the first file among the multiple files, adding the attribute content of the hyperlink element before the start tag of the first setting element, and adding the end tag of the hyperlink element between the end tag of the first setting element and the end tag of the second setting element.
[0123] In this step, the first file is a main content file representing the initial text document, which contains all text and format information of the initial text document.
[0124] For example, the initial text document is a .docx text document. After decompressing the .docx text document, multiple files are obtained, including folders _rels, docProps, word, and file [Content_Types].xml. Each folder contains files. The folder _rels contains the definitions of various relationships in the .docx text document; the folder docProps contains the metadata of the .docx text document, such as author, title, creation date, etc.; the folder word is the main content part of the .docx text document, and almost all document content, such as text, tables, pictures, etc., are stored in the files of this folder; the file [Content_Types].xml defines all content types used in the .docx text document and their associated file extensions.
[0125] The document.xml file in the word folder is the main content file of the .docx text document, which contains all the text and formatting information in the document. Edit the document.xml file as the first file and set the start tag of the "Run" element in the first setting. <w:r> Add the hyperlink element's attribute content before, for example<w:hyperlink r:id="rId6"w:history="1"> , in the first set element "run" end tag< / w:r> Add the end tag of the hyperlink element between the end tag of the second setting element "paragraph".
[0126] exist<w:hyperlink r:id="rId6"w:history="1"> middle, <w:hyperlink>The element represents a hyperlink in a document. The r:id attribute specifies the relationship identifier of the hyperlink, and the w:history attribute is used to indicate whether the hyperlink should be considered as a historical record in the browsing history.
[0127] r:id="rId6": indicates that the hyperlink is associated with a relationship in the document, and the relationship identifier is "rId6". This relationship identifier usually corresponds to another part in the document, such as an image, another document part, or a web link.
[0128] w:history="1": indicates that the hyperlink is considered as part of the browsing history. It is possible that after the user clicks the link in the document, the document editor will add the link to the history so that the user can subsequently navigate to the location of the link through the browsing history.
[0129] In XML (Extensible Markup Language), an element is surrounded by a start tag and an end tag, which contain the content of the element. In this context, <w:hyperlink> The element is used to define a hyperlink in a document, and< / w:hyperlink> It is the end tag of the element. The content between a pair of start tags and end tags is the specific content or attributes of the hyperlink.
[0130] It should be noted that the above examples are only illustrative and do not limit this embodiment.
[0131] Step B2, based on the obtained spliced URL corresponding to the target email address, edit the second file among the multiple files, and add a hyperlink relationship before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the spliced URL corresponding to the target email address.
[0132] Still taking the above example, the document.xml.rels file in the _rels folder in the word folder mainly defines the relationship between the other parts required by the document.xml file part. The document.xml.rels file is used as the second file, and the second file is edited. A hyperlink relationship is added before the end tag of the third setting element "relationship". Specifically, <Relationship Id="rId6"Type="http: / / schemas.openxmlformats.org /
[0133] officeDocument / 2006 / relationships / hyperlink"
[0134] Target="https: / / phish.xxxxxx.com / recevice / 00001"TargetMode="External" / >。
[0135] <relationship>The element is used to define relationships within a document, particularly hyperlinks.
[0136] Id="rId6": This is the unique identifier of the relationship, which is used to uniquely identify the relationship in the document. Elements in other parts can use this identifier to reference this relationship.
[0137] Type = "http: / / schemas.openxmlformats.org / officeDocument / 2006 / relationships / hyperlink": This specifies the type of relationship, indicating that this is a hyperlink relationship. This type identifier tells the program that parses the document how to interpret this relationship.
[0138] Target = "https: / / phish.xxxxxx.com / recevice / 00001": This is the target of the relationship, indicating that the target of this hyperlink is "https: / / phish.xxxxxx.com / recevice / 00001", which corresponds to an external web page type resource.
[0139] TargetMode = "External": This attribute specifies the target mode of the hyperlink, which is "External" here, indicating that the hyperlink points to an external resource. This means that the hyperlink will be opened in an external application or browser, not inside the document.
[0140] Taken together, this <relationship>The element represents a hyperlink relationship in the document, whose target points to "https: / / phish.xxxxxx.com / recevice / 00001" and this link should be opened externally. This corresponds to a hyperlink somewhere in the document, which when clicked by the user opens the browser and jumps to the website.
[0141] It should be noted that the above examples are only illustrative and do not limit this embodiment.
[0142] This embodiment implements automated editing operations to insert and modify specific elements in multiple files to obtain edited files to generate phishing emails targeting specific target email addresses.
[0143] A possible implementation method is provided in an embodiment of the present application. When the first file among multiple files is edited in step B1 above, a set number of second-category characters may be added between the start tag and the end tag of the fourth setting element.
[0144] Here, for example, in the fourth setting element "text content in paragraph" the start tag <w:t> and the end tag< / w:t> A set number of second-class characters are added between them. The second-class characters here can be space characters, etc., and the set number can be determined according to actual needs.
[0145] For example, under the default size, paper, font size, line spacing, paragraph format, and margins, each page can generate a maximum of 3,300 characters. Therefore, the guiding text prepared in advance, such as "The document is damaged, click to view the original text", combined with factors such as spaces and line breaks, requires 800 characters. Therefore, when replacing<w:hyperlink r:id="rId6"w:history="1"> After that, in the body tag <w:t> The document is damaged, click to view the original text< / w:t> Just fill in the spaces. You can use python to generate spaces=""*2500, and then add it during automatic replacement. <w:t>Tags.
[0146] The present application provides a possible implementation method. In the above step S107, generating a phishing email for testing the object under test corresponding to the target email address according to the target email address and the target text document may specifically include the following steps C1 or C2:
[0147] Step C1, based on the target email address and the target text document, the target email address is used as the recipient and the target text document is used as the attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0148] Step C2, output the target text document as a document of a specified format, use the target email address as the recipient, and use the document of the specified format as an attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0149] In this step, the specified format may be a picture format, PDF (Portable Document Format), etc., which is not limited in this embodiment.
[0150] The present embodiment can automatically generate phishing emails, which can greatly improve the testing efficiency and reduce the time and labor cost of manual operations. Moreover, according to different testing requirements, the target text document can be selected as an attachment or output as a document of a specified format to generate phishing emails in different forms, which has high flexibility. In addition, by generating phishing emails for specific target email addresses, real email attack scenarios can be simulated, and security tests can be performed on the tested objects corresponding to the target email addresses. The generated phishing emails can be recorded and tracked, which is convenient for statistical analysis of the test results and improves the traceability and reliability of the test.
[0151] The present application provides a possible implementation method. After the above step S107 generates a phishing email for the object under test corresponding to the target email address, the following steps D1 to D4 may be further included:
[0152] Step D1, sending a phishing email of the tested object corresponding to the target email address to the target email address;
[0153] Step D2, monitoring the request for obtaining the test website; wherein, when the tested object corresponding to the target email address receives a phishing email, if the target text document or a document of a specified format in the phishing email is triggered, a request for obtaining the test website is initiated;
[0154] Step D3, if a request for obtaining a test website is monitored, identifying an identification field in the request for identifying each email address;
[0155] Step D4, locating the object to be tested according to the identification field.
[0156] This embodiment can quickly and accurately detect whether the object under test corresponding to the target email address is vulnerable to phishing email attacks by automatically sending phishing emails and monitoring requests for test websites, thereby improving detection efficiency; and, by locating the object under test through the identification field, it can accurately determine the object under test with weak security awareness, and can educate and improve the security awareness of the object under test, reducing the risk of accidentally clicking on malicious emails or leaking sensitive information.
[0157] The above introduces Figure 1 There are multiple implementation methods for each link of the illustrated embodiment. The method for generating a phishing email for testing in the embodiment of the present application will be further explained below through a specific embodiment.
[0158] In a specific embodiment, the method for generating a phishing email for testing may include the following steps S201 to S218:
[0159] Step S201, build a test website and obtain the initial URL of the test website.
[0160] In this step, for example, the initial URL of the test website is https: / / phish.xxxxxx.com / recevice.
[0161] Step S202: obtaining the respective email addresses of the multiple tested objects, and configuring an identification field for identifying each email address for each email address.
[0162] For example, if the number of the multiple tested objects is 1000, the email addresses of the 1000 tested objects can be obtained, which are ants1@xxxxxx.com to ants1000@xxxxxx.com; an identification field for identifying each email address can be configured for each email address, and these identification fields can be 00001, 00002, 00003, ... 01000. It should be noted that the enumeration here is only illustrative and does not limit the present embodiment.
[0163] Step S203: concatenate the initial URL with the identification field of each email address to obtain a concatenated URL corresponding to each email address.
[0164] For example, the initial URL is concatenated with the identification field of each email address, and the concatenated URLs corresponding to each email address are:
[0165] https: / / phish.xxxxxx.com / recevice / 00001;
[0166] https: / / phish.xxxxxx.com / recevice / 00002;
[0167] https: / / phish.xxxxxx.com / recevice / 00003;
[0168] …
[0169] https: / / phish.xxxxxx.com / recevice / 01000.
[0170] It should be noted that the above examples are only illustrative and do not limit this embodiment.
[0171] Step S204, creating an initial text document containing "Document damaged, click to view original text", and decompressing the initial text document to obtain multiple decompressed files.
[0172] For example, the initial text document is a .docx text document. After decompressing the .docx text document, multiple files are obtained, including folders _rels, docProps, word, and file [Content_Types].xml. Each folder contains files. The folder _rels contains the definitions of various relationships in the .docx text document; the folder docProps contains the metadata of the .docx text document, such as author, title, creation date, etc.; the folder word is the main content part of the .docx text document, and almost all document content, such as text, tables, pictures, etc., are stored in the files of this folder; the file [Content_Types].xml defines all content types used in the .docx text document and their associated file extensions.
[0173] Step S205, obtain the spliced URL corresponding to the target email address from the spliced URLs corresponding to each email address, edit the first file among the multiple files, add the attribute content of the hyperlink element before the start tag of the first set element, add the end tag of the hyperlink element between the end tag of the first set element and the end tag of the second set element, and add a set number of spaces between the start tag and the end tag of the fourth set element.
[0174] In this step, the target email address is ants1@xxxxxx.com, and the corresponding concatenated URL of ants1@xxxxxx.com is obtained, that is, https: / / phish.xxxxxx.com / recevice / 00001. Edit the document.xml file in the word folder as the first file, and set the start tag of the first element "Run" <w:r> Add the hyperlink element's attribute content before, for example<w:hyperlink r:id="rId6"w:history="1"> , in the first set element "run" end tag< / w:r> Add the end tag of the hyperlink element between the end tag of the second setting element "paragraph"< / w:t> < / relationship> < / relationship> < / w:hyperlink> The specific explanation of the elements can be found in the previous introduction and will not be repeated here.
[0175] In the fourth set element "text content in paragraph" start tag <w:t> and the end tag< / w:t> Add a set number of spaces between them. The set number here can be determined according to actual needs.
[0176] Step S206, based on the obtained spliced URL corresponding to the target email address, edit the second file among the multiple files, and add a hyperlink relationship before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the spliced URL corresponding to the target email address.
[0177] In this step, the document.xml.rels file in the _rels folder in the word folder is used as the second file, and the second file is edited, and a hyperlink relationship is added before the end tag of the third setting element "relationship". Specifically, <Relationship Id="rId6"Type="http: / / schemas.openxmlformats.org /
[0178] officeDocument / 2006 / relationships / hyperlink"
[0179] Target = "https: / / phish.xxxxxx.com / recevice / 00001" TargetMode = "External" / >, for a detailed explanation, please refer to the previous introduction, which will not be repeated here. Here, the attribute information Id = "rId6" of the hyperlink relationship corresponds to the attribute content r:id = "rId6" of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to https: / / phish.xxxxxx.com / recevice / 00001.
[0180] Step S207, compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document.
[0181] Figure 2 This is a schematic diagram of the storage file space size of the target text document generated by a third-party library. Figure 2 In the example, the target text document hyper.docx occupies 16.0KB (kilobytes).
[0182] Figure 3 is a schematic diagram of the storage file space size of the target text document generated by the method of this embodiment. Figure 3 In the example, the target text document origin.docx occupies 12.0 KB of space. It can be seen that the target text document generated by the method of this embodiment occupies less space than the method of the existing third-party library, which greatly reduces the storage space and saves storage resources.
[0183] Step S208, output the target text document as a PDF document, use the target email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0184] Step S209, continue to obtain the spliced URL corresponding to the next email address of the target email address from the spliced URLs corresponding to each email address, and based on the obtained spliced URL corresponding to the next email address, edit the second file among the multiple files, and modify the target pointing in the attribute information of the hyperlink relationship to the spliced URL corresponding to the next email address.
[0185] In this step, the next email address of the target email address ants1@xxxxxx.com is ants2@xxxxxx.com. You can get the concatenated URL corresponding to ants2@xxxxxx.com, which is https: / / phish.xxxxxx.com / recevice / 00002, and search for the document.xml.rels file in the _rels folder in the word folder. <Relationship Id="rId6"Type="http: / / schemas.openxmlformats.org / officeDocument / 2006 / relationships / hyperlink"
[0186] Target="https: / / phish.xxxxxx.com / recevice / 00001" TargetMode="External" / >, change Target="https: / / phish.xxxxxx.com / recevice / 00001" to: Target="https: / / phish.xxxxxx.com / recevice / 00002".
[0187] Step S210, compress the file edited in the above step to obtain a compressed file, and modify the compressed file into a text format to obtain the next target text document.
[0188] Step S211, output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address.
[0189] Step S212, continue to obtain the spliced URL corresponding to the next email address from the spliced URLs corresponding to each email address, and based on the obtained spliced URL corresponding to the next email address, edit the second file among the multiple files, and modify the target pointing in the attribute information of the hyperlink relationship to the spliced URL corresponding to the next email address.
[0190] In this step, the next email address is ants2@xxxxxx.com, and the next email address is ants3@xxxxxx.com. You can get the concatenated URL corresponding to ants3@xxxxxx.com, which is https: / / phish.xxxxxx.com / recevice / 00003, and search for the document.xml.rels file in the _rels folder in the word folder. <Relationship Id="rId6"Type="http: / / schemas.openxmlformats.org / officeDocument / 2006 / relationships / hyperlink"
[0191] Target="https: / / phish.xxxxxx.com / recevice / 00002"TargetMode="External" / >, change Target="https: / / phish.xxxxxx.com / recevice / 00002" to:
[0192] Target="https: / / phish.xxxxxx.com / recevice / 00003".
[0193] Step S213, compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document.
[0194] Step S214, output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address.
[0195] Step S215, and so on, can generate phishing emails for testing the objects under test corresponding to each email address.
[0196] Step S216, sending the phishing email for testing the object under test corresponding to the target email address to the target email address; sending the phishing email for testing the object under test corresponding to the next email address to the next email address; sending the phishing email for testing the object under test corresponding to the next email address to the next email address; and so on, the phishing email for testing the object under test corresponding to each email address can be sent to the corresponding email address.
[0197] Step S217, monitoring the request for obtaining the test website; wherein, when the tested object corresponding to each email address receives a phishing email, if the PDF document in the phishing email is triggered, a request for obtaining the test website is initiated.
[0198] Step S218: If a request for obtaining a test website is monitored, an identification field in the request for identifying each email address is identified, and the object under test is located according to the identification field.
[0199] This embodiment can accurately identify the subjects whose security awareness is weak, and can educate and improve the security awareness of the subjects, thereby reducing the risk of accidentally clicking on malicious emails or leaking sensitive information.
[0200] It should be noted that the size of the sequence number of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. In practical applications, all the above possible implementation methods can be combined in any way to form possible embodiments of the present application, which will not be described one by one here.
[0201] Based on the methods for generating phishing emails for testing provided in the above embodiments, and based on the same inventive concept, an embodiment of the present application also provides a device for generating phishing emails for testing.
[0202] Figure 4 is a structural diagram of a device for generating phishing emails for testing provided in an embodiment of the present application. Figure 4 As shown, the device for generating phishing emails for testing may specifically include a building module 410, an acquisition module 420, a configuration module 430, a splicing module 440, a decompression module 450, an editing module 460, a compression module 470 and a generation module 480.
[0203] A building module 410 is suitable for building a test website;
[0204] An acquisition module 420 is adapted to acquire an initial URL of a test website;
[0205] The configuration module 430 is adapted to obtain the email addresses of the plurality of tested objects and configure an identification field for identifying each email address for each email address;
[0206] The concatenation module 440 is adapted to concatenate the initial URL with the identification field of each email address to obtain a concatenated URL corresponding to each email address;
[0207] A decompression module 450 is adapted to create an initial text document containing the first type of characters, and decompress the initial text document to obtain a plurality of decompressed files;
[0208] The editing module 460 is adapted to obtain a spliced URL corresponding to a target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the target email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein a target of the hyperlink points to the spliced URL corresponding to the target email address;
[0209] A compression module 470 is adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document;
[0210] The generation module 480 is adapted to generate a phishing email for testing the object under test corresponding to the target email address according to the target email address and the target text document.
[0211] A possible implementation method is provided in an embodiment of the present application, wherein the editing module 460 is further adapted to obtain a spliced URL corresponding to a next email address of the target email address from the spliced URLs corresponding to the respective email addresses after the generating module generates a phishing email for testing the tested object corresponding to the target email address, and based on the acquired spliced URL corresponding to the next email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the next email address;
[0212] The compression module 470 is also adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a next target text document;
[0213] The generating module 480 is further adapted to generate a phishing email for testing the object under test corresponding to the next email address according to the next email address and the next target text document.
[0214] A possible implementation method is provided in an embodiment of the present application, wherein the editing module 460 is further adapted to, after the generation module generates a phishing email for testing the tested object corresponding to the next email address, continue to obtain a concatenated URL corresponding to the next email address of the next email address from the concatenated URLs corresponding to the respective email addresses, and based on the concatenated URL corresponding to the obtained next email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein the target of the hyperlink points to the concatenated URL corresponding to the next email address;
[0215] The compression module 470 is also adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document;
[0216] The generating module 480 is further adapted to generate a phishing email for testing the object under test corresponding to the next email address according to the next email address and the next target text document.
[0217] A possible implementation is provided in an embodiment of the present application, wherein the editing module 460 is further adapted to:
[0218] Performing an editing operation on a first file among the multiple files, adding attribute content of a hyperlink element before a start tag of a first setting element, and adding an end tag of the hyperlink element between an end tag of the first setting element and an end tag of a second setting element;
[0219] Based on the obtained spliced URL corresponding to the target email address, an editing operation is performed on the second file among the multiple files, and a hyperlink relationship is added before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the spliced URL corresponding to the target email address.
[0220] A possible implementation is provided in an embodiment of the present application, wherein the editing module 460 is further adapted to:
[0221] When the first file among the multiple files is edited, a set number of characters of the second category are added between the start tag and the end tag of the fourth setting element.
[0222] A possible implementation is provided in an embodiment of the present application, wherein the generating module 480 is further adapted to:
[0223] According to the target email address and the target text document, a phishing email is generated for testing the object under test corresponding to the target email address, with the target email address as the recipient and the target text document as the attachment; or
[0224] Output the target text document as a document of a specified format, use the target email address as the recipient, and use the document of the specified format as an attachment to generate a phishing email for testing the object under test corresponding to the target email address.
[0225] A possible implementation method is provided in the embodiment of the present application, such as Figure 5 As shown above Figure 4 The device shown may also include a sending module 510 , a monitoring module 520 , and an identification module 530 .
[0226] A sending module 510, adapted to send a phishing email of a tested object corresponding to a target email address to the target email address;
[0227] The monitoring module 520 is adapted to monitor the request for obtaining the test website; wherein, when the tested object corresponding to the target email address receives a phishing email, if the target text document or a document of a specified format in the phishing email is triggered, a request for obtaining the test website is initiated;
[0228] The identification module 530 is adapted to identify the identification field for identifying each email address in the request if a request for obtaining a test website is monitored; and locate the object under test according to the identification field.
[0229] Based on the same inventive concept, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for generating a phishing email for testing of any one of the above embodiments.
[0230] In an exemplary embodiment, an electronic device is provided, such as Figure 6 As shown, Figure 6 The electronic device 600 shown includes: a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, such as through a bus 602. Optionally, the electronic device 600 may also include a transceiver 604. It should be noted that in actual applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not constitute a limitation on the embodiments of the present application.
[0231] Processor 601 may be a CPU (Central Processing Unit), a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0232] The bus 602 may include a path to transmit information between the above components. The bus 602 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 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.
[0233] The memory 603 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0234] The memory 603 is used to store the computer program code for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the computer program code stored in the memory 603 to implement the contents shown in the above method embodiment.
[0235] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0236] Based on the same inventive concept, an embodiment of the present application further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute, when running, a method for generating a phishing email for testing in any of the above embodiments.
[0237] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.
[0238] Those skilled in the art can understand that the technical solution of the present application can be essentially or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, which includes a number of program instructions, so that an electronic device (such as a personal computer, a server, or a network device, etc.) executes all or part of the steps of the method described in each embodiment of the present application when running the program instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0239] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as electronic devices such as personal computers, servers, or network devices), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of an electronic device, the electronic device executes all or part of the steps of the methods described in the embodiments of the present application.
[0240] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present application, they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not deviate from the protection scope of the present application.
Claims
1. A method for generating a phishing email for testing, characterized in that: include: Build a test website and obtain the initial URL of the test website; Obtaining respective email addresses of a plurality of tested objects, and configuring an identification field for identifying each email address for each email address; Concatenate the initial URL with the identification field of each email address to obtain the concatenated URL corresponding to each email address; Creating an initial text document containing the first type of characters, and decompressing the initial text document to obtain multiple decompressed files; Obtaining a spliced URL corresponding to a target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the target email address, performing an editing operation on a specified file among the multiple files, adding content representing a hyperlink to the specified file, and obtaining an edited file, wherein a target of the hyperlink points to the spliced URL corresponding to the target email address; Compressing the edited file to obtain a compressed file, and modifying the compressed file to a text format to obtain a target text document; Generate a phishing email for testing the object under test corresponding to the target email address according to the target email address and the target text document; Among them, the spliced URL corresponding to the target email address is obtained from the spliced URLs corresponding to the various email addresses, and based on the spliced URL corresponding to the obtained target email address, a specified file among the multiple files is edited, and content representing a hyperlink is added to the specified file to obtain an edited file, wherein the target of the hyperlink points to the spliced URL corresponding to the target email address; the edited file is compressed to obtain a compressed file, and the compressed file is modified to a text format to obtain a target text document; according to the target email address and the target text document, a phishing email for testing the object under test corresponding to the target email address is generated, specifically including: Obtaining a concatenated URL corresponding to a target email address from the concatenated URLs corresponding to each email address, editing a first file among the multiple files, adding attribute content of a hyperlink element before a start tag of a first set element, adding an end tag of a hyperlink element between an end tag of the first set element and an end tag of a second set element, and adding a set number of spaces between a start tag and an end tag of a fourth set element; Based on the obtained concatenated URL corresponding to the target email address, an editing operation is performed on the second file among the multiple files, and a hyperlink relationship is added before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the concatenated URL corresponding to the target email address; Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document; Output the target text document as a PDF document, use the target email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the target email address; Continue to obtain the spliced URL corresponding to the next email address of the target email address from the spliced URLs corresponding to the various email addresses, and based on the obtained spliced URL corresponding to the next email address, edit the second file among the multiple files to modify the target pointing in the attribute information of the hyperlink relationship to the spliced URL corresponding to the next email address; Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document; Output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address; Continue to obtain the concatenated URL corresponding to the next email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, edit the second file among the multiple files, and modify the target pointing in the attribute information of the hyperlink relationship to the concatenated URL corresponding to the next email address; Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document; Output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address; In the same way, phishing emails are generated to test the objects under test corresponding to each email address.
2. The method according to claim 1, characterized in that After generating a phishing email for testing the object under test corresponding to the target email address, the method further includes: Sending a phishing email of the object to be tested corresponding to the target email address to the target email address; Monitoring requests for obtaining a test website; wherein, when the subject under test corresponding to the target email address receives a phishing email, if a target text document or a document of a specified format in the phishing email is triggered, a request for obtaining the test website is initiated; If a request to obtain the test website is monitored, an identification field in the request for identifying each email address is identified; Locate the object under test based on the identification field.
3. A device for generating phishing emails for testing, characterized in that: include: Building modules, suitable for building test websites; The acquisition module is suitable for obtaining the initial URL of the test website; A configuration module, adapted to obtain the respective email addresses of the plurality of tested objects, and configure an identification field for identifying each email address for each email address; A concatenation module, adapted to concatenate the initial URL with the identification field of each email address to obtain a concatenated URL corresponding to each email address; A decompression module, adapted to create an initial text document containing the first type of characters, and decompress the initial text document to obtain a plurality of decompressed files; The editing module is adapted to obtain a spliced URL corresponding to a target email address from the spliced URLs corresponding to the respective email addresses, and based on the obtained spliced URL corresponding to the target email address, perform an editing operation on a specified file among the multiple files, add content representing a hyperlink to the specified file, and obtain an edited file, wherein a target of the hyperlink points to the spliced URL corresponding to the target email address; A compression module, adapted to compress the edited file to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document; A generation module, adapted to generate a phishing email for testing a tested object corresponding to the target email address according to the target email address and the target text document; Wherein, the editing module is also suitable for: Obtaining a concatenated URL corresponding to a target email address from the concatenated URLs corresponding to each email address, editing a first file among the multiple files, adding attribute content of a hyperlink element before a start tag of a first set element, adding an end tag of a hyperlink element between an end tag of the first set element and an end tag of a second set element, and adding a set number of spaces between a start tag and an end tag of a fourth set element; Based on the obtained concatenated URL corresponding to the target email address, an editing operation is performed on the second file among the multiple files, and a hyperlink relationship is added before the end tag of the third setting element, wherein the attribute information of the hyperlink relationship corresponds to the attribute content of the hyperlink element, and the target in the attribute information of the hyperlink relationship points to the concatenated URL corresponding to the target email address; The compression module is also adapted to: Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain a target text document; The generating module is also adapted to: Output the target text document as a PDF document, use the target email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the target email address; The editing module is also adapted to: Continue to obtain the spliced URL corresponding to the next email address of the target email address from the spliced URLs corresponding to the various email addresses, and based on the obtained spliced URL corresponding to the next email address, edit the second file among the multiple files to modify the target pointing in the attribute information of the hyperlink relationship to the spliced URL corresponding to the next email address; The compression module is also adapted to: Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document; The generating module is also adapted to: Output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address; The editing module is also adapted to: Continue to obtain the concatenated URL corresponding to the next email address from the concatenated URLs corresponding to the respective email addresses, and based on the obtained concatenated URL corresponding to the next email address, edit the second file among the multiple files, and modify the target pointing in the attribute information of the hyperlink relationship to the concatenated URL corresponding to the next email address; The compression module is also adapted to: Compress the file edited in the above step to obtain a compressed file, and modify the compressed file to a text format to obtain the next target text document; The generating module is also adapted to: Output the next target text document as a PDF document, use the next email address as the recipient, and use the PDF document as an attachment to generate a phishing email for testing the object under test corresponding to the next email address; In the same way, phishing emails are generated to test the objects under test corresponding to each email address.
4. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for generating a phishing email for testing according to any one of claims 1 to 2.
5. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for generating a phishing email for testing according to any one of claims 1 to 2 when running.
