With Windows XP and newer, you can use the NETSTAT -ano command to tell
what services are listening for inbound connections on these ports. Fport /
Vision from
www.foundstone.com/knowledge is another popular tool you can
download to do this. If you have a third party firewall software like
www.Kerio.com,
www.Sygate.com or
www.Zonealarm.com installed, these tend to
tell you this as well.
Once you know what is listening on those ports, to close them you would
probably want to figure out how to stop, disable and/or uninstall those
services. Or, if the service is necessary or important to you and you don't
want to disable it entirely, then use some sort of IP filtering, IPsec or
firewall such as the three free ones mentioned above to control what IP
addresses are permitted to access those ports.
If you meant you wanted to know what programs are accessing those ports
outbound, you would want to use and configure some sort of host-based
firewall software that does logging, such as the three free firewall
products listed above. You would need to set up a new rule that either
permits or denies and also logs access to those ports.