### Comment:
What is the purpose of a keylogger in malware?

### REPLY:
A keylogger in malware is used to secretly monitor and record all keystrokes made by a user, including sensitive information such as usernames, passwords, credit card details, and other personal data. This information can then be transmitted to the attacker's server, giving them unauthorized access to the victim's accounts and potentially leading to identity theft or financial fraud.