How can I send my own SYN and ACK packets to a server in php. I do not want the system to do anything, I would like to create my own packets, and send them myself to establish the TCP connection. Can this be done in php, or do I have to use C++ for this, or maybe python, or bash (shell script), which ever is easiest. And can some one direct me to a good place to learn what the contents of a SYN and ACK packet is exactly. I know a SYN packet has the IP address, and other details on where to send the server's ACK reply to.
Sounds like you're looking for a raw network library for PHP. A quick search turned up prnl. Support is likely to be uneven across operating systems, though; so-called "raw sockets" are sometimes considered to be sensitive items.