Multi-application security detection method, device, medium and electronic equipment

By detecting the running environment and information of the application process, automated batch instrumentation solves the problems of low efficiency and high cost of the traditional one-by-one instrumentation method, and improves the efficiency and effectiveness of security detection.

CN115454856BActive Publication Date: 2024-09-03CHINA TELECOM CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211130378.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2024-09-03
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

The traditional application-by-application instrumentation method is inefficient and costly in security detection, making it difficult to meet the security detection needs of multiple applications.

Method used

By detecting whether the running environment of multiple application processes to be tested meets the instrumentation conditions, obtaining relevant information, determining the target application process, and creating an agent process for security detection when specific conditions are met, automatic batch instrumentation is realized.

Benefits of technology

It significantly improves the efficiency of security detection, saves users' time, reduces labor costs, and allows them to focus more on vulnerability troubleshooting and repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115454856B
    Figure CN115454856B
Patent Text Reader

Abstract

The present application relates to the field of computer security, and discloses a multi-application security detection method, device, medium, and electronic device. The method includes: after starting multiple application processes to be tested, detecting whether the operating environment of the multiple application processes to be tested meets the first plugging condition; if the operating environment meets the first plugging condition, obtaining information related to each application process to be tested, and determining the target application process to be tested that meets the second plugging condition from the multiple application processes to be tested based on the information related to each application process to be tested; creating a corresponding target proxy process for each target application process to be tested through plugging, so that the target proxy process can collect information from the corresponding target application process to be tested, and send the collected information to the security detection engine for security detection. This method realizes the automated batch plugging of multiple application processes to be tested, saving the user's time and improving the efficiency of security detection.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of the Internet and information technology, a large number of computer applications have been generated to meet various needs.

[0003] Security testing of applications through instrumentation is an important means to reduce security vulnerabilities in applications. However, as more and more computer applications are developed and run, the traditional solution of requiring users to instrument applications one by one has become increasingly inefficient and costly, and it is difficult to meet the needs of security testing. Summary of the invention

[0004] In the field of computer security technology, in order to solve the above technical problems, the purpose of this application is to provide a multi-application security detection method, device, medium and electronic device.

[0005] According to one aspect of the present application, a multi-application security detection method is provided, the method comprising:

[0006] After starting a plurality of application processes to be tested, detecting whether the operating environments of the plurality of application processes to be tested meet a first instrumentation condition;

[0007] If the operating environment satisfies the first instrumentation condition, information related to each application process to be tested is obtained, and a target application process to be tested that satisfies the second instrumentation condition is determined from the multiple application processes to be tested according to the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit that the application process to be tested depends on, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested;

[0008] A corresponding target proxy process is created for each target application process to be tested through the insertion, so that the target proxy process can collect information in the corresponding target application process to be tested, and send the collected information to the security detection engine for security detection.

[0009] According to another aspect of the present application, a multi-application safety detection device is provided, the device comprising:

[0010] A detection module is configured to detect whether the operating environment of the multiple application processes to be tested meets the first instrumentation condition after starting the multiple application processes to be tested;

[0011] an acquisition and determination module, configured to acquire information related to each application process to be tested if the operating environment satisfies the first instrumentation condition, and determine a target application process to be tested that satisfies the second instrumentation condition from among the multiple application processes to be tested based on the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested;

[0012] The instrumentation module is configured to create a corresponding target proxy process for each target application process to be tested through instrumentation, so that the target proxy process can collect information in the corresponding target application process to be tested, and send the collected information to the security detection engine for security detection.

[0013] According to another aspect of the present application, a computer-readable program medium is provided, which stores computer program instructions. When the computer program instructions are executed by a computer, the computer executes the method as described above.

[0014] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0015] processor;

[0016] A memory having computer-readable instructions stored therein, wherein the computer-readable instructions, when executed by the processor, implement the aforementioned method.

[0017] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0018] The present application provides a multi-application security detection method, device, medium and electronic device, the method comprising the following steps: after starting multiple application processes to be tested, detecting whether the operating environment of the multiple application processes to be tested meets a first plugging condition; if the operating environment meets the first plugging condition, obtaining information related to each application process to be tested, and determining a target application process to be tested that meets a second plugging condition from the multiple application processes to be tested based on the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested; creating a corresponding target proxy process for each target application process to be tested through plugging, so that the target proxy process collects information in the corresponding target application process to be tested, and sends the collected information to the security detection engine for security detection.

[0019] Under this method, after starting multiple application processes to be tested, it is first determined whether the operating environment of these application processes to be tested meets the first plugging condition, and when the first plugging condition is met, it is further determined whether the second plugging condition is met based on information related to the application process to be tested. When the target application process to be tested also meets the second plugging condition, a corresponding target proxy process is created for the target application process to be tested through plugging, thereby realizing automated batch plugging of multiple application processes to be tested. The use of the first plugging condition and the second plugging condition ensures that the plugging of the application process to be tested can be successfully completed, saving the user's time. On this basis, by performing security detection based on the information collected by the target proxy process, the efficiency of security detection is significantly improved, so that users can devote more energy to how to detect and repair vulnerabilities.

[0020] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0022] Figure 1 is a schematic diagram of a system architecture of a multi-application security detection method according to an exemplary embodiment;

[0023] Figure 2 is a flow chart of a multi-application security detection method according to an exemplary embodiment;

[0024] Figure 3A is a flowchart showing whether a running environment and a process meet the instrumentation condition according to an exemplary embodiment;

[0025] Figure 3B is a schematic diagram of a process of instrumenting a process according to an exemplary embodiment;

[0026] Figure 4 It is a schematic diagram of the overall process of performing security detection on an application process to be tested according to an exemplary embodiment;

[0027] Figure 5 is a block diagram of a multi-application safety detection device according to an exemplary embodiment;

[0028] Figure 6 is an example block diagram of an electronic device for implementing the above-mentioned multi-application security detection method according to an exemplary embodiment;

[0029] Figure 7 A program product for implementing the above-mentioned multi-application security detection method is shown according to an exemplary embodiment. DETAILED DESCRIPTION

[0030] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0031] In addition, the drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0032] Interactive application security testing (IAST) is a technology that automatically identifies and diagnoses software vulnerabilities in applications and APIs. When performing application testing, network companies gradually abandon static testing with high false positive rates and choose interactive testing with low false positive and false negative rates to check for security risks. Interactive application security testing combines dynamic and static security testing to discover security vulnerabilities by analyzing and processing requests. It has the characteristics of being able to trace vulnerabilities and having high accuracy.

[0033] Since interactive detection technology needs to obtain application-related requests, it needs to perform instrumentation operations. In current interactive security detection practices, the applications to be detected are not single. For example, in a network company, there are usually more than one or two applications to be detected. Therefore, users need to manually instrument the applications to be detected one by one. Obviously, this instrumentation method wastes a lot of time, is very inefficient, and has high labor costs.

[0034] To this end, the present application first provides a multi-application security detection method. The multi-application security detection method provided by the present application can overcome the above defects, can realize automated batch plugging, can bring convenience to users, improve security detection efficiency, and reduce costs.

[0035] The implementation terminal of the present application can be any device with computing functions, which can be connected to an external device for receiving or sending data. Specifically, it can be a portable mobile device, such as a smart phone, a tablet computer, a laptop computer, a PDA (Personal Digital Assistant), etc., or it can be a fixed device, such as a computer device, a field terminal, a desktop computer, a server, a workstation, etc. It can also be a collection of multiple devices, such as the physical infrastructure or server cluster of cloud computing.

[0036] Optionally, the implementation terminal of the present application may be a server or a workstation.

[0037] Figure 1 FIG. 1 is a schematic diagram of a system architecture of a multi-application security detection method according to an exemplary embodiment. Figure 1 As shown, the system architecture includes a detection server 130, a target server 110 and multiple user terminals, the multiple user terminals specifically include a first user terminal 121, a second user terminal 122 and a third user terminal 123, and communication connections are established between each user terminal and the target server 110, as well as between the detection server 130 and the target server 110, and data can be sent and received with each other through the communication connection. A detection engine is deployed on the detection server 130, and the target server 110 is the executor of the embodiment of the present application, which has multiple application processes to be tested. When a multi-application security detection method provided by the present application is applied to Figure 1In the system architecture shown, a process may be as follows: first, after the application process to be tested is started, each user terminal accesses the application process to be tested through the client; next, it is detected whether the operating environment of multiple application processes to be tested on the target server 110 meets the first plugging condition; then, when the operating environment meets the first plugging condition, further information related to each application process to be tested is obtained, and based on the information related to each application process to be tested, it is determined whether each application process to be tested meets the second plugging condition, thereby finding the target application process to be tested that meets the second plugging condition; then, the target server 110 automatically generates and executes the plugging command for each target application process to be tested, thereby creating a corresponding target proxy process for each target application process to be tested in the target server 110; finally, each target proxy process collects information from the corresponding target application process to be tested, and sends the collected information to the detection engine of the detection server 130 for security detection.

[0038] In one embodiment of the present application, the client is a browser, and the application process to be tested is a process of a web application.

[0039] In one embodiment of the present application, the multi-application security detection method is performed during an idle period of the application process to be detected.

[0040] It is worth mentioning that Figure 1 This is only one embodiment of the present application. Although the terminal devices that execute the multi-application security detection method and actually perform security detection through the detection engine in the embodiment of the present application are all servers, in other embodiments of the present application, the terminal device for executing the terminal and deploying the detection engine can be other types of terminal devices such as desktop computers; although the application process to be tested in the embodiment of the present application is a process of a web application, in other embodiments of the present application, the application process to be tested can also be a process of other types of applications, and the types of different application processes to be tested can be different; although in the embodiment of the present application, the deployment of the detection engine and the creation of the target proxy process are implemented on different terminal devices, in other embodiments of the present application, the detection engine can also be deployed and the target proxy process can be created on the same terminal device; although in the embodiment of the present application, the number of user terminals is 3 and each user terminal is a terminal device of the same type, in other embodiments of the present application, the number of user terminals can be any other number and each user terminal can be a terminal device of a different type. This application does not make any limitation on this, and the scope of protection of this application should not be limited in any way.

[0041] Figure 2 is a flow chart of a multi-application security detection method according to an exemplary embodiment. The multi-application security detection method provided in this embodiment can be executed by a server, such as Figure 2 As shown, the following steps are included:

[0042] Step 210: After starting a plurality of application processes to be tested, detecting whether the operating environments of the plurality of application processes to be tested meet a first instrumentation condition.

[0043] Each application process to be tested can be started on a Linux server, and each application process to be tested can be a process of the same type or a process of a different type. The multiple application processes to be tested can be web application processes. The multiple application processes to be tested can specifically be application processes built based on the Java language. The operating environment of the multiple application processes to be tested is the environment on the server where the application processes to be tested are located.

[0044] In one embodiment of the present application, the detecting whether the operating environment of the plurality of application processes to be tested meets the first instrumentation condition includes at least one of the following:

[0045] Check whether you can switch to the root user through the su command;

[0046] Check whether the proxy file used to create the proxy process exists in the specified directory;

[0047] Check whether the current memory usage ratio does not exceed the preset memory usage ratio threshold;

[0048] Check whether the virtual machine version on which the application process to be tested depends meets the predetermined requirements.

[0049] Specifically, the first insertion condition may include the above four items at the same time. When the operating environment does not meet any one of the above four items, that is, when it is not possible to switch to the root user through the su command, or the proxy file used to create the proxy process does not exist in the specified directory, or the current memory occupancy ratio does not reach the predetermined memory occupancy ratio threshold, or the virtual machine version on which the operation of the application process to be tested depends does not meet the predetermined requirements, the process of executing the multi-application security detection method can be exited.

[0050] su is the abbreviation of switch user. In Linux, the su command allows users to temporarily change their login identities. When changing to a user other than root, you must enter the user account and password to be changed. If you can switch to the root user through the su command, you will have server permissions, and only then will you be allowed to perform subsequent instrumentation and security checks; if you cannot switch to the root user through the su command, you will be prompted with no permissions and exit the entire process.

[0051] The proxy process is the agent process, and accordingly, the proxy file is the agent file. You can detect whether the agent file exists in the / root / directory of the server; if it does not exist, you can prompt the user to download the agent file to the specified directory and then exit.

[0052] The predetermined memory usage ratio threshold can be set as needed, for example, it can be set to 80%; the predetermined memory usage ratio threshold can also be set by monitoring the memory usage of the server through a deep learning model. If the current memory usage ratio is not large, you can continue to perform subsequent steps; if the current memory usage ratio is large, it means that the application process to be tested has occupied a lot of memory resources. At this time, by exiting the process, no more plugging operations are performed to avoid server crashes caused by plugging, ensuring that the application process to be tested can run stably.

[0053] The virtual machine version is the version of the JVM (Java Virtual Machine) that the application process to be tested depends on. Specifically, the JVM version can be obtained through the java --version command; when the virtual machine version does not meet the predetermined requirements, the entire process can be directly exited.

[0054] Combine the following Figure 3A The solution of the embodiment of the present application is further introduced. Figure 3A is a flowchart showing a method for checking whether the running environment and the process meet the instrumentation condition according to an exemplary embodiment. Figure 3A As shown, the following steps are included:

[0055] Step 301, enter the batch plugging process.

[0056] Step 302 is a step of checking whether the operating environment meets the plugging condition, which specifically includes: checking whether there is root permission, checking whether the agent file exists, checking whether the memory meets the requirements, and checking whether the Java version meets the requirements. If it does not meet the requirements, execute step 303.

[0057] Step 303, exit the process.

[0058] Step 220: If the operating environment satisfies the first instrumentation condition, information related to each application process to be tested is obtained, and a target application process to be tested that satisfies the second instrumentation condition is determined from the multiple application processes to be tested according to the information related to each application process to be tested.

[0059] Among them, the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit that the application process to be tested depends on, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested.

[0060] Specifically, since the security detection object of the embodiment of the present application is a web application process built based on Java; therefore, when the operating environment meets the first plug-in condition, the application process to be tested containing the parameter "java" can be selected and information related to these application processes to be tested can be obtained.

[0061] After obtaining information related to each application process to be tested, for each application process to be tested, it is determined whether to determine the application process to be tested as a target application process to be tested according to whether the information related to the application process to be tested satisfies the second instrumentation condition.

[0062] In one embodiment of the present application, the second instrumentation condition includes at least one of the following:

[0063] Determine that the process type information in the startup parameter information of the application process to be tested is a specified type;

[0064] Determine whether the version of the application process to be tested and the version of the software development kit that the application process to be tested depends on support security detection according to the support information of the version of the application process to be tested and the version of the software development kit that the application process to be tested depends on for security detection;

[0065] Determine the username that can get the user who started the process;

[0066] Make sure that the current user has root privileges or that the user ID of the current user is consistent with the user ID that starts the application process to be tested;

[0067] It is determined that the proxy parameters in the application process to be tested do not include the proxy parameters corresponding to the target proxy process.

[0068] Each of the second instrumentation conditions corresponds to each of the aforementioned information related to each application process to be tested. The second instrumentation condition may include all of the above items.

[0069] In one embodiment of the present application, the step of determining a target application process to be tested that meets the second instrumentation condition from among the multiple application processes to be tested according to information related to each application process to be tested includes:

[0070] If the current application process to be tested does not meet any of the second instrumentation conditions, the current application process to be tested is ignored, and the next application process to be tested is judged.

[0071] When the current application process under test does not meet any of the second instrumentation conditions, the current application process under test cannot become the target application process under test. At this time, it is necessary to judge the next application process under test to confirm whether the next application process under test can be used as the target application process under test.

[0072] First, a process check is required. The startup parameter information specifically includes process type information. Specifically, the specified type can be a tomcat process. You can check whether the process is a tomcat process based on the startup parameter information. If not, skip the process and check the next process. If yes, you can continue to perform other checks on the process.

[0073] A version check is also required. After determining that the process is a tomcat process, you can further check whether the version of the tomcat process and the version of the software development kit (Java Development Kit, JDK) that the tomcat process depends on support security detection. If not, it means that security detection cannot be performed on it, so skip the process and check the next process; if it does, you can continue to perform other checks on the process.

[0074] Next, a user check is required. If the username of the user who started the process cannot be obtained, the process is skipped and the next process is checked. If the username of the user who started the process can be obtained, other checks can be continued on the process.

[0075] The user ID is the real user's UID (User ID), which uniquely corresponds to the user name; in the Linux system, the user name is used to log in to the system.

[0076] A permission check is also required. If the current user has root permission or the user ID of the current user is consistent with the user ID of the application process to be tested, it means that the current user has the permission required to check the process; if the current user does not have root permission and the user ID of the current user is inconsistent with the user ID of the application process to be tested, the current user does not have the permission required to check the process, and the process is skipped and the next process is checked. In other words, only when the current user is a user with root permission or the user who started the application process to be tested can the security check of the application process to be tested be performed.

[0077] In addition, an agent conflict check is required. Specifically, check whether the application process to be tested already contains the Java agent parameter; if an application process to be tested already contains the Java agent parameter, it means that there are other agent processes corresponding to the application process to be tested, and these agent processes may not be used for interactive security detection. If a corresponding agent process for interactive security detection is created for the application process to be tested, a conflict may occur, resulting in the inability to complete the interactive security detection normally. Therefore, if the application process to be tested already contains the Java agent parameter, skip the process and check the next process.

[0078] Please continue to see Figure 3A , if the requirements are met, execute step 304.

[0079] Step 304, traverse the process and obtain the Java process information.

[0080] Based on the information obtained for each Java process, determine whether the process meets the instrumentation conditions.

[0081] Step 305 is a step of checking whether the process meets the instrumentation condition, which specifically includes: checking the process, checking the version, checking the user, checking the authority, and checking the conflict. If all checks are passed, step 306 is executed.

[0082] Step 306, record the information of the process that meets the instrumentation condition.

[0083] What is recorded here is actually the PID of the process that meets the instrumentation conditions. PID (Process Identification) refers to the process identification number in the operating system, that is, the process identifier.

[0084] Step 230, creating a corresponding target proxy process for each target application process to be tested by inserting a stub, so that the target proxy process collects information in the corresponding target application process to be tested, and sends the collected information to the security detection engine for security detection.

[0085] Instrumentation can be achieved by running the instrumentation command. The target agent process sends the collected information to the security detection engine for interactive security detection.

[0086] In one embodiment of the present application, the step of creating a corresponding target proxy process for each target application process to be tested by inserting a stub includes:

[0087] For each target application process to be tested, a target proxy process capable of communicating with the target application process to be tested is created for the target application to be tested by inserting a stub, so that the target proxy process can collect information in the target application process to be tested and send the collected information to the security detection engine for security detection.

[0088] In the embodiment of the present application, each target application process to be tested is instrumented one by one.

[0089] The agent file is installed for each target application process to be tested through the su command to start the corresponding target agent process for the target application process to be tested. Each target agent process can obtain information in the target application process to be tested corresponding to the target agent process and send the obtained information to the security detection engine.

[0090] Specifically, the information acquired by the target agent process from the corresponding target application process to be tested may include information such as the request received by the target application process to be tested and the IP address of the requester that sent the request.

[0091] During the insertion, the embodiment of the present application further determines whether the insertion is successful.

[0092] In one embodiment of the present application, the multi-application security detection method further includes:

[0093] Whenever a target application process to be tested is instrumented, other processes other than the target application process to be tested are traversed to determine whether there is a target proxy process corresponding to the target application process to be tested;

[0094] If not, log an error and exit.

[0095] After a target application process to be tested is instrumented, if the instrumentation is successful, a target proxy process corresponding to the target application process to be tested should have been generated; if there is no target proxy process corresponding to the target application process to be tested, it means that the instrumentation has failed. At this time, by recording the error log, the cause of the error can be analyzed for repair.

[0096] In one embodiment of the present application, the multi-application security detection method further includes:

[0097] Whenever a target application process to be tested is instrumented, an attempt is made to access a port of the target application process to be tested;

[0098] If the port of the target application process to be tested cannot be accessed, an error log is recorded, all created target proxy processes are stopped, and the process exits.

[0099] In one embodiment of the present application, if the port of the target application process to be tested cannot be accessed, an error log is recorded, including: if the port of the target application process to be tested cannot be accessed after trying to access the port of the target application process to be tested for a predetermined number of times, an error log is recorded.

[0100] The predetermined number can be set according to actual needs, for example, it can be set to 50. Then, the port of the target application process to be tested can be tried up to 50 times; if it cannot be accessed, an error log is recorded, all created target agent processes are stopped, and the system exits.

[0101] If the port of the target application process to be tested cannot be accessed after multiple attempts, it means that the target agent process has affected the normal operation of the target application process to be tested. At this time, by stopping all created target agent processes, the factors affecting the normal operation of the target application process to be tested can be eliminated, and the normal operation of the target application process to be tested can be prioritized to avoid affecting the normal business of the target application process to be tested.

[0102] Figure 3B FIG. 1 is a flow chart showing a process of instrumenting a process according to an exemplary embodiment. Figure 3B As shown, it includes the following processes:

[0103] Step 310, obtaining the screened process pid array.

[0104] The process pid array stores the process pids that meet the instrumentation conditions.

[0105] Step 320, obtaining process information according to the process pid.

[0106] Specifically, you can use the following code to get process information based on the process pid:

[0107] java_path=$(readlink-f / proc / $pid / exe)

[0108] tomcat_home=$(strings / proc / $pid / cmdline|awk-F=' / -Dcatalina.home / {print$2}')

[0109] tomcat_user=$(getent passwd$tomcat_uid|awk-F:'{print$1}');

[0110] The instrumentation command may be generated based on the acquired process information. Specifically, the following instrumentation command may be generated based on the acquired process information:

[0111] su-"$tomcat_user"-c"$java_path-jar

[0112] installAgent.jar$tomcat_home".

[0113] Step 330, execute the instrumentation commands one by one.

[0114] Run the instrumentation command for each process indicated by pid one by one, so as to create a target proxy process that can communicate with each process.

[0115] Step 340, traverse the processes to determine whether there is an agent process corresponding to the current process.

[0116] If yes, execute step 360 ; if no, execute step 350 .

[0117] Step 350, exit the process and record an error log.

[0118] Step 360, determine whether the port of the instrumented process can be accessed.

[0119] If no, execute step 370; if yes, execute step 380.

[0120] Step 370, exit the process, record the error log and stop all agent processes.

[0121] Step 380, enter the interactive detection process.

[0122] Interactive security detection is performed through the created agent process.

[0123] Next, combine Figure 4 The solution of the embodiment of the present application is further introduced. Figure 4 FIG. 1 is a schematic diagram of the overall process of performing security detection on an application process to be tested according to an exemplary embodiment. Figure 4 As shown, the following processes may be included:

[0124] Step 410: Start the application process to be tested.

[0125] After starting the application process to be tested, perform automated batch instrumentation, including the following steps:

[0126] Step 420, check whether the environment meets the instrumentation conditions.

[0127] Check the environment of the application process under test.

[0128] Step 430, obtain the process name.

[0129] Step 440, analyzing whether the process meets the instrumentation condition.

[0130] Step 450, executing the instrumentation commands in batches according to the process IDs.

[0131] Step 460, check the instrumentation status.

[0132] If the insertion fails, step 470 is executed; if the insertion succeeds, step 480 is executed.

[0133] Step 470, record the log and stop the process.

[0134] Step 480, perform interactive detection.

[0135] To sum up, according to the multi-application security detection method provided in the embodiment of the present application, automatic batch instrumentation can be realized, which can bring convenience to users and save users' time; on this basis, by performing security detection based on the information collected by the target agent process, the efficiency of security detection is significantly improved, and the time required for the overall interactive detection process is reduced, so that users can devote more energy to how to detect and fix vulnerabilities.

[0136] The present application also provides a multi-application safety detection device. The following is an embodiment of the device of the present application.

[0137] Figure 5 FIG. 1 is a block diagram of a multi-application security detection device according to an exemplary embodiment. Figure 5 As shown, the device 500 includes:

[0138] The detection module 510 is configured to detect whether the operating environment of the multiple application processes to be tested meets the first instrumentation condition after starting the multiple application processes to be tested;

[0139] The acquisition and determination module 520 is configured to acquire information related to each application process to be tested if the operating environment satisfies the first instrumentation condition, and determine a target application process to be tested that satisfies the second instrumentation condition from among the multiple application processes to be tested based on the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit that the application process to be tested depends on, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested;

[0140] The instrumentation module 530 is configured to create a corresponding target proxy process for each target application process to be tested through instrumentation, so that the target proxy process collects information in the corresponding target application process to be tested, and sends the collected information to the security detection engine for security detection.

[0141] According to a third aspect of the present application, an electronic device capable of implementing the above method is also provided.

[0142] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0143] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present application is described. Figure 6 The electronic device 600 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.

[0144] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610).

[0145] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps described in the above “Example Method” section of this specification according to various exemplary embodiments of the present application.

[0146] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .

[0147] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0148] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0149] The electronic device 600 may also communicate with one or more external devices 800 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650, such as communicating with a display unit 640. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. As shown, the network adapter 660 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0150] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0151] According to the fourth aspect of the present application, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present application can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary implementations of the present application described in the above "Exemplary Method" section of the present specification.

[0152] refer to Figure 7 As shown, a program product 700 for implementing the above method according to an embodiment of the present application is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0153] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0154] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0155] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0156] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0157] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0158] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be performed without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A multi-application security detection method, It is characterized in that The method comprises: After starting multiple application processes to be tested, detecting whether the operating environment of the multiple application processes to be tested meets the first plugging condition; the detecting whether the operating environment of the multiple application processes to be tested meets the first plugging condition includes the following four items: detecting whether it is possible to switch to the root user through the su command; detecting whether the proxy file used to create the proxy process exists in the specified directory; detecting whether the current memory occupancy ratio reaches a predetermined memory occupancy ratio threshold; detecting whether the virtual machine version on which the operation of the application process to be tested depends meets the predetermined requirements; when the operating environment does not meet any of the above items, exiting the process of executing the multi-application security detection method; If the operating environment satisfies the first instrumentation condition, information related to each application process to be tested is obtained, and a target application process to be tested that meets the second instrumentation condition is determined from the multiple application processes to be tested based on the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested; the second instrumentation condition includes: determining that the process type information in the startup parameter information of the application process to be tested is a specified type; determining that the process type information in the startup parameter information of the application process to be tested is a specified type according to the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends The software development kit version supports security detection by determining that the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends support security detection; determining that the user name of the user who can start the process is obtained; determining that the current user has root authority or the user ID of the current user is consistent with the user ID that starts the application process to be tested; determining that the proxy parameters in the application process to be tested do not include the proxy parameters corresponding to the target proxy process; the target application process to be tested that meets the second plugging condition is determined from the multiple application processes to be tested based on the information related to each application process to be tested, including: if the current application process to be tested does not meet any of the second plugging conditions, ignoring the current application process to be tested, and continuing to judge the next application process to be tested; A corresponding target proxy process is created for each target application process to be tested through the insertion, so that the target proxy process can collect information in the corresponding target application process to be tested, and send the collected information to the security detection engine for security detection.

2. The method according to claim 1, It is characterized in that The method further comprises: Whenever a target application process to be tested is instrumented, other processes other than the target application process to be tested are traversed to determine whether there is a target proxy process corresponding to the target application process to be tested; If not, log an error and exit.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: Whenever a target application process to be tested is instrumented, an attempt is made to access a port of the target application process to be tested; If the port of the target application process to be tested cannot be accessed, an error log is recorded, all created target proxy processes are stopped, and the process exits.

4. The method according to claim 1, It is characterized in that The step of creating a corresponding target proxy process for each target application process to be tested by inserting a stub includes: For each target application process to be tested, a target proxy process capable of communicating with the target application process to be tested is created for the target application to be tested by inserting a stub, so that the target proxy process can collect information in the target application process to be tested and send the collected information to the security detection engine for security detection.

5. A multi-application safety detection device, It is characterized in that The device comprises: The detection module is configured to detect whether the operating environment of the multiple application processes to be tested meets the first plugging condition after starting the multiple application processes to be tested; the detection of whether the operating environment of the multiple application processes to be tested meets the first plugging condition includes the following four items: detecting whether it is possible to switch to the root user through the su command; detecting whether the proxy file used to create the proxy process exists in the specified directory; detecting whether the current memory occupancy ratio reaches a predetermined memory occupancy ratio threshold; detecting whether the virtual machine version on which the operation of the application process to be tested depends meets the predetermined requirements; when the operating environment does not meet any of the above items, exiting the process of executing the multi-application security detection method; The acquisition and determination module is configured to acquire information related to each application process to be tested if the operating environment satisfies the first instrumentation condition, and determine a target application process to be tested that meets the second instrumentation condition from among the multiple application processes to be tested based on the information related to each application process to be tested, wherein the information related to each application process to be tested includes at least one of the following: startup parameter information of the application process to be tested, support information for security detection of the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends, the user ID of the current user, the permissions of the current user, and the proxy parameters in the application process to be tested; the second instrumentation condition includes: determining that the process type information in the startup parameter information of the application process to be tested is a specified type; determining that the process type information in the startup parameter information of the application process to be tested is a specified type based on the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends The software development kit version's support information for security detection determines that the version of the application process to be tested and the version of the software development kit on which the application process to be tested depends support security detection; determines that the user name of the user who can start the process is obtained; determines that the current user has root authority or that the user ID of the current user is consistent with the user ID that starts the application process to be tested; determines that the proxy parameters in the application process to be tested do not include the proxy parameters corresponding to the target proxy process; the acquisition and determination module determines the target application process to be tested that meets the second plugging condition from the multiple application processes to be tested based on the information related to each application process to be tested, and is further configured as follows: if the current application process to be tested does not meet any of the second plugging conditions, the current application process to be tested is ignored, and the next application process to be tested is continued to be judged; The instrumentation module is configured to create a corresponding target proxy process for each target application process to be tested through instrumentation, so that the target proxy process can collect information in the corresponding target application process to be tested, and send the collected information to the security detection engine for security detection.

6. A computer readable program medium, It is characterized in that The computer program instructions are stored therein, and when the computer program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 4.

7. An electronic device, It is characterized in that The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Compatibility test method and apparatus, computer device and medium

    CN109446069A

  • Browser testing method and device and computer equipment

    CN110837472A

  • Code coverage rate detection method and device

    CN113836006A

  • Binary multi-executive software instrumentation method based on dynamic instrumentation

    CN114860586A

  • Systems and methods for debugging and application development

    WO2021229295A1