可以查看系统进程信息,注意:如果是勘验或者验证漏洞,需要验证netstat程序的完整性(netstat程序是否被修改过)。

老版本的CentOS中会自带这个软件包,新版的7有的时候需要单独安装。

yum install -y net-tools

参数说明
-a —allShow both listening and non-listening (for TCP this means established connections) sockets. With the —interfaces option, show interfaces that are not up
-t —tcptcp connection
-u —udpudp connection
-l —listeningShow only listening sockets. (These are omitted by default.)
-p —program程序的信息(PID/Program name) 通过PID进而就可以知道源程序在哪里
-n —numeric# 数值(0.0.0.0:22) Show numerical addresses instead of trying to determine symbolic host, port or user names.

Windows

W系统和Linux系统的命令有些差别,但主要功能还是查看进程信息,例如我们要寻找80端口被哪个未知的程序占用了。

# 找到进程号
netstat -ano|findstr 80
 
# 找到进程
tasklist | findstr 18156
 
# 杀掉进程
taskkill /PID 18156