Some Not-So Famous Windows Commands

1. Not-so-famous Windows directories and files include the following:

C:\ - the "root" of the C: disk

C:\WINNT\system32\drivers\etc - directory of system configuration

files that mimics /etc in Unix

hosts, services, protocol - files in the directory above

C:\WINNT\system32 - directory of commands

C:\Documents and Settings - user home directories

2. The "/?" and "/help" switches (e.g. "telnet /?") can be used to get more

information on most of the following commands.

4. "telnet astro.temple.edu" - to log into astro.temple.edu (very insecure).

5. Unfortunately, windows does not implement the ssh (secure shell) command.

Try "mindterm" from www.appgate.com.

6. "ftp ftp.rfc-editor.org" - transfer a file from ftp.rfc-editor. Log in using

account "anonymous" with your E-mail address as password. Try "dir",

"cd in-notes", "ascii", "dir" again, and finally "get rfc791.txt". Use

"bye" to exit ftp and "more rfc-index.txt" to read the document.

(To do all of this automatically, enter the web address

"ftp://ftp.rfc-editor.org/in-notes/rfc791.txt" in your browser.)

7. "more < C:\WINNT\system32\drivers\etc\hosts" to see your local Internet

name and address file

8. "more < C:\WINNT\system32\drivers\etc\protocol" (not protocols) to see

what protocols can be carried in IP packets.

9. "more < C:\WINNT\system32\drivers\etc\services" to see the ports are used

by "well known" services.

11. "ping www.temple.edu" - to see if computer www.temple.edu is alive and

reachable.

12. "arp -a" to print Ethernet and IP address of other active computers on

your LAN

13. "ipconfig /all" (not ifconfig) to see your computer's Ethernet and IP

addresses.

14. "netstat -nr" to print your computer's IP routing tables

15. "netstat -a" (Listening Udp or Tcp sockets) to see the network services

offered on Windows systems.

17. "netstat -e" to see statistics on packets sent and received.

18. "nslookup www.temple.edu" to find IP address of computer www.temple.edu

19. "nslookup", then "?" to do a lot more.

20. "tracert www.bucks.edu" (not traceroute) to determine the path to

"www.bucks.edu"

Results of executing Networking commands on the Windows XP system in my office.

1. C:\>ipconfig /all

Windows IP Configuration

Host Name ...... : gamma

Primary Dns Suffix ...... : stafford.temple.edu

Node Type ...... : Hybrid

IP Routing Enabled...... : No

WINS Proxy Enabled...... : No

DNS Suffix Search List...... : cis.temple.edu

temple.edu

ist.temple.edu

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix : ambadmin.temple.edu

Description ...... : 3Com 3C920 Integrated Fast Ethernet

Controller (3C905C-TX Compatible)

Physical Address...... : 00-06-5B-52-1D-70

Dhcp Enabled...... : Yes

Autoconfiguration Enabled . . . : Yes

IP Address...... : 192.168.1.147

Subnet Mask ...... : 255.255.255.0

Default Gateway ...... : 192.168.1.1

DHCP Server ...... : 192.168.1.1

DNS Servers ...... : 155.247.166.2

155.247.19.2

Primary WINS Server ...... : 155.247.172.241

Secondary WINS Server . . . . . : 155.247.179.240

Lease Obtained...... : Tuesday, December 23, 2003 8:23:45AM

Lease Expires ...... : Wednesday, December 24, 2003 8:23:45AM

2. C:\>netstat -a

Active Connections

Proto Local Address Foreign Address State

TCP gamma:http gamma.stafford.temple.edu:0 LISTENING

TCP gamma:epmap gamma.stafford.temple.edu:0 LISTENING

TCP gamma:https gamma.stafford.temple.edu:0 LISTENING

TCP gamma:microsoft-ds gamma.stafford.temple.edu:0 LISTENING

TCP gamma:1025 gamma.stafford.temple.edu:0 LISTENING

TCP gamma:1028 gamma.stafford.temple.edu:0 LISTENING

TCP gamma:1029 gamma.stafford.temple.edu:0 LISTENING

TCP gamma:1038 gamma.stafford.temple.edu:0 LISTENING

TCP gamma:5000 gamma.stafford.temple.edu:0 LISTENING

TCP gamma:netbios-ssn gamma.stafford.temple.edu:0 LISTENING

TCP gamma:1038 baym-cs80.msgr.hotmail.com:1863 ESTABLISHED

TCP gamma:7424 gamma.stafford.temple.edu:0 LISTENING

UDP gamma:microsoft-ds *:*

UDP gamma:isakmp *:*

UDP gamma:1643 *:*

UDP gamma:2967 *:*

UDP gamma:3456 *:*

UDP gamma:ntp *:*


UDP gamma:1039 *:*

UDP gamma:1900 *:*

UDP gamma:ntp *:*

UDP gamma:netbios-ns *:*

UDP gamma:netbios-dgm *:*

UDP gamma:1900 *:*

3. C:\>netstat -e

Interface Statistics

Received Sent

Bytes 9328926 1833414

Unicast packets 15480 14186

Non-unicast packets 855 320

Discards 0 0

Errors 0 0

Unknown protocols 0

4. C:\>arp -a

Interface: 192.168.1.147 --- 0x10003

Internet Address Physical Address Type

192.168.1.1 00-04-5a-f3-d9-e1 dynamic

192.168.1.102 00-50-04-d3-c0-ca dynamic

5. C:\>ping www.bucks.edu

Pinging www.bucks.edu [192.231.233.6] with 32 bytes of data:

Reply from 192.231.233.6: bytes=32 time=38ms TTL=47

Reply from 192.231.233.6: bytes=32 time=24ms TTL=47

Reply from 192.231.233.6: bytes=32 time=22ms TTL=47

Reply from 192.231.233.6: bytes=32 time=94ms TTL=47

Ping statistics for 192.231.233.6:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 22ms, Maximum = 94ms, Average = 44ms

6. C:\>tracert www.bucks.edu

Tracing route to www.bucks.edu [192.231.233.6] over a maximum of 30 hops:

1 2 ms 1 ms 1 ms 155.247.107.1

2 4 ms 4 ms 4 ms 155.247.4.1

3 5 ms 5 ms 5 ms conwellbln2.is.temple.edu [155.247.119.226]

4 5 ms 4 ms 4 ms p4-3.hsa1.phi1.bbnplanet.net [4.25.94.49]

5 5 ms 5 ms 4 ms ge-6-1-0.mp2.Philadelphia1.Level3.net [64.159.3.29]

6 27 ms 8 ms 8 ms so-6-1-0.bbr2.NewYork1.Level3.net [209.247.8.66]

7 43 ms 9 ms 8 ms ge-5-0.core1.NewYork1.Level3.net [64.159.17.37]

8 7 ms 7 ms 10 ms cogent-level3-oc12.NewYork1.Level3.net [63.211.54.66]

9 9 ms 8 ms 9 ms p14-0.core02.jfk02.atlas.cogentco.com [154.54.1.165]

10 11 ms 10 ms 10 ms p14-0.core01.phl01.atlas.cogentco.com [66.28.4.2]

11 10 ms 10 ms 9 ms g8.ba21..phl01.atlas.cogentco.com [38.12.34.142]

12 10 ms 10 ms 11 ms VoicenetComm.demarc.cogentco.com [38.112.5.30]

13 11 ms 12 ms 19 ms g2-0-0-ivyland.voicenet.net [207.103.5.101]

14 15 ms 11 ms 11 ms ivy3-gw-h0-0.voicenet.net [207.103.5.222]

15 16 ms 17 ms 17 ms bccc-gw-s0.voicenet.net [207.103.5.30]

16 15 ms 16 ms 17 ms bucks-fw.voicenet.net [207.103.210.203]

17 17 ms 19 ms 20 ms www.bucks.edu [192.231.233.6]

Trace complete.


7. C:\>more < C:\WINNT\system32\drivers\etc\services

# This file contains port numbers for well-known services defined by IANA

# <service name> <port number>/<protocol> [aliases...] [#<comment>]

echo 7/tcp

echo 7/udp

discard 9/tcp sink null

discard 9/udp sink null

systat 11/tcp users #Active users

systat 11/tcp users #Active users

daytime 13/tcp

daytime 13/udp

qotd 17/tcp quote #Quote of the day

qotd 17/udp quote #Quote of the day

chargen 19/tcp ttytst source #Character generator

chargen 19/udp ttytst source #Character generator

ftp-data 20/tcp #FTP, data

ftp 21/tcp #FTP. control

telnet 23/tcp

...

7. linux:/ # more /etc/services

# See: http://www.iana.org/assignments/port-numbers

echo 7/tcp Echo

echo 7/udp Echo

discard 9/tcp Discard sink null

discard 9/udp Discard sink null

daytime 13/tcp Daytime # Daytime (RFC 867)

daytime 13/udp Daytime # Daytime (RFC 867)

ftp-data 20/tcp # File Transfer [Default Data]

ftp 21/tcp # File Transfer [Control]

ssh 22/tcp # SSH Remote Login Protocol

telnet 23/tcp # Telnet

smtp 25/tcp mail # Simple Mail Transfer

domain 53/tcp # Domain Name Server

domain 53/udp # Domain Name Server

http 80/tcp # World Wide Web HTTP

epmap 135/tcp # DCE endpoint resolution

netbios-ns 137/tcp # NETBIOS Name Service

netbios-ssn 139/tcp # NETBIOS Session Service

https 443/tcp # http protocol over TLS/SSL

8. C:\>more < C:\WINNT\system32\drivers\etc\protocol

# The Internet protocols as defined by RFC 1700 (Assigned Numbers).

# <protocol name> <assigned number> [aliases...] [#<comment>]

ip 0 IP # Internet protocol

icmp 1 ICMP # Internet control message protocol

ggp 3 GGP # Gateway-gateway protocol

tcp 6 TCP # Transmission control protocol

egp 8 EGP # Exterior gateway protocol

pup 12 PUP # PARC universal packet protocol

udp 17 UDP # User datagram protocol

hmp 20 HMP # Host monitoring protocol

xns-idp 22 XNS-IDP # Xerox NS IDP

rdp 27 RDP # "reliable datagram" protocol

rvd 66 RVD # MIT remote virtual disk