1 00:00:00,330 --> 00:00:01,040 Hello everybody. 2 00:00:01,110 --> 00:00:02,670 And welcome back. 3 00:00:02,670 --> 00:00:07,250 And in the previous video we finished actually coding our program. 4 00:00:07,440 --> 00:00:14,460 Right now we should be good to go and we should actually try to run it so that there is another thing 5 00:00:14,460 --> 00:00:19,530 that we actually need to add but we can edit after we actually test the program itself and see if it 6 00:00:19,530 --> 00:00:20,970 actually works well. 7 00:00:21,030 --> 00:00:26,340 Now I will test with tell you that the past four list you can use any pastoralist you want. 8 00:00:26,340 --> 00:00:29,060 Basically right now we are not trying to actually brute force it. 9 00:00:29,070 --> 00:00:32,060 Right now we are trying to see if it actually works. 10 00:00:32,080 --> 00:00:37,500 Then after that we will specify the correct user name and password in some list and we will see if it 11 00:00:37,500 --> 00:00:41,760 can find the username and password that is actual correct. 12 00:00:41,970 --> 00:00:51,810 After that since if I just open my program loops that I write here you can actually see that I don't 13 00:00:51,810 --> 00:00:58,530 have an actual function that will actually print the users what the usage of this program is so we'll 14 00:00:58,530 --> 00:01:00,120 have to code that as well. 15 00:01:00,120 --> 00:01:02,580 But that is rather simple and not needed at the moment. 16 00:01:02,580 --> 00:01:06,050 So we can just run this program right now. 17 00:01:06,060 --> 00:01:13,030 Let me just delete the basic authentication has not by that saves since I renamed the file to be basically 18 00:01:13,030 --> 00:01:16,910 called the PI since it is a lot less short term. 19 00:01:17,040 --> 00:01:22,310 And right now we know that we can run it with this and then we can specify all the options that we added 20 00:01:22,320 --> 00:01:29,580 in our program which is minus W for the U.R.L. which will be a GDP 182 the 168 that one that one for 21 00:01:29,580 --> 00:01:35,520 the IP address of my router then minus you for the user name I will use anything. 22 00:01:35,520 --> 00:01:36,890 Doesn't really matter. 23 00:01:36,890 --> 00:01:42,030 No we will not be able to brute force it with his user name but it does matter a number of threats to 24 00:01:42,030 --> 00:01:44,480 be five and the father we will use. 25 00:01:44,630 --> 00:01:54,220 Let's set the path to be user share one of this and then rocket up the steep. 26 00:01:54,800 --> 00:02:01,190 And right now we can actually presenter and see if this will work well with our code it brute force 27 00:02:01,210 --> 00:02:08,700 or so we can see it is running through all these passwords and we can see our program actually works 28 00:02:08,730 --> 00:02:16,110 well it is it went through like 15 passwords right here they are not valid of course and after I specified 29 00:02:16,110 --> 00:02:25,560 the controls see it said interrupted our program works good right now before we actually try to actual 30 00:02:25,560 --> 00:02:32,340 brute force with the correct user name and password let us actually let me just restart the terminal 31 00:02:33,180 --> 00:02:42,990 since it is being a little bit laggy now let's actually add the function that will actually print the 32 00:02:42,990 --> 00:02:45,180 users the users of this program. 33 00:02:45,840 --> 00:02:50,900 So now know basic authentication to buy and we can add that function right here. 34 00:02:50,910 --> 00:02:56,970 It doesn't really matter what we want to do is just give the user the simple usage of this program specification 35 00:02:57,000 --> 00:03:01,820 of all the commands and our simple example of the command itself. 36 00:03:02,040 --> 00:03:08,850 So it can do that with several print commands or with one print command we the three single quotes as 37 00:03:08,850 --> 00:03:14,160 we saw in my back the creation we can use three single quotes at the beginning and at the end of the 38 00:03:14,160 --> 00:03:17,810 string in order to specify a string that will be multi line. 39 00:03:17,910 --> 00:03:19,460 Now we do not have to do that. 40 00:03:19,470 --> 00:03:21,660 We can just use print option for everything. 41 00:03:22,050 --> 00:03:31,550 Let's use a function called usage and we can print usage which is may be the first line. 42 00:03:31,590 --> 00:03:36,360 The second line can be moved like one tab. 43 00:03:36,360 --> 00:03:45,780 So mine is W and then the URL and then let's specify in the brackets for example a TTP some site dot 44 00:03:45,780 --> 00:03:55,860 com so we specify in the brackets we closed the double quotes we print the next usage so minus you for 45 00:03:55,860 --> 00:03:57,120 the user name. 46 00:03:57,330 --> 00:04:06,310 So let us set these two so that people know that they need to separate it so it will be user name like 47 00:04:06,310 --> 00:04:08,880 this then print the next one. 48 00:04:09,070 --> 00:04:18,220 So minus C for the threads I believe the threads closed the double quotes and the last one or actually 49 00:04:18,220 --> 00:04:22,770 the last option will be minus F for the file itself. 50 00:04:22,780 --> 00:04:24,550 So password best 51 00:04:28,010 --> 00:04:28,340 OK. 52 00:04:28,370 --> 00:04:39,920 So right now what we want to do is actually pretty simple usage or a simple example of using so example 53 00:04:40,940 --> 00:04:50,390 could be actually basic auth not be Y minus W for dealing. 54 00:04:50,390 --> 00:04:58,670 So it's a DP slash that's lovely double down in some sites dot com minus you for the user name which 55 00:04:58,670 --> 00:05:04,970 can be add mean minus T for threads for that can be five minus F for the file with passwords which can 56 00:05:04,970 --> 00:05:13,940 be passed out the deep and when we put it to be string and we have our usage a function coded in our 57 00:05:13,940 --> 00:05:21,400 program now all we have to actually do right now is actually call this function somewhere from our program 58 00:05:23,010 --> 00:05:27,150 so let's see where we can add it we need to add it right here. 59 00:05:27,150 --> 00:05:34,950 So as soon as we actually type the banner we need to set our simple if l slope basically that will check 60 00:05:35,040 --> 00:05:38,100 if the usage needs to be printed out or not. 61 00:05:38,100 --> 00:05:44,630 So for example if our user specifies a different number of arguments add those add some argument that 62 00:05:44,640 --> 00:05:50,100 doesn't exist or doesn't use an argument that is needed for example they specified you are the user 63 00:05:50,100 --> 00:05:56,310 name and threats but don't specify the password list our program will still not work so we need to specify 64 00:05:56,310 --> 00:06:01,440 at the beginning of the program before it started doing anything else we need to specify whether the 65 00:06:01,440 --> 00:06:08,220 number or the number of arguments is equal to 5 since we actually have 5 arguments. 66 00:06:08,300 --> 00:06:12,640 Now I might be asking how do we have 5 arguments when we here only have 4. 67 00:06:12,660 --> 00:06:18,660 Well basically the name of the file itself or the program itself is also counted as an argument so we 68 00:06:18,660 --> 00:06:19,950 have to include that one too. 69 00:06:20,550 --> 00:06:21,890 So how can we do that. 70 00:06:22,020 --> 00:06:23,910 We can do that simply with this. 71 00:06:23,940 --> 00:06:34,890 So if all ends of deceased arguments is a lesser than five basically as I said before 5 arguments we 72 00:06:34,890 --> 00:06:37,520 will print the usage of our program. 73 00:06:37,800 --> 00:06:43,100 So we will call this function which will then print this that we printed right here. 74 00:06:43,200 --> 00:06:49,650 And then the user will know what they need to specify and then they will we can close the actual program. 75 00:06:49,650 --> 00:06:54,280 So since the text and we should be good to go right now. 76 00:06:54,610 --> 00:06:57,030 So let us see how this will work. 77 00:06:57,070 --> 00:06:58,840 Everything is set. 78 00:06:58,840 --> 00:06:59,860 We are good to go. 79 00:06:59,860 --> 00:07:01,860 So that is control all this. 80 00:07:01,870 --> 00:07:06,210 So control all that allow us. 81 00:07:07,090 --> 00:07:10,040 Then let's say we just want to specify the EU or now. 82 00:07:10,060 --> 00:07:13,720 So GDP Google dot com. 83 00:07:14,110 --> 00:07:20,410 We only specify that we just found this and you can see we get the banner and the simple usage of the 84 00:07:20,440 --> 00:07:21,250 command. 85 00:07:21,250 --> 00:07:26,370 So right now if the user was writing this for the first time they would right now know what to do. 86 00:07:26,440 --> 00:07:29,140 So let this actually test if this works. 87 00:07:29,140 --> 00:07:33,910 Now the user name for my writer is telecom and the password is small so telecom. 88 00:07:34,210 --> 00:07:37,390 I said that for this video so we can see if that will work. 89 00:07:37,390 --> 00:07:44,380 So that we now know passwords that the extreme in this directory and here will specify some random password. 90 00:07:44,380 --> 00:07:50,480 So admin wrote administrator password 1 2 3 4. 91 00:07:51,160 --> 00:07:53,730 Hello world. 92 00:07:54,910 --> 00:08:03,010 Basically we can just type anything call in numbers and then let's hear type your telecom then add something 93 00:08:03,010 --> 00:08:03,400 more 94 00:08:06,350 --> 00:08:08,260 and that should be about it. 95 00:08:09,310 --> 00:08:12,790 So right now we have the correct password for my right right here. 96 00:08:12,790 --> 00:08:18,060 And we will now check out if the program itself will actually manage to find this password right here. 97 00:08:19,180 --> 00:08:22,480 So let me see if everything is set to go. 98 00:08:22,490 --> 00:08:25,760 We run the basic order B Y and we see the use it. 99 00:08:25,780 --> 00:08:36,510 So let us type the command minus W a CTP IP address on my router minus to the user name is telecom minus 100 00:08:36,510 --> 00:08:43,840 still let's use 5 threats and minus F for the password list if we want to use which is in my current 101 00:08:43,840 --> 00:08:44,380 directory. 102 00:08:44,380 --> 00:08:48,220 So all I have to do is specify the name of the file itself. 103 00:08:48,220 --> 00:08:52,270 Now if I press your enter we can see it really fast. 104 00:08:52,300 --> 00:08:54,830 Found the correct password. 105 00:08:54,970 --> 00:09:00,580 So right here you can see it went through these passwords is not valid is not valid and then it found 106 00:09:00,580 --> 00:09:02,340 password found Telecom. 107 00:09:03,100 --> 00:09:06,370 So we actually saw that our program works perfectly. 108 00:09:06,430 --> 00:09:13,210 It can find a password it can brute force really fast using our threats and it most likely will work 109 00:09:13,270 --> 00:09:19,120 in any case where you have the basic authentication protocol or basically basic authentication on your 110 00:09:19,120 --> 00:09:25,680 log in page so that will be about it for this coding of our brute force sir. 111 00:09:25,730 --> 00:09:31,020 Now we will continue with a few more with using the next lectures and then we will finish up and wrap 112 00:09:31,020 --> 00:09:32,430 up our course. 113 00:09:32,430 --> 00:09:37,410 Hope you enjoyed this coding section and I hope I see you in the next lecture by.