I\'m busy experimenting with TCP socket connnections. I have made a client SOCK_
ID: 654135 • Letter: I
Question
I'm busy experimenting with TCP socket connnections. I have made a client SOCK_STREAM socket andi've got a few questions:
+ Is there any way that a streaming(TCP) socket can get data from another socket without having to connect to it?
+ Is it safer to have a socket that a client connects to send data, and another one that the client gets data from (the server sockets exchange data) instead of one up and down socket?
Because what i'm trying to do now is to set up a client socket that request data from a server socket. Then that server socket forwards data to a random other socket that sends the data to the client.
If you don't exactly know what I mean, i'm open to questions!
Explanation / Answer
To answer the first question: no, it is not possible for one socket without connecting to it, unless you attack the IP layer underneath. In that case you don't have to talk about sockets anymore.
No, it is not safer to have a server socket connect back to the client. An attacker could send the server socket almost anywhere.
If you want to protect a socket, use TLS.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.