Unix 查看服务的端口状况

nmap localhost   ###也是查看系统运行的服务所对应的端口

 

cat /etc/services  ###全部程序的默认端口列表都在这里了

 

netstat -an          ####查看系统运行时端口的状态 # 这会打印全部端口的状态 最好后面加上grep 和more

 

netstat -an|grep "port"|more

 

netstat -antp ## t param means tcp,u means udp ,p means program/pid
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:21              0.0.0.0:*               LISTEN      701/vsftpd      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      737/sshd        
tcp        0      0 127.0.0.1:9391          0.0.0.0:*               LISTEN      763/openvassd: Wait
tcp        0      0 127.0.0.1:9392          0.0.0.0:*               LISTEN      662/gsad        
tcp        0      1 192.168.0.116:41402     37.61.54.158:443        SYN_SENT    1632/iceweasel  
tcp        0      0 192.168.0.116:56701     54.192.117.79:80        ESTABLISHED 1632/iceweasel  
tcp        0      0 192.168.0.116:56699     54.192.117.79:80        ESTABLISHED 1632/iceweasel  
tcp        0      0 192.168.0.116:56700     54.192.117.79:80        ESTABLISHED 1632/iceweasel
相关文章
相关标签/搜索