1 00:00:00,570 --> 00:00:03,840 Instructor: Welcome to our second coding project. 2 00:00:03,840 --> 00:00:05,040 As we already know, 3 00:00:05,040 --> 00:00:07,830 we are going to create a working back door 4 00:00:07,830 --> 00:00:10,530 and as the previous project was in Python, 5 00:00:10,530 --> 00:00:12,720 this one will be as well. 6 00:00:12,720 --> 00:00:15,360 However, if we think about it a little bit, 7 00:00:15,360 --> 00:00:18,780 you might realize that in order for our project to work 8 00:00:18,780 --> 00:00:21,540 and in order for us to successfully communicate 9 00:00:21,540 --> 00:00:24,030 with the target machine using our back door, 10 00:00:24,030 --> 00:00:27,510 we must create two programs, 11 00:00:27,510 --> 00:00:30,720 a server and a payload. 12 00:00:30,720 --> 00:00:33,600 One will be running on our Cal Linux machine 13 00:00:33,600 --> 00:00:37,440 and the other one will run on our target machine. 14 00:00:37,440 --> 00:00:38,850 What will happen is 15 00:00:38,850 --> 00:00:41,640 they will communicate between one another 16 00:00:41,640 --> 00:00:45,060 and from the server, we will be sending our instructions 17 00:00:45,060 --> 00:00:47,490 that we want our target to execute. 18 00:00:47,490 --> 00:00:50,670 Then, the payload will send us back an output. 19 00:00:50,670 --> 00:00:53,673 So, it would pretty much look something like this. 20 00:00:54,570 --> 00:00:57,630 Cal Linux machine is running the server program 21 00:00:57,630 --> 00:01:01,800 and the target is running the payload, or our back door. 22 00:01:01,800 --> 00:01:03,420 Once we get to creating these, 23 00:01:03,420 --> 00:01:05,910 you will notice that the code of these two programs 24 00:01:05,910 --> 00:01:07,410 will be rather similar, 25 00:01:07,410 --> 00:01:10,020 due to them working together. 26 00:01:10,020 --> 00:01:14,010 We will be sending commands from our Cal Linux machine. 27 00:01:14,010 --> 00:01:17,010 For example, if we wanted to check out all the files 28 00:01:17,010 --> 00:01:20,340 in the current working directory on the target machine, 29 00:01:20,340 --> 00:01:23,850 we know that the command for this is DIR on Windows 30 00:01:23,850 --> 00:01:26,610 and LS on Linux. 31 00:01:26,610 --> 00:01:28,740 Once we send that from our server, 32 00:01:28,740 --> 00:01:33,030 we would want our target to send us back the response, 33 00:01:33,030 --> 00:01:36,000 which will contain an output of all the files 34 00:01:36,000 --> 00:01:39,840 and folders inside of that specific directory. 35 00:01:39,840 --> 00:01:43,440 Now, that is just an example of one command. 36 00:01:43,440 --> 00:01:45,960 We of course want to be able to execute 37 00:01:45,960 --> 00:01:49,050 all the commands that we can run inside the regular terminal 38 00:01:49,050 --> 00:01:53,550 or command prompt and we will see exactly how to do that. 39 00:01:53,550 --> 00:01:57,810 To code this, we will need knowledge of reverse shells, 40 00:01:57,810 --> 00:02:01,500 which we already have since we covered exploitation section. 41 00:02:01,500 --> 00:02:03,780 We know exactly how reverse shells work 42 00:02:03,780 --> 00:02:07,710 and another thing that we must be familiar with are ports 43 00:02:07,710 --> 00:02:09,060 and IP addresses. 44 00:02:09,060 --> 00:02:11,400 And this is also something that we know. 45 00:02:11,400 --> 00:02:13,173 This will not present us a problem. 46 00:02:14,190 --> 00:02:16,800 We need to be familiar with Python sockets 47 00:02:16,800 --> 00:02:19,170 and this is something we briefly touched 48 00:02:19,170 --> 00:02:20,850 in our first coding project. 49 00:02:20,850 --> 00:02:23,880 However, I will do my best to explain it once again 50 00:02:23,880 --> 00:02:26,070 in the code that we're going to use. 51 00:02:26,070 --> 00:02:28,140 And last, at the end, 52 00:02:28,140 --> 00:02:32,190 we will need to compile the Python code to .EXE 53 00:02:32,190 --> 00:02:34,260 for our windows targets. 54 00:02:34,260 --> 00:02:35,940 This is something you should not worry about 55 00:02:35,940 --> 00:02:38,340 since I will demonstrate how to do this 56 00:02:38,340 --> 00:02:40,410 after we code our programs. 57 00:02:40,410 --> 00:02:44,640 So, now that we know what we are doing, without further ado, 58 00:02:44,640 --> 00:02:47,493 let's get straight into the coding lessons.