This is a simple keylogger implemented in C# that logs keystrokes and emails the logs periodically.
The keylogger hooks into the Windows keyboard events and captures keystrokes. It maintains a buffer to store keystrokes until a certain threshold is reached, then writes them to a log file. When the log file reaches a specified length, it archives the log file, sends it via email, and clears the log file.
- Clone or download the repository.
- Open the solution in Visual Studio or any compatible IDE.
- Customize the variables in the
Program.csfile according to your email settings and preferences. - Build and run the application.
FROM_EMAIL_ADDRESS: Email address used to send logs.FROM_EMAIL_PASSWORD: Password for the sending email address.TO_EMAIL_ADDRESS: Email address to receive logs.LOG_FILE_NAME: Path to the log file.ARCHIVE_FILE_NAME: Path to the archive log file.INCLUDE_LOG_AS_ATTACHMENT: Whether to include the log file as an attachment in the email.MAX_LOG_LENGTH_BEFORE_SENDING_EMAIL: Maximum length of the log file before sending it via email.MAX_KEYSTROKES_BEFORE_WRITING_TO_LOG: Maximum number of keystrokes to buffer before writing them to the log file.
SystemSystem.Runtime.InteropServicesSystem.DiagnosticsSystem.Windows.FormsSystem.IOSystem.Net.MailSystem.Net
This code is provided for educational purposes only. Please use responsibly and respect privacy laws and regulations in your jurisdiction.