Instructor: Welcome to our second coding project.
As we already know,
we are going to create a working back door
and as the previous project was in Python,
this one will be as well.
However, if we think about it a little bit,
you might realize that in order for our project to work
and in order for us to successfully communicate
with the target machine using our back door,
we must create two programs,
a server and a payload.
One will be running on our Cal Linux machine
and the other one will run on our target machine.
What will happen is
they will communicate between one another
and from the server, we will be sending our instructions
that we want our target to execute.
Then, the payload will send us back an output.
So, it would pretty much look something like this.
Cal Linux machine is running the server program
and the target is running the payload, or our back door.
Once we get to creating these,
you will notice that the code of these two programs
will be rather similar,
due to them working together.
We will be sending commands from our Cal Linux machine.
For example, if we wanted to check out all the files
in the current working directory on the target machine,
we know that the command for this is DIR on Windows
and LS on Linux.
Once we send that from our server,
we would want our target to send us back the response,
which will contain an output of all the files
and folders inside of that specific directory.
Now, that is just an example of one command.
We of course want to be able to execute
all the commands that we can run inside the regular terminal
or command prompt and we will see exactly how to do that.
To code this, we will need knowledge of reverse shells,
which we already have since we covered exploitation section.
We know exactly how reverse shells work
and another thing that we must be familiar with are ports
and IP addresses.
And this is also something that we know.
This will not present us a problem.
We need to be familiar with Python sockets
and this is something we briefly touched
in our first coding project.
However, I will do my best to explain it once again
in the code that we're going to use.
And last, at the end,
we will need to compile the Python code to .EXE
for our windows targets.
This is something you should not worry about
since I will demonstrate how to do this
after we code our programs.
So, now that we know what we are doing, without further ado,
let's get straight into the coding lessons.