Is there any simple way to get the 5-tuple information (source ip, source pprt, destination ip, destination port, layer-4 protocol) in php?
I see that there is $_SERVER[‘REMOTE_ADDR’] that gives me source ip. How can I get remaining 4 elements?
EDIT: From http://php.net/manual/en/reserved.variables.server.php, I see that there are $_SERVER elements for REMOTE_ADDR, REMOTE_PORT, SERVER_PORT, SERVER_ADDR that the webserver I am using is not setting. I can modify the webserver code to export these elements as well.
Would it be safe to assume that layer-4 protocol would always be tcp?
4 of 5. “layer-4 protocol” is usually always TCP
http://php.net/reserved.variables.server