Keyloggers are used to capture a user's keystrokes. Keyloggers may be either hardware or software and may be installed on a computer to record every key typed. If a keylogger is software it may not be able to get a windows password, but if the keylogger is hardware plugged in between the keyboard and computer, it can record all passwords entered. A hardware keylogger must be accessed directly by the attacker so physical access to the computer is required but they can be difficult for users to detect. A software keylogger may be able to send keystrokes to the attacker remotely anywhere on the internet.
Software keyloggers may be spread as a trojan horse, virus, or worm. Firewalls that filter network traffic going out to the internet may help prevent the keylogger traffic from getting to an attacker.