Instructor: Welcome back.
In this video, we are finally going to test our back door.
Now we are going to see whether we get some errors
during the compiling of the program.
We're going to see all of our commands work.
So we will be testing, uploading files, downloading files
and other commands as well.
And if we encounter any error
we're going to fix it to make our backdoor fully work.
Now the first error that I want to change
from the previous video is inside of our backdoor code.
And what that is is right here in the upload command,
I didn't specify download file, I only specify download.
And if I were to compile this program
this function would not work
because there is no download function inside our code.
There is only download file function.
Now that is the only error for now.
Let us save this and if we go
and compile the program, so what I'm going to do
is I'm going to copy the backdoor.py
to the home, Mr. Hacker and then desktop.
Then I'm going to paste the backdoor
onto my Windows 10 desktop so I can compile it later.
And right after it I'm going to check
out whether I set the IP addresses correctly.
So what I got inside of our server
and backdoor is the IP address of 192.168.1.12
in port 5555.
Now port is something that we do not need to change
unless some other program is using it.
But what we must check out
before running both of these programs is our IP address.
So in my case it does match.
My IP address is 192.168.1.12.
So I can straight away start my server.
It'll listen for the incoming connections.
And while it is listening
I will go and compile my back door.
So for this, I will open the command prompt.
I will navigate to the desktop directory.
And if you remember the command, we must run py installer
then the name of the program
and then dash dash one file and dash dash no console.
Once we specify this command right here
then we can press enter.
Now what you can do
after you test out this program and it works successfully
then you can apply other methods such
as making it look like an image
something that we already covered before to
make your backdoor even more trust able
to the target so they can execute it.
Our compiling of the program has finished
and here we get those four files.
These three we can delete straight away.
And all we need is this, this directory.
We have our backdoor.exe
and if we run it, remember that inside of our code,
it'll wait for 20 seconds before establishing connection
to the server.
And hopefully in just a few seconds
we should see right here a shell pop up
on the target system.
And here it is, we got the connection
from 192.168.1.4, which is Windows 10 machine
and it is initiating the connection from this port number.
Now let's test out all
of the commands that we applied to our code.
So first of all, let's start
with simple commands such as simple command front commands
which are who am I, IP config.
Let's run netstat to see
whether we are going to be able to see all
of the connections that our Windows 10 target machine has
and we do manage to see it.
If I type dir,
I will only see backdoor.exe because inside
of the this directory we only have backdoor.exe program.
Now comes the crucial part.
Are we going to be able to change directory to one step back
and see the contents of the desktop directory?
Let's give it a try.
If I timely command CD and then two dots, press Enter
run the recommend, and here it is.
We successfully changed directory to the desktop directory.
Let's try to go to some other directory.
Let's for example, go one more directory back.
So if I type once again type dir and here it is
we are one directory back
and we can change the directory from here.
If I go to documents.
Now I am inside of the documents directory
so I can successfully change the directory
to whichever folder I want.
Now before we continue with execution of other commands
let us navigate back
to the desktop directory on my Windows 10 machine.
And from here, let us test
out whether we can upload and download files.
So what I got inside of my tools directory
on my Kali Linux machine is I got this tester.txt file
and this is simply just a txt file that says Hello world.
What we want to do is we want to see
whether we are going to be able to upload this file
to the target system.
So let's give it a try.
If I go right here and type upload tester.txt.
Now before you run this command, make sure
that the file that you're trying to upload is
in the same directory as your server.py.
Otherwise you will need to specify the full path
to that file because if you don't
this will not work and it'll probably crash.
So let's give it a try.
Since tester.txt is in the same directory
as both of my programs, if I press Enter,
let's go to our Windows 10 desktop
and here is the tester.txt.
If I open the file here, it opens Hello world.
So we successfully managed to upload the file
to the target machine.
This file wasn't here before we ran our program.
Now let's see whether we can still execute commands.
Maybe it crashed something.
So if I run, who am I?
I can still execute more commands.
Let's give a try to the download function.
So in this case, we're going to download something
from the Windows 10 desktop.
So what I'm going to do is I'm going to open a notepad
and I'm going to write something.
So for example,
"This is a file from the Windows 10 machine."
I'm going to save it onto my desktop
as a try download me dot txt.
So here it is on the desktop
and if I go right here, type dir once again,
we should see that file inside
of our dir output.
Let's give it a try and try to download it.
So download, try download me dot txt.
One more thing, make sure you specify the name correctly
otherwise it'll also crash because
if you specify a name of the file that doesn't exist
it'll not be able to find it.
So if you press enter right here, it'll take a few seconds.
And if I go inside of my back door directory type LS
once again, here we have try download me dot txt file.
If I get it to see the contents, here it is.
This is a file from the Windows 10 machine.
So our commands work successfully.
The one less command
that we must give it a try is the clear command.
So if a type clear, it'll clear our screen
and we will be able to execute other commands
in a more clear terminal.
Great, everything works as we planned.
Now the one last command
that we must test, easily quit command.
So if I go to my task manager
while I still didn't close the backdoor
you should see backdoor.txt running
as a background process on the Windows 10 machine.
But if I type quit
it will close the server from the Kali Linux machine.
But let's see
whether it'll also close the backdoor in Windows 10 machine.
And it does indeed close it.
We no longer see backdoor.txt process right here
inside of our task manager.
So everything worked as we planned.
All of the commands that we applied
are working successfully.
Now what you can do
from here is you can try applying different commands
and making these backdoor even better.
You can try adding a keylogger in Python.
You can try creating a persistence using registry.
You can try executing screenshots.
And all of this I do in my Python free hacking course.
But since this is a beginner course
in complete ethical hacking, we will stop here
and we're going to focus
on some other subjects from the next video.
But you can improve this program a lot if you learn Python
and add even more functions to this program.
Nonetheless
this is another project that we did successfully.
And in the next section we're going to touch
on a big subject of web app penetration testing.
See in the next video.