Sunday 13 May 2012

Keystroke logging


Software-based key loggers
These are software programs designed to work on the target computer’s operating system. From a technical perspective there are five categories:
    Hypervisor-based: The key logger can theoretically reside in a malware hypervisor running underneath the operating system, which remains untouched. It effectively becomes a virtual machine. Blue Pill is a conceptual example.
    Kernel-based: This method is difficult both to write and to combat. Such key loggers reside at the kernel level and are thus difficult to detect, especially for user-mode applications. They are frequently implemented as root kits that subvert the operating system kernel and gain unauthorized access to the hardware, making them very powerful. A key logger using this method can act as a keyboard device driver for example, and thus gain access to any information typed on the keyboard as it goes to the operating system.
    API-based: These keyloggers hook keyboard APIs; the operating system then notifies the key logger each time a key is pressed and the keylogger simply records it. Windows APIs such as GetAsyncKeyState(), GetForegroundWindow(), etc. are used to poll the state of the keyboard or to subscribe to keyboard events.These types of keyloggers are the easiest to write, but where constant polling of each key is required, they can cause a noticeable increase in CPU usage, and can also miss the occasional key. A more recent example simply polls the BIOS for pre-boot authentication PINs that have not been cleared from memory.
    Form grabbing based: Form grabbing-based keyloggers log web form submissions by recording the web browsing onsubmit event functions. This records form data before it is passed over the Internet and bypasses HTTPS encryption.
    Memory injection based: Memory Injection (MITB)-based keyloggers alter memory tables associated with the browser and other system functions to perform their logging functions. By patching the memory tables or injecting directly into memory, this technique can be used by malware authors who are looking to bypass Windows UAC (User Account Control). The Zeus and Spyeye Trojans use this method exclusively.[citation needed]
    Packet analyzers: This involves capturing network traffic associated with HTTP POST events to retrieve unencrypted passwords.
Remote access software key loggers
These are local software key loggers with an added feature that allows access to the locally recorded data from a remote location. Remote communication may be achieved using one of these methods:
    The software enables a remote login to the local machine from the Internet or the local network, for data logs stored on the target machine to be accessed.
Related features
Software Key loggers may be augmented with features that capture user information without relying on keyboard key presses as the sole input. Some of these features include:
    Clipboard logging. Anything that has been copied to the clipboard can be captured by the program.
    Screen logging. Screenshots are taken in order to capture graphics-based information. Applications with screen logging abilities may take screenshots of the whole screen, just one application or even just around the mouse cursor. They may take these screenshots periodically or in response to user behaviours (for example, when a user has clicked the mouse). A practical application used by some keyloggers with this screen logging ability is to take small screenshots around where a mouse has just clicked; these defeat web-based keyboards (for example, the web-based screen keyboards that are often used by banks) and any web-based on-screen keyboard without screenshot protection.
    Programmatically capturing the text in a control. The Microsoft Windows API allows programs to request the text 'value' in some controls. This means that some passwords may be captured, even if they are hidden behind password masks (usually asterisks).
    The recording of every program/folder/window opened including a screenshot of each and every website visited, also including a screenshot of each.
    The recording of search engines queries, instant messenger conversations, FTP downloads and other Internet-based activities (including the bandwidth used).

Hardware-based key loggers
Hardware-based key loggers do not depend upon any software being installed as they exist at a hardware level in a computer system.
    Firmware-based: BIOS-level firmware that handles keyboard events can be modified to record these events as they are processed. Physical and/or root-level access is required to the machine, and the software loaded into the BIOS needs to be created for the specific hardware that it will be running on.
    Keyboard hardware: Hardware key loggers are used for keystroke logging by means of a hardware circuit that is attached somewhere in between the computer keyboard and the computer, typically inline with the keyboard's cable connector. More stealthy implementations can be installed or built into standard keyboards, so that no device is visible on the external cable. Both types log all keyboard activity to their internal memory, which can be subsequently accessed, for example, by typing in a secret key sequence. A hardware key logger has an advantage over a software solution: it is not dependent on being installed on the target computer's operating system and therefore will not interfere with any program running on the target machine or be detected by any software. However its physical presence may be detected if, for example, it is installed outside the case as an inline device between the computer and the keyboard. Some of these implementations have the ability to be controlled and monitored remotely by means of a wireless communication standard.