Okay so now our focus should be development of this function which is aggregate demand to working with
those.
So if we go here we don't have any logic defined here.
And the more you start building our logic here.
So if we want to educate commands on what our logic should be that we should send command from server
then execute command to more key and then receive very whose arms are at.
If there is an error.
So this is how the algorithm for how it works.
So you send the command remotely executes command and then send specs.
This is what we want to do is that we want to do right.
We want to write a program that will ask the user continuously for the good ones and then they will
execute once again and again unless there is a sufficient condition.
So our logic will relate this.
So we will send up the one and then they do return.
Come on.
And then this group whatever.
And unless there is a special condition and this special condition
condition will be stopped.
So we will try different commands for example one directory the president working directory.
These are all given those commands are let's say some other command for example.
So we really try to try to loop that we are creatively ask the user for the input commands.
Again and again and it will give better results automatically.
But if they use that input stop then this command loop should stop and it will move out of this loop
and go back to here and then ask the user for options again.
So this will be all logic.
So let's start building it.
The first would be to get the user input.
So we will define the new data there and then we can get the input from the user want to have this input.
We will define the.
Come on loop now.
If that's too true and then we will loop all this come on.
Okay.
So the next step is to just one data stream
and then simply we ask the user to input come ons which is and these arrows are greater than it and
indicate kind of like when for example if you open a terminal you see something like this.
And we want to replace it with this thing.
So our terminal would look like this.
Once you have that the next step would be to added the user input.
So we are going to see Donald tweeting
and then by extension as our generator and then we're able to store this as command
stand then to heaven or if it's not a name you're going to.
And then we're going to continue.
So we skip the loop and then try to get the input again.
All right.
So the next step would be to send this come on to the time machine.
So simply I'm going to use connections to try and
hide and then whatever the commanders say we're simply waiting to come on to the victim machine and
then the next step will be to check for that type of form on.
So if.
Come on
equals equals to stop.
Now when you read into the exit condition.
So here we will set a command loop to pause and mouth.
This is control and we move out of this loop and back to the main function.
So this is our stopping condition.
The next step we need to define.
So as you already know that if we like they're different.
Come on for example the Baier or something.
And then there is evidence usually multiple lines.
So uh.
So what we will do is that we will try to develop a command structure that will give us results back
to The Hague a set of A B C so as we already know how to tend a start toward a connection.
In this lecture we define the new Struct so that call it.
And it will be called command structure.
Okay.
And this should contain two fields.
The first would be the command.
Come on out would be careful to write this in these fields as capital letters or it doesn't cause any
problems need to be type string.
And similarly come on as if there is an adult while executing our command.
So we have a start and then we will send this struct.
So do we really see this stack from our account.
Now on logic is defined here.
So we are sending the commands to the victim.
The Victorian Execute commands and then they go through and the results in a struct so I I'm going to
define the stop here.
So I'm going to go see him these struct codes to and come on.
So we will create an empty start because the results will come from the victim machine and then we will
take the decoder.
Right we will do is that we will in the results in our victim machine and then we will attend the results
here.
And here we will decode that isn't so.
I will take the logic for decoding here now.
So let's create a decoder first that is equal to go up new decoder and then connection.
The next thing we want to do is decoded decode and then give the structure and then the ever
so if it is not equal to men we can just point out the errors and then continue developing.
It.
So if everything goes perfectly and we get a command and start with the valid fields of output in the
header we can simply print them for example different data.
Graeme Dylan come on stop.
Dot come on output so whatever the output is we print it and then you check the condition.
So if I go on to dark command error is not equal to empty strings then we can print this F.
And then the ones don't come on.
So if there is no error this string will be empty here.
And if there is an error we can just simply apply indeed if the common stock is not good to this thing.
Yeah.
Okay.
So now we have a server side complete Mauldin next lecture should we really build our victim site.