You are here:Home>>Tutorials

Find Open Ports using Command prompt and netstat command

There are lot of goodies MS included in its Windows OS, user need not to go for some tricky GUI based 3rd party applications to buy or to download free. I have explained some good examples to find the open and listening ports in you computer using netstat command, even you can create a text file in c: or any directry as a result. Its a nice try.

Tutorial 1

Command:
C:\>netstat -an |find /i "listening"
Info: This command will give you the listening ports in your computer.
Example:
  C:\>netstat -an |find /i "listening"
  TCP    0.0.0.0:25             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1433         0.0.0.0:0              LISTENING
  TCP    192.168.1.69:139       0.0.0.0:0              LISTENING
  TCP    192.168.1.69:1433      0.0.0.0:0              LISTENING
C:\>

Tutorial 2

Ok, You need a soft copy or the hardcopy of the above results what you will do??, I know you may thinking of copy and paste to note pad or word right?, yes i do know that its possible, but how if I'm your boss and ask you to get me a result in c: once you run this command?? hmm?? thinking??? I have a solution for this tooo...
Command:
C:\>netstat -an |find /i "listening" > c:'openports.txt
Example:
  C:\>netstat -an |find /i "listening" > c:'openports.txt
  TCP    0.0.0.0:25             0.0.0.0:0              LISTENING
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    127.0.0.1:1433         0.0.0.0:0              LISTENING
  TCP    192.168.1.69:139       0.0.0.0:0              LISTENING
  TCP    192.168.1.69:1433      0.0.0.0:0              LISTENING
C:\>

Tutorial 3

You can also get the "Established" connections lists by replacing the "listening" to "established"
Command:
C:\>netstat -an |find /i "established"
C:\>netstat -an |find /i "established"
  TCP    127.0.0.1:4497         127.0.0.1:4498         ESTABLISHED
  TCP    127.0.0.1:4498         127.0.0.1:4497         ESTABLISHED
  TCP    127.0.0.1:4505         127.0.0.1:4506         ESTABLISHED
  TCP    127.0.0.1:4506         127.0.0.1:4505         ESTABLISHED
 




Google Reader or Homepage Subscribe Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online Add to Technorati Favorites!
Web Development : Free Php Scripts | PHP Script and Programs | Javascripts | Javascript Kit | For latest IT news | Sitemap
Free Web Templates : Nuvio Templates - Free Web Templates & WordPress Themes
Best PHP email Systems and Forms : PHP Email Systems Script and Programs | Free ready to use Contact me form for your Website | Free PHP contact us form script | PHP Webmasters tools and help | Website Ranking - Rankings - Get Website Optimization basics correct, add great linking strategies and your website rankings will rocket. Most Web Masters lack website optimization service skills, website ranking and website optimization services is our specialty.

Search Technohub.in

Guest Book    |   Contact Me    |    Articles    |    Comments    |    Bookmark My Site !