I don't know of any way to accomplish what you are talking about - but if your not already, you should be running some sort of Firewall (either hardware or software). Something like Zone Alarm would do fine - that way, the firewall will bring to your attention any programs that are trying to access remote sites or gain access to your machine. Then you'll have the option of blocking that program. But like I said, I don't know of any way to 'manually' close those ports.