Keyloggers are widely known utilities that can capture keystrokes and other runtime information. These tools are often considered malicious; however, they do have valid application to track system usage and study the interactions between users and their computers. Regardless of the purpose, these programs interact at a low level to capture user information. The code developed in this chapter is for educational use only and provides an opportunity to introduce Python's ability to interact with the Windows API. In addition to this, we will gain an understanding of malicious code in Python and how it works.
In this chapter, we will construct a keylogger to demonstrate the use of several libraries used to access features of the Windows operating system. We will also learn to use multiprocessing with Python to better take advantage of a system's resources. Though this chapter differs from the main focus of forensic script development, it introduces several...