Okay so in this lecture we are going to develop a DCP scanner.
So what this cannot we lose it would try to connect with an IP address that we will provide.
And then it will return back a connection acknowledgement which tells us that the connection has been
established properly.
So DCP scanners are used for active scanning.
For example if you're in a network and you want to scan an IP address then you can ping this IP address
and get back different results.
You can use this tool for example.
Know if there is any board open which is followed up on on the piece and then you can use this port
to attack this machine so it disappears scanning is very important step in and hacking these systems.
So what.
In this lecture what we are going to do is uh going to scan and uh and map.
And then we're going to get back the results and then we will try board scanning.
So let's proceed.
So the first thing we need to do is we need to dial the DCP scanner or the IP address that we want to
use.
So the first thing we need to do is you need to define the IP.
So in this lecture we are going to scan this address which is scan me Dot and map out or cheap.
So this is an IP so an address provided by and map which is organization that has developed the program
called and my network mapper.
So what this the IP address represents is that if you ping it it will back and make acknowledgement
that you have been able to scan it or connect with this IP address.
As we will move forward you will see what we are trying to achieve.
So the next thing you need to define is you need to define which port you want to use to communicate
with this IP address.
So in this we are going to use some of our port.
So once you have that the next thing you need to do is you need to connect with this address to connect
it to go has a package called net.
And it has a method called Dial which can be used to communicate with different IP addresses.
So I'm going to use that dial and then you need to provide certain things.
The first thing you need to do is you need to define which network layer protocol you want to use.
And you can use different network protocols.
For example you can use a DCP UDP and several other but in this sector we're focusing on DCP DCP uses
a network of acknowledgment.
For example you try to connect with the other machine and then then the machine sends an acknowledgement
bag which represents that the connection has been established properly.
You can read about data online but the most the most important factor is that it uses signals for communication
and acknowledgement.
So we are going to use a DCP connection.
So the next thing you need is an address.
So you have an IP address and the port and then you can use address.
So in our case address would be IP and port.
But you have to represent it in a different format
so an address could be something like this for example IP plus and then you have to provide a call on
that which tells this net dot dial function that the IP address has completed up to this point.
And then after calling you define each port you want to use.
And then I'm going to put this address.
So now for this function we lose it will try to dial this IP address if you press documentation.
You can see their dial connect to the address on the name network.
So this is our network and it will try to connect with it and it will.
If there is a successful connection it will return to things a connection or an error.
If there is no connection so then you can say that if ETA equals to nil which means that the connection
has been established properly we can simply print out a statement s
and then we can see that connection established
and then we can tell which IP address it ought to exist on the string.
So this will tell us which is the satellite which is responding so well.
We are sending the address in the letter format for example dot to scan me Dot and map that or G.
And this is not in the other digit form.
For example something like t 30 34 Doug Flutie shakes out salmon.
If you know the IP address you will know that IP addresses can be represented in two forms either using
numbers are using these letters so a DNS server will have a will to resolve this address into this thing
which is number.
So our program is complete now.
Next we will run this program.
So I am going to use go on the line scan as you can see that it is connection established and then it
returns this IP address which is 45 33 32 31 36.
So this is the IP address of this address.
And this year we can bring this here.
We can replace the IP with anything that we want to scan.
And then we will be able to scan it.