Building a keylogger file transfer
We have already learned how to send and receive very basic data in the program we developed in Chapter 6, Malware Development. In this chapter, we will try to send and receive files from one PC to another, first from the victim's PC to the hacker's PC, and then from the hacker's to the victim's PC. This will give us access to any sensitive files present on the victim's PC. For example, let's say that the victim has stored their passwords in a file present on their PC (which is a very bad idea; never store your passwords in a plain text file on your PC); then we can simply read the contents of the file and send it to the hacker. Let's see how this works.
Downloading the victim file to the hacker
Here, we will modify the program we developed in Chapter 6, Malware Development, where we ran Windows commands to add functionality for file transfer (see the Creating malware section). First, we will add a download...