SYSTEM AND METHOD FOR DETECTING A MALFUNCTION INJECTED INTO THE STORAGE OF A DATA PROCESSING DEVICE
Patent Information
- Application Number
- DE602018075580
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-07-13
- Filing Date
- 2018-07-13
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2038-07-13
AI Technical Summary
Existing solutions are inadequate for detecting malicious instructions injected into the memory of computing devices, as they primarily focus on scanning non-volatile storage and lack effective methods for identifying threats in volatile memory.
A malicious code detection module that examines the call stack of each thread to identify originating modules not backed by a disk image, flags potentially malicious threads, and generates an alert or suspends their execution.
Effectively detects and alerts or suspends malicious instructions in memory, preventing potential system harm by identifying threads operating from non-disk-backed code that directly interact with the operating system API.
Description
FIELD OF THE DISCLOSURE
[0001] The present disclosure relates to a system and method for detecting the execution of malicious instructions injected into the memory of a computing device.BACKGROUND
[0002] As computing devices become increasingly complex, viruses and malware also are becoming increasingly complex and difficult to detect and prevent. While the prior art includes many approaches for scanning non-volatile storage such as a hard disk drive for such threats, the prior art includes few satisfactory solutions for detecting malicious code loaded into memory or the processor itself.
[0003] Figure 1 depicts an exemplary prior art computing device 100 comprising processor 110, memory 120, and storage device 130. In this example, memory 120 is volatile and can comprise DRAM, SRAM, SDRAM, or other known memory devices. Storage device 130 is non-volatile and can comprise a hard disk drive, solid state drive, flash memory, or other known storage devices. One of ordinary skill in the art will understand that processor 1 10 can include a single processor core or multiple processor cores as well as numerous cache memories, as is known in the prior art. Processor 110 executes operating system 140. Examples of operating system 140 include the operating systems known by the trademarks WINDOWS ®< by Microsoft, MacOS ®< and IOS ®< by Apple, CHROME OS ®< and ANDROID ®< by Google, LINUX, and others.
[0004] In Figure 2, data is stored in storage device 130. There are numerous mechanisms to store data in storage device 130, and two known mechanisms are shown for illustration purposes. In one mechanism, data is stored as blocks 220 and can be accessed by logical block address (LBA) or similar addressing scheme. In another mechanism, data is stored as files 230 and can be accessed using a file system. In the prior art, scanning module 210 can be executed by processor 110 and can scan either blocks 220 or files 230 to look for malicious code. This often is referred to as virus scan software and is well-suited for identifying and nullifying known malicious programs that are stored in non-volatile devices such as in storage device 130.
[0005] While prior art techniques are well-suited for detecting known malicious programs stored in storage device 130, there is no satisfactory technique for detecting malicious instructions that have been injected into memory 120 but not stored in storage device 130.
[0006] U.S. Patent Application Publication No. US 2015 / 0020198 A1 relates to techniques for detecting malicious computer software. For example, a method gathers information about processes and threads executing on a computing device. Instructions executed by a thread that is currently running are monitored. The method performs certain steps if a function to create a process or a function to load a library is called. The steps performed may include examining a thread information block, determining whether an address included in a stack pointer of the thread is in a range of addresses for a stack specified by the thread information block, and determining whether a first plurality of no-operation instructions is followed by shell code that is followed by a second plurality of no-operation instructions.
[0007] U.S. Patent Application Publication No. US 2011 / 0271343 A1 describes a system and method for detecting malicious code disguised as a normal process by first determining whether a thread generated by a process running on a computer system is generated by malicious code and additionally analyzing a malicious code behavior in a virtual environment when the thread is suspicious to be malicious. In one example, the system includes a malicious code detection module and a forcible malicious code termination module. The malicious code detection module extracts information on a thread generated by a process running on a computer system to identify code related to the thread. It then preliminarily determines whether or not the identified code is malicious and extracts the code preliminarily determined to be malicious. The forcible malicious code termination module finally determines the code as malicious code based on an analysis result of behavior of the extracted code executed in a virtual environment and forcibly terminates execution of the code.
[0008] In U.S. Patent Application Publication No. US 2016 / 0232347 A1, malware in a computer is found by detecting a sequence of function calls in a memory space of a process executing on a computer, tracing the process stack to locate members of the sequence in a database of non-malicious function calls, failing to locate the sequence in the database, and responding to the failure by a combination of logging the failure, alerting an operator and terminating, blocking or otherwise disabling the process or a system call initiated by the process.
[0009] Examples described in U.S. Patent Application Publication No. US 2016 / 0180089 A1 provide for an electronic device that can be configured to intercept a process, store execution profiling for the process if the process involves a privileged resource or a privileged operation, and analyze the code involved in each stack frame to determine malicious activity. If the process does not involve a privileged resource or a privileged operation, then the process is not analyzed.
[0010] In U.S. Patent Application Publication No. US 2016 / 0357958 A1, a thread related to an event is identified and a set of software modules of a computer system is enumerated. The thread is verified by determining whether the thread corresponds to one of the software modules. Code related to the thread is verified by loading code segments from storage into memory and comparing newly loaded code with original code segments in memory. The stack is verified by determining whether the thread matches one or more stack addresses of the stack. The execution path related to the event is verified by comparison to a set of predefined execution paths. If any of the security verifications fail, a security event is generated such as by blocking execution of code related to the event.
[0011] What is needed is a mechanism for detecting malicious instructions that have been injected into processor 110 or memory 120 but not stored in storage device 130 and generating an alert upon such detection and / or suspending execution of the malicious instructions.BRIEF SUMMARY OF THE INVENTION
[0012] The invention is defined in the independent claims. Particular embodiments are set out in the dependent claims.
[0013] For example, a malicious code detection module identifies potentially malicious instructions in memory of a computing device. The malicious code detection module examines the call stack for each thread running within the operating system of the computing device. Within each call stack, the malicious code detection module identifies the originating module for each stack frame and determines whether the originating module is backed by an image on disk. If an originating module is not backed by an image on disk, the thread containing that originating module is flagged as potentially malicious, execution of the thread optionally is suspended, and an alert is generated for the user or administrator.BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 depicts a prior art computing device. Figure 2 depicts prior art virus scan software. Figure 3 depicts multiple threads running within a prior art operating system. Figure 4 depicts attribute information for various programs running in a prior art computing device. Figure 5 depicts a malicious code detection module for identifying potentially malicious instructions. Figure 6 further depicts a malicious code detection module for identifying potentially malicious instructions. DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS
[0015] Additional aspects of prior art systems will now be described. In Figure 3, processor 110 executes operating system 140. Operating system 140 can manage multiple threads of instructions that are executed concurrently. Here, exemplary threads 301 and 302 are depicted, but it is to be understood that additional threads can be executed. Operating system 140 maintains a call stack for each thread. Here, exemplary call stack 312 is depicted, which is the call stack for thread 302. Threads can be related to one another. For example, in this example, thread 302 was initiated by thread 301.
[0016] In this simplified example, call stack 312 comprises variables 331, 332, and 335 and parameter 333, which were placed in call stack 312 by thread 302. Return address 334 also was placed on call stack 312 by thread 302. Return address 334 is the address corresponding to the instruction in thread 302 that placed stack frame 341 in call stack 312. A stack frame is a collection of data placed in a call stack as part of a procedure. Here, stack frame 341 comprises variables 331 and 332, parameter 333, and return address 334.
[0017] Operating system 140 further comprises application programming interface (API) module 320, which is a mechanism by which threads can invoke APIs specific to operating system 140.
[0018] Figure 4 depicts further aspects of the prior art. Here, memory 120 contains various types of programs, user data, and unassigned portions. Each of these items is stored in a particular address range within memory 120, and memory 120 includes attribute information 410 that indicates whether each item is backed by a file stored in storage device 130 (e.g., whether that item is "backed on disk"). In this simple example, attribute information 410 includes address ranges for operating system 140, utility program 411, application program 412, program 413, user data 414, and an unassigned area 415. Attribute information 410 further indicates whether each item is backed by a file in storage device 130 or not. Here, all items are in fact backed by a file except for program 413. Attribute information 410 typically is established and managed by operating system 140.
[0019] With reference now to Figure 5, an embodiment of computing device 500 is depicted. Computing device 500 comprises processor 1 10 and operating system 140 as in the prior art. Computing device 500 further comprises malicious code detection module 510, which comprises lines of code executed by processor 110. Malicious code detection module 510 optionally can be part of the kernel of operating system 140 or can be code outside of operating system 140 that is given special privileges by operating system 140, such as the ability to access attribute information 410 and / or to suspend execution of a thread.
[0020] The embodiments detect malicious code based on three characteristics that typically are present in malicious code. First, malicious code usually owns a thread of execution. Second, this thread of execution originates or operates from code that is not backed by a file on disk. Third, the thread of execution must call the operating system
[0021] API module 320 directly in order for the malicious code to affect appreciable activity on the system. That is, in order for the malicious code to inflict harm, it inevitably must call operating system API module 320 directly. Although there are some exceptions, these three features generally are not found in benign application or operating system 140 itself.
[0022] Malicious code detection module 510 first enumerates the call stacks of each thread of execution. In one embodiment, malicious code detection module 510 assigns a unique identifier to each call stack. Once enumerated, each call stack is analyzed to determine if it is malicious in nature.
[0023] In the simplified example of Figure 5, malicious code detection module 510 starts at the top of call stack 312 and works down. The top of a call stack is almost always a system call originating from an operating system library. If not, the thread was likely performing a CPU intensive task and the thread is immediately deemed non-malicious. Here, the top of the call stack 312 is system call 521 (which represents a call made to API module 320), and the analysis therefore continues.
[0024] Malicious code detection module continues down call stack 312 and determines the originating module for each stack frame in the reverse order in which the stack frames were added to call stack 312. Here, stack frames 502 and 501 are shown. Malicious code detection module 510 determines the return address for stack frames 502 and 501, which here are return addresses 512 and 511, and determines the procedure within thread 302 associated with the return address. Malicious code detection module 510 then consults attribute information 410 to determine whether the code in which that procedure is contained is backed by a file in storage device 130. If it is (as would be the case if the procedure is part of application program 412), then the procedure and the thread containing it are deemed non-malicious. If it is not (as would be the case if the procedure is part of program 413), then the procedure and the thread containing it are deemed potentially malicious.
[0025] With reference to Figure 6, when malicious code detection module 510 determines that a procedure and the thread containing it are potentially malicious, it optionally suspends the thread (if operating system 140 has given malicious code detection module 510 permission to perform such an action) and / or it generates alert 610.
[0026] If suspended, thread 302 will not resume execution unless and until a user or administrator expressly instructs computing device 500 to proceed with execution of thread 302.
[0027] Alert 610 can take any variety of forms. Alert 610 can be a message displayed on a display operated by a user or administrator. Alert 610 also might be an email, SMS message, MMS message, or other message sent to a device operated by a user or administrator. Alert 610 also might be an audible sound generated by computing device 500.
[0028] With reference again to Figure 5, it is understood that each stack frame is analyzed in the reverse order in which the stack frame was added to the call stack. Optionally, malicious code detection module 510 can stop this analysis when threshold / event 520 is reached. Examples of different threshold / event 520 possibilities include: (1) Malicious code detection module 510 can analyze X stack frames and then stop; (2) Malicious code detection module 510 can analyze the stack frames that were added to call stack 312 within the last Y seconds; (3) Malicious code detection module 510 can analyze the stack frames that were added to call stack 312 since the last analysis performed by malicious code detection module 510 was performed on call stack 312; or (4) Malicious code detection module 510 can analyze the stack frames until it identifies a return address associated with a certain type of procedure. This type of limitation might be desirable because call stacks can become very large, and continuing the analysis indefinitely may slow down processor 110 in performing other tasks.
[0029] The foregoing merely illustrates the principles of the disclosure. Various modifications and alterations to the described embodiments will be apparent to those skilled in the art in view of the teachings herein. It will thus be appreciated that those skilled in the art will be able to devise numerous systems, arrangements, and procedures which, although not explicitly shown or described herein, embody the principles of the disclosure and can be thus within the scope of the disclosure. Various different exemplary embodiments can be used together with one another, as well as interchangeably therewith, as should be understood by those having ordinary skill in the art. In addition, certain terms used in the present disclosure, including the specification, drawings and claims thereof, can be used synonymously in certain instances, including, but not limited to, for example, data and information. It should be understood that, while these words, and / or other words that can be synonymous to one another, can be used synonymously herein, that there can be instances when such words can be intended to not be used synonymously.
Claims
1. A method of detecting malicious code in a computing device (500) comprising a processor (110) executing an operating system (140) and a malicious code detection module (510), memory (120), and a non-volatile storage device (130), the method comprising: identifying, by the malicious code detection module (510), a call stack (312) for a thread of execution (301, 302) within the operating system (140); determining, by the malicious code detection module (510), an originating module that initiated a stack frame (501, 502) in the call stack (312); determining, by the malicious code detection module (510), whether the originating module has been injected into the processor (110) or the memory (120), but is not backed by a file (230) stored in the non-volatile storage device (130); and generating an alert (610), by the malicious code detection module (510), if the originating module is not backed by a file (230) stored in the non-volatile storage device (130).
2. The method of claim 1, wherein the step of determining the originating module is performed for additional stack frames (501, 502) in the call stack (312) until a threshold (520) or event is reached.
3. The method of claim 1 or 2, wherein the step of determining the originating module is not performed if the top of the call stack (312) does not contain a call to an application programing interface (320) of the operating system (140).
4. The method of claim 1, 2 or 3, wherein the malicious code detection module (510) is part of a kernel of the operating system (140).
5. The method of claim 1, 2, or 3, wherein the malicious code detection module (510) is not part of the operating system (140).
6. The method of any of the preceding claims, further comprising: suspending, by the malicious code detection module (510), the thread of execution (301, 302) containing the originating module if the originating module is not backed by a file (230) stored in the non-volatile storage device (130).
7. The method of any of the preceding claims, further comprising: detecting malicious code based on the identified call stack for the thread of execution (301, 302), the determination that the originating module is not backed by a file (230) stored in the non-volatile storage device (130), and a determination that the thread of execution (301, 302) directly calls the application programming interface (320) of the operating system (140).
8. A computing device comprising: a processor (110); memory (120); a non-volatile storage device (130); an operating system (140) executable by the processor (110); and a malicious code detection module (510) executable by the processor (110), the malicious code detection module (510) comprising instructions for: identifying a call stack (312) for a thread of execution (301, 302) within the operating system (140); determining an originating module that initiated a stack frame (501, 502) in the call stack (312); determining whether the originating module has been injected into the processor (110) or the memory (120), but is not backed by a file (230) stored in the non-volatile storage device (130); and generating an alert (610) if the originating module is not backed by a file (230) stored in the non-volatile storage device (130).
9. The device of claim 8, wherein the malicious code detection module (510) further comprises instructions for performing the step of determining the originating module for additional stack frames (501, 502) in the call stack (312) until a threshold (520) or event is reached.
10. The device of claim 8 or 9, wherein the malicious code detection module (510) further comprises instructions that skip the step of determining the originating module if the top of the call stack (312) does not contain a call to an application programing interface (320) of the operating system (140).
11. The device of claim 8, 9, or 10, wherein the malicious code detection module (510) is part of a kernel of the operating system (140).
12. The device of claim 8, 9, or 10, wherein the malicious code detection module (510) is not part of the operating system (140).
13. The device of any of claims 8-12, wherein the malicious code detection module (510) further comprises instructions for suspending the thread of execution (301, 302) containing the originating module if the originating module is not backed by a file (230) stored in the non-volatile storage device (130).
14. The device of any of claims 8-13, wherein the malicious code detection module (510) further comprises instructions for detecting malicious code based on the identified call stack for the thread of execution (301, 302), the determination that the originating module is not backed by a file (230) stored in the non-volatile storage device (130), and a determination that the thread of execution (301, 302) directly calls the application programming interface (320) of the operating system (140).
