WEBVTT

00:01.440 --> 00:01.760
Okay.

00:01.760 --> 00:07.120
Here we were able to, uh, establish a small connection, uh, for a while.

00:07.160 --> 00:13.640
Okay, now let's go and see, uh, how to send some data.

00:13.680 --> 00:14.120
Okay.

00:15.560 --> 00:19.440
From this machine, which is Windows to Linux or Kali Linux.

00:19.480 --> 00:20.560
Okay.

00:20.600 --> 00:22.600
And using the socket.

00:22.960 --> 00:28.720
So we have the object which is connection dot send method.

00:29.000 --> 00:31.480
Here we can add uh anything.

00:31.480 --> 00:37.360
You can add text like let's use backslash n to go to new line.

00:37.360 --> 00:44.400
And here let me add a text like connection established.

00:45.600 --> 00:47.400
And I can go to a new line.

00:47.720 --> 00:54.680
After this you need to do one thing and that is to lose the connection.

00:54.960 --> 00:55.320
Okay.

00:58.120 --> 00:59.720
Now the connection is closed.

01:00.200 --> 01:10.860
Now if I come back to Kali Linux and open this port that is right now listening and come back here,

01:10.860 --> 01:15.420
let me use CLS, okay?

01:15.460 --> 01:16.460
It is giving me an error.

01:16.500 --> 01:21.300
It is telling me type error about like object is required, not a string.

01:21.340 --> 01:21.940
Okay.

01:21.980 --> 01:22.700
Very good.

01:22.900 --> 01:25.140
Here you see we have a send function.

01:25.140 --> 01:29.980
This send function is not able to send a plain text from here.

01:30.020 --> 01:30.660
Okay.

01:30.700 --> 01:31.660
So no problem.

01:31.660 --> 01:32.540
We can solve this.

01:32.540 --> 01:33.140
Very easy.

01:33.180 --> 01:35.740
Okay I cut this from there.

01:35.780 --> 01:37.500
And let's create a variable.

01:37.500 --> 01:38.820
I'm going to name it message.

01:38.820 --> 01:43.780
It is equal to to this one okay.

01:44.340 --> 01:48.220
And now I use this message into send function.

01:48.620 --> 01:49.060
Okay.

01:50.460 --> 01:51.580
Message me.

01:51.620 --> 01:53.860
This is a dot.

01:54.500 --> 01:58.700
We have a function called a method called encode.

01:58.740 --> 02:01.140
So this will encode the connection okay.

02:01.180 --> 02:02.640
Not the Not the connection, this message.

02:03.080 --> 02:04.800
So now it is not a plaintext.

02:05.120 --> 02:11.280
And then this time maybe it is able to send data.

02:11.560 --> 02:13.760
So here we will be able to receive data.

02:14.360 --> 02:17.160
So let me open this port again.

02:19.360 --> 02:25.040
Come to windows and let's open terminal or cmd.

02:26.320 --> 02:26.760
Okay.

02:26.800 --> 02:28.360
You see nothing happened.

02:29.080 --> 02:30.440
Let's come to here.

02:30.720 --> 02:34.160
Right now you see that connection established?

02:34.400 --> 02:38.600
This was a text that we just a message.

02:38.600 --> 02:44.240
It was a message that we we printed or we send from windows.

02:44.280 --> 02:46.920
Now it looks like a chat system.

02:46.960 --> 02:47.160
Okay.

02:47.200 --> 02:50.720
But we are not going to build a chat system or chat application.

02:50.960 --> 02:53.760
We are going to create backdoor.

02:53.800 --> 02:58.040
So the other part is to do to receive data.

02:58.080 --> 03:04.650
Right now you see we are receiving from Windows, but not sending two windows.

03:04.930 --> 03:06.970
So let's come back here to windows.

03:08.130 --> 03:11.730
Right in here I am going to send some data.

03:13.450 --> 03:13.890
Okay.

03:14.530 --> 03:15.610
Let's come here.

03:15.650 --> 03:18.290
Create another variable I'm going to name this.

03:20.370 --> 03:21.290
Received.

03:24.250 --> 03:28.450
Received data is equal to connection.

03:30.970 --> 03:31.490
Dot.

03:31.530 --> 03:32.130
Receive.

03:32.170 --> 03:32.450
Okay.

03:32.490 --> 03:34.930
Are we see.

03:34.970 --> 03:35.970
Received.

03:36.690 --> 03:39.050
And here you're going to give some space.

03:39.050 --> 03:42.930
For example I'm going to give 1024 bytes.

03:42.970 --> 03:52.930
So for each packet that we are sending and this mission is receiving will actually will be um will contain

03:52.930 --> 03:55.090
at least this size of byte.

03:55.130 --> 03:55.570
Okay.

03:56.570 --> 04:08.110
Now that we are receiving this data I can print this data Here writing to the CMT.

04:08.150 --> 04:13.430
Okay, now let me save it and go here.

04:13.470 --> 04:15.190
Open the port again.

04:16.230 --> 04:17.350
Now it is opened.

04:20.350 --> 04:21.430
Let's come back here.

04:21.470 --> 04:22.110
Try to.

04:23.230 --> 04:23.670
Okay.

04:25.070 --> 04:25.670
Again.

04:27.470 --> 04:33.590
Socket object has no attribute or V or e v c.

04:34.350 --> 04:34.630
Okay.

04:34.630 --> 04:36.950
It looks like we have a misspelling here.

04:37.270 --> 04:38.030
We need to.

04:40.110 --> 04:42.710
Use our e v okay.

04:46.870 --> 04:48.750
Again let's come back here and try to.

04:50.790 --> 04:51.870
Reopen that.

04:57.870 --> 04:58.390
Okay.

04:58.390 --> 05:02.810
If we execute this wait a moment.

05:03.610 --> 05:04.010
Okay.

05:04.450 --> 05:05.450
We are waiting.

05:05.490 --> 05:06.490
There's nothing else.

05:06.930 --> 05:10.090
Let's come back here right now.

05:10.130 --> 05:15.370
You see that we have a connection established and it is not closed yet.

05:15.410 --> 05:15.810
Okay.

05:17.010 --> 05:20.730
And here I need to write something.

05:20.730 --> 05:26.490
For example, say hello from Cali and hit enter.

05:26.890 --> 05:29.490
Now you see that we send some data.

05:29.490 --> 05:31.410
We received some data.

05:31.410 --> 05:38.130
And also if I came back here, you see that hello from Cali is printed here.

05:38.170 --> 05:39.970
Okay, into this terminal.

05:39.970 --> 05:47.250
Now we are able to send data from this machine which is Windows to Kali Linux.

05:47.250 --> 05:51.130
And also we are able to send from Linux to Windows machine.

05:51.770 --> 05:56.370
And we are able to receive from both sides and send from both side.

05:56.410 --> 05:56.770
Okay.

05:56.970 --> 06:02.890
So thanks for watching and let's go do the next part into the next video.
