Question by cim2phat4u: How can I log source IP and Port of connections to a website hosted on public server? *Technical answers*?
Suppose I have a webpage hosted on some public server like geocities or xanga for example. I would like to log the source IP and Port for every connection request to my website, as well as the time the connection was initiated. How could I do this? Note that I want both IP and Port. Ideally I would like to capture all SYN packets, but since the website is hosted on a public server, I can’t simply monitor a packet sniffer. Any ideas? Technical answers and source code are welcome. Please don’t point me to an online IP tracker unless it can also log ports. Thanks in advance!
Correct me if I’m wrong, but a computer on an internal network may use its own port 80 to initiate http connections, but the packet the router will send out to the external internet will be sourced with the external IP and a unique Port that is mapped to an internal IP address. Therefore, the actual packet that the website server would recieve would not be sourced as port 80 but rather with whatever port the router has mapped to the particular client computer. Is this correct? That is why I want to record the port as well.
Best answer:
Answer by boris
A free public server picks the ports you use, almost always this is port 80. The only way to do this would be to use another server of your own and have the originating site link to a picture on that site. The call for the picture URL will be recognized by your server, from there you can log the IP / port as you wish.
Give your answer to this question below!
Share and Enjoy
Recent Comments