A system for locating malicious codes
A deep learning-based system with graph neural networks and attention mechanisms automates malicious code localization in software, addressing the limitations of existing detection systems by providing accurate and interpretable malicious code identification within applications.
Patent Information
- Application Number
- PCT/TR2024/050252
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-03-13
- Publication Date
- 2024-09-19
AI Technical Summary
Current malicious software detection systems lack the ability to automatically locate and interpret malicious code snippets within applications, relying on manual review and lacking interpretability, which prolongs analysis time and reduces reliability.
A deep learning-based system utilizing graph neural networks and an attention mechanism to automatically detect and localize malicious code by constructing API sequences and analyzing control or data flow graphs, providing weighted subgraph identification and interpretive verification.
The system significantly reduces manual review time by accurately locating and interpreting malicious code, enhancing detection reliability and interpretability through automated malicious code localization and relationship analysis.
Smart Images

Figure TR2024050252_19092024_PF_FP_ABST
Abstract
Description
[0001] A SYSTEM FOR LOCATING MALICIOUS CODES
[0002] Technical Field
[0003] The present invention relates to a system which enables to locate (localize) a malicious code within an application entirely and automatically, and thus to shorten the time it will take to review a malicious code manually.
[0004] Background of the Invention
[0005] Malicious software is one of the most important cyber security threats today. With the proliferation of mobile devices, security threats against these devices and mobile applications increase as well. In the literature, there are successful static and dynamic analysis-based detection systems developed for these attacks and these systems are being improved day by day with the emergence of new malicious software. Among these solution suggestions, artificial intelligence-based systems particularly stand out. However, these methods are usually addressed like a black box and thus, they remain incapable of explaining why the related software is found to be malicious or non-malicious. In analysis of malicious software, it is important to explain where the malicious code snippet is located in the application and what it does, as well as to detect whether an application is malicious / non-malicious, Thereby, the period of analysis to be carried out by malicious software on an application is significantly shortened.
[0006] There are very few studies in the literature on this subject known as localization of malicious software code (malware localization). However, these studies do not address a malicious software code entirely, but they rather list suspicious behaviors included within an application. Therefore, analysts must review a code manually to interpret the relationships on these behaviors. For this reason, today there is a need for solutions which enable to locate a malicious code snippet included in an application entirely and automatically.
[0007] The Chinese patent document no. CN111523117A, an application included in the state of the art, discloses a system for Android malicious software detection and malicious code positioning which is used to solve the problems of poor interpretation and analysis ability of an Android malicious software detector. In the system of the said invention, normal and malicious samples are taken as original data; Androguard is used to extract an application instruction byte code; API sequences wherein an application is used are extracted via static analysis; API sequence data set is constructed and then it is applied to a deep learning model. For malicious software detection, a classifier is trained in order to achieve automatic malicious software detection. Meanwhile, an attention mechanism is introduced. For applications that are detected to be malicious, there are malicious code segments and finally they are output in the form of an analysis report. The present invention not only provides detection of malicious software, but also provides an interpretive verification basis for detection results. An objective of the present invention is to propose an Android malicious software detection and malicious code positioning system and method used to automatically detect Android malicious software. The present invention not only provides effective detection of malicious software, but also solves the problem that the existing detection methods based on the learning model lack interpretability. The located malicious code section serves as the verification of the detection result and improves the reliability of the software. The APK preprocessing module is used to disassemble an APK package of an Android application to be tested, and to obtain basic information, a method set and a system API set of the Android application to be tested. The API sequence generation module receives the method set generated by the APK preprocessing module, as input and obtains a digitally numbered API sequence through the depth- first traversal of the root method in the method set. The sequence unit vectorization module is used to construct an API mapping table containing a mapping relationship between a character form and a distributed vector form, in order to expand the semantic expression force of each member in the API sequence. The malware detection module adopts a deep learning model based on bidirectional LSTM for training and testing in order to obtain a classifier used to detect whether the Android application is a malicious program. The malicious code positioning module is used to analyze the malicious program determined by the classifier, to generate and output an analysis report. The invention adopts a depth-first performing method on a call and traversal instruction in order to construct an Application Programming Interface (API) sequence. The invention can better simulate a real behavior sequence of an application program during running
[0008] Summary of the Invention
[0009] An objective of the present invention is to realize a system which enables to automatically locate (localize) a malicious code snippet in software detected as malicious with the development of a deep learning-based model and to shorten the time taken by the review of a malicious code manually.
[0010] Another objective of the present invention is to realize a system which enables to locate the subgraph(s) that are most effective in making an application malicious in order to address a malicious software code entirely.
[0011] Another objective of the present invention is to realize a system which enables to locate the relationship between different malicious code snippets.
[0012] Another objective of the present invention is to realize a system which uses an attention mechanism as base in order to weight distinctive code blocks for the purpose of malicious code localization.
[0013] Detailed Description of the Invention “A System for Locating Malicious Codes” realized to fulfil the objectives of the present invention is shown in the figure attached, in which:
[0014] Figure 1 is a schematic view of the inventive system.
[0015] The components illustrated in the figure are individually numbered, where the numbers refer to the following:
[0016] 1. System
[0017] 2. Application
[0018] 3. Application display unit
[0019] 4. Localization unit
[0020] 5. Evaluation unit
[0021] The inventive system (1) for determining malicious codes within an application found to be malicious by means of a malicious software detection tool, comprises at least one application (2) which is configured to be run on at least one electronic device and to enable the extraction of at least control flow graphs or data flow graphs; at least one application display unit (3) which is configured to be in communication with the application (2), to extract the control flow graphs or data flow graphs on the application (2) on this communication established, and to create a graph particularly on API calls; at least one localization unit (4) which is configured to be in communication with the application display unit (3), to receive control flow or data flow graphs over this communication established, to locate the relationships between API calls by using attention mechanism on the said graphs for malicious code detection, to locate and weight the effective subgraph; and at least one evaluation unit (5) which is configured to be in communication with the localization unit (4), and enables to evaluate the malicious codes localized over this this communication established. The application (2) included in the inventive system (1) is an application run on an electronic device and it is configured to enable the creation of a control flow or data flow graph for the application display unit (3) in order to preserve the flows and semantic information related to its behaviours.
[0022] The application display unit (3) included in the inventive system (1) is configured to extract flow control graphs (CFG) or data flow graphs (DFG) in order to identify each application (2), and to preserve the flow related to the behaviors of the application (2). The application display unit (3) is configured to preferably use a Androguard tool and to extract flow control graphs by developing it. The application display unit (3) is configured to extract a graph over API calls due to the large size of the control flow graphs created. The application display unit (3) is configured to receive the flow of calls instead of receiving the API calls included within a code block sequentially, and to ensure the preservation of the related malicious behaviour. In a call created by the application display unit (3), each node corresponds to one API call. The application display unit (3) is configured to use sensitive API calls using malicious permissions, by utilizing PScout and Axplorer for the applications (2) with large graphs. The application display unit (3) is also configured to create an API call list with a smaller size, by receiving the differences between the API calls frequently used in malicious and non-malicious applications. In another preferred embodiment, the application display unit (3) is configured to use graph reduction technologies available for size reduction. The process of graph reduction carried out by the application display unit (3) shortens the operating time of the suggested model. The application display unit (3) is configured to preferably use a FlowDroid tool instead of control flow graphs in order to detect malicious applications that perform data leakage, and to extract precise data flow graphs by developing it. Thereby, it is possible to use data flow graphs instead of control flow graphs in detection of malicious applications that perform data leakage. The localization unit (4) included in the inventive system (1) is configured to use graph neural networks. The localization unit (4) is configured to classify graphs, to find out which class -including malicious or non-malicious- an application with a given graph belongs to, and to locate a malicious code. The localization unit (4) is configured to use an attention mechanism focusing on the most related parts of the graphs in order to locate a malicious code entirely, and to ensure that attention weights are given to the subgraphs of the graph given as input in order to locate the relationships between API calls. The localization unit (4) is configured ensure that the subgraph effective in a graph is located and weighted. In one preferred embodiment, the localization unit (4) is configured to use a GAM attention mechanism.
[0023] The evaluation unit (5) included in the inventive system (1) is configured to evaluate the accuracy level of the malicious code detected by the localization unit (4) and to compare the results of DroidDetect and graph kernel-based method for this. The evaluation unit (5) is configured to use artificially created datasets in order to make an automatic comparison.
[0024] Within these basic concepts; it is possible to develop various embodiments of the inventive “System (1) for Locating Malicious Codes”; the invention cannot be limited to examples disclosed herein and it is essentially according to claims.
Claims
CLAIMS1. A system (1) for determining malicious codes within an application found to be malicious by means of a malicious software detection tool; characterized by at least one application (2) which is configured to be run on at least one electronic device and to enable the extraction of at least control flow graphs or data flow graphs; at least one application display unit (3) which is configured to be in communication with the application (2), to extract the control flow graphs or data flow graphs on the application (2) on this communication established, and to create a graph particularly on API calls; at least one localization unit (4) which is configured to be in communication with the application display unit (3), to receive control flow or data flow graphs over this communication established, to locate the relationships between API calls by using attention mechanism on the said graphs for malicious code detection, to locate and weight the effective subgraph; and at least one evaluation unit (5) which is configured to be in communication with the localization unit (4), and enables to evaluate the malicious codes localized over this this communication established.
2. A system (1) according to Claim 1; characterized by the application (2) which is an application run on a mobile device, and is configured to enable the creation of a control flow or data flow graph for the application display unit (3) in order to preserve the flows and semantic information related to its behaviours3. A system (1) according to Claim 1 or 2; characterized by the application display unit (3) which is configured to extract flow control graphs (CFG) or data flow graphs (DFG) in order to identify each application (2), and to preserve the flow related to the behaviors of the application (2).
4. A system (1) according to any of the preceding claims; characterized by the application display unit (3) which is configured to extract a graph over API calls due to the large size of the control flow graphs created.
5. A system (1) according to any of the preceding claims; characterized by the application display unit (3) which is configured to receive the flow of calls instead of receiving the API calls included within a code block sequentially, and to ensure the preservation of the related malicious behaviour.
6. A system (1) according to any of the preceding claims; characterized by the localization unit (4) which is configured to use graph neural networks7. A system (1) according to any of the preceding claims; characterized by the localization unit (4) which is configured to classify graphs, to find out which class -including malicious or non-malicious- an application with a given graph belongs to, and to locate a malicious code.
8. A system (1) according to any of the preceding claims; characterized by the localization unit (4) which is configured to use an attention mechanism focusing on the most related parts of the graphs in order to locate a malicious code entirely, and to ensure that attention weights are given to the subgraphs of the graph given as input in order to locate the relationships between API calls.
9. A system (1) according to any of the preceding claims; characterized by the localization unit (4) which is configured ensure that the subgraph effective in a graph is located and weighted.
Citation Information
Patent Citations
A malicious code homology analysis method based on system call control flow graph
CN109101816A
Systems and Methods For Malware Classification
US20100180344A1
Detection of malicious code fragments via data-flow isolation
US20190156028A1
