1 00:00:01,190 --> 00:00:07,130 Okay now that we had a quick overview of colonics I want to spend some time talking about the Linux 2 00:00:07,130 --> 00:00:13,310 terminal so you can access the terminals through this application right here so if you click on that 3 00:00:13,700 --> 00:00:15,960 it'll open the terminal window for us. 4 00:00:16,250 --> 00:00:21,730 And as you can see all it is is a black screen where you can type commands. 5 00:00:22,100 --> 00:00:28,490 Now the Linux terminal is actually very very powerful because it can be used to do anything that you 6 00:00:28,490 --> 00:00:30,040 can think of really. 7 00:00:30,320 --> 00:00:36,800 A lot of the applications in Linux that have a graphical interface where command prompt programs first 8 00:00:37,100 --> 00:00:40,670 and then people made a graphical interface for it. 9 00:00:40,700 --> 00:00:46,520 So a lot of the time maybe the graphical interface will be buggy or crash and the terminal program will 10 00:00:46,520 --> 00:00:48,380 still work. 11 00:00:48,380 --> 00:00:53,870 Also a lot of the penetration testing tools do not even have a graphical interface. 12 00:00:53,990 --> 00:00:58,430 A lot of them can only be used throughout the terminal. 13 00:00:58,430 --> 00:01:06,230 Not only that but in many scenarios you might only have an S-sh or a command prompt access to a machine. 14 00:01:06,440 --> 00:01:12,260 So you need to know how to use this command prompt in order to achieve your goals. 15 00:01:12,290 --> 00:01:15,900 So throughout the course we're going to be using the terminal a lot. 16 00:01:16,010 --> 00:01:22,250 And that's why I want to spend some time just showing you the basics of it and making sure that you're 17 00:01:22,250 --> 00:01:25,200 going to be comfortable using it. 18 00:01:25,280 --> 00:01:31,480 Now the basic idea is you type a command and the result will be displayed for you on screen. 19 00:01:31,970 --> 00:01:37,120 So let's have a look on a very very simple command which is p w d. 20 00:01:37,730 --> 00:01:43,260 Now this command prints the current working directory has the name P.W.. 21 00:01:43,640 --> 00:01:50,660 So if I hit enter you can see it's print and forward slash route which means right now I'm in the root 22 00:01:50,750 --> 00:01:51,720 directory. 23 00:01:52,070 --> 00:01:55,480 So basically I'm in here this is the route. 24 00:01:55,510 --> 00:01:57,450 It's home. 25 00:01:57,560 --> 00:02:04,370 So if I do ls which is a command to list all the directories and files in the current working directory 26 00:02:04,700 --> 00:02:08,260 we should get all of these directories that we've seen here. 27 00:02:09,490 --> 00:02:16,540 So if I had to enter as you can see I can see all these directories in the current working directory. 28 00:02:17,140 --> 00:02:25,680 Now another very useful command is DCD command this command allow us to navigate into another directory. 29 00:02:25,690 --> 00:02:29,950 So for example let's say I want to navigate into the downloads. 30 00:02:30,520 --> 00:02:37,680 All we have to do is type C followed by the name of the directory that I want to navigate to. 31 00:02:37,690 --> 00:02:45,670 So I'm going to type downloads now if I hit enter I should be inside the downloads now. 32 00:02:45,780 --> 00:02:52,410 So if I do PWT to see my current working directory you'll see that it's saying I'm in route forward 33 00:02:52,410 --> 00:03:00,330 slash downloads so if I do ls here it should show me all the directories and files inside downloads. 34 00:03:00,480 --> 00:03:05,720 So if I do enter as you can see I have a directory and the file in here. 35 00:03:05,940 --> 00:03:10,560 And these are the exact same files that you'll see if you double click the downloads here. 36 00:03:12,690 --> 00:03:15,480 Now if you want to go back one directory. 37 00:03:15,510 --> 00:03:19,280 So similar to press and the back button in here. 38 00:03:19,290 --> 00:03:21,020 All you have to do is do a CD. 39 00:03:21,060 --> 00:03:26,390 Again the command to change the working directory followed by dot dot. 40 00:03:26,730 --> 00:03:34,170 And now if I do PWT you'll see I'm back in road and if I do ls you'll see all the directories and files 41 00:03:34,170 --> 00:03:35,870 and root. 42 00:03:36,030 --> 00:03:38,060 So that's all good. 43 00:03:38,060 --> 00:03:41,970 And there's actually a huge number of commands that you can use. 44 00:03:41,970 --> 00:03:47,940 So I'm going to include a link in the resources of the structure of all the Linux commands that you 45 00:03:47,940 --> 00:03:49,070 can use. 46 00:03:49,080 --> 00:03:50,880 You don't need to know them by heart. 47 00:03:50,880 --> 00:03:53,500 We're actually going to be using a lot of them throughout the course. 48 00:03:53,640 --> 00:03:58,770 So you're going to naturally learn them as you go through the course. 49 00:03:59,040 --> 00:04:04,830 Now if you are using a command and you're not sure about how this command works you can just use the 50 00:04:04,830 --> 00:04:09,190 man command to display the manual of this command. 51 00:04:09,660 --> 00:04:14,610 For example we've used the ls command here to list the files and directories in the current working 52 00:04:14,610 --> 00:04:15,650 directory. 53 00:04:15,780 --> 00:04:23,510 But if I do mine followed by LS This basically means I'm requesting the manual of ls. 54 00:04:23,520 --> 00:04:26,980 So I'm asking how can I use the ls command. 55 00:04:27,180 --> 00:04:34,650 So if I hit Enter you'll see I'll get a screen similar to a text file and basically it's given me a 56 00:04:34,650 --> 00:04:38,570 lot of information on how to use the ls command. 57 00:04:38,850 --> 00:04:43,930 So you can see that it's telling us that this command will list the directory contents. 58 00:04:44,010 --> 00:04:49,650 You can see the way it works by type in LS followed by the options followed by a file if you if you 59 00:04:49,650 --> 00:04:59,500 want to run it on a file you can see a longer description of the command and then you can see all the 60 00:04:59,500 --> 00:05:06,310 options and the arguments that we can use with this command now in Linux. 61 00:05:06,310 --> 00:05:10,420 Most of the time the options will always follow the same syntax. 62 00:05:10,570 --> 00:05:18,790 So either use dush letter or dash dash a word to specify the argument for example and here the dash 63 00:05:18,880 --> 00:05:25,230 A and dash dash all will ignore entries starting with dot. 64 00:05:25,240 --> 00:05:32,220 So if you keep going down in here you'll see all the options and arguments you can use with the ls command 65 00:05:33,540 --> 00:05:35,370 and we have another example. 66 00:05:35,370 --> 00:05:42,340 Here we have the dash L which means it's going to use a long listing format which will display more 67 00:05:42,340 --> 00:05:46,870 information about the files in the current working directory. 68 00:05:46,960 --> 00:05:48,140 So let's have a look on that. 69 00:05:48,160 --> 00:05:53,410 I'm going to press Q to exit this and then we're going to do ls as usual. 70 00:05:53,590 --> 00:06:00,070 And since we read the manual we know we can do dash L to see more information about the files. 71 00:06:00,280 --> 00:06:06,070 And if I hit Enter now you can see I'm still getting the same directories but it's also shown me the 72 00:06:06,070 --> 00:06:11,270 permissions of the users that they've created and so on. 73 00:06:11,290 --> 00:06:14,830 So you can use the man command on any command you want. 74 00:06:14,830 --> 00:06:16,420 Not only on the LS. 75 00:06:16,570 --> 00:06:24,520 So you can use it on the PWT you can use it on the CD or any other command and it'll show you full description 76 00:06:24,550 --> 00:06:30,210 or the manual page of how to use this command. 77 00:06:30,210 --> 00:06:34,830 Now I'm going to clear the screen by typing clear. 78 00:06:35,170 --> 00:06:38,950 And the next thing that I want to show you is the dash dash help. 79 00:06:38,950 --> 00:06:45,460 So this is something that you can use again and almost all commands and all programs in Linux so you 80 00:06:45,460 --> 00:06:53,950 can just type the program name or the command name followed by Didache help as you might think this 81 00:06:53,950 --> 00:06:59,440 will show you help message telling you what this command is or what this program is. 82 00:06:59,530 --> 00:07:06,270 The arguments that it takes how to use these arguments aren't examples at the bottom. 83 00:07:06,440 --> 00:07:11,340 Now another useful thing with the term and also I'm going to clear this again is the arrows. 84 00:07:11,420 --> 00:07:16,550 So you can press up to go up to see all the commands that we executed before. 85 00:07:16,580 --> 00:07:23,430 And again you can go down to see to navigate between the commands that you executed previously. 86 00:07:23,720 --> 00:07:27,310 You can also use the tab for auto complete. 87 00:07:27,320 --> 00:07:34,520 So again let's do ls and you can see all the files and let's say we want to go into documents so we 88 00:07:34,520 --> 00:07:37,170 can do cd followed by documents. 89 00:07:37,250 --> 00:07:44,650 You can type documents or if you're lazy like me you can just do d o c and press tab. 90 00:07:44,840 --> 00:07:49,820 And as you can see it's automatically completing the rest of the work for me. 91 00:07:50,600 --> 00:07:57,010 So this is something that comes very very handy when you're using the terminal for a long time. 92 00:07:57,050 --> 00:08:03,220 Now what I also want to show you is how to install programs and Cali from the terminal. 93 00:08:03,230 --> 00:08:08,790 So first I'm going to clear this and the first thing that you want to do is update the sources where 94 00:08:08,790 --> 00:08:13,270 Akali can search and download programs from. 95 00:08:13,280 --> 00:08:21,990 So we're going to do apt get update now up get is the name of the application that allows us to download 96 00:08:22,080 --> 00:08:23,710 and install programs. 97 00:08:23,880 --> 00:08:29,790 And we're saying update because I'm saying that I want you to update the list of all the programs that 98 00:08:29,850 --> 00:08:33,230 I can install so I'm going to hit enter. 99 00:08:33,540 --> 00:08:37,380 And you want to make sure that you have internet connection when running this. 100 00:08:37,530 --> 00:08:44,750 And as you can see it's telling me that it's done and now we can go ahead and start and stolen applications. 101 00:08:45,240 --> 00:08:51,890 So the first program that I want to install is actually a terminal program so similar to this one but 102 00:08:52,020 --> 00:08:57,740 it allows us to have multiple terminal windows open and the same window. 103 00:08:58,290 --> 00:09:04,740 So in order to install a program through the command line we're going to do apt get which is again the 104 00:09:04,740 --> 00:09:09,580 name of the program that allows us to install programs on the system. 105 00:09:09,690 --> 00:09:16,640 We're going to say that I want to install and the program that I want to install is called Terminator 106 00:09:18,620 --> 00:09:20,210 so very very simple. 107 00:09:20,270 --> 00:09:23,960 First of all we're type in the name of the command which is apt get. 108 00:09:24,200 --> 00:09:30,570 We're saying that I want to install and the program name that I want to install is called Terminator. 109 00:09:30,950 --> 00:09:32,160 So I'm going to hit enter. 110 00:09:33,910 --> 00:09:38,320 And this is going to download and install Terminator for me. 111 00:09:38,320 --> 00:09:42,040 So you can use the same command to install any programs that you want. 112 00:09:42,070 --> 00:09:48,490 You just need to replace Terminator with the name of the program that you want to install now. 113 00:09:48,500 --> 00:09:54,860 I've already downloaded and installed this before so it didn't ask me to confirm but if you're running 114 00:09:54,860 --> 00:10:00,530 this for the first time it might ask you to confirm whether or not you actually want to install this 115 00:10:00,530 --> 00:10:01,260 program. 116 00:10:01,430 --> 00:10:06,220 So all you have to do is press y from the keyboard and hit enter. 117 00:10:06,250 --> 00:10:08,040 Now as you can see it's done. 118 00:10:08,260 --> 00:10:17,640 So if I go to my all applications in here and just type Terminator you can see that I have it here. 119 00:10:18,160 --> 00:10:24,950 So I'm actually going to drag it and put it in my dark so I can access it easily in the future. 120 00:10:26,780 --> 00:10:32,510 So now I can just click it in here and that will open Terminator for me. 121 00:10:32,510 --> 00:10:36,320 Now this is another application that allow me to run commands. 122 00:10:36,350 --> 00:10:38,980 So it's exactly the same as this. 123 00:10:38,990 --> 00:10:47,180 So again I can do ls and P.W. D The only difference is with this one I can actually right click and 124 00:10:47,180 --> 00:10:54,230 click on split horizontally for example and this will split the same screen into two screens where I 125 00:10:54,230 --> 00:11:01,190 can run commands at the same time so I can have some commands in here and I can run commands in here. 126 00:11:02,380 --> 00:11:08,220 And then I can even split this more if I want again vertically or horizontally. 127 00:11:08,730 --> 00:11:14,530 And as you can see I can have as many terminal windows as I want and this will be very helpful in the 128 00:11:14,530 --> 00:11:20,300 future when we'll be running a number of programs and a number of commands at the same time.