Establishing TCP Connections by hping3

ddostcp

when a client sends 10 TCP SYN packets by hping3(not spoofing), server responds and sends 10 TCP SYN+ACK packets. now client should answer to server and Establish the connection by sending 10 ACK packets, but client sends 10 RST and terminates the half-open connections(i guess that's because linux kernel responds).

how can i send 10 SYN packets per second (to the same destination with different source ports ) and in response of SYN+ACKs, send ACK and establish the connections? thanks very much

Best Answer

You cannot craft packets in user space outside of the native TCP/IP stack and expect the Kernel to accept unsolicited SYN/ACK packets in response. The Kernel is right to RST the packets as per RFC standard. I'm doubtful that hping3 will be able to achieve what you are looking for.

If you are comfortable with Python, you can look into Scapy which will allow you to send and receive packets in user space. Here's a simple example of creating a three-way-handshake in Scapy.

Related Topic