WEBVTT

00:01.400 --> 00:04.920
Okay, now it is time to build this reverse connection.

00:04.920 --> 00:12.160
So while creating a reverse connection, first we need to open a port on hacker machine and then create

00:12.200 --> 00:20.640
a file, evil file, or any kind of file that try to connect to this hacker computer on that specific

00:20.640 --> 00:23.480
port using its IP address.

00:23.480 --> 00:25.960
So here we are going to use socket module.

00:26.520 --> 00:29.440
And that is here it's a library.

00:29.440 --> 00:34.800
You can come here Docs.python.org slash three libraries dot HTML.

00:35.240 --> 00:40.920
So you will be able to find a lot of information about socket okay.

00:41.560 --> 00:47.080
And you need to come here and take a look a quick look here okay.

00:47.960 --> 00:52.760
And you will be able to go with this section.

00:52.760 --> 01:00.120
If you're not trying to learn more than this course, then if you follow the course that will be okay.

01:00.120 --> 01:00.360
Okay.

01:00.400 --> 01:02.720
That would be okay too.

01:02.720 --> 01:05.840
So let's come here.

01:06.360 --> 01:09.350
Try to open a port.

01:09.390 --> 01:09.670
Okay.

01:09.710 --> 01:11.030
Any kind of port.

01:11.270 --> 01:15.990
So this computer, listen to that specific port and other computer.

01:16.030 --> 01:20.190
The victim will try to connect with us on that.

01:20.830 --> 01:24.510
So here, for opening this port, we are going to use netcat.

01:24.550 --> 01:24.790
So.

01:27.150 --> 01:29.030
And that is very easy.

01:29.390 --> 01:32.430
That program is called n c.

01:32.470 --> 01:38.630
Here we use dash V for more details.

01:38.910 --> 01:42.750
And I'm trying to listen on port.

01:42.790 --> 01:45.590
For example it is going to be 444.

01:46.230 --> 01:47.310
Hit enter.

01:47.350 --> 01:51.750
Right now it is telling that listening on any 444.

01:51.790 --> 01:55.590
That means on from any IPS.

01:55.630 --> 01:58.070
I am listening on this port.

01:58.110 --> 02:07.190
And now if I go back to Windows Machine, which is here, I created a file called reverse backdoor.

02:07.230 --> 02:16.210
Here I try to connect first, try to build my program and then try to connect on that specific specific

02:16.210 --> 02:16.490
port.

02:16.490 --> 02:23.370
So I will be able to do that because on Kali Linux this port is open and listening.

02:23.370 --> 02:24.770
Okay.

02:24.810 --> 02:34.370
And here I installed this, um, this thing which is called VSCode on Windows Machine.

02:34.810 --> 02:41.090
You can install this one or PyCharm or even any text editor that you like.

02:41.090 --> 02:41.890
Okay.

02:41.890 --> 02:44.570
So let's go and try to build that.

02:44.770 --> 02:53.090
So here we need to first import the module that we are going to use okay.

02:53.570 --> 02:58.650
So let's use import socket okay.

02:59.450 --> 03:03.650
So this socket is already comes with Python.

03:03.650 --> 03:06.570
And now we imported this.

03:07.010 --> 03:11.650
It is time to build uh an object from this socket.

03:11.650 --> 03:15.050
So I'm going to name this object connection.

03:15.050 --> 03:20.920
So it is equal to socket dot Art socket.

03:22.280 --> 03:26.800
And here inside these we have socket.

03:27.440 --> 03:30.400
Dot AF in it.

03:33.840 --> 03:39.760
If in it and also we have socket dot

03:41.720 --> 03:51.160
um capital okay is o c k underscore I think it was rain that is here.

03:51.560 --> 03:51.800
Okay.

03:51.800 --> 03:53.560
You may ask where this come from.

03:53.560 --> 03:56.120
Okay I don't know what what all this okay.

03:56.160 --> 04:00.200
Again I'm going to tell you you can write in here and search for that.

04:00.560 --> 04:02.280
You read this documentation okay.

04:02.320 --> 04:04.400
We have this one change in version three.

04:05.680 --> 04:13.440
Uh c that means no not that really.

04:13.480 --> 04:19.440
We had if in it and that was here I don't know.

04:20.080 --> 04:21.520
Let me search for that okay.

04:21.760 --> 04:23.480
We have f underscore.

04:25.670 --> 04:28.030
In it that is here.

04:28.070 --> 04:28.750
Okay.

04:28.790 --> 04:29.430
Appear.

04:29.470 --> 04:33.630
Host and also port is used for if in it.

04:33.670 --> 04:34.630
Address familiar.

04:34.750 --> 04:41.910
Host is string presenting either a host name in internet domain and something like that.

04:41.910 --> 04:46.390
And also you need to provide IP version four something like this.

04:47.110 --> 04:49.230
So for that we are going to use.

04:51.670 --> 04:52.870
This this two here.

04:52.910 --> 04:53.270
Okay.

04:54.110 --> 04:59.310
And the next thing is another function or another method that comes with socket.

04:59.310 --> 05:00.630
We need to use that.

05:00.790 --> 05:04.870
So now I have the object okay.

05:04.910 --> 05:11.270
Connection dot connect is a method that we are going to use in here.

05:11.270 --> 05:13.070
We need to provide two things okay.

05:13.110 --> 05:18.510
One of them is the IP address for victim or for destination.

05:18.550 --> 05:19.190
Sorry.

05:19.230 --> 05:23.230
And also the next one is the port that is open and listening.

05:23.230 --> 05:26.470
So the port which is listening right now is this one.

05:26.590 --> 05:32.500
And the IP address is going to be IP address for Uh, Kali Linux.

05:32.500 --> 05:38.940
Okay, so if I came right in here, you know that, uh, let me before that, let me write the IP.

05:38.980 --> 05:42.500
It is 0 to 4.

05:42.540 --> 05:47.540
I think this is, uh, the Mac, the IP address for Kali Linux machine.

05:47.940 --> 05:50.580
So now I'm going to save this and.

05:53.100 --> 05:53.540
So.

05:56.340 --> 05:59.540
So right now you see still it is listening on this port.

05:59.580 --> 05:59.980
Okay.

06:00.300 --> 06:06.260
Let's come back here and try to run the program okay.

06:06.260 --> 06:10.380
It is going to be Python reverse backdoor hit enter.

06:10.700 --> 06:12.540
Nothing happened at all okay here.

06:13.140 --> 06:17.340
But let's go back to this machine.

06:17.340 --> 06:26.380
You see that uh, connect connection has been, uh, connected.

06:26.380 --> 06:26.740
Okay.

06:27.980 --> 06:29.380
It was for a while.

06:29.420 --> 06:30.300
Okay.

06:30.300 --> 06:32.900
And you see that connect to this computer.

06:32.900 --> 06:34.380
From this computer.

06:34.380 --> 06:38.200
You see, we built a very small connection here.

06:38.240 --> 06:38.640
Okay.

06:39.000 --> 06:44.960
When we didn't send or receive any data, but we were able to build the connection.

06:45.160 --> 06:45.560
Okay.

06:45.880 --> 06:49.560
So this is very important.

06:49.920 --> 06:52.400
First we need to build the connection.

06:52.440 --> 06:53.040
Okay.

06:53.040 --> 06:54.760
Let me come right here.

06:54.920 --> 06:57.000
First we need to have this connection.

06:57.120 --> 07:03.480
And then while we have the connection we will be able to send and receive data on victim.

07:03.520 --> 07:07.480
So now from from windows machine which is our victim.

07:07.520 --> 07:08.200
Okay.

07:08.240 --> 07:11.880
We have this program to send the connection.

07:11.880 --> 07:20.560
So later we will be improving this to have this connection for a while for a lot of time, for the time

07:20.560 --> 07:21.720
that we want.

07:21.760 --> 07:28.520
And for now it's only for some time, for example, for half of a second, okay.

07:28.560 --> 07:30.920
Or even less than that.

07:30.920 --> 07:33.720
But we were able to build the connection.

07:33.960 --> 07:43.160
So let's go and build this connection for a while and try to get data.

07:43.800 --> 07:44.440
So.
