netstat -t -l -p will list the listening ports and the pid and process name that created the socket. Since you have the pid you can use ps PID to find the path to the executable.
netstat -t -l -p
ps PID
Also lsof -i:<port number> should give you the PID of the process and you can use ps <pid> to look up for the path
lsof -i:<port number>
ps <pid>