a) netstat –an | more: mostra todas as portas abertas no sistema.
As portas em estado LISTEN são portas aguardando conexão. É importante registrar essas portas e posteriormente tentar descobrir o processo associado. Em algumas distribuições, o comando netstat –anp mostra o processo responsável por aquela conexão.
Segue abaixo um exemplo da saída do comando netstat –anp.
| Active Internet connections (servers and established) | |||||
|---|---|---|---|---|---|
| Proto | Recv-Q | Send-Q Local Address | Foreign Address | State | PID/Program name |
| tcp | 0 | 0 0.0.0.0:45416 | 0.0.0.0:* | LISTEN | 1541/rpc.statd |
| tcp | 0 | 0 0.0.0.0:111 | 0.0.0.0:* | LISTEN | 1530/portmap |
| tcp | 0 | 0 172.16.1.10:53 | 0.0.0.0:* | LISTEN | 1765/named |
| tcp | 0 | 0 127.0.0.1:53 | 0.0.0.0:* | LISTEN | 1765/named |
| tcp | 0 | 0 0.0.0.0:22 | 0.0.0.0:* | LISTEN | 1794/sshd |
| tcp | 0 | 0 127.0.0.1:5432 | 0.0.0.0:* | LISTEN | 1814/postgres |
| tcp | 0 | 0 127.0.0.1:25 | 0.0.0.0:* | LISTEN | 2096/exim4 |
| tcp | 0 | 0 127.0.0.1:953 | 0.0.0.0:* | LISTEN | 1765/named |