So now we have developed a program that will send out to the victim.
So in this lecture you're going to develop a program that will receive data from the cetera.
So the first thing we need to do is we need to define a procedure how we are going to receive this data
since then that is sent over the connection which is often at dot com type.
So we are going to use the same connection to receive the data.
But we first need to define a leader in which we are going to redo our data.
We are going to use the same for input output that we already define our new reader method and then
we will define what type of leader we want to use to receive data since.
In this case we don't have to use the input from the user but we need to read input from our connection.
So I'm going to use that as our connection.
So now we need to store this to the in variable.
I'm going to call this as you do.
Once we have this reader we need to read this string that are a data that we sent to do this I'm going
to use reader dot seed string so that you string bytes in a very different way.
So as you know that whenever we import that on the server side we load our data whatever our text is
and then the press entered and it stop taking input from the user.
And then it sends the whole data plus the new line characters backslash and along with this data combined
and it sends it over the connection here.
We have to receive the same data.
So we need to define our daily router byte as well.
So our delivery right in that case is vaccination.
So you can use the same delimiter byte head to tell the reader that the input has finished that coming
from the server side has finished it coming.
So I'm going to use backslash and as the delimiter byte and then we need to store this data in something.
So I'm going to create a new variable called uh that I received
and then this.
There are two distinct also tons and add.
So I'm going to handle that as well.
First let us handle the error.
If Adam is naughty girl to nil
I am simply going to log fatal error.
Once we have a handle that.
The next step is simply to print out whatever the data is from you don't print and take notice.
So if you simply just print out this data received what will happen is that this data received already
contains a backslash and corrected so it will create extra spaces in our program but we can use strings
function which is strings dot trim suffix and then we need to give the data received and then we want
to define which suffix we want to trim and remove.
So I'm going to use that selection.
So what we want to do is that we want to remove the this backslash and connected from the string which
is at the suffix R end of this ring for this whole matter will do it on a same string.
And removes this suffix from this thing.
So I'm going to call this data and then instead of printing this step of the New Line connector included
I'm just going to print out the simple data from whatever it is.
So see this.
OK.
So the next step is to send data and check how the program works.
So to do this I'm going to go to the server side which is the godly manic side.
Okay.
Sorry.
So my colleague leanings has updated and there are few changes in this setup.
It means that now this Linux is non dude by default.
So for example previously we could write a f config and this program will run properly.
But now since it is non root by default previously it is used to say rude at Kali which means that our
default to use it was rude and we could do anything where politics has improved their security and now
the main use it is not by default you can convert it into a rule but by default.
It's not rude.
So in order to use it you have to use pseudo super user do command.
And then you have to write whatever you want you want to write.
I'm going to write a f config and then you have to provide password provided my posit and now you can
see the same consonant perfectly.
So this thing has changed in Cali Lane x 20 20 or so.
Enough of this gonna update.
So let's go ahead and get this out.
Okay now we want to run this several for a gun so I'm going to start this program which is good on men
and then I'm going to my windows machine.
And I'm going to run this may come as well.
So now I was a victim is trying to connect with the server.
It will take some time so I'm going to the server again.
Let's wait for this program to connect properly
okay.
As you can see that it has obtained a connection from Zero Dark Thirty which is that a Windows machine.
And now it's waiting for the input which is indicated by these created then to science.
So our program is.
You hear and it's waiting for a reading thing from the standard input.
So I'm going to write string as far as the.
That's it.
Okay so I want to send this data which is far the lead to the victim.
So the note that I haven't pressed entirely yet so it's waiting for more input.
So let's say if I write some garbage text here and then a vanilla I start I press enter it.
It stops taking my input from the standard input so I press into and not get in.
You can see that it concludes this statement which is it better to send than it then writes the bytes
to connect and it is this one.
And now since the whites are written we have to see if the bytes separate them properly or not.
So I am going to the Windows machine and nowadays you can see that we have received the exact same bad
here.
And this database has a backslash and removed.
If the bags.
If we did not write this statement which is dreams are fakes then there would be two new lines of blank
lines here which is instead of one which is here.
So this is how you can communicate with them from somewhere to the claim.
And this is a very basic example of how to communicate with data as we move forward we will start building
on this obligation and then we will try to send more and more complex data including files which will
help us build a more complicated malware program.
So that's it for this lecture.
See you next.