Thứ Bảy, 26 tháng 12, 2015

[Centos] netstat hiển thị port khi scan

Hiển thị port đang listen trên Centos

References

  1. http://unix.stackexchange.com/questions/140021/how-to-close-ports-in-linux

  2. Nmap is a great port scanner, but sometimes you want something more authoritative. You can ask the kernel what processes have which ports open by using the netstat utility:
    me@myhost:~$ sudo netstat -tlnp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address   Foreign Address   State    PID/Program name
    tcp        0      0 127.0.0.1:53    0.0.0.0:*         LISTEN   1004/dnsmasq    
    tcp        0      0 0.0.0.0:22      0.0.0.0:*         LISTEN   380/sshd        
    tcp        0      0 127.0.0.1:631   0.0.0.0:*         LISTEN   822/cupsd       
    tcp6       0      0 :::22           :::*              LISTEN   380/sshd        
    tcp6       0      0 ::1:631         :::*              LISTEN   822/cupsd       
    
    The options I have given are:
  • -t TCP only
  • -l Listening ports only
  • -n Don't look up service and host names, just display numbers
  • -p Show process information (requires root privilege)

Không có nhận xét nào:

Đăng nhận xét