OK let's stop picking the world.
So this is the program that we really use to control our money turn our victim.
So first things first we need to write a program to establish the connection.
So in this lecture we are going to write a program that will help us establish a connection with the
victim.
OK.
Let's start writing.
So first we need to create a variable called connection.
This variable will be used to establish connection with our victim.
So that type of this variable should be named dot com
OK.
And this is a part of net package and as you can see from that.
So once you have it you need to define your victim IP and victim port in this case.
We don't need it since this is a cell and we will try to connect from victim to server.
So we don't need the IP address of the victim directly here.
So what we are going to do is we require the server IP.
So in this case the server IP is where is it.
Let me clear it again.
I have config and you can see that the central right is 1 9 2 1 6 8 0 0 0 that turkey.
So I'm going to copy it and I'm going to create a new variable called IP which is the server ip of this
called Linux machine.
And I'm going to place the value then I need the port to connect to it.
I'm going to create a port variable and then you can use any port but I'm going to use the port number
in 1990.
So now we have a victim.
Now you have an IP address and a port number for this local machine that will be used to connect with
the victim.
The next thing is we need to define a port computer base so a complete address can be defined as follows.
So first thing you need is IP and then you need to add a column and then you need to add the port.
So it's okay or it should be capital.
So in essence it looks something like this or 9 to the 16 year dot zero dot 13.
And come on.
And then 1990.
So this is how you define an address.
And the thing about this that package is that it requires address in this format.
So you have converted this thing into this format.
So now you have this the next step is to create and to try to listen to the set of the incoming connections
to listen to the incoming connection.
We are again going to use a net package net and dot and then we are going to use a method called listen
then what this method does it is that it tries to listen on incoming connections.
So the first thing you need to define is the network protocol.
So essentially you're going to develop a DCP what we are going to right the network as DCP the next
thing is address string as you can clearly see from here.
And if you see the documentation as you can see that the first thing is a network type which could be
DCP UTC before DCP 6 or whatever unique.
And the next thing is address and the address should be a preview for the address in this format which
is here.
So I'm going to use this local address here.
So now we have created a listen to what this matter will return to objects.
The first thing is a list not object which will be used for listening on this on incoming connections
and then an error if it is unable to get a listener.
Once we have that I'm just going to handle this error.
So we don't get into any problems and then I'm just going to print and that is it's like this log of
fatal error.
So now we have handle a lot properly.
The next step is to accept the incoming connection if there is an incoming connection.
So what happens is that it starts execution from here and then it starts waiting here for incoming connection.
So the poll numbers proceed further from here.
And then there is an incoming connection.
Once there is a connection it will accept the connection Miss dot accept
and then this is not a lot except to return the connection object which is here of a network icon.
And if it's unable to accept it it will cause an adverse Okay let's do it.
Okay now we have an established connection here.
So now this connection can be used to trust me.
But here we simply want to acknowledge the establishment of a connection.
So first I'm going to end on the other.
If ever is no equal to nil no return.
Okay.
I'm just going to print it.
That had a connection cannot be established.
Okay so once a your hand a letter the next step is to find out what the IP address of the incoming connection
is.
So I'm going to write here.
Ms.
Okay from to that.
So now we can say connection established form and then we can get the IP address of the victim by doing
like this connection loose connection that they won't address the string.
So on this soon do is that it will let us know the name of this IP of the victim wishing.
And so now you have everything complete.
So we write the IP address of our local machine.
Then we try to listen for incoming connection.
Once we have listened once we are listening we can accept the connection.
If we have an incoming connection and once we have accepted it we can just print out the IP address
of incoming connection.
So this is the server side just up or down.
Now we will define the victim.
Does this put gum in the next lecture.