Okay, now that we created our program, that is working perfect.
And still there is one problem.
Whenever we are trying to log into something, okay, that we created that here.
When I was trying to log in, I provided this username, password and everything.
I logged in and then it lost the session.
Okay.
When we lost the session, that means we close the browser and then clear the history.
So we need to handle that.
And just imagine that I am trying to use this okay.
This username password and everything trying to log in.
And then I want to keep the being logged in okay.
Not to just log out, get some data and then immediately log out.
I don't want that.
So to solve that in here we need to use instead of Request.get.
We need to use session okay.
So let's see if we can do that or not.
In here I need to create a session.
So let's name it session self dot session is going to be uh equal to.
Uh it is going to be equal to.
In here we have requests dot uh session okay.
And this session because it is a part of the request.
So it is it is a class okay.
You see it is capital S.
So that means it is a class.
When I move my mouse over it it says class session.
Okay.
Now that I use it here, in here in this extract link I use request dot get.
Now instead of using request dot get here.
I can use uh, something else instead of request I can just use self dot session.
Okay.
So.
Now what is going on here.
Okay self dot session dot get and then the URL.
So now it looks like uh it is better now.
And in here also we need to.
Handle this okay.
The first thing that we want is this data dictionary.
So I use data dictionary.
From here I copy everything that is there and then I paste it here.
You see data dictionary is equal to something like this.
And also we need to change this URL okay.
Then next thing that I want is the scanner okay.
In here we need to add two argument okay.
So I will handle that in just a moment.
And here I need to use that session so I have this vulnerable wall scanner.
Okay.
Dot session.
Dot post.
I want to post something.
Okay.
The first thing that I want to post, uh, the first argument is the link for the login page for a website.
The second one is the data.
So this data is going to be equal to data dictionary.
So now let's come here.
And the first thing I want is this one link for this login page.
So let's paste it here.
And the second thing or the second option is also this one.
So here I don't need to give the login.
So immediately it will redirect me to that page.
Okay.
And.
Now it is better.
Okay.
That this looks better, I think.
Now let me save this to use Ctrl s and also this.
Now let's come back here and try to see if the program is still working.
And as you see right now it is working better.
Okay.
It is logged in and it's giving me all and everything that is inside that web page.
And these all are inside the page.
Okay.
And you see that at the end.
It is it has the log out still.
It is.
When I have this in my list, that means I am logged out of that web page still.
So we need to handle that as well.
Okay.
What does that mean?
Maybe you didn't understand.
Let me explain.
Okay.
We have the log out dot PHP.
Log out dot PHP means that I logged out.
Okay.
And, uh, right now I am at this page.
So in here, if I check in here, I have maybe only 1 or 2 links.
And when we logged in, you see, inside the page, we have a lot of links.
You see that here.
And then at the end it logs me out back.
So because we have this link, it logged me out of that website.
So we need to handle that too.
How can I handle that.
I can create a list to ignore this kind of link or this link.
So in here I'm going to create a list.
I'm going to name it link to what link to ignore.
It is going to be equal to a list.
So this list is going to be.
That list that we have.
Okay.
The log out.
Let me copy that.
From here we have it.
Okay.
Copy selection.
And now, instead of this that I just copied, I'm going to copy this logout dot php.
Now I have this and I need to use this.
Okay.
We are going to use this.
I can use it as an argument in my class.
So here you see we have a target URL.
And in here I'm going to add another thing.
And that is going to be link to ignore.
Okay.
So when I add this here that means the class get two argument.
So when the class get two argument that means in here into init method or init function or the constructor
we need to handle this two okay.
So here you see right now it is asking only for one argument.
And that is the URL that.
Now I need to add another one.
So let's name it ignore.
Links.
Okay.
And also down here I'm going to tell it the self dot we had link to ignore is going to be equal to ignore
links.
That is something we have up here.
Okay.
And now I save this.
And also somewhere inside this method I am checking if url in link and link not in the target link.
Do something okay.
And in here I'm going to check that too.
So I use and here and the link that is That that we are capturing, that we're extracting.
Okay.
And link.
Not in.
In what?
In link to ignore.
Okay.
Self dot link to ignore.
So right now it is a very big and beautiful condition here that is checking.
And then it is returning me the link okay.
And then printing all the link.
But it is ignoring the link to ignore.
You see we have the link to ignore here that is here.
So right now it is.
It will ignore that and it will not get that.
So that means we need to ignore that we are logged in and we are not logged out of something that we
are logged in.
So let's re-execute this program and see this time what happened.
So this time you see before we had logout dot php here.
But now in this time we only have about dot php.
Instead of logout we have nothing.
Okay, so that means now we are logged in and this thing is ignored.
Okay, we're not logged out of the class of the website.
All right.
Excuse me.
So here you see we have the username provided we have the password provided.
And then we have the submit button clicked.
And then after we are logged in then we have the session.
And then the data had been sent.
And then we call this method.
The method is in here.
It happens here.
And then it ignore that link to ignore.
And then it gives me all the link that it capture and that is it.
So thanks for watching and I will see you in the next lecture to improve this to get something very,
very useful.