Okay, here we are capturing all and everything that we are browsing.
Okay, that is not very good for us to do this, okay?
Because that is not readable.
I want to filter this.
Okay.
Filter and only capture the thing I want.
Okay.
So if you want to filter this you can do that right here we have another option called filter.
And this filter is equal to any type of package that you want to capture for example if it is going
to be UDP.
So you provide UDP here.
If it is TCP then TCP if it is um, if you want to capture on a specific port, for example port 80.
So you provide that here okay.
Port 80.
And it is how it work okay.
But the goal of this program is to capture the browsers link or the link that while we are browsing
think while the target is browsing.
And also another thing like username, password, something like that.
So if you want to do such kind of thing, that is not possible to do that right here.
So for doing that we need to use a third party module that is called http, uh I think HTTP request.
Okay.
So let's come right here and try to install it.
It calls http okay.
Use pip install skip http.
And as you see I already installed this.
You can install it by using pip install escape underscore http.
And here let's use that okay.
Uh for example I want to capture only the HTTP packet.
So let's see.
And if it is going to work or not.
So here I'm going to import that.
So from Scapy dot layer.
Import http okay.
Now I import this here.
Down here inside this process sniffed packet method I can use an if condition, and I can print the
packets or the details about packet that I want here.
Let's do that okay I use if condition again here.
If we have the packet okay.
If packet.
And this Skippy has a method called as layer okay has layer and it asks for HTTP.
For example I am trying to use http dot http request.
Okay HTTP is all capital and request with capital e and something like this.
If it has this then let's print it okay.
Let's tap here.
Not really there here.
And like this.
Now, if I try to execute this.
Okay, we have an if condition here that try to search on each packet, that if this packet has a layer
by the name of HTTP request or HTTP layer, then it will print that packet for me.
Not all and every packet that has UDP, TCP and everything.
Okay.
Like on port 18, port 21 anything.
Not all of them, only the HTTP.
Let's save this and try to go back here okay.
Let's use pseudo python packet sniffer.py hit enter.
And right now it's doing nothing.
Let me come here.
Uh Bing.
Dot com.
Okay.
Net hundred pro.
Okay.
That is something that I hit on colony Hunter okay.
That is come.
And I'm sure this captures something.
Okay.
You see that it is capturing this data like either IP, TCP, IP, http, post, gate, and this thing.
Okay.
And also this is a JavaScript file.
This is a png which is an image.
And these all are get okay not post.
That means these are HTTP data okay.
You see again we have the data that is not really readable okay.
Of course it is.
HTTP is bing.com and a lot of data here links something like that.
But these are really not what we want okay.
We want some specific thing like only the link, the browse link okay or URL and also some specific
thing like username and password, something like that.
Okay.
While the target is entering any kind of username or password we need to capture them.
Not everything okay.
Like passport ASP log okay.
So let's go and try to see if you're able to do that or not.