0

I am a beginner in Linux.

I tried to scan the open port of my computer but I found that only three ports are opened which is port 80, 53 and 65535.

Then, I tried to scan my android mobile phone. It shown that all ports are closed.

I used the following command:

nmap -sT -p- (myip)

Is it normal? Or am I doing something wrong?

3
  • So what's the problem? Should it show more ports or fewer?
    – muru
    Dec 23, 2014 at 15:13
  • Thanks for your reply. Actually, I don't really know whether it's normal or not. I supposed it will be more open ports. Also, I am afraid that I did something wrong because the result shown that all ports on my android phone are closed.
    – Router
    Dec 23, 2014 at 15:39
  • I don't about your phone, but if you're running a web server and a DNS server, the ports look right.
    – muru
    Dec 23, 2014 at 15:55

2 Answers 2

1

It is normal that the port are closed if no service like ssh server or web server is opening them.

If you install openssh-server port 22 will be opened, if you install apache2 port 80 will be opened.

If you use ssh ( apt-get install openssh-client ) or a webbrowser it will temporary open a random high port for the duration of the usage.

Port 53 is dns. Port 80 is http, do netstat -tlpen to see which process opens which port, especially the port 80 in your case.

Since on your android phone you are not offering any services, only using them it is nornal that nmap shows no open ports.

You find the default port numbers in /etc/services

1
  • Thank for your reply. I understand right now! I have one more question. I tried to use my android phone and connect to some website and perform the scanning one more time. I supposed that port 80 will be opened but the result shown that all ports on my phone are still closed. Am I did something wrong?
    – Router
    Dec 24, 2014 at 12:17
0

The ports 0-1023 are called well known ports, they are registered with special services: 22 ssh 23 telnet 25 smtp 80 http 143 imap 443 https and so on, see /etc/services.

This is the server side waiting for a client to connect.

The client ( telnet, webbrowser, putty ...) will use a random high port (ports are 16 bit so 0- 65k ) for example 38743, it opens the connection by sending a tcp packet with set syn flag to the server.

That packet has the sender ip and port and the destination ip and port.

The server replies with a packet with ack flag set, and uses the clients packets sender ip and port as destination.

So if your Webbrowser opens connections to 2 different webservers it uses different random high ports for each server.

2
  • Thank you so much. I understand right now. Can I ask one more question? My computer is not a web server. So, why the port 80 is opened? Thank you so much!
    – Router
    Dec 24, 2014 at 15:34
  • Use netstat -tlpen to see which process has port 80 open.
    – Uwe Burger
    Dec 26, 2014 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.