Okay so let's start going forward.
Our next goal would be to execute commands from or clear on the machine.
So what we want to do is we want to send commands from our Hecker system and then move on to execute
those command on the remote machine on the vector machine.
And when that one is executed we want to know the results back on our side of the machine.
So this is basically remote command investigation.
So this is a very important feature on hacking for example if you get an A shuttle out a remote access
and then you can execute commands on the Supreme Court system then you can pretty much do anything on
their piece.
So this is one of the very important features of remote access tools.
So let's start writing code for command execution.
So the first thing we want to do is we want to create a function.
OK let's go here and then we can name this as executed.
Go on
execute notes come on Windows.
So what we want to do is we want to execute commands on the windows from our server which is here.
So to do this what we need to do is we need to create a module or package.
I'm going to create a new phone called execute and then we're developed fortunes in this.
So the first function we write is function called execute.
Come on for me.
Windows
so we want to call this function which is a view to more porn from hand so that we can access the uncle
monitor exactly when defined the logic of this function later.
But let's for the moment go ahead.
OK.
So now we have an established connection.
What we want to do next is to create a loop here so that we can again and again next year.
Commands are do different procedures.
So what we want to do is we want to create a loop here that really had on come on so do other functions
depending on the user input.
So we will determine the logic as we go along.
So the first thing we need to do is we need to get the user input.
So we are going to use the same procedure that is we will create a data debt which will be of type offering
for new leader.
And then then input type will be standard input.
So we have got a role in Turkomans on this on machine of underlying except server.
Once you have this commands you can use this reader to get input trump the user and then determine the
UP PUT DOWN YOUR the code accordingly.
So let's start moving.
OK our next step is to get the loop so to create a loop we will define the loop control we're given
and its initial value will be true and then we will define affordable and we will take over this loop.
So know that since the value of flow control is true.
So at the moment this loop will always be true.
But we don't want to do it like this and we will define our logic as you move along.
So once we have that the next step is to simply get the user input.
So I'm going to write it off and then we'll ask users to enter options.
Okay.
So here we will ask users to input options or whatever options we want to enter the next step is to
leave the user input so I'm going to create a new variable on the user input and then I'll add this
to
the previous stream.
So this is the same read string function that we were using previously.
So once we have grabbed the user input we can simply check for an error.
If that is not equal to men in print and then we will continue in the loop.
Okay.
So now we will get the input here.
But what is this input.
So this input should be some option that we select from our features.
So we will develop different features for example and execute.
Come on download files set out to upload files to the victim.
So I will start building the logic.
So the first command our first option that we will build is called execute on lines and we want to get
going to work.
So I'm going to create a function and call options.
So these are the options that we will develop during our execution the detailed train plan.
So our first would be execute come ons
so this option will help us in executing Cohen's
switch and looking for.
OK so what do you want to do here is we will call this options here and then every time we loop through
this every time we loop we will get the list of options we can select from.
So I'm going to call options here and then we will have options here.
So let's define one more option.
So if we want to exit the program let's.
So we have at the moment two options either we can execute commands or we can exit the program.
So whenever we call this function we will get a list of different options that we can execute.
So it kind of gives you a choices of options that you can select from.
Once you have that let's proceed from there.
OK so our next step is to write this user input to the connection so that the s the victim until the
Temple Mount and those which you command out which action is being performed.
So I am going to call it an action
that flight insincere to grab a bite.
I'm going to go and use it.
So now we have sent our command out of whatever our command is to the to the victim.
So there are those of each command is being run.
Once you have run the command and victim both knows you can proceed from the okay.
Now since this command already has this backslash and attached to it our next step would be to remove
this back selection and get just up your option.
So I'm going to use the string struct trim suffix function and then I'm going to let the user run input
and we want to remove backslash from this and then I'm going to store this in a new variable current
user input.
All right.
So now we have this user option input which could be either one of 99.
Keep that in mind.
So now we will switch.
We will develop a switch case and then we will use this as the condition the event so I'm going to write
switch
user.
Each case you loops user input equals equals to one
OK so from the Internet.
So now we we are in the world command execution will go
and we will have zip codes.
And here we will call this functionality.
We have defined in the word package which is executed.
And what God wants you to come to with Windows.
So I'm going to call it here and then I'm going to use the package.
Which is if you go on the windows.
That's this one okay.
If you go here you have to define the inputs and outputs.
So we are going to input on that channel which is off base and that dot com and then we are going to
return an error if there is an error.
So let's sweep them into
action.
And this is going to be done and has
the next step would be to print out this ad.
But what we want to do is we want to define the genetic function that will write and they will take
in this area and print out its message.
So we don't have to write did this adult condition every day.
So I already have defined this function which is called display ad which takes the error and simply
print it.
If there is an ad that otherwise it does nothing.
As you can see here it simply prints out there.
So I'm going to call this function edit here to display and then simply I'm going to give it the edit.
OK.
So our first condition is almost complete.
So we will select the option one then we want to execute a remote command on the ATM machine and then
this function it is executed.
Come on remotely windows will execute commands remotely under Windows species.
So let's define a default case as a live free for example you gave a wrong input or something.
So I'm going to call it loops
and then to say that the invalid option try again or something.
So now we have a message for each.
If we press one we really go to the command execution method and if we press any other value it will
again ask the use that input to try again because your input is invalid.
So that's it for this lecture and then the next lecture will proceed further.