WEBVTT

00:00.680 --> 00:01.280
Hi.

00:01.320 --> 00:02.120
Welcome back.

00:02.680 --> 00:06.400
Now let's explain something which is very important.

00:06.400 --> 00:11.680
And that is about domain and also sub domain and main domain.

00:12.160 --> 00:15.520
So it is very important to learn what is domain.

00:15.520 --> 00:16.960
What is the main domain.

00:16.960 --> 00:19.080
How can we access them.

00:19.080 --> 00:28.520
And also how to create a program to get this domain and also sub domains and the domain.

00:28.520 --> 00:31.960
For example this google.com, it is a domain okay.

00:32.000 --> 00:36.200
And everyone knows that it is the main domain okay.

00:36.240 --> 00:38.280
And also it has some sub domain.

00:38.280 --> 00:40.680
For example this Google has a lot of things.

00:40.680 --> 00:45.480
For example it has a mail and also it has social media.

00:45.480 --> 00:48.640
It has a lot of things okay that people are using.

00:48.640 --> 00:51.680
For example, it has Google Drive and a lot of things.

00:51.720 --> 00:53.120
Okay.

00:53.160 --> 00:57.120
And here let me show you for example this is the main domain.

00:57.120 --> 01:02.540
And also if you want to get one of the one of its sub domain, it is I think.

01:02.740 --> 01:04.460
Mail.google.com.

01:04.820 --> 01:09.860
Now, if I hit enter, you will see that now we get this Mail.google.com.

01:09.860 --> 01:15.380
And also you see that it has changed to Gmail slash vote and blah blah blah.

01:15.420 --> 01:22.340
Okay, so we need to create a program that git we give the main domain okay.

01:22.380 --> 01:26.020
And also some subdomain that we are testing.

01:26.060 --> 01:32.100
For example we give google.com and then we give the other thing like Gmail like mail.google.com.

01:32.100 --> 01:35.500
We need to have uh okay.

01:35.660 --> 01:45.180
Or to go to hundred or even print for me or for us that this domain exists and it is very good because

01:45.220 --> 01:55.740
in some cases we are going to find some, some sub domain of a main website that they are, for example,

01:55.780 --> 02:01.860
it is a light part or a light version of that website, and they're still testing something on that.

02:01.860 --> 02:03.930
And we And we can hack them very easily.

02:03.970 --> 02:04.490
Okay.

02:04.530 --> 02:07.690
So we need to get subdomain of the main domains.

02:08.090 --> 02:08.690
So it is good.

02:08.730 --> 02:09.810
Okay.

02:09.810 --> 02:15.250
Now if I came back here you see I created something called cobbler dot pi.

02:15.290 --> 02:19.450
It is a, uh, just a website.

02:19.490 --> 02:19.890
Okay.

02:20.570 --> 02:21.410
Let me go to.

02:23.650 --> 02:25.650
Set a document.

02:27.890 --> 02:31.290
And we have.

02:31.290 --> 02:31.850
Okay.

02:31.890 --> 02:34.930
Python for ethical hacking.

02:34.930 --> 02:39.290
And also we have, uh, website hacking.

02:39.530 --> 02:41.730
Okay, good.

02:42.170 --> 02:46.490
Now, I'm in this position or in this part.

02:48.250 --> 02:48.610
Okay.

02:49.490 --> 02:56.610
So for getting access to website and also getting information from a website, we are going to use a

02:56.610 --> 02:58.170
module called request.

02:58.210 --> 02:58.690
Okay.

02:59.290 --> 03:04.710
Um, this request, uh, we already used use this in some cases.

03:04.950 --> 03:06.270
Now you know how to use it.

03:06.270 --> 03:07.590
So let's import this.

03:08.950 --> 03:09.950
Requests.

03:11.030 --> 03:17.030
And first let's create a variable I'm going to name this URL.

03:17.070 --> 03:17.790
Okay.

03:17.790 --> 03:31.310
So this URL is going to be for example um google.com okay so here I am going to use a request and also

03:31.350 --> 03:33.750
the get method to get access to this.

03:33.750 --> 03:38.230
So let's use get response.

03:40.750 --> 03:43.190
It's going to be equal to request.

03:45.310 --> 03:46.990
Dot get method.

03:46.990 --> 03:56.230
So this get method will get will try to access the URL that we are providing for this for example google.com

03:56.350 --> 03:58.510
and also something else.

03:58.510 --> 04:05.210
So here I'm going to um I'm going to give something else.

04:05.210 --> 04:14.290
For example, we are having this here and in here I need to provide HTTP.

04:16.650 --> 04:21.610
And I'm going to concatenate this with the URL that we have it okay.

04:22.210 --> 04:26.050
Now if I print this Get response.

04:28.570 --> 04:34.530
And you see we have WWE google.com.

04:34.530 --> 04:44.410
And if I execute this program now and it tries to get access to this website, if it gets access, if

04:44.410 --> 04:45.170
that exists.

04:45.170 --> 04:48.170
So this will give me a code.

04:48.210 --> 05:01.210
A response code of 200 200 means okay so let's use Python and we have our.py.

05:01.250 --> 05:02.250
Now I hit enter.

05:02.250 --> 05:09.750
It is trying to access that and you see that we get a response code of 403.

05:09.790 --> 05:13.510
That means it is not able to access this thing.

05:13.550 --> 05:14.510
Okay.

05:14.510 --> 05:14.750
So.

05:17.790 --> 05:18.990
Let's remove this.

05:21.390 --> 05:24.470
And now I'm going to try once again.

05:25.510 --> 05:26.190
Let's see.

05:27.190 --> 05:33.310
And still you see that we are not able to get access to this one.

05:33.350 --> 05:34.310
Okay.

05:34.310 --> 05:36.790
What if I use https.

05:41.950 --> 05:45.670
You see a response code of 403.

05:45.990 --> 05:48.790
That means we are not able to access.

05:51.030 --> 05:57.630
Now, this, uh, 403 means that it is accessible.

05:57.670 --> 05:57.990
Okay.

05:58.030 --> 06:01.150
But it is forbidden now because of that.

06:01.310 --> 06:05.980
And you may know that in Iran, Everything is filtered.

06:05.980 --> 06:06.380
Okay?

06:06.420 --> 06:06.940
All.

06:06.940 --> 06:09.740
And the whole internet is filtered.

06:10.060 --> 06:12.220
They are forbidden in Iran.

06:12.380 --> 06:16.820
So because of that, now I'm not able to get the response code of 200.

06:17.140 --> 06:24.820
Now, for example, if I try to get access to an Iranian website and you will see that I will get a

06:24.860 --> 06:26.860
code 200.

06:28.140 --> 06:31.100
And if I try to do with a website like.

06:33.260 --> 06:35.660
Shaken dot air.

06:36.220 --> 06:44.260
Now if this website exists and I would be able to access it, I will get 200.

06:44.300 --> 06:48.340
And if it is not exist then I will get an error.

06:48.780 --> 06:50.580
Let's try to access this.

06:54.500 --> 06:54.740
Uh.

06:54.740 --> 06:55.460
Let's see.

06:57.940 --> 06:59.620
We have shaken dot air.

06:59.660 --> 07:00.060
Okay.

07:01.020 --> 07:02.260
You see that?

07:02.260 --> 07:04.140
It gives me this kind of error.

07:04.180 --> 07:06.680
That means this is not exist.

07:06.680 --> 07:06.960
Okay?

07:06.960 --> 07:08.040
This chicken air.

07:08.440 --> 07:12.360
Now, if I came back here, we have its URL here.

07:12.680 --> 07:15.000
Let me copy the whole thing from here.

07:16.120 --> 07:21.720
So I copy this and you see instead of C I used k.

07:21.760 --> 07:23.440
It is an Iranian website okay.

07:23.480 --> 07:25.760
That is breaking the filters.

07:28.760 --> 07:39.760
And here now if I use that website here and remove this part because I use that here and I save it.

07:41.440 --> 07:42.600
Let's clear this.

07:45.760 --> 07:46.560
And hit enter.

07:46.560 --> 07:48.960
Now you see that I get code 200.

07:49.000 --> 07:52.480
That means I am able to get access to this one.

07:52.520 --> 07:53.240
Okay.

07:53.240 --> 08:03.600
And if I try something else for example, to get its, um, sub domain, I will be able to get that.

08:03.600 --> 08:03.920
Okay.

08:03.960 --> 08:06.360
So I will explain that in the next lecture.
