Hot Downloads

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: The Power Of Command Line Tools

The Power Of Command Line Tools 13 years 2 months ago #811

  • sahirh
  • sahirh's Avatar
  • Offline
  • Honored Member
  • Posts: 1700
  • Karma: 0
Just thought I'd whip up a few of the windows command line based utilities you can use for networking functions. All these commands are typed at the command prompt in windows. Older versions may not have all of them, but winxp and win2k have them all.

ping - We all know this one, sends an ICMP echo request packet to the target and tells you by the response whether its up or not. Some options you may not know are
-t you can continuous ping,
-r you can record the route it takes
-l set the size of the ping packet
-f set the dont fragment bit (use this with -l to see the max unfragmented packet size MTU a system can handle)

tracert - another staple utility, it traces the hosts that a packet from your machine will go through to reach a destination.. will show you all the routers and firewalls along the way. It works by starting with an initial TTL of 1 and increasing it for each 'hop', whenever the TTL expires, the system it expires on sends an ICMP message back and we can record the route.
option : -d makes it work faster by not resolving names

netstat - shows you the list of connections to and from your machine, including what ports are listening for connections. options
-a shows listening ports
-n doesnt resolve names (faster)
btw I recommend TCPView instead of this, see my review of it in the Cool Software forum

arp - shows you your machines arp cache. Try pinging a broadcast address and then do arp -a to see all the hosts that responded (For a discussion on why some hosts didn't respond, tfs has a post in this forum somewhere)

route - shows you your machines routing table and lets you add / delete entries.. type route print

nbtstat - shows you the target windows machine's remote name table : options -a takes a hostname, -A takes an ip address.
Tip: any system that has a <20> in the list it returns is offering file sharing services. A <03> listing which is not the same as the computers name is the username of the currently logged on user.
example :
SAHIRH <03> UNIQUE Registered

net - This is a workhorse command, it lets you connect to other windows machines, add and delete users, see the list of windows shares etc etc. Too much to cover, type net help to see a list of commands and then net <command> help for detailed help on a command.

ipconfig - You should all know this one, shows you your current IP address and subnet mask, if you use DHCP it lets you release and renew the IP. I use this to make a quick batch file script to find out my ip.

make a batch file with the following lines and put it in a directory in your path (eg c:\windows):

@echo off
cls
ipconfig | find "IP address" /I
echo.
pause


Phew that was a long post ! I know some of you probably know about all these but may not know about some of the more esoteric options. Plus for newbies, learning to use these tools early is a must.


Cheers,
Sahir.
Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
The administrator has disabled public write access.

Re: The Power Of Command Line Tools 12 years 6 months ago #3745

  • indebluez
  • indebluez's Avatar
  • Offline
  • Distinguished Member
  • Posts: 114
  • Karma: 0
hey sahir:) this is really cool..
may i ask...how did u come up with this...
@echo off
cls
ipconfig | find "IP address" /I
echo.
pause

its cool:)
inde
The administrator has disabled public write access.

Command Line 12 years 6 months ago #3761

  • TheBishop
  • TheBishop's Avatar
  • Offline
  • Moderator
  • Posts: 1719
  • Thank you received: 8
  • Karma: 5
I'm always amazed how Sahir has the talent of starting off really good posts. I agree - the command line is the way to go. Remember the days that your OS would run in 640k of RAM? (Ok, Ok, so I'm old. Enough already!) Well, it did so because the user interface was simple and efficient - the command line. Now it takes about a hundred meg and four minutes to provide you with all sorts of embellishments and little animated sheafs of flying paper when all you want is to delete the !! file.

Seriously though, if there are command line alternatives to WIndows tasks they are well worth learning. Case in point - Microsoft Cluster Services under NT. This uses a clunky and slow GUI to show you where the resources are. But you can do it all from command line also, and it goes like a rocket in comparison.
The administrator has disabled public write access.

Re: The Power Of Command Line Tools 12 years 6 months ago #3765

  • Chris
  • Chris's Avatar
  • Offline
  • Administrator
  • Posts: 1446
  • Thank you received: 13
  • Karma: 8
I couldn't agree more with you Bishop on both paragraphs! :)

Have you ever tried deleting a directory (and empty the recycle bin) with over 6000 files under windows 95/98 ? You'll be able to have a quick shower, grab something to eat while you watch your favourite series and even by that time, it might still not be complete!

Until the "deltree" command was removed from the Dos shell, I would open a dos shell and use that awesome command which took a few seconds only, and not hours ! :)
Chris Partsenidis.
Founder & Editor-in-Chief
www.Firewall.cx
The administrator has disabled public write access.

Command Line 12 years 6 months ago #3768

  • TheBishop
  • TheBishop's Avatar
  • Offline
  • Moderator
  • Posts: 1719
  • Thank you received: 8
  • Karma: 5
Yeah. I remember the first time I saw a Windows NT server (3.51). I remember disparaging it on the basis that why anyone would want to put a high-resolution graphical front-end onto a SERVER box was beyond me, and wondering how badly the server part (you know, the part you actually want when you implement a server) would run as a result of having to support all that overhead. Well, now we know! :lol:
The administrator has disabled public write access.

Re: The Power Of Command Line Tools 12 years 6 months ago #3771

  • sahirh
  • sahirh's Avatar
  • Offline
  • Honored Member
  • Posts: 1700
  • Karma: 0
I surf using lynx sometimes... its like seeing the web through your own eyes rather than through glasses.. a very sobering experience well away from flash banner ads and popup javascript.

This may sound silly to some, but there is a certain purity from working at the command line. It makes you think through things logically rather than mindlessly pointing and clicking. There is nothing nicer than seeing someone crafting a really well thought out CLI command to accomplish a task that would take you minutes to execute with a GUI.


A lot of programmers see this when they understand a particularly well written piece of code.. you look at it and you say 'wow, that is pure genius...' its the same thing in bite sized chunks..

Some may even dare to call it --- poetry ? :)
Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.087 seconds

CCENT/CCNA

Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V

Linux

  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup