Welcome to this lecture in this lecture we're going to make our own yen map module with the help of
these celebrities.
So first of all you have to go to these sweeps said that is yen map dot org and less download dot estimate.
Or simply you can source for and map for your machine and up to that I'm on windows that means that
did a set download these Windows binary.
You can simply click on this installer.
You'll save this by downloading.
And after that you just download that you suit open it and you should install on these set drive C drive
and you'll see that it is installed in program files.
And here is in map.
So next thing is to this copy the installation the file location.
And after that you have to go to your P.C. and go to the properties up to that advanced system setting
environmental variables inside this spot.
You have to this you read here and it makes I've already put D.C. and map location but now you can simply
click on new and you can just paste it over there.
So now after this you apply all of this is this go back here.
And now we have a successful installation map.
Next thing is to install these by Tony and map module.
So you have to open your terminal.
And this simply this copy from here.
And this go back to the terminal pasted right here.
After that you have to this install despite the net map.
I have a little install and now after closing this you are good to go with the coding.
So before that I'll just open my ideally and see what we are just doing here.
So in this we have to make these see and map module and we'll just make a port the scanner with the
help of these python in map module.
So first of all you have to import that and map that is in map.
And now let's instantiate this in map and let me see.
They scan is the object and after that I'll see and map DOT Board scan room.
So this is the important class.
So it is a port scanner replaces a click Okay.
There is single pop up screen that means port the scanner is up and running now so you can now scan
the any IP field over here.
So you have to for his type the scan and the material way here is that you scan method.
So in this is can matter do you have to give the host hostname here is IP address so I'll simply give
the local just to give you a real quick example output that you have to give the port number.
So I'll just say 22 2 4 4 3.
Let's take this port number and hear the arguments is optional.
So I'll just leave it here and I'll just read into it is going to scan us and it will this come after
a minute so let's wait and see the result.
It will take some time and give you results like this so you can see you have the DNA over here.
The result is in the form of DNA containing some of this information you could see the host over here
you could see the Virgin you could see the name you could see everything over here.
You can see the services you can see the method which is obviously the singing method you'll see all
of this in the next minute but for now you can see this is can import which is DCP protocol over here
and now you can disagree friends each of these keys and values of this destiny.
So if you want let me say command line you can simply do something like this is scan dot and come on
line.
So if you see this and if I hit enter you are going to get the command line over here and the next thing
you can also do is you can also get the protocols all of these protocols up this is can.
So you can have something like the IP over here.
So first of all it should be IP which is obviously our local host.
And if we scan and get all the protocols through this all protocol method
and if you just hit enter you'll just get DCP over here which is our protocol.
If it has more protocol than the speed will just print out in the form of list.
So next thing what you can also do is you can also see this step if it is running or not.
So we'll just say scan again and local host which is obviously these host We are just scanning and now
I have to just see they state if it is up and running or not if a hit enter it is saying up because
it is running so you can just take all of these estates and all of these key and value appear from this
dishonesty so you can also take something like the hostname if you let me just grab all of this
which is obviously our host.
And if I just stick for the hostname with this hostname method you'll see it is local host.
So you can do multiple things from DC and map body scanner which is going to scan us with this source
name.
And this is the port to be the source.
And next one here will be the argument.
So argument will be in the form of the characters and you can the source in the Google so something
like this will appear.
So these are all your arguments.
So if you see yes v over here it is the probe.
It is basically searching for the open port to determine the service of words and input.
That means if we go back to our ideally this ESB argument refers to the open port because it is searching
for the open port to determine the service and in form.
So these are some arguments to be SaaS.
So we'll make now our only and maybe scan and we'll see how we can just scan the IP addresses.
So with the UDP DCP and the comprehensive scan so let's open out by over here.
Let's do real estate coding now.
So first of all.
So something like the three type of scan we are going to this encounter over here.
So first over here we'll be seeing a scan.
Let me right.
The type of scanning first and the next one would be your UDP scan.
And the last one would be the comprehensive.
So first of all let's see about the single scan which is also known is that DCP scan.
So this single scan is detected specifically it is a way that the Melissa's hacker cracker will use
to communicate with the victim's support without establish a full connection.
That means this scanning will just scan the board.
No but it won't have any connection with the victim computer.
This approach is the world staples.
Basically it's the trackers use and it is also used to perform the denial of service attack and the
sync scanning is also known as the half open scanning because in this case we are not connecting fully
with the client computer.
Instead we are just having a half open scanning or take over here.
So next one would be your UDP scan.
So it is also quite similar of that of single scan but in this case.
But the UDP that connects none less protocol that means there is no equivalent to this DCP seeing packet
of it.
If the UDP packet is ascend to the victim computer or open port the system will replace worn within
Port.
That is the unreachable masses.
And in that way the response will indicate that the port is open and we have seen about this sink in
a UDP in the previous lecture.
So that won't be a problem for you.
So it is basically a two type of scanner will see in the argument six and how this is can differ from
each other.
So let's start coding here.
So first of all as always we have to import day and map module.
So this is the in map module.
So let's make this scanner now.
So first of all we have to this instantiate this in map module.
That means with this help a body scanner we have seen about this port is Kennedy nominated before.
So first of all let me just give the masses to the user saying welcome to our in map port scanner.
So this will be the message to the user.
So next thing is let me just make quite some spaces over here.
And now after this what do you need to do is you need to have IP address so IP address would be input
from the user.
So you knew how to input it is going to give us the message to the user saying plays into the IP address.
You want to scan
OK.
This will be the message to the user.
It is this input that IP address and let's bring this IP address again to the user saying the IP address
is you can simply format this with your IP address.
So now what we done was with us today.
So let's see the type of diabetes so you know what this type method does.
This is going to this region as the class.
So next thing is to get the response so what this response does is it does take the input from the user
to see what the user want.
So if a user want to have the single scanning they need to just get to the single scanning.
So what this response does it it will have the flow control.
That means we'll use the conditional statement to have the flow control between this is can.
So if user presses one then it will redirect to the sink scan if he presses to it to redirect to the
UDP scan if he presses three then it will just redirect to the complexity scan.
So that means there will be flow controls.
So in order to get that number in turn will this use input again and if we remember we have this terrible
code to have the multiple line.
So I'll just make a multiple line in a single line new line over here that is with this lesson and I'll
just say please into the type of his scan type of scan you want to perform so we can just go down because
this is a multi line comment.
So first of all let's give one here saying if you want to sync acknowledges scan and the second one
will be UDP scan and the third one here will be comprehensive
so this will be three scans and if I this put the new line again.
So this will be the response from the user or basically to the user.
So after that they will just get that number as a sprint.
You have selected
ups.
And that will be or is.
Which is basically the number.
So do lists get that number.
Let's take now.
So if this is so if we just do one.
This is not going to work.
Because if we see this it is is from this input method and we have talked about this in a multiple of
times before in the basic Python Lexa that this input method is going to give us this string and this
one is basically an integer so we cannot compare this input which is in the form of the string with
this one.
So we have to this pass this as a string.
So first of all we just compare with the one and if it is the case we have to now do something that
is your sync is scanning.
So let's do a single scanning so first of all let's check for the version of the end map.
So I'll say in my version this print this in my present first.
And it will be done with this scanner which you can see here which is the object of this map and will
make use of map bars and metal over here.
So it is in my portion.
So this matter will be called to take the version of the map that is installed on our machine.
So next thing is to see that what this is scan does.
So we have seen this scan was going to give us the dignity.
So let's see how we can just get the DNA.
So first of all first parameter that is to be seen in this scan is IP address which is entered by the
user here.
So the next thing was the portraits.
So I want to take from 1 to 1 to 2 for the number of report to be scanned is still here and the next
one is argument.
So let's talk about this argument.
So first of all see V and the next one.
Id yes.
Yes.
So what we did here was we just gave the argument to this scan saying that it has to this is scan with
the Volvo city and the SS is to scan for the sink connect acknowledges windows or may mom scans.
If you want to know for further then you can this take this documentation online in this book reference
space.
So if page's source for V which is obviously our verbosity.
So that should be right here.
It is saying increase verbosity level and you can also use VB for more greater effect.
So this is your argument which is just we just pass right here and this.
Yes this means that we want to just see the DCP seeing is scanning.
So this is the way to put the argument to our scan method.
So next thing what you need to do is to print that.
So basically what we get from here is the dysentery.
So I want to get that you scan in full from the dignity side of the scanner or this scan in full so
this will be the meter.
So what this is scanning for dogs is it will just give the Dignity for the meter like seeing in services.
So next thing what I want is the IP status so let's sprint.
If that IP status is up or down.
So for that we have to first of all to have the scanner and we have seen these in a minute before.
Because in that case if I just good ideally also you here what we just did was in the case of this estate.
So we just pass here the local host.
We saw they state which was up or running or not.
So we'll do the same over here.
So instead of local host we have to pass IP address that is in from the user.
And now we have to see those did so before that.
Let me just bring some matches over here.
Silence is IP status.
And up to that this but here they status which will be done with this estate method.
So we have now they state matter which is going to give us the status either up or down and the next
thing I want to give him is our protocols which will be DCP protocol.
So if you see an ideologue in which was a right over him.
So let's make use of this method to sell this a scanner and let's put again that IP address and said
that is scanner and less take for all protocols
so this will be my as hell basically calling the fund since to get the DCP and the next thing is to
take for the open put in this is important.
We haven't done this before.
So we will take for the open ports so to do that we have again this scanner and we'll just pass IP address
that is inter from the user.
Now in this case we have to make use of the DCP keys because this is the TCB scanning So will this pass
DCP and now we'll just get the keys which is for the values.
So what this result is basically this will give this last statement will give us the dignity and dignity
will be in the form of the port number.
So we'll get no ports that is open so that can be something like the dysentery which will be in the
form of 123 or 45.
Any port that is open will be result from this is determined.
So this is our pretty much the first scanning which is our DCP scan.
So we have completed our DCP scan over here.
Let's go to the live part and type something like if the response is greater than maybe 20 then print
Invalid something massive like this
listed for our forces scan.
So first of all I'll just go to the run run the main so it is saying it was saying that this is what
Jesus did here.
We have to check if it is one or not.
So let's run this again on the main.
It is saying into the IP address to scan and let me make some spaces over here and make spaces.
Let's stop it again.
Let's go.
And on this main.
So it is going to give us the IP registry scan.
So let's see our IP address from here.
IP config.
Daniel the skilled IP address 1 9 2 2 1 6 did wandered 14.
So I'll just dive here and 60 did one not 14.
And it is the masses that we just get here now which is saying input which is can we have.
So in this case we have only the one which is obviously the SDK scan which is seeing SDK scan.
So that means all this put here one.
So I'll just into one now and it is giving us the selective absence of first thing that he does the
Get was in my voice and because if you see here we are just printing they and my version so pristine
with this it is in my position and the next we get is this DCP so this is in the form of the dignity
which are the result of this scanning for metal and it is giving us the method which is obviously sync
meter which we just did here.
It was a yes way and same method.
And the next what the services so services was basically to scan the port from 1 2 1 0 2 4 and next
to was to see this did if it is up and running or not.
So our IP status is up and the next one was at the protocol so protocol is DCP protocol.
And the last one was open port.
So these are the open ports are basically these are the ports that are open on dismissing.
So use this gate open port from this scanner.
So in the next link so will complete with this UDP scan and the comprehensive scan.
So see you in the next one.