标签归档:查看开放的端口

sort -u -k 7n port.txt,netstat -anpt >> port.txt

[root@adp ~]# sort -u -k 7n port.txt
tcp        0      0 222.222.222.222:80             60.21.136.42:52059          SYN_RECV    –
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2786/portmap
tcp        0      0 0.0.0.0:867                 0.0.0.0:*                   LISTEN      2805/rpc.statd
tcp        0      0 :::22                       :::*                        LISTEN      3004/sshd
tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      3029/vsftpd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      3048/sendmail: acce
tcp        0      0 0.0.0.0:2583                0.0.0.0:*                   LISTEN      3177/perl
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      16959/adpmain
tcp        0      0 ::ffff:222.73.23.24:22      ::ffff:119.57.32.69:50122   ESTABLISHED 20767/0
tcp        0      0 0.0.0.0:631                 0.0.0.0:*                   LISTEN      23339/cupsd
tcp        0      0 0.0.0.0:2102                0.0.0.0:*                   LISTEN      29924/mysqld