LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2010, 09:08 AM   #1
winxandlinx
Member
 
Registered: May 2006
Posts: 141

Rep: Reputation: 15
Nmap localhost ?


Hi Everyone

My query here - when i excute Nmap localhost

Wheather it would check all the port numbers or only few port numbers ?



I do not think it would check all the port numbers when the above command

Because when i excute the command Nmap localhost in the same
machine it shows the output as below ,
There is other port number 8834 which is listening but it is not displaying
in the result below . So the above command would check only few ports ?


22/tcp open ssh
25/tcp open smtp
80/tcp open http
443/tcp open https
514/tcp open shell
3306/tcp open mysql
 
Old 07-19-2010, 09:15 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Nmap offers a plethora of options, some for specifying ports and port ranges, as well as protocols, which you can see in the man page. To be sure that nmap is scanning at least as high as the port you are questioning, try nmap with the -p1-8834 argument, telling it to scan ports from #1 to #8834.
 
Old 07-20-2010, 04:44 AM   #3
winxandlinx
Member
 
Registered: May 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Thanks for the command. So by default till how many port it would scan ?
 
Old 07-20-2010, 05:11 AM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I don't know, and the man page IIRC did not specify. It's common however for port scanners to (by default) only scan the first 1024 ports. If you cannot find the answer in the manpage or Google, I would just err on the cautious side and specify the port range you desire.
 
Old 07-20-2010, 05:36 AM   #5
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
From the man page:

Quote:
By default, Nmap scans all ports up to and including 1024 as well as higher numbered ports listed in the nmap-services file for the protocol(s) being scanned.
The file nmap-services is typically installed at /usr/share/nmap/nmap-services
 
Old 07-22-2010, 08:43 AM   #6
winxandlinx
Member
 
Registered: May 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Thanks for all your update and this is really good piece of information

Thankyou
 
Old 09-10-2010, 04:52 PM   #7
marco18
Member
 
Registered: Jul 2007
Location: Argentina
Distribution: Ubuntu 13.04 , Debian Lenny 5.0.7
Posts: 223

Rep: Reputation: 21
Hi! Sorry if this post is already closed but I was wondering if you could tell me something curious about nmap. I'll be straight.
If I run nmap on a computer with "localhost" as destination it tells me that I have 3 ports open; but if I run the same nmap with my ip address as parameter I find out that some ports that figured as open are closed in fact. Does anyone know why can this happen? Which result should I consider??
 
Old 09-10-2010, 06:32 PM   #8
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Because an application can bind to any combination of interfaces or IPs your system has. You have some programs listening only on localhost.
Quote:
Which result should I consider??
Why are you using nmap?
 
Old 09-11-2010, 01:23 AM   #9
LVsFINEST
Member
 
Registered: Aug 2006
Posts: 99

Rep: Reputation: 21
Quote:
Originally Posted by winxandlinx View Post
Thanks for the command. So by default till how many port it would scan ?
The latest version of Nmap scans the top 1000 ports by default. The top ports are based on popularity which is in the nmap-services file, third column. A -F scan means fast scan, this will scan the top 100 ports.

Last edited by LVsFINEST; 09-11-2010 at 01:26 AM.
 
Old 09-11-2010, 10:11 AM   #10
marco18
Member
 
Registered: Jul 2007
Location: Argentina
Distribution: Ubuntu 13.04 , Debian Lenny 5.0.7
Posts: 223

Rep: Reputation: 21
Quote:
Originally Posted by AlucardZero View Post
Because an application can bind to any combination of interfaces or IPs your system has. You have some programs listening only on localhost.

Why are you using nmap?

Right, maybe that's the reason, but, I did a similar test on a Windows box and found out that locally (using ip or localhost) for e.g.: msrpc, is enumerated as open and, remotelly, is enumerated as closed. This is really strange (maybe something to do with the way windows handles the protocol stack).

I'm using nmap to have some control of which services are available to remote hosts. It helps me to know if there is any of them I don't use to shut them down and minimize security risks. Not big deal, but helps a little.

Thanks for your answers!
 
Old 09-11-2010, 03:01 PM   #11
Bull3t
Member
 
Registered: Aug 2010
Posts: 56

Rep: Reputation: 0
What I did was man Nmap. Then print that to a file, and make a hard copy so you have your own manual with all the commands.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nmap ? how do i do nmap in linux ? command not found abbasakhtar Linux - Newbie 2 01-02-2011 01:08 AM
LXer: Learn how to use nmap, and nmap GUI, a great port scan tool LXer Syndicated Linux News 0 01-03-2008 09:10 AM
nmap increase send delay for nmap 4.20 matters Slackware 1 10-01-2007 11:37 PM
Debian SID users: help me by running an nmap on localhost introuble Debian 12 12-19-2006 07:23 AM
Message from syslogd@localhost localhost kernel: Disabling IRQ #21 ylts Linux - Hardware 0 02-26-2005 08:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration