Okay.
Here we were able to, uh, establish a small connection, uh, for a while.
Okay, now let's go and see, uh, how to send some data.
Okay.
From this machine, which is Windows to Linux or Kali Linux.
Okay.
And using the socket.
So we have the object which is connection dot send method.
Here we can add uh anything.
You can add text like let's use backslash n to go to new line.
And here let me add a text like connection established.
And I can go to a new line.
After this you need to do one thing and that is to lose the connection.
Okay.
Now the connection is closed.
Now if I come back to Kali Linux and open this port that is right now listening and come back here,
let me use CLS, okay?
It is giving me an error.
It is telling me type error about like object is required, not a string.
Okay.
Very good.
Here you see we have a send function.
This send function is not able to send a plain text from here.
Okay.
So no problem.
We can solve this.
Very easy.
Okay I cut this from there.
And let's create a variable.
I'm going to name it message.
It is equal to to this one okay.
And now I use this message into send function.
Okay.
Message me.
This is a dot.
We have a function called a method called encode.
So this will encode the connection okay.
Not the Not the connection, this message.
So now it is not a plaintext.
And then this time maybe it is able to send data.
So here we will be able to receive data.
So let me open this port again.
Come to windows and let's open terminal or cmd.
Okay.
You see nothing happened.
Let's come to here.
Right now you see that connection established?
This was a text that we just a message.
It was a message that we we printed or we send from windows.
Now it looks like a chat system.
Okay.
But we are not going to build a chat system or chat application.
We are going to create backdoor.
So the other part is to do to receive data.
Right now you see we are receiving from Windows, but not sending two windows.
So let's come back here to windows.
Right in here I am going to send some data.
Okay.
Let's come here.
Create another variable I'm going to name this.
Received.
Received data is equal to connection.
Dot.
Receive.
Okay.
Are we see.
Received.
And here you're going to give some space.
For example I'm going to give 1024 bytes.
So for each packet that we are sending and this mission is receiving will actually will be um will contain
at least this size of byte.
Okay.
Now that we are receiving this data I can print this data Here writing to the CMT.
Okay, now let me save it and go here.
Open the port again.
Now it is opened.
Let's come back here.
Try to.
Okay.
Again.
Socket object has no attribute or V or e v c.
Okay.
It looks like we have a misspelling here.
We need to.
Use our e v okay.
Again let's come back here and try to.
Reopen that.
Okay.
If we execute this wait a moment.
Okay.
We are waiting.
There's nothing else.
Let's come back here right now.
You see that we have a connection established and it is not closed yet.
Okay.
And here I need to write something.
For example, say hello from Cali and hit enter.
Now you see that we send some data.
We received some data.
And also if I came back here, you see that hello from Cali is printed here.
Okay, into this terminal.
Now we are able to send data from this machine which is Windows to Kali Linux.
And also we are able to send from Linux to Windows machine.
And we are able to receive from both sides and send from both side.
Okay.
So thanks for watching and let's go do the next part into the next video.