Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When scanning with nmap using the -O or -A flag, nmap tries to determine the OS of the target machine.

Putting the question of why you would want to scan your own machine for OS aside, running OS scan on your own machine renders the message

Skipping OS Scan against 192.168.1.12 because it doesn't work against your own machine (localhost)

What is it that makes OS scan against your own machine impossible?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Because nmap does its work by performing various "side-channel attacks" on the packets that are received back from the requests it makes. It expects the packet to go through the normal path of

nmap 
 -> OS 
   -> Driver
     -> Adapter (yours)
       -> Wire
         -> Adapter (theirs)
           -> Driver
             -> OS
               -> Application
             <- OS
           <- Driver
         <- Adapter (theirs)
       <- Wire
     <- Adapter (yours)
   <- Driver
 <- OS 
nmap 

However when you are connecting to yourself any of the following optimizations could happen.

nmap 
 -> OS 
   -> Driver
     -> Adapter (yours)
       -> Driver
         -> OS
           -> Application
         <- OS
       <- Driver
     <- Adapter (yours)
   <- Driver
 <- OS 
nmap 

or

nmap 
 -> OS 
   -> Driver
     -> OS
       -> Application
     <- OS
   <- Driver
 <- OS 
nmap 

or

nmap 
 -> OS 
   -> Application
 <- OS 
nmap 

Those other options make it much more complicated for nmap to figure out the information it wants to know, so instead of spending the time to support the 3 possible options they just block requests to yourself.

share|improve this answer

Try using your IP Address instead. Localhost does not involve the entire network interface, and I would believe that nmap will work if you use your IP address instead...

See Why is there a difference between ping "localhost" and ping "local IP address"? for more details on why I believe Localhost won't work...

share|improve this answer
    
The localhost text seems to be just boilerplate. It shows up regardless of how I address the target. It actually never occurred to me to scan "localhost". –  Zano May 22 '12 at 20:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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