Hi.
Welcome back.
Now let's explain something which is very important.
And that is about domain and also sub domain and main domain.
So it is very important to learn what is domain.
What is the main domain.
How can we access them.
And also how to create a program to get this domain and also sub domains and the domain.
For example this google.com, it is a domain okay.
And everyone knows that it is the main domain okay.
And also it has some sub domain.
For example this Google has a lot of things.
For example it has a mail and also it has social media.
It has a lot of things okay that people are using.
For example, it has Google Drive and a lot of things.
Okay.
And here let me show you for example this is the main domain.
And also if you want to get one of the one of its sub domain, it is I think.
Mail.google.com.
Now, if I hit enter, you will see that now we get this Mail.google.com.
And also you see that it has changed to Gmail slash vote and blah blah blah.
Okay, so we need to create a program that git we give the main domain okay.
And also some subdomain that we are testing.
For example we give google.com and then we give the other thing like Gmail like mail.google.com.
We need to have uh okay.
Or to go to hundred or even print for me or for us that this domain exists and it is very good because
in some cases we are going to find some, some sub domain of a main website that they are, for example,
it is a light part or a light version of that website, and they're still testing something on that.
And we And we can hack them very easily.
Okay.
So we need to get subdomain of the main domains.
So it is good.
Okay.
Now if I came back here you see I created something called cobbler dot pi.
It is a, uh, just a website.
Okay.
Let me go to.
Set a document.
And we have.
Okay.
Python for ethical hacking.
And also we have, uh, website hacking.
Okay, good.
Now, I'm in this position or in this part.
Okay.
So for getting access to website and also getting information from a website, we are going to use a
module called request.
Okay.
Um, this request, uh, we already used use this in some cases.
Now you know how to use it.
So let's import this.
Requests.
And first let's create a variable I'm going to name this URL.
Okay.
So this URL is going to be for example um google.com okay so here I am going to use a request and also
the get method to get access to this.
So let's use get response.
It's going to be equal to request.
Dot get method.
So this get method will get will try to access the URL that we are providing for this for example google.com
and also something else.
So here I'm going to um I'm going to give something else.
For example, we are having this here and in here I need to provide HTTP.
And I'm going to concatenate this with the URL that we have it okay.
Now if I print this Get response.
And you see we have WWE google.com.
And if I execute this program now and it tries to get access to this website, if it gets access, if
that exists.
So this will give me a code.
A response code of 200 200 means okay so let's use Python and we have our.py.
Now I hit enter.
It is trying to access that and you see that we get a response code of 403.
That means it is not able to access this thing.
Okay.
So.
Let's remove this.
And now I'm going to try once again.
Let's see.
And still you see that we are not able to get access to this one.
Okay.
What if I use https.
You see a response code of 403.
That means we are not able to access.
Now, this, uh, 403 means that it is accessible.
Okay.
But it is forbidden now because of that.
And you may know that in Iran, Everything is filtered.
Okay?
All.
And the whole internet is filtered.
They are forbidden in Iran.
So because of that, now I'm not able to get the response code of 200.
Now, for example, if I try to get access to an Iranian website and you will see that I will get a
code 200.
And if I try to do with a website like.
Shaken dot air.
Now if this website exists and I would be able to access it, I will get 200.
And if it is not exist then I will get an error.
Let's try to access this.
Uh.
Let's see.
We have shaken dot air.
Okay.
You see that?
It gives me this kind of error.
That means this is not exist.
Okay?
This chicken air.
Now, if I came back here, we have its URL here.
Let me copy the whole thing from here.
So I copy this and you see instead of C I used k.
It is an Iranian website okay.
That is breaking the filters.
And here now if I use that website here and remove this part because I use that here and I save it.
Let's clear this.
And hit enter.
Now you see that I get code 200.
That means I am able to get access to this one.
Okay.
And if I try something else for example, to get its, um, sub domain, I will be able to get that.
Okay.
So I will explain that in the next lecture.