Keystroke logging

Keystroke logging (often called keylogging) is the action of tracking (or logging) the keys struck on a keyboard, typically in a covert manner so that the person using the keyboard is unaware that their actions are being monitored. There are numerous keylogging methods, ranging from hardware and software-based approaches to electromagnetic and acoustic analysis.

Contents

Application

Software-based keyloggers

These are software programs designed to work on the target computer’s operating system. From a technical perspective there are five categories:

Remote access software keyloggers

These are local software keyloggers 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:

Related features

Software Keyloggers may be augmented with features that capture user information without relying on keyboard key presses as the sole input. Some of these features include:

Hardware-based keyloggers

Hardware-based keyloggers do not depend upon any software being installed as they exist at a hardware level in a computer system.

Wireless keyboard sniffers

These passive sniffers collect packets of data being transferred from a wireless keyboard and its receiver. As encryption may be used to secure the wireless communications between the two devices, this may need to be cracked beforehand if the transmissions are to be read.

Keyboard overlays

Criminals have been known to use keyboard overlays on ATMs to capture people's PINs. Each keypress is registered by the keyboard of the ATM as well as the criminal's keypad that is placed over it. The device is designed to look like an integrated part of the machine so that bank customers are unaware of its presence.[7]

Acoustic keyloggers

Acoustic cryptanalysis can be used to monitor the sound created by someone typing on a computer. Each key on the keyboard makes a subtly different acoustic signature when stroked. It is then possible to identify which keystroke signature relates to which keyboard character via statistical methods such as frequency analysis. The repetition frequency of similar acoustic keystroke signatures, the timings between different keyboard strokes and other context information such as the probable language in which the user is writing are used in this analysis to map sounds to letters.[8] A fairly long recording (1000 or more keystrokes) is required so that a big enough sample is collected.[9]

Electromagnetic emissions

It is possible to capture the electromagnetic emissions of a wired keyboard from up to 20 metres (66 ft) away, without being physically wired to it.[10] In 2009, Swiss researches tested 11 different USB, PS/2 and laptop keyboards in a semi-anechoic chamber and found them all vulnerable, primarily because of the prohibitive cost of adding shielding during manufacture.[11] The researchers used a wide-band receiver to tune into the specific frequency of the emissions radiated from the keyboards.

Other

Optical surveillance

Optical surveillance, while not a keylogger in the classical sense, is nonetheless an approach that can be used to capture passwords or PINs. A strategically placed camera, such as a hidden surveillance camera at an ATM, can allow a criminal to watch a PIN or password being entered.[12]

Physical evidence

For a keypad that is used only to enter a security code, the keys which are in actual use will have evidence of use from many fingerprints. A passcode of four digits, if the four digits in question are known, is reduced from 10,000 possibilities to just 24 possibilities. These could then be used on separate occasions for a manual "brute force attack."

History

An early keylogger was written by Perry Kivolowitz and posted to the Usenet news group net.unix-wizards,net.sources on November 17, 1983.[13] The posting seems to be a motivating factor in restricting access to /dev/kmem on Unix systems. The user-mode program operated by locating and dumping character lists (clists) as they were assembled in the Unix kernel.

Cracking

Writing simple software applications for keylogging can be trivial, and like any nefarious computer program, can be distributed as a trojan horse or as part of a virus. What is not trivial for an attacker, however, is installing a covert keystroke logger without getting caught and downloading data that has been logged without being traced. An attacker that manually connects to a host machine to download logged keystrokes risks being traced. A trojan that sends keylogged data to a fixed e-mail address or IP address risks exposing the attacker.

Trojan

Young and Yung devised several methods for solving this problem and presented them in their 1997 IEEE Security & Privacy paper[14] (their paper from '96 touches on it as well). They presented a deniable password snatching attack in which the keystroke logging trojan is installed using a virus or worm. An attacker who is caught with the virus or worm can claim to be a victim. The cryptotrojan asymmetrically encrypts the pilfered login/password pairs using the public key of the trojan author and covertly broadcasts the resulting ciphertext. They mentioned that the ciphertext can be steganographically encoded and posted to a public bulletin board such as Usenet.

Ciphertext

Young and Yung also mentioned having the cryptotrojan unconditionally write the asymmetric ciphertexts to the last few unused sectors of every writable disk that is inserted into the machine. The sectors remain marked as unused. This can be done using a USB token. So, the trojan author may be one of dozens or even thousands of people who are given the stolen information. Only the trojan author can decrypt the ciphertext because only the author knows the needed private decryption key. This attack is from the field known as cryptovirology.

Use by police

In 2000, the FBI used a keystroke logger to obtain the PGP passphrase of Nicodemo Scarfo, Jr., son of mob boss Nicodemo Scarfo.[15] Also in 2000, the FBI lured two suspected Russian cyber criminals to the US in an elaborate ruse, and captured their usernames and passwords with a keylogger that was covertly installed on a machine that they used to access their computers in Russia. The FBI then used these credentials to hack into the suspects' computers in Russia in order to obtain evidence to prosecute them.[16]

Countermeasures

The effectiveness of countermeasures varies, because keyloggers use a variety of techniques to capture data and the countermeasure needs to be effective against the particular data capture technique. For example, an on-screen keyboard will be effective against hardware keyloggers, transparency will defeat some screenloggers - but not all - and an anti-spyware application that can only disable hook-based keyloggers will be ineffective against kernel-based keyloggers.

Also, keylogger software authors may be able to update the code to adapt to countermeasures that may have proven to be effective against them.

Anti keyloggers

An anti keylogger is a piece of software specifically designed to detect keyloggers on your computer, typically comparing all files in your computer against a database of keyloggers looking for similarities which might signal the presence of a hidden keylogger. As anti keyloggers have been designed specifically to detect keyloggers, they have the potential to be more effective than conventional anti virus software; some anti virus software do not consider certain keyloggers a virus, as under some circumstances a keylogger can be considered a legitimate piece of software.

Live CD/USB

Rebooting the computer using a Live CD or write-protected Live USB is a possible countermeasure against software keyloggers if the CD is clean of malware and the operating system contained on it is secured and fully patched so that it cannot be infected as soon as it is started. Booting a different operating system does not impact the use of a hardware or BIOS based keylogger.

Anti-spyware / Anti-virus programs

Many anti-spyware applications are able to detect some software keyloggers and quarantine, disable or cleanse them. However, because many keylogging programs are legitimate piece of software under some circumstances, anti spyware often neglects to label keylogging programs as spyware or a virus. These applications are able to detect software-based keyloggers based on patterns in executable code, heuristics and keylogger behaviours (such as the use of hooks and certain APIs).

No software-based anti-spyware application can be 100% effective against all keyloggers. Also, software-based anti-spyware cannot defeat non-software keyloggers (for example, hardware keyloggers attached to keyboards will always receive keystrokes before any software-based anti-spyware application).

However, the particular technique that the anti-spyware application uses will influence its potential effectiveness against software keyloggers. As a general rule, anti-spyware applications with higher privileges will defeat keyloggers with lower privileges. For example, a hook-based anti-spyware application cannot defeat a kernel-based keylogger (as the keylogger will receive the keystroke messages before the anti-spyware application), but it could potentially defeat hook- and API-based keyloggers.

Network monitors

Network monitors (also known as reverse-firewalls) can be used to alert the user whenever an application attempts to make a network connection. This gives the user the chance to prevent the keylogger from "phoning home" with his or her typed information.

Automatic form filler programs

Automatic form-filling programs may prevent keylogging by removing the requirement for a user to type personal details and passwords using the keyboard. Form fillers are primarily designed for web browsers to fill in checkout pages and log users into their accounts. Once the user's account and credit card information has been entered into the program, it will be automatically entered into forms without ever using the keyboard or clipboard, thereby reducing the possibility that private data is being recorded. However someone with physical access to the machine may still be able to install software that is able to intercept this information elsewhere in the operating system or while in transit on the network. (Transport Layer Security (TLS) prevents the interception of data in transit by network sniffers and proxy tools.)

One-time passwords (OTP)

Using one-time passwords may be keylogger-safe, as each password is invalidated as soon as it's used. This solution may be useful for someone using a public computer, however an attacker who has remote control over such a computer can simply wait for the victim to enter his/her credentials before performing unauthorised transactions on their behalf while their session is active.

One-time passwords also prevent replay attacks where an attacker uses the old information to impersonate. One example is online banking where one-time passwords are implemented to protect accounts from keylogging attacks as well as replay attacks. KYPS is a service that gives OTP access to websites that normally do not offer OTP access.

Security tokens

Use of smart cards or other security tokens may improve security against replay attacks in the face of a successful keylogging attack, as accessing protected information would require both the (hardware) security token as well as the appropriate password/passphrase. Knowing the keystrokes, mouse actions, display, clipboard etc. used on one computer will not subsequently help an attacker gain access to the protected resource. Some security tokens work as a type of hardware-assisted one-time password system, and others implement a cryptographic challenge-response authentication, which can improve security in a manner conceptually similar to one time passwords. Smartcard readers and their associated keypads for PIN entry may be vulnerable to keystoke logging through a so called supply chain attack[17] where an attacker substitutes the card reader/PIN entry hardware for one which records the user's PIN.

On-screen keyboards

Most on screen keyboards (such as the onscreen keyboard that comes with Windows XP) send normal keyboard event messages to the external target program to type text. Every software keylogger can log these typed characters sent from one program to another.[18] Additionally, keylogging software can take screenshots of what is displayed on the screen (periodically, and/or upon each mouse click), which means that although certainly a useful security measure, an on-screen keyboard will not protect from all keyloggers.

Keystroke interference software

Keystroke interference software is also available.[19] These programs attempt to trick keyloggers by introducing random keystrokes, although this simply results in the keylogger recording more information than it needs to. An attacker has the task of extracting the keystrokes of interest—the security of this mechanism, specifically how well it stands up to cryptanalysis, is unclear.

Speech recognition

Similar to on-screen keyboards, speech-to-text conversion software can also be used against keyloggers, since there are no typing or mouse movements involved. The weakest point of using voice-recognition software may be how the software sends the recognized text to target software after the recognition took place.

Handwriting recognition and mouse gestures

Also, many PDAs and lately tablet PCs can already convert pen (also called stylus) movements on their touchscreens to computer understandable text successfully. Mouse gestures utilize this principle by using mouse movements instead of a stylus. Mouse gesture programs convert these strokes to user-definable actions, such as typing text. Similarly, graphics tablets and light pens can be used to input these gestures, however these are less common everyday.

The same potential weakness of speech recognition applies to this technique as well.

Macro expanders/recorders

With the help of many programs, a seemingly meaningless text can be expanded to a meaningful text and most of the time context-sensitively, e.g. "en.wikipedia.org" can be expanded when a web browser window has the focus. The biggest weakness of this technique is that these programs send their keystrokes directly to the target program. However, this can be overcome by using the 'alternating' technique described below, i.e. sending mouse clicks to non-responsive areas of the target program, sending meaningless keys, sending another mouse click to target area (e.g. password field) and switching back-and-forth.

Non-technological methods

Alternating between typing the login credentials and typing characters somewhere else in the focus window[20] can cause a keylogger to record more information than they need to, although this could easily be filtered out by an attacker. Similarly, a user can move their cursor using the mouse during typing, causing the logged keystrokes to be in the wrong order e.g. by typing a password beginning with the last letter and then using the mouse to move the cursor for each subsequent letter. Lastly, someone can also use context menus to remove, cut, copy, and paste parts of the typed text without using the keyboard. An attacker who is able to capture only parts of a password will have a smaller key space to attack if he chose to execute a brute-force attack.

Another very similar technique utilizes the fact that any selected text portion is replaced by the next key typed. E.g. if the password is "secret", one could type "s", then some dummy keys "asdfsd". Then these dummies could be selected with mouse, and next character from the password "e" is typed, which replaces the dummies "asdfsd".

These techniques assume incorrectly that keystroke logging software cannot directly monitor the clipboard, the selected text in a form, or take a screenshot every time a keystroke or mouse click occurs. They may however be effective against some hardware keyloggers.

See also

References

  1. ^ The Evolution of Malicious IRC Bots. Symantec. 2005-11-26. pp. 23–24. http://www.symantec.com/avcenter/reference/the.evolution.of.malicious.irc.bots.pdf. Retrieved 2011-03-25. 
  2. ^ Jonathan Brossard (2008-09-03) (PDF). Bypassing pre-boot authentication passwords by instrumenting the BIOS keyboard buffer (practical low level attaks against x86 pre-boot authentiation software). Iviz Technosolutions. http://www.ivizsecurity.com/research/preboot/preboot_whitepaper.pdf. Retrieved 2008-09-23. 
  3. ^ Microsoft. "EM_GETLINE Message()". Microsoft. http://msdn.microsoft.com/en-us/library/bb761584(VS.85).aspx. Retrieved 2009-07-15. 
  4. ^ "Apple keyboard hack". Apple keyboard hack. Digital Society. http://www.digitalsociety.org/2009/08/apple-keyboards-hacked-and-possessed/. Retrieved 9 June 2011. 
  5. ^ "Keyghost". keyghost.com. http://www.keyghost.com/sx/. Retrieved 2009-04-19. 
  6. ^ "Keylogger Removal". Keylogger Removal. SpyReveal Anti Keylogger. http://spyreveal.com/keyloggerremoval. Retrieved 25 April 2011. 
  7. ^ Jeremy Kirk (2008-12-16). "Tampered Credit Card Terminals". IDG News Service. http://www.pcworld.com/article/155525/.html?tk=rss_news. Retrieved 2009-04-19. 
  8. ^ Andrew Kelly (2010-09-10). "Cracking Passwords using Keyboard Acoustics and Language Modeling". http://www.inf.ed.ac.uk/publications/thesis/online/IM100855.pdf. 
  9. ^ Berkeley.edu
  10. ^ "Remote monitoring uncovered by American techno activists". ZDNet. 2000-10-26. http://news.zdnet.co.uk/security/0,1000000189,2082190,00.htm. Retrieved 2008-09-23. 
  11. ^ Martin Vuagnoux and Sylvain Pasini (2009-06-01). Compromising Electromagnetic Emanations of Wired and Wireless Keyboards. Lausanne: Security and Cryptography Laboratory (LASEC). http://lasecwww.epfl.ch/keyboard/. 
  12. ^ "ATM camera". snopes.com. http://www.snopes.com/fraud/atm/atmcamera.asp. Retrieved 2009-04-19. 
  13. ^ "The Security Digest Archives". http://securitydigest.org/unix/archive/006. Retrieved 2009-11-22. 
  14. ^ A. Young, M. Yung, "Deniable Password Snatching: On the Possibility of Evasive Electronic Espionage," IEEE Symposium on Security & Privacy, pages 224–235, May 4–7, 1997.
  15. ^ John Leyden (2000-12-06). "Mafia trial to test FBI spying tactics: Keystroke logging used to spy on mob suspect using PGP". The Register. http://www.theregister.co.uk/2000/12/06/mafia_trial_to_test_fbi/. Retrieved 2009-04-19. 
  16. ^ John Leyden (2002-08-16). "Russians accuse FBI Agent of Hacking". The Register. http://www.theregister.co.uk/2002/08/16/russians_accuse_fbi_agent/. 
  17. ^ Austin Modine (2008-10-10). "Organized crime tampers with European card swipe devices". The Register. http://www.theregister.co.uk/2008/10/10/organized_crime_doctors_chip_and_pin_machines/. Retrieved 2009-04-18. 
  18. ^ Ian Richards (2007-07-19). "How to improve your security when using a public terminal (part 3 of 4)". Windows Secrets. http://windowssecrets.com/support-alert/2007/07/19/13-How-to-improve-your-security-when-using-a-public-terminal-(part-3-of-4). Retrieved 2010-06-15. 
  19. ^ Christopher Ciabarra (2009-06-10). "Anti Keylogger". Network Intercept. http://networkintercept.com/keystrokeinterference.html. 
  20. ^ Cormac Herley and Dinei Florencio (2006-02-06). "How To Login From an Internet Cafe Without Worrying About Keyloggers" (PDF). Microsoft Research. http://cups.cs.cmu.edu/soups/2006/posters/herley-poster_abstract.pdf. Retrieved 2008-09-23. 

External links