WEBVTT

00:01.080 --> 00:01.360
Okay.

00:01.400 --> 00:05.120
In the previous lecture, we refactored the listener.

00:05.160 --> 00:07.160
Now it is time to refactor the backdoor.

00:07.200 --> 00:07.600
Okay.

00:08.680 --> 00:16.800
And I mean by refactoring to create a class and put them into functions or methods.

00:16.840 --> 00:17.640
Okay.

00:17.640 --> 00:21.360
So let's create a class I'm going to name this class backdoor.

00:23.720 --> 00:31.520
And here as you see this part is responsible for uh this.

00:31.800 --> 00:34.480
So here we need to create a constructor.

00:34.560 --> 00:36.840
So let's use init.

00:37.920 --> 00:43.080
And we don't need this part here.

00:43.320 --> 00:44.440
Let's use.

00:47.160 --> 00:47.720
Uh okay.

00:47.760 --> 00:49.000
Later we can use it.

00:49.200 --> 00:51.080
Let me paste this here.

00:51.880 --> 00:54.600
Now hit tab twice.

00:55.160 --> 00:57.080
As you see here we have two argument.

00:57.080 --> 00:58.560
One of them is port.

00:58.560 --> 01:03.520
And also we have the other thing which is uh IP and port.

01:03.560 --> 01:03.760
Okay.

01:03.760 --> 01:04.400
This is the IP.

01:04.400 --> 01:05.760
The other one is port.

01:05.800 --> 01:09.920
So let's provide IP and port.

01:11.890 --> 01:13.370
So perfect.

01:13.410 --> 01:20.930
Now, instead of using this here, I need to just write IP and port.

01:22.330 --> 01:22.850
Okay.

01:23.730 --> 01:25.530
And also this one.

01:25.650 --> 01:31.530
Now it is, uh, part of the class, so I need to hit a tab here.

01:32.010 --> 01:35.650
So it became part of this class.

01:35.890 --> 01:44.890
And also for this we need to create a function because this part is responsible for running the command.

01:44.930 --> 01:45.210
Okay.

01:45.250 --> 01:49.050
System command for receiving and sending command.

01:49.130 --> 01:52.050
So let's create a function.

01:52.090 --> 01:59.490
I'm going to name it run here paste it and hit tab twice.

02:01.490 --> 02:06.330
And as you see some of these are not uh have some error.

02:06.370 --> 02:07.050
Okay.

02:07.050 --> 02:10.170
So that is because self keyboard.

02:10.210 --> 02:12.410
The first thing is here the connection.

02:12.410 --> 02:20.210
While we are using connection we need to add this self keyword here at the beginning because we are

02:20.210 --> 02:24.790
using this self in other function as well.

02:24.790 --> 02:28.110
And also we need to add a self keyword here.

02:28.390 --> 02:28.830
Okay.

02:29.630 --> 02:32.830
And also we have the self here right.

02:32.870 --> 02:39.870
Now we need to add self dot connection there and also self dot execute system command.

02:40.230 --> 02:44.230
And we have self dot connection.

02:44.510 --> 02:45.150
Perfect.

02:45.390 --> 02:46.590
Now it is good.

02:46.750 --> 02:50.670
But still we need to create an instance from this.

02:52.230 --> 02:53.430
Let me collapse this.

02:54.030 --> 02:56.710
Let me before collapsing let me hit some.

02:58.150 --> 02:58.990
Enter here.

02:59.030 --> 03:01.910
Okay I do have enter now.

03:02.510 --> 03:02.830
Okay.

03:03.590 --> 03:10.990
So I'm going to create this object by the name of my backdoor.

03:12.990 --> 03:16.070
So this is my backdoor is equal to.

03:20.070 --> 03:21.310
Backdoor class.

03:22.750 --> 03:29.590
And as you see it is asking for cheating because in constructor we add an IP and also a port.

03:29.630 --> 03:39.400
So the IP is ten 024 because the color Kali Linux IP address is four and the port is going to be four,

03:39.400 --> 03:40.200
four, four.

03:41.240 --> 03:46.960
And now I'm going to go use the run method.

03:47.000 --> 03:47.720
Okay.

03:47.720 --> 03:49.360
Now I'm going to save this okay.

03:49.400 --> 03:50.960
I did save that.

03:51.320 --> 03:55.520
And now let's come back here into Kali machine.

03:55.560 --> 03:56.880
Execute the listener.

03:56.920 --> 03:58.720
Right now it is listening okay.

03:59.200 --> 04:01.480
And let's come back here.

04:01.520 --> 04:08.320
Try to run this program to see what is going to be happening.

04:08.920 --> 04:11.280
So the connection is happened.

04:11.320 --> 04:12.520
Okay, we got a connection.

04:12.520 --> 04:17.200
Now let's execute the Dir command.

04:17.200 --> 04:18.280
You see, it is working.

04:18.560 --> 04:22.960
If I use ipconfig who am I?

04:24.120 --> 04:25.200
And it is working.

04:25.240 --> 04:27.800
Okay so we did not break the program.

04:28.080 --> 04:28.760
Perfect.

04:28.800 --> 04:30.400
Now the code.

04:30.440 --> 04:34.400
It looks more beautiful okay.

04:34.440 --> 04:35.800
In both sides.

04:35.840 --> 04:36.600
Listener.

04:36.600 --> 04:38.600
And also the other part.

04:38.640 --> 04:45.440
So now that it is completed, it is time to go add some more functionality to the back door.

04:45.480 --> 04:45.920
Okay.
