Figuring out what IP's and Ports a program is accessing

There is

lsof -i

and

netstat -n

just to name few of Terminal commands to look who is using the Internet.

Those are information only, and will not block anything.


Little Snitch is a program that blocks everything that you specifically doesn't allow. That way it is quite easy to keep track on all IPs and ports different programs are accessing. That way it's easy to use that information for Self-Control.

http://www.obdev.at/products/littlesnitch/index.html


You can use the lsof command to figure out what IPs/ports are being accessed by a process, but first you'll have to figure out the process ID (PID) is for your poker software. You can use Activity Monitor (in the Utilities folder inside of Applications) to find out the PID. It should show up in the CPU tab, but if it doesn't, you can add it by right clicking in the column headers. One you have the PID, you can use the following command to see what IP connections are being used by the software (replace PID with the PID of the poker software:

lsof -p PID | grep IPv4

(It's possible, but unlikely the poker software is using IPv6, but you can tweak the command to check that, too.)

If the software creates lots of different connections at different times and then drops them, this may not work well, and Little Snitch would definitely help you out in that case (I totally recommend Little Snitch--it's awesome, but not free). In any event, if you block the persistent connections, it will most likely solve your issue.