Search code examples
network-programmingtcplow-level

Can you initiate a connection from a bound port?


If I have a service running on some port, let's say port 80, would I be able to initiate a connection with a different service using that port as the source port? Given that I have full level access to the computer, i.e. root, low-level drivers, etc. Is it possible to do so or do tcp specifications prevent something like that from happening?


Solution

  • It is possible, I have an ssh server running on my computer and I tried doing an nmap scan from port 22, worked without a problem and the scan was successful.

    sudo nmap -sS xxx.xx.xx.0/24 -g 22 -p 80

    I have also discussed it with some experts and there is nothing in TCP specifications which would prevent that from happening. The only problem can occur at implementation level.