Android application security detection method and device

By storing and analyzing the operation records of Android applications, and identifying attack behaviors based on the operation condition table, the problem of low accuracy in the existing technology is solved and more efficient security detection is achieved.

CN112380540BActive Publication Date: 2024-09-03WUHAN HONGXU INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011267911.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2024-09-03
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

Existing Android application security detection methods have low accuracy and cannot effectively identify simulated clicks and unknown hook plug-ins, causing attacks to be bypassed.

Method used

By receiving and storing the operation records of the application to be detected, and combining the pre-obtained operation condition table for security detection, it can determine whether the interface switching time and business logic request are legal, and identify simulated clicks and Hook attacks.

Benefits of technology

It improves the accuracy of Android application security detection, can detect attack behaviors more effectively, and enhances the simplicity and adaptability of security detection steps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112380540B
    Figure CN112380540B
Patent Text Reader

Abstract

The present invention provides an Android application security detection method and device, comprising: receiving an operation record of the current operation of an application to be detected sent by a client, and adding the client operation record to an operation record table; performing security detection according to the client operation record table and a pre-acquired operation condition table; wherein the client operation record table is used to store the operation record of the historical operation of the application to be detected; and the client operation condition table includes the operation information of all legal operations of the application to be detected. The Android application security detection method and device provided by the present invention determines whether the application to be detected has attack behavior according to the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table, and can detect the attack behavior more accurately and effectively, and the steps of security detection are simpler and more adaptable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to an Android application security detection method and device. Background Art

[0002] On the Android system, applications may be attacked by hackers to obtain user information, divert traffic, and make illegal profits. Typical attack methods include: using simulated clicks to automatically log in and perform illegal operations; or using Hook technology to automatically obtain user or application data and perform illegal automated batch processing.

[0003] Existing Android application security detection methods mainly include root detection or hook plug-in detection. However, in actual applications, if the attack behavior is disguised, the above security detection may be bypassed, and the existing hook plug-in detection cannot identify unknown hook plug-ins, resulting in low accuracy of the above security detection methods. Summary of the invention

[0004] The present invention provides an Android application security detection method and device, which are used to solve the defect of low accuracy of the application security detection method in the prior art and realize more accurate Android application security detection.

[0005] The present invention provides an Android application security detection method, comprising:

[0006] Receive the operation record of the current operation of the application to be detected sent by the client, and add the operation record to the operation record table;

[0007] Perform safety testing according to the operation record table and the pre-acquired operation condition table;

[0008] The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected.

[0009] According to an Android application security detection method provided by the present invention, the security detection is performed according to the operation record table and the pre-acquired operation condition table, specifically comprising:

[0010] If it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table;

[0011] If it is determined that the time for switching the interface is less than a preset time threshold, it is determined that the current operation is a simulated click.

[0012] According to an Android application security detection method provided by the present invention, the security detection is performed according to the operation record table and the pre-acquired operation condition table, specifically comprising:

[0013] Receiving a current business logic request of the application to be detected;

[0014] Acquire the operation corresponding to the current business logic request according to the operation condition table;

[0015] If it is determined that there is no operation record of the operation corresponding to the current business logic request in the operation record table, it is determined that the current business logic request is a Hook attack.

[0016] According to an Android application security detection method provided by the present invention, after obtaining the operation corresponding to the current business logic request according to the operation condition table, the method further includes:

[0017] If it is determined that an operation record of the operation corresponding to the current business logic request exists in the operation record table, then obtaining a preceding operation of the operation corresponding to the current business logic request according to the operation condition table;

[0018] If it is determined that there is no operation record of the preceding operation in the operation record table, it is determined that the current business logic request is a Hook attack.

[0019] According to an Android application security detection method provided by the present invention, after performing security detection according to the operation record table and the pre-acquired operation condition table, the method further includes:

[0020] If an attack behavior is detected in the application to be detected, an alarm message is sent to the client and an alarm log is generated.

[0021] The present invention provides an Android application security detection method, comprising:

[0022] Collect the operation records of the current operation of the application to be tested;

[0023] Sending the operation record to an application server so that the application server receives the operation record, adds the operation record to an operation record table, and performs security detection according to the operation record table and a pre-acquired operation condition table;

[0024] The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected.

[0025] The present invention also provides an Android application security detection device, comprising:

[0026] A recording module, used for receiving an operation record of the current operation of the application to be detected sent by the client, and adding the operation record to an operation record table;

[0027] A detection module, used for performing safety detection according to the operation record table and the pre-acquired operation condition table;

[0028] The operation record table is used to store the operation information of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected.

[0029] The present invention also provides an Android application security detection device, comprising:

[0030] A collection module, used to collect operation records of the current operation of the application to be detected;

[0031] A communication module, used for sending the operation record to an application server, so that the application server receives the operation record, adds the operation record to an operation record table, and performs security detection according to the operation record table and a pre-acquired operation condition table;

[0032] The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected.

[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned Android application security detection methods are implemented.

[0034] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned Android application security detection methods are implemented.

[0035] The Android application security detection method and device provided by the present invention can determine whether the application to be detected has attack behavior based on the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table. The attack behavior can be detected more accurately and effectively, and the security detection steps are simpler and more adaptable. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 It is a flow chart of the Android application security detection method provided by the present invention;

[0038] Figure 2 It is a flow chart of the Android application security detection method provided by the present invention;

[0039] Figure 3 It is a structural schematic diagram of the Android application security detection device provided by the present invention;

[0040] Figure 4 It is a structural schematic diagram of the Android application security detection device provided by the present invention;

[0041] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0043] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0044] In order to overcome the above-mentioned problems in the prior art, the present invention provides an Android application security detection method and device. The inventive concept is to determine whether the operation or business logic request in the application to be detected is an attack behavior based on the operation records of the executed operations and the operation information of all legal operations. The security detection has higher accuracy and wider adaptability.

[0045] Figure 1 This is a flow chart of the Android application security detection method provided by the present invention. Figure 1 The Android application security detection method according to an embodiment of the present invention is described. Figure 1 As shown, the method includes: step S101, receiving an operation record of the current operation of the application to be detected sent by the client, and adding the operation record to an operation record table.

[0046] The operation record table is used to store the operation records of the historical operations of the application to be detected.

[0047] It should be noted that the execution subject of the Android application security detection method provided in the embodiment of the present invention is the application server.

[0048] Specifically, when the user uses the application to be detected, he can perform relevant operations in the application to be detected. The client can obtain the operation record of the current operation of the application to be detected and send the operation record to the application server.

[0049] It is understandable that after the user completes the current operation in the application to be tested, the user starts the next operation, and the next operation becomes the current operation of the application to be tested. Therefore, the current operation of the application to be tested is constantly changing, and the client can continuously obtain and send the operation record of the current operation of the application to be tested.

[0050] After receiving an operation record of the current operation of the application to be detected sent by the client, the application server adds the operation record to the operation record table.

[0051] The operation record may include, but is not limited to, information such as interface identification, operation name, operation object, and operation time.

[0052] The interface identifier may represent the interface for performing the current operation. For example, the interface identifier may be the name of the Activity, the name of the Fragment, or any unique string.

[0053] The operation name can represent the name of the operation of the control corresponding to the current operation. For example, the operation name can be ClickButton, InputText, CheckRadio, ClickListItem, ScrollDow or ScrollUp, etc.

[0054] Operation object refers to the name of the control corresponding to the current operation. For example, the operation object can be a control such as RefreshControl, ToolBar, or Slider.

[0055] Operation time refers to the time when the current operation is performed.

[0056] It should be noted that the operation record table can be used to store the operation records of the historical operations of the application to be detected in the time period from a certain time before the current time to the current time. By continuously adding the operation records of the current operation sent by the client to the operation record table, the content of the operation record table is continuously updated to ensure that the operation record table includes the operation records of all operations executed in the time period.

[0057] Step S102: Perform safety detection according to the operation record table and the pre-acquired operation condition table.

[0058] The operation condition table includes operation information of all legal operations of the application to be detected.

[0059] Based on the operation records of all operations executed by the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table, it can be determined whether there is an attack behavior.

[0060] Attack behaviors may include but are not limited to simulated click or Hook attacks.

[0061] It should be noted that the legal operations of the application to be detected refer to all legal operations that can be performed by each control in each interface of the application to be detected. Each operation of the application to be detected included in the operation condition table is unique.

[0062] The operation information of all legal operations of the application to be detected can describe legal operations from different dimensions and describe the properties or characteristics of legal operations. The operation information may include but is not limited to: operation code, operation name, operation object, interface identifier and other information.

[0063] Specifically, the operation code is an identifier of each legal operation that can be performed by each control in each interface of the application to be detected. Each legal operation of the application to be detected included in the operation condition table corresponds to a unique operation code.

[0064] The interface identifier can represent the interface where a legal operation is performed. For example, the interface identifier can be the name of the Activity, the name of the Fragment, or any unique string.

[0065] The operation name may represent the name of the operation of the control corresponding to the legal operation, for example, the operation name may be ClickButton, InputText, CheckRadio, ClickListItem, ScrollDow or ScrollUp, etc.

[0066] The operation object refers to the name of the control corresponding to the legal operation. The operation objects of different legal operations in the operation condition table can be the same. For example, the operation object can be Refresh Control, ToolBar, or Slider.

[0067] The operation names of different legal operations in the operation condition table may be the same, but the interface identifiers or operation objects may be different.

[0068] It is understandable that the operation condition table describes the properties or characteristics of legal operations, and security detection can be performed based on whether the operation information in the operation record table conforms to the properties or characteristics of legal operations to determine whether there is illegal attack behavior.

[0069] If the operation information of any operation in the operation record table does not conform to the attributes or characteristics of a legal operation, an illegal attack behavior is detected.

[0070] The embodiment of the present invention determines whether there is an attack behavior in the application to be detected based on the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table. The attack behavior can be detected more accurately and effectively, and the security detection steps are simpler and more adaptable.

[0071] Based on the contents of the above embodiments, a security check is performed according to the operation record table and the pre-acquired operation condition table, specifically including: if it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table.

[0072] It should be noted that the operation information may also include an interface switching identifier.

[0073] The interface switching flag can indicate whether a legal operation will cause an interface switch. If the interface switching flag is True, it means that a legal operation will cause an interface switch, indicating that the interface is allowed to be switched; if the interface switching flag is False, it means that a legal operation will not cause an interface switch, indicating that the interface is not allowed to be switched.

[0074] The operation record of the previous operation of the current operation can be obtained in the operation record table. After obtaining the operation record of the previous operation of the current operation, the operation name, operation object, and interface identifier of the previous operation of the current operation can be obtained. According to the operation record of the previous operation of the current operation, the interface switching identifier corresponding to the previous operation of the current operation can be found in the operation condition table.

[0075] If the interface switching flag of the previous operation of the current operation is True, it can be determined that the previous operation of the current operation allows interface switching.

[0076] The operation time of the current operation and the operation before the current operation can be obtained in the operation record table. The time difference between the operation time of the current operation and the operation time of the operation before the current operation can be calculated as the time of interface switching between the operation before the current operation and the current operation.

[0077] If the interface switching flag of the previous operation of the current operation is False, it can be determined that the previous operation of the current operation does not allow interface switching, and there is no interface switching between the previous operation of the current operation and the current operation.

[0078] If it is determined that the time for obtaining the interface switching is less than the preset time threshold, it is determined that the current operation is a simulated click.

[0079] Simulated clicks refer to simulating user click operations to illegally switch interfaces in the application. Common simulated clicks include: automatic login using Accessibility, Auto.js, or Keyboard Wizard.

[0080] Generally, the time required for page switching caused by simulated clicks is much shorter than the time required for page switching caused by normal user operations. Therefore, based on the length of the page switching time, it can be determined whether the operation in the application to be tested is a simulated click. The page switching time can be obtained from the operation record table.

[0081] The time required for page switching caused by simulated clicks is much shorter than the time required for page switching caused by normal user operations. Therefore, it can be determined whether the time required for interface switching is less than the preset time threshold.

[0082] If it is less than, the current operation is determined to be a simulated click; if it is not less than, the current operation is not determined to be a simulated click.

[0083] It should be noted that the preset duration threshold can be determined according to actual conditions. For example, the time of page switching caused by normal operation can be obtained, and the preset duration threshold is determined according to the time of page switching caused by normal operation. The specific value of the preset duration threshold is not specifically limited in the embodiments of the present invention.

[0084] The embodiment of the present invention obtains the interface switching identifier of the previous operation of the current operation according to the operation condition table, and after determining that the previous operation of the current operation allows interface switching according to the interface switching identifier, obtains the time of interface switching between the previous operation of the current operation and the current operation according to the operation record table, and determines whether the current operation is a simulated click by judging whether the interface switching time is less than a preset duration threshold. This can more accurately detect simulated clicks, and the security detection steps are simpler and more adaptable.

[0085] Based on the contents of the above embodiments, security detection is performed according to the operation record table and the pre-acquired operation condition table, specifically including: receiving the current business logic request of the application to be detected.

[0086] Specifically, the service logic request is used to request the application server to process the requested service. The service logic request carries the information of the requested service.

[0087] After the operation in the application to be tested triggers a business logic request, the client sends the business logic request to the application server.

[0088] The application server receives the business logic request of the application to be detected sent by the client.

[0089] The operations corresponding to the business logic requests are legal operations in the above-mentioned application to be tested.

[0090] Get the operation corresponding to the current business logic request according to the operation condition table.

[0091] It should be noted that the operation information may also include a business identifier.

[0092] The service identifier is a unique identifier of the service logic request sent by the client to the application server. Each service logic request corresponds to a unique service identifier.

[0093] According to the business identifier of the current business logic request, the operation corresponding to the current business logic request can be obtained in the operation condition table. Further, the operation information of the operation corresponding to the current business logic request can be obtained, which may include: the interface identifier, operation name and operation object of the operation corresponding to the current business logic request.

[0094] If it is determined that there is no operation record of the operation corresponding to the current business logic request in the operation record table, it is determined that the current business logic request is a Hook attack.

[0095] Hook attack refers to inserting other functional codes before the code that the application should normally execute when initiating a business logic request in the application, so that the application performs other illegal operations before performing normal operations. This is equivalent to replacing the normal operation corresponding to the business logic request with the illegal operation corresponding to the inserted other functional codes. Common Hook attacks include: using the Xposed framework or Frida framework to automatically obtain user or application data (for example: personal login account, password or payment password, etc.) and the complete data of the application sandbox, and performing illegal automated batch processing.

[0096] Usually, the application has never executed the illegal operations corresponding to the inserted other function codes. Therefore, the operation corresponding to the business logic request can be obtained through the operation condition table. By looking up the operation record table, it can be known whether the operation corresponding to the business logic request has been executed, and then determine whether the business logic request is a Hook attack.

[0097] Hook attacks can replace normal operations corresponding to business logic requests with illegal operations corresponding to other inserted function codes. The application to be detected has never performed the illegal operations corresponding to the other inserted function codes. Therefore, it can be determined whether there is an operation record corresponding to the current business logic request in the operation record table, and whether the current business logic request is a Hook attack can be determined based on the judgment result.

[0098] Specifically, according to information such as the interface identifier, operation name, and operation object of the operation corresponding to the current business logic request, it is possible to query in the operation record table whether there is an operation record including the operation corresponding to the current business logic request.

[0099] If an operation record of an operation corresponding to the current business logic request is found in the operation record table, the current business logic request is not temporarily determined as a Hook attack.

[0100] If no operation record of the operation corresponding to the current business logic request is found in the operation record table, it is determined that the current business logic request is a Hook attack.

[0101] The embodiment of the present invention obtains operation information of the operation corresponding to the current business logic request according to the operation condition table, and queries whether there is an operation record of the operation corresponding to the current business logic request in the operation record table according to the operation information of the operation corresponding to the current business logic request. If no operation record of the operation corresponding to the current business logic request is found in the operation record table, it is determined that the current business logic request is a Hook attack. The Hook attack that illegally initiates the business logic request can be detected more accurately, and the unknown Hook attack can be detected more effectively. The security detection steps are simpler and the adaptability is wider.

[0102] Based on the contents of the above embodiments, after obtaining the operation corresponding to the current business logic request according to the operation condition table, it also includes: if it is determined that there is an operation record of the operation corresponding to the current business logic request in the operation record table, then according to the operation condition table, obtain the preceding operation of the operation corresponding to the current business logic request.

[0103] It should be noted that the operation information may also include pre-operation.

[0104] Pre-operation refers to the previous legal operation that must be executed before executing a legal operation. A legal operation can have multiple pre-operations. For example, after executing several legal operations, you can continue to execute the same next legal operation. In this case, the above legal operations are all pre-operations of the above next legal operation. The prerequisite for executing the above next legal operation is that one of the above legal operations must be executed.

[0105] According to the business identifier of the current business logic request, the preceding operation of the operation corresponding to the current business logic request can be obtained in the operation condition table.

[0106] Furthermore, according to the preceding operation, the operation information of the preceding operation of the operation corresponding to the current business logic request can be obtained in the operation condition table. The operation information may include: the interface identifier corresponding to the preceding operation, the operation name and the operation object.

[0107] If it is determined that there is no operation record of the preceding operation in the operation record table, it is determined that the current business logic request is a Hook attack.

[0108] Hook attacks can also illegally initiate business logic requests by inserting other functional codes. The application to be tested has never performed illegal operations corresponding to the inserted other functional codes.

[0109] Therefore, whether the current business logic request is a Hook attack can be determined by checking whether there is an operation record of the preceding operation of the operation corresponding to the current business logic request in the operation record table.

[0110] Specifically, it is possible to query in the operation record table whether there is an operation record of the preceding operation according to information such as the interface identifier, operation name, and operation object of the preceding operation of the operation corresponding to the current business logic request.

[0111] If an operation record of a preceding operation is found in the operation record table, it indicates that an operation record of the preceding operation exists in the operation record table, and the current business logic request is not determined to be a Hook attack.

[0112] If no operation record of the preceding operation is found in the operation record table, it means that there is no operation record of the preceding operation in the operation record table, and the current business logic request is determined to be a Hook attack.

[0113] The embodiment of the present invention obtains operation information of a preceding operation of an operation corresponding to a current business logic request according to an operation condition table, and queries an operation record table for operation records of the preceding operation of the operation corresponding to the current business logic request according to the operation information of the preceding operation. If the operation record of the preceding operation of the operation corresponding to the current business logic request is not found in the operation record table, it is determined that the current business logic request is a Hook attack. Hook attacks that illegally initiate business logic requests can be detected more accurately, and unknown Hook attacks can be detected more effectively. The security detection steps are simpler and more adaptable.

[0114] Based on the contents of the above embodiments, after the operation record table and the pre-acquired operation condition table are security checked, it further includes: if an attack behavior is detected in the application to be checked, an alarm message is sent to the client and an alarm log is generated.

[0115] Specifically, the attack behaviors existing in the application to be detected may include simulated click or Hook attacks.

[0116] If it is detected that the current operation of the application to be detected is a simulated click, an alarm message indicating that the current operation is a simulated click is sent to the client. The content of the alarm message may also include an operation record of the current operation.

[0117] If it is detected that the current business logic request of the application to be detected is a Hook attack, an alarm message indicating that the current business logic request is a Hook attack is sent to the client. The alarm message may also include a business flag of the current business logic request, operation information of a legal operation corresponding to the current business logic request, or operation information corresponding to a pre-operation of a legal operation corresponding to the current business logic request.

[0118] An alarm log can be generated based on the alarm information, and the alarm log can be sent to the client at a regular interval.

[0119] The embodiment of the present invention sends an alarm message to the client after detecting the presence of a simulated click or Hook attack in the application to be tested, generates an alarm log based on the alarm message, and sends the alarm log to the client. The user can be notified in time of the discovery of the attack behavior in the application to be tested, and a response can be made based on the alarm message. The attack behavior can be analyzed based on the alarm log, and a data basis can be provided for the later security protection work of the application to be tested.

[0120] Figure 2 This is a flow chart of the Android application security detection method provided by the present invention. Figure 2 The Android application security detection method according to an embodiment of the present invention is described. Figure 2 As shown, the method includes: step S201, collecting operation records of the current operation of the application to be detected.

[0121] It should be noted that the execution subject of the Android application security detection method provided in the embodiment of the present invention is the client.

[0122] Specifically, when the user uses the application to be detected, he can complete relevant operations in the application to be detected. The client can collect the operation records of the current operation of the application to be detected.

[0123] The client can collect the operation records of the current operation of the application to be tested in various ways, such as: point collection, etc.

[0124] It is understandable that after the user completes the current operation in the application to be tested, the user starts the next operation, and the next operation becomes the current operation of the application to be tested. Therefore, the current operation of the application to be tested is constantly changing, and the client can continuously obtain and send the operation record of the current operation of the application to be tested.

[0125] Each time the application server receives an operation record of the current operation of the application to be detected sent by the client, the application server adds the operation record to the operation record table.

[0126] The operation record may include, but is not limited to, information such as interface identification, operation name, operation object, and operation time.

[0127] The interface identifier may represent the interface for performing the current operation. For example, the interface identifier may be the name of the Activity, the name of the Fragment, or any unique string.

[0128] The operation name can represent the name of the operation of the control corresponding to the current operation. For example, the operation name can be ClickButton, InputText, CheckRadio, ClickListItem, ScrollDow or ScrollUp, etc.

[0129] Operation object refers to the name of the control corresponding to the current operation. For example, the operation object can be a control such as RefreshControl, ToolBar, or Slider.

[0130] Operation time refers to the time when the current operation is performed.

[0131] Step S202: Send the operation record to the application server, so that the application server receives the operation record, adds the operation record to an operation record table, and performs security detection according to the operation record table and the pre-acquired operation condition table.

[0132] The operation record table is used to store the operation records of the historical operations of the application to be detected. The operation condition table includes the operation information of all legal operations in the application to be detected.

[0133] After the client collects the operation records of the current operation of the application to be tested each time, the collected operation records are sent to the application server.

[0134] Each time the application server receives an operation record of the current operation of the application to be detected sent by the client, the application server adds the operation record to the operation record table.

[0135] It should be noted that the operation record table can be used to store the operation records of the historical operations of the application to be detected within the time period from a certain time before the current time to the current time. By continuously adding the operation records of the current operation sent by the client to the operation record table, the content of the operation record table is continuously updated to ensure that the operation record table includes the operation records of all operations executed within the time period.

[0136] The application server can determine whether there is an attack behavior based on the operation records of all operations executed by the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table.

[0137] Attack behaviors may include but are not limited to simulated click or Hook attacks.

[0138] Specifically, simulated clicks refer to simulating user click operations to illegally switch interfaces in the application. Common simulated clicks include: automatic login using Accessibility, Auto.js, or Keyboard Wizard.

[0139] Generally, the time required for page switching caused by simulated clicks is much shorter than the time required for page switching caused by normal user operations. Therefore, based on the length of the page switching time, it can be determined whether the operation in the application to be tested is a simulated click. The page switching time can be obtained from the operation record table.

[0140] Hook attack refers to inserting other functional codes before the code that the application should normally execute when initiating a business logic request in the application, so that the application performs other illegal operations before performing normal operations. This is equivalent to replacing the normal operation corresponding to the business logic request with the illegal operation corresponding to the inserted other functional codes. Common Hook attacks include: using the Xposed framework or Frida framework to automatically obtain user or application data (for example: personal login account, password or payment password, etc.) and the complete data of the application sandbox, and performing illegal automated batch processing.

[0141] Usually, the application has never executed the illegal operations corresponding to the inserted other function codes. Therefore, the operation corresponding to the business logic request can be obtained through the operation condition table. By looking up the operation record table, it can be known whether the operation corresponding to the business logic request has been executed, and then determine whether the business logic request is a Hook attack.

[0142] It should be noted that the legal operations of the application to be detected refer to all operations that can be performed by each control in each interface of the application to be detected. Each legal operation of the application to be detected included in the operation condition table is unique.

[0143] The operation information of all legal operations of the application to be detected can describe legal operations from different dimensions. The operation information may include but is not limited to: operation code, operation name, operation object, interface identifier and other information.

[0144] Specifically, the operation code is a unique identifier of a legal operation, and each legal operation of the application to be detected included in the operation condition table corresponds to a unique operation code.

[0145] The interface identifier can represent the interface where a legal operation is performed. For example, the interface identifier can be the name of the Activity, the name of the Fragment, or any unique string.

[0146] The operation name may represent the name of the operation of the control corresponding to the legal operation. The operation names of different legal operations in the operation condition table may be the same. For example, the operation name may be ClickButton, InputText, CheckRadio, ClickListItem, ScrollDow, or ScrollUp.

[0147] The operation object refers to the name of the control corresponding to the legal operation. The operation objects of different legal operations in the operation condition table can be the same. For example, the operation object can be Refresh Control, ToolBar, or Slider.

[0148] It should be noted that if an attack behavior is detected in the application to be detected, the client can also receive alarm information and alarm logs sent by the application server.

[0149] The embodiment of the present invention collects the current operation of the application to be detected and sends the current operation of the application to be detected to the application server, so that the application server receives the operation record and adds the operation record to the operation record table. According to the operation record of all the executed operations of the application to be detected in the operation record table and the operation information of all the legal operations of the application to be detected in the operation condition table, it is judged whether there is an attack behavior in the application to be detected, and the attack behavior can be detected more accurately and effectively. The security detection steps are simpler and the adaptability is wider.

[0150] The Android application security detection device provided by the present invention is described below. The Android application security detection device described below and the Android application security detection method described above can be referenced to each other.

[0151] Figure 3 This is a schematic diagram of the structure of the Android application security detection device provided by the present invention. Figure 3 The Android application security detection device according to the embodiment of the present invention is described. Figure 3 As shown, the device includes: a recording module 301 and a detection module 302, wherein:

[0152] The recording module 301 is used to receive the operation record of the current operation of the application to be detected sent by the client, and add the operation record to the operation record table.

[0153] The detection module 302 is used to perform safety detection according to the operation record table and the pre-acquired operation condition table.

[0154] The operation record table is used to store the operation information of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected.

[0155] It should be noted that the Android application security detection device in the embodiment of the present invention is the application server in any of the above embodiments.

[0156] Specifically, the recording module 301 and the detection module 302 are electrically connected.

[0157] The recording module 301 adds each operation record of the current operation of the application to be detected sent by the client to the operation record table. The operation record may include but is not limited to information such as interface identification, operation name, operation object and operation time.

[0158] The detection module 302 can determine whether there is an attack behavior in the application to be detected based on the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table.

[0159] It should be noted that the Android application security detection device of the embodiment of the present invention may also include an alarm module.

[0160] The alarm module is used to send an alarm message to the client and generate an alarm log if an attack behavior is detected in the application to be detected.

[0161] Specifically, the alarm module is electrically connected to the detection module 302 .

[0162] If it is detected that the current operation of the application to be detected is a simulated click or if it is detected that the current business logic request of the application to be detected is a Hook attack, the alarm module can send an alarm message to the client, generate an alarm log based on the alarm message, and send the alarm log to the client regularly.

[0163] The embodiment of the present invention determines whether there is an attack behavior in the application to be detected based on the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table. The attack behavior can be detected more accurately and effectively, and the security detection steps are simpler and more adaptable.

[0164] Figure 4 This is a schematic diagram of the structure of the Android application security detection device provided by the present invention. Figure 4 The Android application security detection device according to the embodiment of the present invention is described. Figure 4 As shown, the device includes: a collection module 401 and a communication module 402, wherein:

[0165] The collection module 401 is used to collect the operation records of the current operation of the application to be detected.

[0166] The communication module 402 is used to send the operation record to the application server, so that the application server receives the operation record, adds the operation record to the operation record table, and performs security detection according to the operation record table and the pre-acquired operation condition table.

[0167] The operation record table is used to store the operation records of the historical operations of the application to be detected. The operation condition table includes the operation information of all legal operations in the application to be detected.

[0168] It should be noted that the Android application security detection device in the embodiment of the present invention is the client in any of the above embodiments.

[0169] Specifically, the acquisition module 401 and the communication module 402 are electrically connected.

[0170] The acquisition module 401 can acquire the operation records of the current operation of the application to be detected. The acquisition module 401 can acquire the operation records of the current operation of the application to be detected in various ways, such as: embedding point acquisition, etc.

[0171] After the communication module 402 collects the operation records of the current operation of the application to be tested each time, the collected operation records are sent to the application server. Each time the recording module 301 receives an operation record of the current operation of the application to be detected sent by the client, the above operation record is added to the operation record table. The detection module 302 can determine whether there is an attack behavior based on the operation records of all executed operations of the application to be detected in the operation record table and the operation information of all legal operations of the application to be detected in the operation condition table.

[0172] The communication module 402 can also receive the alarm information and alarm log sent by the alarm module.

[0173] The embodiment of the present invention collects the current operation of the application to be detected and sends the current operation of the application to be detected to the application server, so that the application server receives the operation record and adds the operation record to the operation record table. According to the operation record of all the executed operations of the application to be detected in the operation record table and the operation information of all the legal operations of the application to be detected in the operation condition table, it is judged whether there is an attack behavior in the application to be detected, and the attack behavior can be detected more accurately and effectively. The security detection steps are simpler and the adaptability is wider.

[0174] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logic instructions in the memory 530 to execute the Android application security detection method, which includes: receiving the operation record of the current operation of the application to be detected sent by the client, and adding the operation record to the operation record table; performing security detection according to the operation record table and the pre-acquired operation condition table; wherein the operation record table is used to store the operation record of the historical operation of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected; or includes: collecting the operation record of the current operation of the application to be detected; sending the operation record to the application server so that the application server receives the operation record, adding the operation record to the operation record table, and performing security detection according to the operation record table and the pre-acquired operation condition table; wherein the operation record table is used to store the operation record of the historical operation of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected.

[0175] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0176] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the Android application security detection method provided by the above methods, the method including: receiving an operation record of the current operation of the application to be detected sent by a client, and adding the operation record to an operation record table; performing security detection according to the operation record table and a pre-acquired operation condition table; wherein the operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes operation information of all legal operations of the application to be detected; or including: collecting the operation records of the current operation of the application to be detected; sending the operation records to an application server so that the application server receives the operation records, adding the operation records to the operation record table, and performing security detection according to the operation record table and the pre-acquired operation condition table; wherein the operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes operation information of all legal operations in the application to be detected.

[0177] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned Android application security detection methods, the methods comprising: receiving an operation record of the current operation of the application to be detected sent by a client, and adding the operation record to an operation record table; performing security detection according to the operation record table and a pre-acquired operation condition table; wherein the operation record table is used to store the operation record of the historical operation of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected; or comprising: collecting the operation record of the current operation of the application to be detected; sending the operation record to an application server so that the application server receives the operation record, adding the operation record to the operation record table, and performing security detection according to the operation record table and the pre-acquired operation condition table; wherein the operation record table is used to store the operation record of the historical operation of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected.

[0178] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0180] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for Android application security detection, It is characterized in that include: Receive the operation record of the current operation of the application to be detected sent by the client, and add the operation record to the operation record table; Perform safety testing according to the operation record table and the pre-acquired operation condition table; The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected; The performing of safety detection according to the operation record table and the pre-acquired operation condition table specifically includes: If it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table; If it is determined that the time for switching the interface is less than a preset time threshold, determining that the current operation is a simulated click; The performing of safety detection according to the operation record table and the pre-acquired operation condition table also includes: Receiving a current business logic request of the application to be detected; Acquire the operation corresponding to the current business logic request according to the operation condition table; If it is determined that an operation record of the operation corresponding to the current business logic request exists in the operation record table, then, according to the business identifier of the current business logic request, a preceding operation of the operation corresponding to the current business logic request is obtained in the operation condition table; According to the preceding operation, obtaining operation information of the preceding operation of the operation corresponding to the current business logic request in the operation condition table, wherein the operation information of the preceding operation includes an interface identifier, an operation name, and an operation object of the preceding operation; According to the operation information of the preceding operation of the operation corresponding to the current business logic request, querying in the operation record table whether there is an operation record of the preceding operation; If the operation record of the preceding operation is not found in the operation record table, it is determined that the current business logic request is a Hook attack.

2. The Android application security detection method according to claim 1, It is characterized in that The performing of safety detection according to the operation record table and the pre-acquired operation condition table specifically includes: Receiving a current business logic request of the application to be detected; Acquire the operation corresponding to the current business logic request according to the operation condition table; If it is determined that there is no operation record of the operation corresponding to the current business logic request in the operation record table, it is determined that the current business logic request is a Hook attack.

3. The Android application security detection method according to any one of claims 1 to 2, It is characterized in that After the safety detection is performed according to the operation record table and the pre-acquired operation condition table, the method further includes: If an attack behavior is detected in the application to be detected, an alarm message is sent to the client and an alarm log is generated.

4. A method for Android application security detection, It is characterized in that include: Collect the operation records of the current operation of the application to be tested; Sending the operation record to an application server so that the application server receives the operation record, adds the operation record to an operation record table, and performs security detection according to the operation record table and a pre-acquired operation condition table; The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected; The performing of safety detection according to the operation record table and the pre-acquired operation condition table specifically includes: If it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table; If it is determined that the time for switching the interface is less than a preset time threshold, determining that the current operation is a simulated click; The performing of safety detection according to the operation record table and the pre-acquired operation condition table also includes: Receiving a current business logic request of the application to be detected; Acquire the operation corresponding to the current business logic request according to the operation condition table; If it is determined that an operation record of the operation corresponding to the current business logic request exists in the operation record table, then, according to the business identifier of the current business logic request, a preceding operation of the operation corresponding to the current business logic request is obtained in the operation condition table; According to the preceding operation, obtaining operation information of the preceding operation of the operation corresponding to the current business logic request in the operation condition table, wherein the operation information of the preceding operation includes an interface identifier, an operation name, and an operation object of the preceding operation; According to the operation information of the preceding operation of the operation corresponding to the current business logic request, querying in the operation record table whether there is an operation record of the preceding operation; If the operation record of the preceding operation is not found in the operation record table, it is determined that the current business logic request is a Hook attack.

5. An Android application security detection device, It is characterized in that include: A recording module, used for receiving an operation record of the current operation of the application to be detected sent by the client, and adding the operation record to an operation record table; A detection module, used for performing safety detection according to the operation record table and the pre-acquired operation condition table; The operation record table is used to store the operation information of the historical operation of the application to be detected; the operation condition table includes the operation information of all legal operations of the application to be detected; The detection module is specifically used for: If it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table; If it is determined that the time for switching the interface is less than a preset time threshold, determining that the current operation is a simulated click; The detection module is further used for: Receiving a current business logic request of the application to be detected; Acquire the operation corresponding to the current business logic request according to the operation condition table; If it is determined that an operation record of the operation corresponding to the current business logic request exists in the operation record table, then, according to the business identifier of the current business logic request, a preceding operation of the operation corresponding to the current business logic request is obtained in the operation condition table; According to the preceding operation, obtaining operation information of the preceding operation of the operation corresponding to the current business logic request in the operation condition table, wherein the operation information of the preceding operation includes an interface identifier, an operation name, and an operation object of the preceding operation; According to the operation information of the preceding operation of the operation corresponding to the current business logic request, querying in the operation record table whether there is an operation record of the preceding operation; If the operation record of the preceding operation is not found in the operation record table, it is determined that the current business logic request is a Hook attack.

6. An Android application security detection device, It is characterized in that include: A collection module, used to collect operation records of the current operation of the application to be detected; A communication module, used for sending the operation record to an application server, so that the application server receives the operation record, adds the operation record to an operation record table, and performs security detection according to the operation record table and a pre-acquired operation condition table; The operation record table is used to store the operation records of the historical operations of the application to be detected; the operation condition table includes the operation information of all legal operations in the application to be detected; The application server is used for: If it is determined according to the operation condition table that the previous operation of the current operation allows interface switching, then the time of interface switching between the previous operation of the current operation and the current operation is obtained according to the operation record table; If it is determined that the time for switching the interface is less than a preset time threshold, determining that the current operation is a simulated click; The application server is further used for: Receiving a current business logic request of the application to be detected; Acquire the operation corresponding to the current business logic request according to the operation condition table; If it is determined that an operation record of the operation corresponding to the current business logic request exists in the operation record table, then, according to the business identifier of the current business logic request, a preceding operation of the operation corresponding to the current business logic request is obtained in the operation condition table; According to the preceding operation, obtaining operation information of the preceding operation of the operation corresponding to the current business logic request in the operation condition table, wherein the operation information of the preceding operation includes an interface identifier, an operation name, and an operation object of the preceding operation; According to the operation information of the preceding operation of the operation corresponding to the current business logic request, querying in the operation record table whether there is an operation record of the preceding operation; If the operation record of the preceding operation is not found in the operation record table, it is determined that the current business logic request is a Hook attack.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the Android application security detection method as described in any one of claims 1 to 4 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by the processor, the steps of the Android application security detection method as described in any one of claims 1 to 4 are implemented.