WEBVTT

00:01.280 --> 00:05.320
Okay, now we have this little program.

00:06.320 --> 00:07.320
Extract from.

00:07.440 --> 00:09.400
Now I'm going to ignore this for now.

00:09.520 --> 00:12.280
And I'm going to do one more thing.

00:12.280 --> 00:19.320
And that is to create a program that can this program, this website, for example, and extract everything

00:19.320 --> 00:24.120
we need and then check for vulnerabilities.

00:24.160 --> 00:29.920
And we are going to do that in this section in Vulnerability Scanner.

00:30.760 --> 00:33.720
So in here I'm going to create two new files.

00:33.720 --> 00:35.360
One of them is going to be scanner.

00:37.520 --> 00:41.040
The next one is going to be Vulnerability scanner.

00:41.080 --> 00:41.520
Okay.

00:44.960 --> 00:46.280
What happened.

00:53.680 --> 00:54.400
Okay.

00:54.400 --> 00:55.400
It is going to be.

01:04.890 --> 01:10.450
Into this scanner file, I am going to add a lot of files.

01:10.530 --> 01:11.850
All the files here.

01:12.730 --> 01:16.010
And then in vulnerability scanner we are going to call.

01:16.010 --> 01:20.530
We are going to this use this scanner to execute our code.

01:20.570 --> 01:21.010
Okay.

01:24.050 --> 01:27.490
So first let's create a class.

01:27.730 --> 01:30.650
I'm going to name this class scanner.

01:31.890 --> 01:34.490
And here we had something.

01:34.530 --> 01:38.330
Let me find that.

01:38.370 --> 01:39.570
Not this one.

01:41.130 --> 01:41.530
Okay.

01:41.770 --> 01:49.050
We need this traveler 2.py because right here it is checking for a URL.

01:49.090 --> 01:49.730
Okay.

01:49.730 --> 01:54.970
And then it is checking it is searching for all the links.

01:54.970 --> 01:58.090
And it is finding it and then printing that to me.

01:58.610 --> 02:03.410
So in here I need to use this.

02:03.570 --> 02:04.010
Okay.

02:08.270 --> 02:09.790
Let's copy this.

02:09.990 --> 02:10.750
And.

02:14.190 --> 02:18.030
Let me copy this from here up to here we have two method here.

02:18.830 --> 02:24.590
And let's put that boot method inside this class.

02:26.030 --> 02:28.910
And in this class because it is a class.

02:28.910 --> 02:32.830
So it is going to be kind of different.

02:32.870 --> 02:33.270
Okay.

02:34.750 --> 02:40.870
So in here we need to create a constructor.

02:40.870 --> 02:43.670
You know how you define a constructor.

02:43.710 --> 02:44.110
Okay.

02:44.470 --> 02:48.230
So we use this keyword and then init.

02:52.670 --> 02:56.670
And we remove some of this thing from here.

02:59.590 --> 03:03.830
And then inside this uh in here we can give.

03:06.590 --> 03:08.470
All the arguments that we need.

03:08.630 --> 03:12.520
So the first argument that I am going to add is going to be the URL.

03:12.880 --> 03:13.160
Okay.

03:13.200 --> 03:15.880
Let's URL.

03:17.240 --> 03:27.720
And here inside this I am going to access this URL and change the name of URL to something else.

03:27.720 --> 03:30.400
Let's use this self dot.

03:30.840 --> 03:32.720
I'm going to change it to target.

03:34.280 --> 03:36.840
URL is going to be equal to URL.

03:37.280 --> 03:44.400
So whenever someone use target URL that means they are going to access this URL that is here.

03:46.080 --> 03:55.720
The next thing that we need to handle is that inside this extract link we need to add the self keyword

03:55.720 --> 03:56.160
here.

03:56.960 --> 04:04.360
Now because we have because it is inside the class, we need to use self keyword here.

04:04.640 --> 04:07.520
And then we have the request here.

04:07.520 --> 04:10.480
That means we need to import request.

04:10.520 --> 04:11.480
Okay.

04:11.520 --> 04:19.570
Import Requests and the next thing we have our e here means regex.

04:19.690 --> 04:21.730
We need to import our e as well.

04:24.610 --> 04:25.050
Okay.

04:27.770 --> 04:32.650
We have response which is equal to request dot get and then the url.

04:33.450 --> 04:34.930
Then we are returning here.

04:37.610 --> 04:38.810
Everything looks good.

04:39.570 --> 04:42.530
So this part is done now.

04:42.530 --> 04:48.930
Now it is time to come here inside the travel and check for this.

04:48.930 --> 04:50.290
We need a lot of things here.

04:50.290 --> 04:53.250
One of them is extract link that is here.

04:53.250 --> 05:03.690
As you see we have the extract link that is saying that it is not defined because before it was defined

05:03.690 --> 05:08.330
because we were out of the class, we were not using class and constructor.

05:08.330 --> 05:13.290
But now that we are using it, we need to use something else here.

05:16.870 --> 05:18.070
That is self okay.

05:25.950 --> 05:28.510
Self dot extract link.

05:29.710 --> 05:37.430
And also here inside these travel method we need to add the self as well.

05:37.470 --> 05:40.230
Okay now that is solved.

05:40.230 --> 05:42.790
But as you see we have URL join here.

05:43.110 --> 05:47.710
That is a library that we need to use it okay.

05:47.710 --> 05:48.590
And that is here.

05:48.590 --> 05:58.270
We need to import that from here just like this I will copy this and use it up here because it is very

05:58.270 --> 06:01.630
easy to copy and paste something.

06:01.630 --> 06:06.270
So now it is also solved and we have the target link here.

06:06.270 --> 06:10.990
Let's see what I have, what I have done about this.

06:10.990 --> 06:12.750
You see we have the target link here.

06:12.870 --> 06:17.390
And you see that I defined the target link right here.

06:17.390 --> 06:22.840
And you see it is an empty List and I need to handle that.

06:22.920 --> 06:24.040
The same thing here.

06:25.200 --> 06:33.200
Inside the constructor and in the constructor I need to define that.

06:33.200 --> 06:39.920
So self the dot target underscore.

06:40.680 --> 06:42.080
We have the URL.

06:42.560 --> 06:44.600
This time it is going to be link.

06:44.640 --> 06:48.120
It is equal to an empty string an empty list.

06:49.040 --> 06:51.040
Target link.

06:53.040 --> 06:53.440
Okay.

06:54.360 --> 06:55.960
Now we have that as well.

06:58.480 --> 07:02.720
And as you see right now it is giving me the kind of error.

07:02.760 --> 07:03.640
Here you see.

07:05.040 --> 07:10.720
And to solve this to use that you need to use self keyword as well here.

07:11.000 --> 07:14.760
And also the same thing here.

07:17.480 --> 07:22.040
Self dot target link happened.

07:22.930 --> 07:23.650
Okay.

07:23.650 --> 07:30.130
And also when you call this method here, inside here you need to use the self keyword.

07:30.130 --> 07:31.210
The same thing here.

07:31.250 --> 07:31.610
Okay.

07:32.330 --> 07:41.170
So now uh, it is almost complete that we need to complete the vulnerability scanner here.

07:41.490 --> 07:45.410
We need to call this scanner inside this file.

07:45.410 --> 07:47.010
And we need to use it okay.

07:53.410 --> 07:55.130
Um okay.

07:55.130 --> 07:56.810
We have the URL here.

07:56.810 --> 08:00.330
We have the target link here target URL and target link.

08:00.370 --> 08:01.890
We have two things here okay.

08:02.650 --> 08:07.490
And in here I need to first import the the file okay.

08:07.530 --> 08:09.730
So let's use import scanner.

08:10.330 --> 08:14.770
And the next thing is that we need is the target URL.

08:17.250 --> 08:20.890
So this target URL is equal to the URL that we want.

08:20.890 --> 08:26.660
And the next thing that I want is to create an object from this Is a scanner.

08:26.700 --> 08:29.700
I'm going to name it one scanner.

08:30.940 --> 08:34.060
It is equal to scanner dot.

08:35.300 --> 08:36.820
Let's see.

08:36.820 --> 08:38.100
We have the class here.

08:38.100 --> 08:38.540
You see.

08:38.580 --> 08:39.380
Okay.

08:39.420 --> 08:40.980
That is must be capital.

08:41.220 --> 08:42.980
Let's see if it is capital or not.

08:43.020 --> 08:44.740
Of course it is capital.

08:45.500 --> 08:50.340
And now that we are going to create its object.

08:51.100 --> 09:00.620
And in here into the constructor, you see we have only one argument and that is URL or target URL.

09:00.660 --> 09:01.100
Okay.

09:01.500 --> 09:08.740
So we need to provide it here I am going to name it target URL or give the target URL that is here.

09:09.580 --> 09:15.700
The next thing is that we need to call the function or the method that is called gravel okay.

09:17.540 --> 09:18.180
And.

09:20.580 --> 09:23.780
That is going to be in here.

09:24.220 --> 09:35.320
So we have its object that is called wall scanner dot Gravel and it is going to get the URL.

09:35.320 --> 09:38.520
And right now it is going to be the target URL.

09:38.560 --> 09:38.960
Okay.

09:39.280 --> 09:44.200
Now I'm going to save this and let's give a URL to this.

09:45.360 --> 09:47.160
And it is going to be.

09:49.200 --> 09:49.880
This one.

09:49.920 --> 09:57.720
So use Ctrl C here and use Ctrl V in here Matilda.

09:57.760 --> 09:59.640
Okay let's save it.

09:59.640 --> 10:01.840
And also let's come here.

10:01.840 --> 10:05.320
Use Ctrl S to save that as well.

10:06.920 --> 10:11.400
And here let's use Clear and Python.

10:11.400 --> 10:15.880
We have vulnerability scanner dot p y and then hit enter.

10:15.920 --> 10:23.160
As you see it is working perfectly and it is scanning for all the links and whatever we need okay.

10:23.200 --> 10:29.400
And finally we get all the link links that we need and it is working perfectly.

10:29.440 --> 10:32.680
So let's go and improve this in the next lecture.
