MacOS: How to list my open network ports?

[ $date ]# 1 noviembre 2016

This commands is perfect when you are paranoid, about what ports/processes are open, or what ports/processes are listening.

We have differents methods and outputs, but netstat and lsof are my preferreds :

lsof, This command lists only the processes of the current user. But you can run this command as root… maybe the hacker got root access?

Remember when execute this commands, list only the process of the current user, if you have a malicious software and this proccess is running by root you need execute lsof as root.

Tested in MacOS Sierra