Method and system for detecting a keylogger that encrypts data captured on a computer
A method and system for detecting a keylogger that encrypts data captured on a computer. One illustrative embodiment acquires a first sample of a portion of a memory of a computer, the portion of the memory being associated with a running process on the computer; inputs to the computer, in a manner that mimics keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns; acquires a second sample of the portion of the memory; compares the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and flags the running process as a potential keylogger when the at least one data segment contains a second data pattern matching the overall sub-pattern structure of the first data pattern despite the particular sub-patterns making up the first and second data patterns being different.
The present application is related to commonly owned and assigned U.S. application Ser. No. 11/334,318, Attorney Docket No. WEBR-033/00US, entitled “Method and System for Detecting a Keylogger on a Computer,” which is incorporated herein by reference.
FIELD OF THE INVENTIONThe present invention relates generally to the detection of pestware or malware on computers. In particular, but without limitation, the present invention relates to methods and systems for detecting keyloggers.
BACKGROUND OF THE INVENTIONProtecting personal computers from a never-ending onslaught of pestware or malware has become increasingly important and challenging. Some types of pestware or malware can compromise a user's privacy by sending sensitive information about the user or the user's computer to a remote destination without the user's knowledge or permission. Such malware is commonly referred to as “spyware.” One particular type of spyware, a “keylogger,” secretly records a user's keystrokes as the user types on a keyboard and captures the resulting text in a data file, which is often encrypted. The keylogger may also secretly send the captured data file to a remote destination by e-mail or some other communication protocol. Such a keylogger can be used by a remote party to acquire information such as credit card numbers, social security numbers, and other sensitive information.
Clearly, computer users have a strong motivation to detect and remove unwanted keyloggers from their systems. Many computer users rely on anti-pestware programs to detect and remove such threats. Some anti-pestware programs detect keyloggers by inputting a known, typically repeating, data pattern to the system in a manner that appears to the system to be keyboard input and searching process memory for the known data pattern. This method fails, however, when the keylogger encrypts the data it captures. In that case, the data captured by the keylogger appears to be completely different from the input “decoy” data pattern. Some keyloggers also evade detection by writing their memory buffers to a disk file very shortly after capturing a group of keystrokes and flushing their memory buffers.
It is thus apparent that there is a need in the art for an improved method and system for detecting keyloggers that encrypt data captured on a computer.
SUMMARY OF THE INVENTIONIllustrative embodiments of the present invention that are shown in the drawings are summarized below. These and other embodiments are more fully described in the Detailed Description section. It is to be understood, however, that there is no intention to limit the invention to the forms described in this Summary of the Invention or in the Detailed Description. One skilled in the art can recognize that there are numerous modifications, equivalents, and alternative constructions that fall within the spirit and scope of the invention as expressed in the claims.
The present invention can provide a method and system for identifying a keylogger that encrypts data captured on a computer. One illustrative embodiment is a method comprising acquiring a first sample of a portion of a memory of a computer, the portion of the memory being associated with a running process on the computer; inputting to the computer, in a manner that mimics keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns; acquiring a second sample of the portion of the memory; comparing the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and flagging the running process as a potential keylogger when the at least one data segment contains a second data pattern matching the overall sub-pattern structure of the first data pattern despite the particular sub-patterns making up the first and second data patterns being different.
Another illustrative embodiment is a system comprising a data acquisition module configured to acquire first and second samples of a portion of a memory of a computer, the portion of the memory being associated with a running process on the computer; a data injection module configured to input to the computer, at a time between acquisition of the first and second samples and in a manner mimicking keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns; and an analysis module configured to compare the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample and to flag the running process as a potential keylogger when the at least one data segment contains a second data pattern that matches the overall sub-pattern structure of the first data pattern despite the particular sub-patterns making up the first and second data patterns being different.
BRIEF DESCRIPTION OF THE DRAWINGSVarious objects and advantages and a more complete understanding of the present invention are apparent and more readily appreciated by reference to the following Detailed Description and to the appended claims when taken in conjunction with the accompanying Drawings, wherein:
In one illustrative embodiment of the invention, a keylogger on a computer is detected by inputting to the computer, in a manner mimicking keyboard input, a data pattern that can be recognized in memory despite that data pattern being encrypted and searching the memory for the altered but still-recognizable data pattern. In this embodiment, “memory” can be any computer storage medium, including, without limitation, random access memory (RAM) and non-volatile storage such as a magnetic disk drive.
The input data pattern can be rendered recognizable in memory despite encryption by structuring it as a “pattern of repeating sub-patterns.” That is, the input data pattern consists of at least one occurrence of each of a set of distinct sub-patterns (e.g., sub-strings). When a keylogger employs an encryption algorithm that produces a consistent output each time a given input occurs, the “pattern of repeating sub-patterns” in the input data pattern can still be recognized within the encrypted data even though the sub-patterns in the input and encrypted data patterns are completely different. When the overall structure of the input data pattern is recognized among the encrypted data, the running process whose memory has been scanned can be flagged as a potential keylogger. Optionally, a user may be notified that the running process has been flagged as a potential keylogger.
To improve the reliability of keylogger detection, the above process of injecting a structured data pattern and searching changed process memory for a recognizable encrypted data pattern can be performed multiple times for a given running process.
Referring now to the drawings, where like or similar elements are designated with identical reference numerals throughout the several views, and referring in particular to
Input devices 115 may be, for example, a keyboard and a mouse or other pointing device. In an illustrative embodiment, storage device 125 is a magnetic-disk device such as a hard disk drive (HDD). In other embodiments, however, storage device 125 can be any type of computer storage device, including, without limitation, a magnetic-disk drive, an optical-disc drive, and a storage device employing flash-memory-based media such as secure digital (SD) cards or multi-media cards (MMCs). Memory 130 may include random-access memory (RAM), read-only memory (ROM), or a combination thereof.
In this illustrative embodiment, memory 130 contains keylogger detection system 135 and an arbitrary running process 140. Keylogger detection system 135 detects keyloggers on computer 100 and, when appropriate, removes them from computer 100. In the illustrative embodiment of
For convenience in this Detailed Description, the functionality of keylogger detection system 135 has been divided into three functional modules: data acquisition module 145, data injection module 150, and analysis module 155. In some embodiments, keylogger detection system 135 includes additional user-interface and keylogger-removal modules (not shown in
Data acquisition module 145 is configured to read a portion of the memory of computer 100 associated with a running process 140. The memory read may be executable-program and data memory (e.g., a RAM portion of memory 130) associated with running process 140 or non-volatile memory associated with running process 140 such as a disk file on storage device 125.
Data injection module 150 is configured to input to computer 100, in a manner that mimics keyboard input, an input data pattern consisting of one or more occurrences of each of a set of distinct sub-patterns. In this illustrative embodiment, data injection module 150 injects the input data pattern at a time between the acquisition of two separate samples of the memory associated with running process 140 by data acquisition module 145. The staggered-time process memory samples allow analysis module 155 to look for regions of change in the memory associated with a particular running process 140, narrowing the search for a recognizable data pattern among the encrypted data captured by a keylogger.
In one embodiment, data injection module 150 mimics keyboard input by generating the input data pattern using a driver-level process associated with keylogger detection system 135 and sending the input data pattern to a hidden window (e.g., a one-pixel window) on computer 100. Techniques for employing such a driver and hidden window in the detection of keyloggers are explained more fully in commonly owned and assigned U.S. application Ser. No. 11/334,318, Attorney Docket No. WEBR-033/00US, entitled “Method and System for Detecting a Keylogger on a Computer,” which is incorporated herein by reference.
Analysis module 155 is configured to examine samples of memory associated with a given running process 140 that have been acquired by data acquisition module 145 to determine whether a later sample has changed relative to an earlier sample. Once one or more such regions of changed process memory have been identified, analysis module 155 examines those regions for an encrypted data pattern having the same structure (“pattern of repeating sub-patterns”) as the input data pattern. If such an encrypted data pattern is found, analysis module 155 flags running process 140 as a potential keylogger. Optionally, analysis module 155 also alerts a user that running process 140 is a potential keylogger. In other embodiments, keylogger detection system 135 may offer the user the option of removing the suspected keylogger from computer 100.
For simplicity, only two distinct sub-patterns are shown in
Analysis module 155 can recognize the correspondence between input data pattern 200 and encrypted data pattern 215 by identifying the repeating sub-patterns 220 and 225 in the memory associated with a running process 140 (a keylogger) and verifying that those repeating sub-patterns 220 and 225 satisfy certain further conditions for input data pattern 200 and encrypted data pattern 215 to have the same overall structure (“pattern of repeating sub-patterns”). One condition is that each sub-pattern in encrypted data pattern 215 occur the same number of times in encrypted data pattern 215 as a unique corresponding sub-pattern in input data pattern 200 occurs in input data pattern 200. Another condition is that the sub-patterns in encrypted data pattern 215 occur in the same order as the corresponding unique sub-patterns occur in input data pattern 200.
In the example of
The techniques described in connection with
Those skilled in the art will recognize that even though the example of
Many variations of the method diagramed in
In conclusion, the present invention provides, among other things, method and system for identifying keyloggers that encrypt data captured on a computer. Those skilled in the art can readily recognize that numerous variations and substitutions may be made in the invention, its use, and its configuration to achieve substantially the same results as achieved by the embodiments described herein. Accordingly, there is no intention to limit the invention to the disclosed illustrative forms. Many variations, modifications and alternative constructions fall within the scope and spirit of the disclosed invention as expressed in the claims.
Claims
1. A method for detecting a keylogger that encrypts data captured on a computer, the method comprising:
- acquiring a first sample of a portion of a memory of the computer, the portion of the memory being associated with a running process on the computer;
- inputting to the computer, in a manner that mimics keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns;
- acquiring a second sample of the portion of the memory;
- comparing the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and
- flagging the running process as a potential keylogger when: the at least one data segment contains a second data pattern consisting of at least one occurrence of each of a second set of distinct sub-patterns, each sub-pattern in the second set of distinct sub-patterns occurs the same number of times in the second data pattern as a corresponding unique sub-pattern in the first set of distinct sub-patterns occurs in the first data pattern, and the sub-patterns in the second data pattern occur in the same order as the corresponding unique sub-patterns occur in the first data pattern.
2. The method of claim 1, wherein the method is performed a plurality of times for a particular running process.
3. The method of claim 1, further comprising:
- notifying a user that the running process is a potential keylogger when the running process has been flagged as a potential keylogger.
4. The method of claim 1, further comprising:
- automatically removing the running process from the computer when the running process has been flagged as a potential keylogger.
5. The method of claim 1, further comprising:
- removing the running process from the computer in response to user input when the running process has been flagged as a potential keylogger.
6. The method of claim 1, wherein the memory is random-access memory.
7. The method of claim 1, wherein the memory is a non-volatile memory.
8. The method of claim 1, wherein the first and second sets of distinct sub-patterns are disjoint.
9. A system for detecting a keylogger that encrypts data captured on a computer, the system comprising:
- a data acquisition module configured to acquire first and second samples of a portion of a memory of the computer, the portion of the memory being associated with a running process on the computer;
- a data injection module configured to input to the computer, at a time between acquisition of the first and second samples and in a manner mimicking keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns; and
- an analysis module configured to: compare the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and flag the running process as a potential keylogger when: the at least one data segment contains a second data pattern consisting of at least one occurrence of each of a second set of distinct sub-patterns, each sub-pattern in the second set of distinct sub-patterns occurs the same number of times in the second data pattern as a corresponding unique sub-pattern in the first set of distinct sub-patterns occurs in the first data pattern, and the sub-patterns in the second data pattern occur in the same order as the corresponding unique sub-patterns occur in the first data pattern.
10. The system of claim 9, wherein the analysis module is further configured to notify a user that the running process is a potential keylogger when the analysis module has flagged the running process as a potential a keylogger.
11. The system of claim 9, wherein the analysis module is further configured to remove the running process from the computer automatically when the analysis module has flagged the running process as a potential keylogger.
12. The system of claim 9, wherein the analysis module is further configured to remove the running process from the computer in response to user input when the analysis module has flagged the running process as a potential keylogger.
13. The system of claim 9, wherein the memory is random access memory.
14. The system of claim 9, wherein the memory is a non-volatile memory.
15. The system of claim 9, wherein the first and second sets of distinct sub-patterns are disjoint.
16. A system for detecting a keylogger that encrypts data captured on a computer, the system comprising:
- means for acquiring first and second samples of a portion of a memory of the computer, the portion of the memory being associated with a running process on the computer;
- means for inputting to the computer, at a time between acquisition of the first and second samples and in a manner mimicking keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns;
- means for comparing the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and
- means for flagging the running process as a potential keylogger when: the at least one data segment contains a second data pattern consisting of at least one occurrence of each of a second set of distinct sub-patterns, each sub-pattern in the second set of distinct sub-patterns occurs the same number of times in the second data pattern as a corresponding unique sub-pattern in the first set of distinct sub-patterns occurs in the first data pattern, and the sub-patterns in the second data pattern occur in the same order as the corresponding unique sub-patterns occur in the first data pattern.
17. A computer-readable storage medium containing program instructions executable by a processor to detect a keylogger that encrypts data captured on a computer, the program instructions comprising:
- a first instruction segment configured to acquire first and second samples of a portion of a memory of the computer, the portion of the memory being associated with a running process on the computer;
- a second instruction segment configured to input to the computer, at a time between acquisition of the first and second samples and in a manner mimicking keyboard input, a first data pattern consisting of at least one occurrence of each of a first set of distinct sub-patterns; and
- a third instruction segment configured to: compare the first and second samples of the portion of the memory to identify at least one data segment in which the second sample has changed relative to the first sample; and flag the running process as a potential keylogger when: the at least one data segment contains a second data pattern consisting of at least one occurrence of each of a second set of distinct sub-patterns, each sub-pattern in the second set of distinct sub-patterns occurs the same number of times in the second data pattern as a corresponding unique sub-pattern in the first set of distinct sub-patterns occurs in the first data pattern, and the sub-patterns in the second data pattern occur in the same order as the corresponding unique sub-patterns occur in the first data pattern.
Type: Application
Filed: Jul 25, 2006
Publication Date: Jul 19, 2007
Inventors: Michael Greene (Boulder, CO), Matt Parker (Broomfield, CO)
Application Number: 11/492,581
International Classification: G06F 12/14 (20060101);