Application security testing methods, devices and electronic devices
By generating pseudo-random user event streams in mobile applications for dynamic or static security detection, the problem of low manual detection efficiency of existing mobile application security detection tools is solved, and efficient and automated security detection and performance testing is achieved, suitable for complex services. Scene.
Patent Information
- Application Number
- CN202110454247.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-26
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2041-04-26
AI Technical Summary
The existing mobile application security detection tools have problems such as low manual detection efficiency, high workload, low degree of automation, single tool functions, and inability to adapt to complex business scenarios.
By receiving the installation package of the target application, a pseudo-random user event stream is generated, and sent to the target mobile terminal, the feedback data is captured in real time, dynamic or static security detection is performed, test reports are generated, and performance testing is supported to realize automated application detection. and privatized deployment.
It improves the automation of mobile application security detection, simplifies the detection process, enhances the privacy and security of detection, supports dynamic and static detection, adapts to complex business scenarios, and reduces the difficulty and time of detection.
Smart Images

Figure CN113157576B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method, device and electronic device for security detection of an application program. Background Art
[0002] There are many problems in the existing technology for implementing security testing of mobile applications (applications, hereinafter referred to as apps). First, the security detector is single, and most detection tools (such as Drozer) can only support static code detection. This method makes it impossible to perform penetration testing on user requests, which easily leads to missed tests. Second, the security detection platform (such as 360app vulnerability scanning) needs to upload software installation packages to third-party external platforms, which is prone to security risks such as unreleased apps being leaked or maliciously decompiled. Third, there are many types of security testing tools, and testers need to deploy a security testing environment on their local machines. The process is complicated and cannot effectively utilize environmental resources and share mobile devices. Fourth, security test reports cannot be uniformly managed and saved, and historical report results cannot be viewed. A special space needs to be opened up for manual storage and maintenance, which is inefficient and time-consuming. In summary, manual detection is inefficient and labor-intensive, and security testing tools have single functions and need to be used in combination. They cannot be adapted and expanded when facing complex business scenarios. Summary of the invention
[0003] The embodiments of the present invention provide a method, device and electronic device for security detection of application programs to solve the problems existing in the prior art of security detection of mobile applications, such as low manual detection efficiency, large workload, low degree of automation, single function of security testing tools, need to be used in combination, and inability to adapt and expand when faced with complex business scenarios.
[0004] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for security detection of an application program, comprising:
[0006] Receive the installation package of the target application of the current detection task, and determine the preset running time, task attributes and target mobile terminal;
[0007] Sending an installation request carrying the installation package of the target application to the target mobile terminal;
[0008] If the task attribute of the detection task is a dynamic detection task, generating a pseudo-random user event stream, and sending the pseudo-random user event stream to a target application installed on the target mobile terminal;
[0009] Capturing in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the data includes interface request data of the target application, forwarding the interface request data of the target application to a dynamic security detection tool for penetration testing;
[0010] When the execution time of the pseudo-random user event flow reaches the preset running time, the penetration test is stopped and a dynamic security test report is generated.
[0011] Optionally, generating a dynamic security test report includes:
[0012] Performing security rule matching on all feedback data of the pseudo-random user event stream;
[0013] Output the vulnerability type, vulnerability level and modification suggestions of the feedback data that does not comply with the security rules.
[0014] Optionally, if all feedback data of the pseudo-random user event stream includes performance data of the target application, the method further includes:
[0015] Collect performance data of the target application and generate a performance test report.
[0016] Optionally, it also includes: configuring a custom pre-test script;
[0017] Before generating a pseudo-random user event stream and sending the pseudo-random user event stream to a target application installed on the target mobile terminal, the method further includes:
[0018] At least one of user login, preset data storage, and authorization operations of the target application is automatically executed according to the customized pre-test script.
[0019] Optionally, also include:
[0020] If the task attribute of the detection task is a static detection task, the installation package of the target application is parsed, source code analysis and binary file analysis are performed on the target application, and a static test report is generated.
[0021] Optionally, after generating the dynamic security test report, the process further includes:
[0022] The dynamic security test report is sent to a defect management platform to generate a security repair task for the target application.
[0023] Optionally, also include:
[0024] receiving a first input for configuring a test task, and generating a test task configuration interface in response to the first input;
[0025] receiving a second input, and determining a target mobile terminal for the test task in response to the second input;
[0026] A third input is received, and in response to the third input, an installation package, a preset running time, and task attributes of the target application of the test task are configured.
[0027] Optionally, the receiving a second input and determining a target mobile terminal for the test task in response to the second input includes:
[0028] Get a list of available mobile terminals;
[0029] A second input is received, and in response to the second input, a target mobile terminal is determined from the list of available mobile terminals.
[0030] In a second aspect, an embodiment of the present invention further provides a security detection device for an application program, comprising:
[0031] A configuration module, used to receive the installation package of the target application of the current detection task, determine the preset running time, task attributes and target mobile terminal;
[0032] A sending module, used for sending an installation request carrying an installation package of the target application to the target mobile terminal;
[0033] A first execution module is used for generating a pseudo-random user event stream if the task attribute of the detection task is a dynamic detection task, and sending the pseudo-random user event stream to a target application installed on the target mobile terminal;
[0034] The first execution module is also used to capture in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the feedback data includes the interface request data of the target application, forward the interface request data of the target application to the dynamic security detection tool for penetration testing;
[0035] A generation module is used to stop the penetration test and generate a dynamic security test report when the execution time of the pseudo-random user event flow reaches the preset running time.
[0036] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the security detection method for an application program as described in any one of the first aspects are implemented.
[0037] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, on which a program is stored, and when the program is executed by a processor, the steps of the security detection method for an application program as described in any one of the first aspects are implemented.
[0038] In an embodiment of the present invention, when a dynamic detection task is executed, a generated pseudo-random user event stream is sent to a target application installed on a target mobile terminal, and all feedback data sent by the target mobile terminal for the pseudo-random user event stream is captured in real time. If the target application's interface request data is included therein, the target application's interface request data is forwarded to a dynamic security detection tool, and a penetration test is performed and a dynamic security test report is generated. The application security detection method of the present invention monitors the interface request interaction data issued by the target application, simulates attacks on it, and analyzes it to determine its security vulnerabilities, thereby providing a method for automatically performing target application detection online and supporting dynamic security detection. The target application's installation package and test report are privately deployed, and have better privacy and security. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0040] Figure 1 One of the flow charts of the security detection method of the application provided by the embodiment of the present invention;
[0041] Figure 2 A second flowchart of a method for detecting security of an application program provided by an embodiment of the present invention;
[0042] Figure 3 One of the structural schematic diagrams of the security detection device for an application provided by an embodiment of the present invention;
[0043] Figure 4 A second structural diagram of a security detection device for an application provided by an embodiment of the present invention;
[0044] Figure 5 This is one of the structural schematic diagrams of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] Please refer to Figure 1 , Figure 1 One of the flow diagrams of the security detection method for an application provided in an embodiment of the present invention; an embodiment of the present invention provides a security detection method for an application, including:
[0047] Step 11: Receive the installation package of the target application of the current detection task, and determine the preset running time, task attributes and target mobile terminal;
[0048] Step 12: Sending an installation request carrying the installation package of the target application to the target mobile terminal;
[0049] Step 13: if the task attribute of the detection task is a dynamic detection task, generate a pseudo-random user event stream, and send the pseudo-random user event stream to a target application installed on the target mobile terminal;
[0050] Step 14: capturing in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the data includes interface request data of the target application, forwarding the interface request data of the target application to a dynamic security detection tool for penetration testing;
[0051] Step 15: When the execution time of the pseudo-random user event flow reaches the preset running time, the penetration test is stopped and a dynamic security test report is generated.
[0052] In an embodiment of the present invention, when a dynamic detection task is executed, a generated pseudo-random user event stream is sent to a target application installed on a target mobile terminal, and all feedback data sent by the target mobile terminal for the pseudo-random user event stream is captured in real time. If the target application's interface request data is included therein, the target application's interface request data is forwarded to a dynamic security detection tool, and a penetration test is performed and a dynamic security test report is generated. The application security detection method of the present invention monitors the interface request interaction data issued by the target application, simulates attacks on it, and analyzes it to determine its security vulnerabilities, thereby providing a method for automatically performing target application detection online and supporting dynamic security detection. The target application's installation package and test report are privately deployed, and have better privacy and security.
[0053] In some embodiments of the present invention, optionally, generating a dynamic security test report includes:
[0054] Performing security rule matching on all feedback data of the pseudo-random user event stream;
[0055] Output the vulnerability type, vulnerability level and modification suggestions of the feedback data that does not comply with the security rules.
[0056] In the embodiment of the present invention, the pseudo-random user event stream simulates the user's click, input, sliding and other behaviors. All feedback data of the pseudo-random user event stream includes but is not limited to feedback data based on the user's click, input, sliding and other behaviors, such as interface request data for the target application interface, etc. By collecting feedback data and matching it with preset security rules, the vulnerability type, vulnerability level and modification suggestions of the target application are obtained through analysis. The dynamic security test report thus obtained is simple, convenient, accurate and highly automated.
[0057] In some embodiments of the present invention, optionally, the tool for generating a pseudo-random user event stream is a monkey tool.
[0058] In some embodiments of the present invention, optionally, a tool for capturing in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream and filtering the interface request data including the target application program is a Charles proxy tool.
[0059] In some embodiments of the present invention, the dynamic security detection tool that receives the interface request data of the target application is optionally a ZAP security detection tool. The interface request interaction data issued by the target application is monitored using the open API (Application Programming Interface) of ZAP, and the system is simulated attacked and analyzed to determine its security vulnerabilities. After the passive scan is completed, ZAP provides security vulnerabilities in the form of a report. The vulnerability types in the report are divided into high priority, medium priority, low priority, etc., to prompt the tester of possible security defects in the system.
[0060] In some embodiments of the present invention, optionally, before executing the dynamic security testing task, it is necessary to preset in advance a target mobile terminal with a target application installed, and connect the proxy of the target mobile terminal to the ip (Internet Protocol Address) address of a physical machine, wherein Charles and ZAP tools are pre-installed on the physical machine.
[0061] In some embodiments of the present invention, optionally, if all feedback data of the pseudo-random user event stream includes performance data of the target application, the method further includes:
[0062] Collect performance data of the target application and generate a performance test report.
[0063] In the embodiment of the present invention, the performance test of the application program can be performed while the security detection method of the application program is performed, and a performance test report is generated synchronously, which is highly practical.
[0064] In some embodiments of the present invention, optionally, an adb native command (Android Debug Bridge) is used to collect performance data of the Android app, wherein the performance data includes but is not limited to the CPU (central processing unit), memory, frame rate, crash data, etc. of the target mobile terminal, and the performance detection is completed synchronously and a performance report is issued.
[0065] In some embodiments of the present invention, optionally, it further includes: configuring a custom pre-test script;
[0066] Before generating a pseudo-random user event stream and sending the pseudo-random user event stream to a target application installed on the target mobile terminal, the method further includes:
[0067] At least one of user login, preset data storage, and authorization operations of the target application is automatically executed according to the customized pre-test script.
[0068] In the embodiment of the present invention, the security detection method of the application can pre-configure a custom pre-test script to realize the automatic execution of at least one of the user login, preset data storage, and authorization operations of the target application by the target application, and can flexibly adapt to the login, authorization and other operations of different applications. The script is customized, so that dynamic security detection can be realized. This solves the problem that most application detection in the prior art relies on pre-login, authorization and other operations, and the degree of automation is low.
[0069] In some embodiments of the present invention, optionally, the method further includes:
[0070] If the task attribute of the detection task is a static detection task, the installation package of the target application is parsed, source code analysis and binary file analysis are performed on the target application, and a static test report is generated.
[0071] In the embodiment of the present invention, static detection can be performed on binary or compressed source codes, and the tested application and test report are stored in the platform database, which is privately deployed with good privacy, and can prevent unreleased apk (Android application package) or ipa (iPhone Application) from being illegally decompiled and leaked to the outside.
[0072] In some embodiments of the present invention, optionally, the static security testing task supports both iOS and Android systems, using the mobsf open source detector, and the inspection items include but are not limited to: app basic information such as package name, MainActivity information, apk encryption and decryption, component exposure risks, manifest file analysis, source code analysis and binary file analysis, privacy compliance, api detection, etc.
[0073] In some embodiments of the present invention, optionally, after generating the dynamic security test report, the method further includes:
[0074] The dynamic security test report is sent to a defect management platform to generate a security repair task for the target application.
[0075] In an embodiment of the present invention, the test report is automatically sent to the defect management platform to generate a security repair task for the target application, which further improves the automation level of dynamic security detection and realizes a closed loop of dynamic security detection. The security repair task based on the test report is further applied to work areas such as defect tracking, task tracking, project tracking and agile management.
[0076] In some embodiments of the present invention, optionally, after generating the static test report, the method further includes:
[0077] The static test report is sent to a defect management platform to generate a security repair task for the target application.
[0078] In some embodiments of the present invention, optionally, the method further includes:
[0079] receiving a first input for configuring a test task, and generating a test task configuration interface in response to the first input;
[0080] receiving a second input, and determining a target mobile terminal for the test task in response to the second input;
[0081] A third input is received, and in response to the third input, an installation package, a preset running time, and task attributes of the target application of the test task are configured.
[0082] In an embodiment of the present invention, by configuring the target mobile terminal, the installation package of the target application, the preset running time and the task attributes of this test task in the configuration interface, the dynamic security performance test of the target application can be automatically executed, with a high degree of interactivity, low testing difficulty and a high degree of automation.
[0083] In some embodiments of the present invention, optionally, the receiving a second input and determining a target mobile terminal for the test task in response to the second input includes:
[0084] Get a list of available mobile terminals;
[0085] A second input is received, and in response to the second input, a target mobile terminal is determined from the list of available mobile terminals.
[0086] In some embodiments of the present invention, optionally, a method of obtaining the available mobile terminal list includes but is not limited to at least one of the following:
[0087] Call the device list acquisition interface of the mobile terminal management cluster to obtain the list of available mobile terminals;
[0088] A fourth input including a list of available mobile terminals is received.
[0089] In the embodiment of the present invention, after obtaining the available mobile terminal list, the target mobile terminal can be determined from the available mobile terminal list. The device status of the mobile terminal list can be updated in real time, ensuring that the target mobile terminals for the test task are all available terminals, further improving the automation and success rate of the test.
[0090] See also Figure 2 , Figure 2 The second flowchart of the security detection method of the application provided by the embodiment of the present invention; wherein JobWorker is a security detection platform, the target mobile terminal is a mobile phone, and the method includes:
[0091] Step 21: Create a task and go to step 22;
[0092] Step 22: Determine whether it is a static detection task, if yes, proceed to step 231, otherwise proceed to step 241;
[0093] Step 231: Create a static security test task and proceed to step 232;
[0094] Step 232: call the mobsf detection service to perform static detection; go to step 25;
[0095] Step 241: Call the mobile phone list interface provided by JobWorker to obtain a list of remote available mobile phone devices, and then proceed to step 242;
[0096] Step 242: specify the installation package and the running time, and then proceed to step 243;
[0097] Step 243: Create a dynamic security test task and proceed to step 244;
[0098] Step 244: Start the monkey service, generate a user click behavior, and go to step 245;
[0099] Step 245: Start the ZAP service, use the proxy to forward the user request to the ZAP service, and go to step 246;
[0100] Step 246: Use the ZAP tool to perform security detection, and simultaneously use the adb native command to collect performance data, and then go to step 25;
[0101] Step 25: End the current test, generate a test report and send an email or enterprise WeChat notification to the target object.
[0102] In an embodiment of the present invention, when a dynamic detection task is performed, a pseudo-random user event stream generated by a monkey tool is sent to a target application installed on a target mobile terminal, and all feedback data sent by the target mobile terminal for the pseudo-random user event stream is captured in real time. If the interface request data of the target application is included, the interface request data of the target application is forwarded to a dynamic security detection tool ZAP tool to perform a penetration test and generate a dynamic security test report; at the same time, performance data is collected from the feedback data to generate a performance test report; when a static detection task is performed, the mobsf detection tool is called to generate a static test report. The security detection method of the application of the present invention monitors the interface request interaction data issued by the target application, simulates attacks and analyzes it to determine its security vulnerabilities, and provides a method for automatically performing target application detection online and supporting dynamic and static security detection, and can generate a performance test report at the same time. The installation package and test report of the target application are privately deployed, and the privacy and security are better.
[0103] In some embodiments of the present invention, optionally, after the task is created, a task list page is generated, on which information such as the task name, tester, test type, etc. can be viewed. After clicking to start the task, the task status changes to being executed.
[0104] In some embodiments of the present invention, optionally, the dynamic security test task is stored in a Kafka (a distributed queue system) queue, and tasks are taken from the queue in sequence when executing tasks. When a dynamic security test task is completed, a new task is taken from the Kafka queue for execution, and the cycle continues.
[0105] In some embodiments of the present invention, optionally, the function of starting the money service is to simulate the user's actions such as clicking, inputting, and sliding.
[0106] In some embodiments of the present invention, optionally, the monkey tool adopts an optimized Maximmonkey algorithm, which has the advantages of fast execution speed, high platform compatibility, and high scene granularity, and has an anti-bounce mechanism, an anti-sleep mechanism, a fuse mechanism, automatic save of crash stack, and random automatic input functions.
[0107] In some embodiments of the present invention, optionally, while executing Monkey, Jobworker will synchronously collect performance information for displaying Android performance results.
[0108] In some embodiments of the present invention, optionally, native commands of adb are used to obtain CPU, memory, installation time, startup time, traffic consumption, page loading utilization, FPS (Frames Per Second), crash stack, etc. to achieve the collection of performance data of the target application.
[0109] In some embodiments of the present invention, optionally, after starting the dynamic detection task, the tester can click the View Mobile Phone Running Status button on the configuration interface to view the execution status of the remote mobile phone to facilitate troubleshooting.
[0110] In some embodiments of the present invention, the execution status of the remote mobile phone can be checked with the help of the open source tool atxsever; atxserver is an open source Android device management cluster with the advantage of convenient device access. After the mobile phone is connected to the computer via a data cable and initialized, it can run automated scripts, view logs, and remotely operate and view the status of the mobile phone. At present, the atxserver mobile phone management platform is deployed on the machine where the Jobworker service is deployed, realizing mobile phone cluster management, facilitating remote device sharing, operation and borrowing of remote devices, etc.
[0111] In some embodiments of the present invention, optionally, if it is a dynamic test, an Android performance report and a ZAP dynamic security test report will be generated; if it is a static test, a static test report will be generated by mobsf.
[0112] In some embodiments of the present invention, optionally, the method further includes: uploading the test report to a file server, and a user can access the file server through a browser to view the test report.
[0113] In some embodiments of the present invention, optionally, the file server provides an upload and download interface. After the static report and the dynamic report are generated locally, the upload interface of the file server is called to upload the report to the file server. The file server returns an access link to the report, which is stored in the database. The user can view the report through the browser.
[0114] In some embodiments of the present invention, optionally, the historical running task report is also saved, and the test personnel can view the test report of the task and download it locally.
[0115] See also Figure 3 , Figure 3 This is one of the structural diagrams of the security detection device for an application provided in an embodiment of the present invention; the embodiment of the present invention also provides a security detection device 30 for an application, including:
[0116] Configuration module 31, used to receive the installation package of the target application of the current detection task, determine the preset running time, task attributes and target mobile terminal;
[0117] A sending module 32, configured to send an installation request carrying an installation package of the target application to the target mobile terminal;
[0118] A first execution module 33 is used to generate a pseudo-random user event stream if the task attribute of the detection task is a dynamic detection task, and send the pseudo-random user event stream to a target application installed on the target mobile terminal;
[0119] The first execution module 33 is also used to capture in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the data includes the interface request data of the target application, forward the interface request data of the target application to the dynamic security detection tool for penetration testing;
[0120] The generating module 34 is used to stop the penetration test and generate a dynamic security test report when the execution time of the pseudo-random user event flow reaches the preset running time.
[0121] In an embodiment of the present invention, when the security detection device of an application performs a dynamic detection task, by sending the pseudo-random user event stream generated by the monkey tool to the target application installed on the target mobile terminal, all feedback data sent by the target mobile terminal for the pseudo-random user event stream is captured in real time. If the interface request data of the target application is included, the interface request data of the target application is forwarded to the dynamic security detection tool ZAP tool to perform a penetration test and generate a dynamic security test report; at the same time, performance data is collected from the feedback data to generate a performance test report; when performing a static detection task, the mobsf detection tool is called to generate a static test report. The security detection device of the application of the present invention monitors the interface request interaction data issued by the target application, simulates attacks and analyzes it to determine its security vulnerabilities, and provides a device that automatically performs target application detection online and supports dynamic and static security detection, and can generate a performance test report at the same time. The installation package and test report of the target application are privately deployed, and the privacy and security are better.
[0122] In some embodiments of the present invention, optionally, the generation module 34 is also used to perform security rule matching on all feedback data of the pseudo-random user event stream; and output the vulnerability type, vulnerability level and modification suggestions of the feedback data that does not comply with the security rules.
[0123] In the embodiment of the present invention, the pseudo-random user event stream simulates the user's click, input, sliding and other behaviors. All feedback data of the pseudo-random user event stream includes but is not limited to feedback data based on the user's click, input, sliding and other behaviors, such as interface request data for the target application interface, etc. By collecting feedback data and matching it with preset security rules, the vulnerability type, vulnerability level and modification suggestions of the target application are obtained through analysis. The dynamic security test report thus obtained is simple, convenient, accurate and highly automated.
[0124] In some embodiments of the present invention, optionally, the tool for generating a pseudo-random user event stream is a monkey tool.
[0125] In some embodiments of the present invention, optionally, a tool for capturing in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream and filtering the interface request data including the target application program is a Charles proxy tool.
[0126] In some embodiments of the present invention, the dynamic security detection tool that receives the interface request data of the target application is optionally a ZAP security detection tool. The API opened by ZAP is used to monitor the interface request interaction data issued by the target application, and simulate attacks and analysis are performed on the system to determine its security vulnerabilities. After the passive scan is completed, ZAP provides security vulnerabilities in the form of a report. The vulnerability types in the report are divided into high priority, medium priority, low priority, etc., to prompt the tester of possible security defects in the system.
[0127] In some embodiments of the present invention, optionally, before executing a dynamic security testing task, it is necessary to preset a target mobile terminal with a target application installed, and connect the proxy of the target mobile terminal to the IP address of a physical machine, wherein Charles and ZAP tools are pre-installed on the physical machine.
[0128] In some embodiments of the present invention, optionally, if all feedback data of the pseudo-random user event stream includes performance data of the target application, the generation module 34 is further used to collect the performance data of the target application and generate a performance test report.
[0129] In the embodiment of the present invention, the performance test of the application program can be performed while the security detection method of the application program is performed, and a performance test report is generated synchronously, which is highly practical.
[0130] In some embodiments of the present invention, optionally, adb native commands are used to collect performance data of Android apps, wherein the performance data includes but is not limited to CPU, memory, frame rate, crash and other data of the target mobile terminal, and the performance detection is completed synchronously and a performance report is issued.
[0131] In some embodiments of the present invention, optionally, the configuration module 31 is also used to configure a custom pre-test script;
[0132] The first execution module 33 is also used to automatically execute at least one of user login, preset data storage, and authorization operations of the target application according to the custom pre-test script before generating a pseudo-random user event stream and sending the pseudo-random user event stream to the target application installed on the target mobile terminal.
[0133] In the embodiment of the present invention, the security detection method of the application can pre-configure a custom pre-test script to realize the automatic execution of at least one of the user login, preset data storage, and authorization operations of the target application by the target application, and can flexibly adapt to the login, authorization and other operations of different applications. The script is customized, so that dynamic security detection can be realized. This solves the problem that most application detection in the prior art relies on pre-login, authorization and other operations, and the degree of automation is low.
[0134] In some embodiments of the present invention, optionally, it also includes: a second execution module 35, which is used to parse the installation package of the target application, perform source code analysis and binary file analysis on the target application, and generate a static test report if the task attribute of the detection task is a static detection task.
[0135] In the embodiment of the present invention, static detection can be performed on binary or compressed source code, and the tested application and test report are stored in the platform database, which is privately deployed with good privacy and can prevent unreleased apk or ipa from being illegally decompiled and leaked to the outside.
[0136] In some embodiments of the present invention, optionally, the static security testing task supports both iOS and Android systems, using the open source detector mobsf, and the inspection items include but are not limited to: app basic information such as package name, MainActivity information, apk encryption and decryption, component exposure risks, manifest file analysis, source code analysis and binary file analysis, privacy compliance, API detection, etc.
[0137] In some embodiments of the present invention, optionally, the static test report is generated by the second execution module.
[0138] In some embodiments of the present invention, optionally, a static test report is generated by a generation module.
[0139] In some embodiments of the present invention, optionally, the generating module 34 is further configured to send the dynamic security testing report to a defect management platform after generating the dynamic security testing report, and to generate a security repair task for the target application.
[0140] In an embodiment of the present invention, the test report is automatically sent to the defect management platform to generate a security repair task for the target application, which further improves the automation level of dynamic security detection and realizes a closed loop of dynamic security detection. The security repair task based on the test report is further applied to work areas such as defect tracking, task tracking, project tracking and agile management.
[0141] In some embodiments of the present invention, optionally, the generating module 34 is further configured to send the static test report to a defect management platform to generate a security repair task for the target application.
[0142] In some embodiments of the present invention, optionally, the method further includes:
[0143] The configuration module 31 is further used to receive a first input for configuring a test task, and generate a test task configuration interface in response to the first input;
[0144] The configuration module 31 is further configured to receive a second input, and determine a target mobile terminal for the test task in response to the second input;
[0145] The configuration module 31 is further configured to receive a third input, and in response to the third input, configure an installation package, a preset running time, and task attributes of the target application of the test task.
[0146] In an embodiment of the present invention, by configuring the target mobile terminal, the installation package of the target application, the preset running time and the task attributes of this test task in the configuration interface, the dynamic security performance test of the target application can be automatically executed, with a high degree of interactivity, low testing difficulty and a high degree of automation.
[0147] In some embodiments of the present invention, optionally, the configuration module 31 is further configured to obtain a list of available mobile terminals; receive a second input, and determine a target mobile terminal from the list of available mobile terminals in response to the second input.
[0148] In the embodiment of the present invention, after obtaining the available mobile terminal list, the target mobile terminal can be determined from the available mobile terminal list. The device status of the mobile terminal list can be updated in real time, ensuring that the target mobile terminals for the test task are all available terminals, further improving the automation and success rate of the test.
[0149] In some embodiments of the present invention, optionally, a method of obtaining the available mobile terminal list includes but is not limited to at least one of the following:
[0150] Call the device list acquisition interface of the mobile terminal management cluster to obtain the list of available mobile terminals;
[0151] Receive a fourth input containing a list of available mobile terminals. See Figure 4 , Figure 4 The second structural diagram of the security detection device for an application provided by an embodiment of the present invention; the security detection device 40 for an application includes:
[0152] The security testing platform 41 is used to configure the installation package, preset running time, task attributes and target mobile terminal of the target application of the current detection task;
[0153] The first detection module 42 has a built-in monkey tool, a Charles proxy tool, a ZAP security detection tool, a UIautomator2 custom test tool, and an adb native command tool; wherein the Charles proxy tool is used to capture in real time all feedback data for the pseudo-random user event stream sent by the target mobile terminal, filter the interface request data including the target application, and forward the interface request data of the target application to the dynamic security detection tool; the monkey tool is used to generate a pseudo-random user event stream when the task attribute of the detection task is a dynamic detection task, and send the pseudo-random user event stream to the target application installed on the target mobile terminal. In the program; the ZAP security detection tool is used to capture in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if it includes the interface request data of the target application, perform a penetration test and generate a dynamic security test report; the UIautomator2 custom test tool is used to automatically execute at least one of the user login, preset data storage, and authorization operations of the target application according to the custom pre-test script when receiving the custom pre-test script; the adb native command tool is used to collect the performance data of the target application and generate a performance test report if all feedback data of the pseudo-random user event stream includes the performance data of the target application.
[0154] The second detection module 43 has a built-in mobsf detector, which is used to parse the installation package of the target application, perform source code analysis and binary file analysis on the target application, and generate a static test report when the task attribute of the detection task is a dynamic detection task.
[0155] File server 44; provides an upload and download interface, and retains the test report of this test task, the test includes: at least one of a dynamic security test report, a performance test report and a static test report.
[0156] In an embodiment of the present invention, when a dynamic detection task is performed, a pseudo-random user event stream generated by a monkey tool is sent to a target application installed on a target mobile terminal, and all feedback data sent by the target mobile terminal for the pseudo-random user event stream is captured in real time. If the target application's interface request data is included, the target application's interface request data is forwarded to a dynamic security detection tool, a ZAP tool, to perform a penetration test and generate a dynamic security test report; at the same time, performance data is collected from the feedback data to generate a performance test report; when a static detection task is performed, the mobsf detection tool is called to generate a static test report. The security detection device for an application of the present invention monitors the interface request interaction data issued by the target application, simulates attacks on it, and analyzes it to determine its security vulnerabilities, thereby providing a device that automatically performs online target application detection and supports dynamic and static security detection, and can generate a performance test report at the same time. The installation package and test report of the target application are privately deployed, and the privacy and security are better.
[0157] In some embodiments of the present invention, the security testing platform is optionally an interface management system, which is a service deployed on a physical machine such as a Mac mini physical machine, and directly interacts with the tester to create tasks, distribute tasks, display and store reports, and receive callbacks for successful task execution. The system directly communicates with the mobile phone and is responsible for providing a mobile phone list, executing the issued dynamic detection tasks, executing dynamic detection pre-scripts, executing monkey, generating dynamic test reports, and completing Android performance testing.
[0158] In some embodiments of the present invention, optionally, the security testing platform also provides a security knowledge base to facilitate security issue modification personnel to query security issue information. The security knowledge base contains security risk descriptions, hazard descriptions, repair suggestions, repair reference links, etc.
[0159] In the embodiment of the present invention, optionally, the first interface is a device list acquisition interface of the mobile phone management cluster.
[0160] The present invention also provides an electronic device, see Figure 5 , Figure 5 One of the structural schematic diagrams of the electronic device provided by the embodiment of the present invention;
[0161] The electronic device 50 includes: a processor 51, a memory 52, and a program stored in the memory 52 and executable on the processor 51. When the program is executed by the processor 51, the various processes of an embodiment of a method for security detection of an application as described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0162] An embodiment of the present invention also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the embodiment of the security detection method for the application program described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0163] The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0164] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A security detection method for an application program, It is characterized in that include: Receive the installation package of the target application of the current detection task, and determine the preset running time, task attributes and target mobile terminal; Sending an installation request carrying the installation package of the target application to the target mobile terminal; If the task attribute of the detection task is a dynamic detection task, generating a pseudo-random user event stream, and sending the pseudo-random user event stream to a target application installed on the target mobile terminal; Capturing in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the data includes interface request data of the target application, forwarding the interface request data of the target application to a dynamic security detection tool for penetration testing; When the execution time of the pseudo-random user event flow reaches the preset running time, the penetration test is stopped and a dynamic security test report is generated; Generating a dynamic security test report includes: Performing security rule matching on all feedback data of the pseudo-random user event stream; Output the vulnerability type, vulnerability level and modification suggestions of the feedback data that does not comply with the security rules; If all feedback data of the pseudo-random user event stream include performance data of the target application, the method further includes: Collecting performance data of the target application and generating a performance test report; The method further includes: receiving a first input for configuring a test task, generating a test task configuration interface in response to the first input; receiving a second input, determining a target mobile terminal for the test task in response to the second input; receiving a third input, configuring an installation package, a preset running time, and task attributes of a target application for the test task in response to the third input; The receiving the second input and determining the target mobile terminal of the test task in response to the second input comprises: obtaining a list of available mobile terminals; receiving the second input and determining the target mobile terminal from the list of available mobile terminals in response to the second input; The dynamic security detection tool that receives the interface request data of the target application is a ZAP security detection tool.
2. The method for detecting the security of an application according to claim 1, It is characterized in that Also includes: Configure custom pre-test scripts; Before generating a pseudo-random user event stream and sending the pseudo-random user event stream to a target application installed on the target mobile terminal, the method further includes: At least one of user login, preset data storage, and authorization operations of the target application is automatically executed according to the customized pre-test script.
3. The method for detecting the security of an application according to claim 1, It is characterized in that Also includes: If the task attribute of the detection task is a static detection task, the installation package of the target application is parsed, source code analysis and binary file analysis are performed on the target application, and a static test report is generated.
4. The method for detecting the security of an application according to claim 1, It is characterized in that After the dynamic security test report is generated, the following steps are also included: The dynamic security test report is sent to a defect management platform to generate a security repair task for the target application.
5. A security detection device for an application program, It is characterized in that include: A configuration module, used to receive the installation package of the target application of the current detection task, determine the preset running time, task attributes and target mobile terminal; A sending module, used for sending an installation request carrying an installation package of the target application to the target mobile terminal; A first execution module is used for generating a pseudo-random user event stream if the task attribute of the detection task is a dynamic detection task, and sending the pseudo-random user event stream to a target application installed on the target mobile terminal; The first execution module is also used to capture in real time all feedback data sent by the target mobile terminal for the pseudo-random user event stream, and if the feedback data includes the interface request data of the target application, forward the interface request data of the target application to the dynamic security detection tool for penetration testing; A generation module, used for stopping the penetration test and generating a dynamic security test report when the execution time of the pseudo-random user event flow reaches the preset running time; The generation module is further used to match all feedback data of the pseudo-random user event stream with security rules; output vulnerability types, vulnerability levels and modification suggestions for feedback data that do not meet the security rules; The generating module is further configured to collect the performance data of the target application and generate a performance test report if all feedback data of the pseudo-random user event stream includes the performance data of the target application; The configuration module is further configured to receive a first input for configuring a test task, and generate a test task configuration interface in response to the first input; Also used for receiving a second input, and determining a target mobile terminal for the test task in response to the second input; Also used to receive a third input, and in response to the third input, configure the installation package, preset running time and task attributes of the target application of the test task; Wherein, in response to the second input, determining the target mobile terminal of the test task includes: obtaining a list of available mobile terminals; receiving the second input, and in response to the second input, determining the target mobile terminal from the list of available mobile terminals; The dynamic security detection tool that receives the interface request data of the target application is a ZAP security detection tool.
6. An electronic device, It is characterized in that include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the security detection method for an application program as claimed in any one of claims 1 to 4.
7. A readable storage medium, It is characterized in that The readable storage medium stores a program, and when the program is executed by a processor, the steps of the security detection method for an application program according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Detection method and system for electric power mobile application software vulnerabilities
CN108595952A
Performance test method and device and computer readable storage medium
CN109766258A
Mobile App vulnerability detection method and device
CN111177715A
