1 00:00:00,060 --> 00:00:03,310 Everyone will come to a new video with our Python lessons. 2 00:00:04,410 --> 00:00:11,120 Last time we talked about how to control our multi threading sessions and interact with each one individually, 3 00:00:11,430 --> 00:00:15,030 and today we will talk about the subprocess module. 4 00:00:16,740 --> 00:00:22,170 The subprocess module allows us to execute shell commands and read the output into a variable. 5 00:00:23,190 --> 00:00:30,270 And since we need our back door to be able to execute seemed or commands, then we will use this function 6 00:00:30,270 --> 00:00:30,660 allowed. 7 00:00:32,220 --> 00:00:34,170 The subprocess module is very simple. 8 00:00:34,350 --> 00:00:40,200 As you can see from the slides, we use the open function to execute some commands, but we have to 9 00:00:40,200 --> 00:00:44,040 pass the shell equal argument to it, otherwise it won't work. 10 00:00:46,380 --> 00:00:53,910 Let's try this subprocess module on our Windows client, but this time we will replace the dash, the 11 00:00:54,300 --> 00:00:57,900 dash l command with the data we receive from our server. 12 00:01:08,070 --> 00:01:09,640 This is our Windows client. 13 00:01:10,980 --> 00:01:14,340 Now let's start our server and connect to it. 14 00:01:36,890 --> 00:01:38,510 Now, let's check our sessions. 15 00:01:42,050 --> 00:01:44,310 Now I'm going to interact with session number one. 16 00:01:47,760 --> 00:01:52,310 I'm going to send the who I my command to the other Windows client. 17 00:01:57,310 --> 00:01:59,020 As you see, I got the name here. 18 00:02:02,140 --> 00:02:03,580 Let's try a different command. 19 00:02:21,310 --> 00:02:22,270 Now it is working. 20 00:02:23,160 --> 00:02:30,030 We sent a command to our Windows client here and then the command was executed using the subprocess 21 00:02:30,030 --> 00:02:33,840 module and then we got the data back to our server. 22 00:02:36,300 --> 00:02:36,870 That was it. 23 00:02:37,140 --> 00:02:39,010 We are done with our Cyprus module. 24 00:02:39,330 --> 00:02:40,940 Thank you and see you in the next video.