Saturday 25 April 2015

How To Find Open Ports Of A Remort Mechine



Nmap - Network exploration tool and security / port scanner.
If we only know the IP address of the remort mechine and we want to know which of the port are open(running services) in that mechine then we use the command "nmap".

Using nmap we can find out the different port that are opened in the remort mechine.
    syntax:
    nmap [scan type] [Options] {ip-address-of-remort-mechine}

example:
1)
Check which of the port are open in 10.42.0.72
    anusree@anusree-Inspiron-5547:~$ nmap 10.42.0.72
    Starting Nmap 6.40 ( http://nmap.org ) at 2015-04-25 14:01 IST
    Nmap scan report for anusree-Inspiron-5547 (10.42.0.72)
    Host is up (0.00016s latency).
    Not shown: 999 closed ports
    PORT   STATE SERVICE
    22/tcp open  ssh
          
|     |    |
           |     |   +----------> The service is ssh
           |    +---------------> The state of the port is open
          +---------------------> The service ssh is listern to port 22/tcp to sent and receive packets
   
    Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds


2)
It shows that only 22/tcp is open in 10.42.0.72. If we stop the above service using the command:
    anusree@anusree-Inspiron-5547:~$ sudo service ssh stop
    ssh stop/waiting

3)
ater stoping the service ssh service then once again try namp

    anusree@anusree-Inspiron-5547:~$ nmap 10.42.0.72

    Starting Nmap 6.40 ( http://nmap.org ) at 2015-04-25 14:07 IST
    Nmap scan report for anusree-Inspiron-5547 (10.42.0.72)
    Host is up (0.00016s latency).
    All 1000 scanned ports on anusree-Inspiron-5547 (10.42.0.72) are closed

    Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds


It shows that all port are closed

4)
Start the service ssh again

    anusree@anusree-Inspiron-5547:~$ sudo service ssh start
    ssh start/running, process 3187

Then again tha state is running




Open port: When anyone asks, the computer responds
that there is a service listening on this port. This means anything
coming to this port will get processed by a program (a service) running
on that computer.
Closed port: When anyone asks, the computer responds that there are no services listening on that port.

No comments:

Post a Comment