I'm trying to manually Send TCP Syn packets to a custom IP/port and handle them on server side.
The Port has to be calculated by the client and server side based on some challenge response protocol.
So the port demanded by the client in the TCP SYN packet is checked by the server. So the server should listen for this Syn packet without opening the connection therefore I cannot use socket.accept().
I am using scapy for sending.
Client side :
packet =scapy.IP(dst="127.0.0.1")/scapy.TCP(dport=port,flags="S")
TCP_SYNACK=scapy.sr1(packet)
How can I listen to those SYN packets on serverside without accepting the connection???