nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Windows How do I tell if a TCP network port is open or not?

This is a discussion on Windows How do I tell if a TCP network port is open or not? within the Getting started tutorials forums, part of the Linux Getting Started category; So how do I tell if a TCP or UDP network port is open or not under UNIX or Linux ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-10-2006, 03:56 AM
tom tom is offline
Contributors
User
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Rep Power: 0
tom is an unknown quantity at this point
Default Windows How do I tell if a TCP network port is open or not?

So how do I tell if a TCP or UDP network port is open or not under UNIX or Linux oses?

Sure iptables can be used to block or open port or to apply packet filtering.

However any program can open a network port. For example if use has access to gcc / cc compiler she can open a port.

So it is necessary to list open TCP or UDP ports.

List open TCP port with netstat
Use netstat command to list open tcp port
Code:
netstat -tulpn
Output:
Code:
tcp        0      0 0.0.0.0:22                 0.0.0.0:*                   LISTEN      11960/sshd
tcp        0      0 127.0.0.1:3306              0.0.0.0:*                   LISTEN      3992/mysqld
tcp        0      0 64.19.12.xx:80           0.0.0.0:*                   LISTEN      9474/lighttpd
tcp        0      0 64.19.12.xx:80           0.0.0.0:*                   LISTEN      9474/lighttpd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1859/master
tcp        0      0 64.19.12.xx:443          0.0.0.0:*                   LISTEN      9474/lighttpd
netstat also works under Windows XP or 2000 server

Using telnet
You can also use telnet to find out if port is open or not
Code:
telnet server-ip port-no
telnet localhost 80
telnet 192.168.1.111 25
telnet also works under Windows XP or 2000 server/UNIX oses

Using nmap
Nmap is a free security scanner which is used to evaluate the security of computers, and to discover services or open/close port numbers
Code:
nmap server-ip
Code:
nmap localhost
Sample output from my computer:
Code:
Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2006-10-10 03:52 MST
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1656 ports scanned but not shown below are in state: closed)
PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
53/tcp  open  domain
80/tcp  open  http
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds
902/tcp open  iss-realsecure-sensor

Nmap finished: 1 IP address (1 host up) scanned in 0.449 seconds
Nmap works under Windows and UNIX oses
Checking to see if a port is open, blocked, dropped, or filtered at the iptables or windows firewall is not simple. But with above three tools you can get list of open port quickly for both Windows and UNIX servers.

Have fun
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
USB Port Blocking / Read only Acces on Windows rajuk Windows Xp/2000/2003 server administration 4 06-08-2008 11:13 PM
How to open a port fed111 Web servers 1 03-08-2008 11:26 PM
what's the Diff. in Windows 2003 and Windows 2000 server kasimani Windows Xp/2000/2003 server administration 2 08-14-2007 11:05 AM
Howto verify linux open port nixcraft Getting started tutorials 0 05-18-2007 01:49 AM
Isolate windows network? RK Windows Xp/2000/2003 server administration 3 04-05-2006 07:53 PM


All times are GMT +5.5. The time now is 05:53 AM.


Powered by vBulletin® Version 3.7.2 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36