Now, if backdoored-cal.exe is a virus, it will do what it is supposed to do.Īnother feature that we are going to discuss is the shell command. Once we execute it, we will see that the process 3324 has been created, so our backdoor has been executed: We are going to run the execute command to execute the uploaded file on the target computer, and then specify the -f option with the name of file that we want to execute which is backdoored-calc.exe. In the following screenshot, we can see a new file called backdoored-calc.exe: Now, we will run ls command to see the list of files. We are going to upload that file using the upload command, along with the filename which is backdoored-calc.exe. If we go to our root directory, we can see a lot of files, including backdoored-calc.exe. Now, suppose that we have a Trojan, a Keylogger, a virus or a backdoor that we want to upload to the target computer. If we go to our root directory, we will be able to see the file called passwords.txt, as shown in the following screenshot: Once we launch the command, the file will be downloaded.
#Cmd hacking basics download
We are going to download it by using the download command and the filename, which is passwords.txt. Let's suppose that we want to keep this file for later.
If we check this file, we will see that the output we received from the cat command matches the content of the file. In the following screenshot, we can see the content of the file: If we want to read this file, we can run the passwords.txt command. In the above screenshot, we can see the passwords.txt file, which seems like an interesting file. Then we will go to the Downloads directory and run ls command to list the files, as shown in the following screenshot: If we run pwd, we can see that we will be in C:\Users\IEUser directory. To do this, we will run cd IEUser command. Let's suppose that we want to navigate to the IEUser folder.
Now, we will run ls command to list all of the files and directories, as shown in the following screenshot: This command will bring us to the C:\Users location. We have a running session which is Meterpreter, and the first thing that we are going to do is run the pwd command to get our current working directory. Now, we will look at some more commands that will allow us to upload, download, list, read, navigate, and execute files on the target machine.