Thursday, July 15, 2010

♦ netstat command on windows 7

             Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections..

Syntax


netstat [-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]
-a : Displays all active TCP connections.
-e : Displays Ethernet statistics.
-n : Displays addresses and port numbers.
-o : Displays process ID (PID) for each connection.
-p : Shows connections for the protocol specified by Protocol (TCP,UDP,ICMP).
-s : Displays statistics by protocol.
-r : Displays the contents of the IP routing table. This is equivalent to the route print command.
/? : Displays help at the command prompt.

c:\windows>netstat
Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    192.168.0.8:49290      hx-in-f191:http        ESTABLISHED
  TCP    192.168.0.8:49291      tx-in-f100:http        ESTABLISHED
  TCP    192.168.0.8:49292      ni-in-f104:http        ESTABLISHED

c:\windows>netstat -a
Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             jupitor:0              LISTENING
  TCP    0.0.0.0:135            jupitor:0              LISTENING
  TCP    0.0.0.0:445            jupitor:0              LISTENING
  TCP    0.0.0.0:554            jupitor:0              LISTENING
  TCP    192.168.0.8:49290      hx-in-f191:http        ESTABLISHED
  TCP    [::]:135               jupitor:0              LISTENING
  TCP    [::]:445               jupitor:0              LISTENING
  TCP    [::]:554               jupitor:0              LISTENING
  TCP    [::]:2869              jupitor:0              LISTENING
  UDP    0.0.0.0:3544           *:*                    
  UDP    0.0.0.0:3702           *:*                    
  UDP    0.0.0.0:3702           *:*   


c:\windows> netstat -ao
ctive Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:80             jupitor:0              LISTENING       1516
  TCP    0.0.0.0:135            jupitor:0              LISTENING       740
  TCP    0.0.0.0:445            jupitor:0              LISTENING       4
  TCP    0.0.0.0:554            jupitor:0              LISTENING       3200
  TCP    0.0.0.0:2869           jupitor:0              LISTENING       4
  TCP    0.0.0.0:3306           jupitor:0              LISTENING       1672
  TCP    192.168.0.8:139        jupitor:0              LISTENING       4
  TCP    192.168.0.8:49290      hx-in-f191:http        ESTABLISHED     4460

c:\windows> netstat -pa TCP
Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             jupitor:0              LISTENING
  TCP    0.0.0.0:135            jupitor:0              LISTENING
  TCP    0.0.0.0:445            jupitor:0              LISTENING
  TCP    0.0.0.0:554            jupitor:0              LISTENING
  TCP    0.0.0.0:2869           jupitor:0              LISTENING
  TCP    192.168.0.8:139        jupitor:0              LISTENING

c:\windows>netstat -pa UDP
Active Connections

  Proto  Local Address          Foreign Address        State
  UDP    0.0.0.0:3544           *:*                    
  UDP    127.0.0.1:1900         *:*                    
  UDP    127.0.0.1:52128        *:*                    
  UDP    127.0.0.1:59552        *:*                    
  UDP    127.0.0.1:59792        *:*                    
  UDP    192.168.0.8:137        *:*                    
  UDP    192.168.0.8:138        *:*                    
  UDP    192.168.0.8:1900       *:*                    
  UDP    192.168.0.8:54193      *:*                    
  UDP    192.168.0.8:59551      *:*                    

c:\windows>netstat -an | find /i "listening"
TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:554            0.0.0.0:0              LISTENING
  TCP    0.0.0.0:2869           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING
  TCP    0.0.0.0:5357           0.0.0.0:0              LISTENING

c:\windows>netstat -an | find /i "established"
TCP    192.168.0.8:445        192.168.0.6:1085       ESTABLISHED

No comments:

Post a Comment