-a Displays all connections and listening ports. (Server-side connections are normally not shown).
-e Displays Ethernet statistics. This may be combined with the -s option.
-n Displays addresses and port numbers in numerical form.
-p proto Shows connections for the protocol specified by proto; proto may be tcp or udp. If used with the -s option to display per-protocol statistics, proto may be tcp, udp, or ip.
-r Displays the contents of the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p
option may be used to specify a subset of the default.interval Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.
以上的信息仅仅是个参考,对于好奇心很强的您来说,是远远不够的。
那好,让我们试试每个命令并查看结果,用来理解当我们执行命令后发生了什么,显示出的信息是什么意思?
首先,我们使用Netstat的-a参数命令。
-a参数用来显示在本地机器上的外部连接,它也显示我们远程所连接的系统,本地和远程系统连接时使用的端口,和本地和远程系统连接的状态。(type and state)
例子:
C:>netstat -a
Active Connections Proto Local Address Foreign Address State TCP ankit:1031 dwarfie.box.com:ftp ESTABLISHED TCP ankit:1036 dwarfie.box.com:ftp-data TIME_WAIT TCP ankit:1043 banners.egroups.com:80 FIN_WAIT_2 TCP ankit:1045 mail2.mtnl.net.in:pop3 TIME_WAIT TCP ankit:1052 zztop.box.com:80 ESTABLISHED TCP ankit:1053 mail2.mtnl.net.in:pop3 TIME_WAIT UDP ankit:1025 *:* UDP ankit:nbdatagram *:*
-a参数常用于获得你的本地系统开放的端口,用它您可以自己检查你的系统上有没有被安装木马(要说一下:有很多好程序用来检测木马,但你的目的是想成为hacker,手工检测要比只按一下「scan」按钮好些----仅个人观点)。如果您Netstat你自己的话,发现下面的信息: Port 12345(TCP) Netbus Port 31337(UDP) Back Orifice