1 00:00:00,210 --> 00:00:06,150 Today, we will talk about the command and control meetings, this command is very useful and powerful 2 00:00:06,150 --> 00:00:09,180 at finding strength in any output file. 3 00:00:10,740 --> 00:00:13,530 Let's take an example on how to use this utility. 4 00:00:14,730 --> 00:00:17,120 I have a file here called Stuff. 5 00:00:17,760 --> 00:00:18,390 This file. 6 00:00:18,390 --> 00:00:19,970 We created the first video. 7 00:00:21,120 --> 00:00:24,750 Let's use the cab command to see the content of this file. 8 00:00:31,460 --> 00:00:38,120 From the content of the file, we see there is a user and password, but what if this file has tons 9 00:00:38,120 --> 00:00:43,160 of information inside and we only want to look for a specific keyword or a string? 10 00:00:44,990 --> 00:00:50,930 Now it's time to use the grep command, followed by any argument, followed by a string you want to 11 00:00:50,930 --> 00:00:51,370 find. 12 00:00:51,380 --> 00:00:54,850 And finally, the location of the file you want to search. 13 00:00:55,850 --> 00:00:56,570 Let's try. 14 00:00:58,100 --> 00:01:06,740 We will use the grid and then password as a string we want to find and then stop. 15 00:01:11,190 --> 00:01:17,890 As you can see, it filtered the output and now we only see the line which contains our strength. 16 00:01:19,260 --> 00:01:26,940 Notice we can add the dash dash color to end to the end of the command to give a nice color on our screen. 17 00:01:29,380 --> 00:01:30,160 Try to again. 18 00:01:35,260 --> 00:01:45,490 But what if we don't know the name of the file and we don't know where to look for in this case, we 19 00:01:45,490 --> 00:01:52,030 use the dash our argument and it tells the system that we want to find a file recursively. 20 00:01:53,050 --> 00:01:56,080 But first, let's try again using this command. 21 00:02:04,790 --> 00:02:11,210 Noticed I put a dot there because they want to tell the system that I want to look for the same string 22 00:02:11,750 --> 00:02:13,610 in our current directory. 23 00:02:19,100 --> 00:02:19,950 It didn't work. 24 00:02:20,870 --> 00:02:28,010 It expected the file name that we gave it to the directory to look for in order to fix this, we need 25 00:02:28,010 --> 00:02:33,530 to add the Dutch are arguing to tell it that we will use a recursive search. 26 00:02:34,880 --> 00:02:35,690 Let's try again. 27 00:02:40,970 --> 00:02:49,660 Nice, I have created another file inside the PSYOPS directory, which it has another username and password, 28 00:02:50,420 --> 00:02:53,210 can we use the recursive search to find that password? 29 00:02:54,500 --> 00:02:58,200 But we really use the recursive command before and nothing came up. 30 00:02:59,240 --> 00:03:05,420 The reason is the password string in the other file is is simply called past, not password. 31 00:03:06,230 --> 00:03:08,930 And then we search for password. 32 00:03:08,930 --> 00:03:16,310 It didn't show up, but now we can search for only pass and it should show us both things in both files. 33 00:03:18,620 --> 00:03:21,470 Let's first navigate into the PSYOPS directory. 34 00:03:26,940 --> 00:03:32,140 If we use a cab command, we see there's another password here. 35 00:03:33,420 --> 00:03:36,280 Let's go back using the card space dot dot. 36 00:03:38,940 --> 00:03:40,360 We're back to our directory. 37 00:03:41,910 --> 00:03:45,660 Let's search again using the past string instead of password. 38 00:03:54,710 --> 00:04:01,220 As you can see, we find both strength in both files, try to practice the great command as it's very 39 00:04:01,220 --> 00:04:06,390 useful and we will use it and use it a lot later and in all the other videos. 40 00:04:07,490 --> 00:04:08,120 Thank you. 41 00:04:08,330 --> 00:04:09,640 See you in the next video.