Forgot your password?
typodupeerror
Image

Nmap Network Scanning 125

Posted by samzenpus
from the read-all-about-it dept.
brothke writes "The 1962 song Wipe Out, with its energetic drum solo started, was the impetus for many people to take up playing the drums. Similarly, Nmap, the legendary network scanner, likely interested many in the art of hacking, and for some, started a career for security professionals and hackers. Nmap and its creator Fyodor need no introduction to anyone on Slashdot. With that, Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning, is a most useful guide to anyone interested in fully utilizing Nmap." Read on for the rest of Ben's review.
Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning
author Gordon Lyon (Fyodor)
pages 468
publisher Nmap Project
rating 9
reviewer Ben Rothke
ISBN 978-0979958717
summary Valuable book about an invaluable security tool
One may ask, why spend $50 on this book, when the Nmap Reference Guide provides a significant amount of the basic information needed to use the tool, especially since the reference guide is both free, and well written. The reference guide is included in the book in chapter 15, and takes up 41 pages. And for those that are cash strapped, the free reference guide is the way to go.

In addition, the web site for the book notes that about half of the content is available in the free online edition. The most useful information is in the book in chapters exclusive to the print edition, which includes Detecting and Subverting Firewalls and Intrusion Detection System, Optimizing Nmap Performance, Port Scanning Techniques and Algorithms, Host Discovery, and troubleshooting.

The main benefit of the buying the book is that it has the collected wisdom of Fyodor's, in addition to numerous real-world scenarios, and Nmap commands not documented elsewhere. At over 400 pages, the books 15 chapters provide the reader with everything they need to know about using Nmap to the fullest.

Chapter 1 starts with an overview of the history of Nmap and how it came to be. As to the question of whether port scanning is legal, the author writes that it is best to avoid the debate and its associated analogies. He advises that it's best to avoid ISP abuse reports and criminal charges, by not annoying the target network administrators in the first place. Chapter 1 provides a number of practical suggestions on just how to do that.

A complaint against Nmap it that is has often been blamed for crashing systems. Chapter 1 shows that the reality is that Nmap will rarely be the primary cause of a system crash. The truth is that many of the systems that crashed as a result of an Nmap scan were likely unstable from the outset, and Nmap either pushed them over the top or they coincidentally crashed at the same time as the Nmap scan.

An ironic incident detailed in chapter 3 is when someone from the information security department of Target Corp. complained to the author that he felt the Nmap documentation was particularly directed at his organization; given the use of the term target. He requested that the Nmap documentation be changed from targetto example. The section on target enumeration in the book shows the author did not take that request to heart.

Another example of where the book goes beyond what is in the reference guide is where the author shows the most valuable TCP ports via his probe of tens of millions of IP addresses across the internet. Not surprisingly, ports 80 23 and 443 were the top three most commonly open TCP ports. It is surprising that other ports, which should have been secured long ago, are still as vulnerable as ever.

For the serious Nmap user, the book is worth purchasing just for the indispensable information in chapter 16, which is about optimizing Nmap performance. The author writes that one of his highest priorities in the creation of Nmap has been performance. Nmap uses parallelism and numerous advanced algorithms to execute its blazingly fast scans. This chapter shows how to create Nmap commands to obtain only the information you care about and significantly sped up the scan. The chapter details numerous scan time reduction techniques, and strategies on how to deal with long scans. The chapter concludes with the output of a user who, with a customized Nmap command, was able to reduce his scan of a 676,352 IP address network from nearly a week to 46 hours.

Chapter 10 is also a fascinating chapter on the topic of detection and subverting of firewalls and IDS. The function of such tests on an internal network is to help an organization understand the dangers and risks of a real attack. Since it is not uncommon for firewalls to be accidentally misconfigured, or have rule bases that leak from far too many rules; such a test can be quite useful to any network.

Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning is the guide for anyone who wants to get more out of Nmap. It is useful whether one is a novice and only getting into basic security testing, or an advanced user looking for ways to optimize Nmap.

The book takes a real-world approach on how to use the tool and clearly documents every Nmap feature and option. It also shows how the tool should be correctly used in various settings.

What is unique about is that this is a rare book in which the creator of the program wrote it. Linus Torvalds never got around to writing a Linux reference, nor did the creators of the Check Point firewall. In Nmap Network Scanning, the reader gets the story from the creator of the code itself. This then is the ultimate Nmap reference guide.

Aside from the history and use of the program in the first chapter, the rest of the book is an extreme guide to maximizing the use of Nmap. It is written by a programmer and written for the technically astute. Anyone who wants to maximize their use of Nmap will find no better reference.

Ben Rothke manages the Bright Hub Enterprise Security channel and is the author of Computer Security: 20 Things Every Employee Should Know.

You can purchase Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

*

This discussion has been archived. No new comments can be posted.

Nmap Network Scanning

Comments Filter:
  • Target (Score:5, Funny)

    by mcgrew (92797) * on Monday December 08, 2008 @03:07PM (#26037263) Homepage Journal

    An ironic incident detailed in chapter 3 is when someone from the information security department of Target Corp. complained to the author that he felt the Nmap documentation was particularly directed at his organization; given the use of the term target.

    He requested that the Nmap documentation be changed from target to walmart

  • by kwabbles (259554) on Monday December 08, 2008 @03:12PM (#26037345)

    I always roll my eyes when I hear someone complain about nmap "crashing a system". This should be common sense. If the target crashed simply from being nmapped or scanned from the outside - the target is obviously a turd of a system.

    • by X0563511 (793323) on Monday December 08, 2008 @03:21PM (#26037495) Homepage Journal

      Hey, they spent a long time polishing that turd, and they are damn proud of it!

    • I always roll my eyes when I hear someone complain about nmap "crashing a system". This should be common sense. If the target crashed simply from being nmapped or scanned from the outside - the target is obviously a turd of a system.

      Hey! Shouldn't that be example is obviously a turd of a system?

    • by tabrisnet (722816) on Monday December 08, 2008 @04:36PM (#26038589)

      Happened to me in college at gvsu.edu. They claimed I had crashed several Solaris boxen, and claimed that my Linux box was 'dangerous', and even cut off my network access.

      The kicker was the 150 hours of community service I had to put in to pay for the time (of 'computer professionals' who were worth a lot more money than I was) it took to bring them back online.

      And to think, I was only trying to map out the campus network and what systems they used for various purposes.

      • by kwabbles (259554) on Monday December 08, 2008 @05:07PM (#26039005)

        The kicker was the 150 hours of community service I had to put in to pay for the time (of 'computer professionals' who were worth a lot more money than I was) it took to bring them back online.

        And just think - since most likely all they had to do was reboot the damned things, what you were really putting in your "sweat equity" to pay for was their time to go back and fix their own mistakes, since they obviously hadn't done their jobs right in the first place.

        However, this brings up an important rule of thumb: Don't pen test something that you don't have permission to pen test, unless you've accepted that you will be prosecuted if caught. There are a lot of idiot admins out there watching their logs ready to point fingers the moment they see a port scan... not because they're concerned about security, but because "hackers" make excellent scapegoats for incompetent admins.

    • by fuzzyfuzzyfungus (1223518) on Monday December 08, 2008 @04:38PM (#26038609) Journal
      That is because you are thinking like an engineer and they aren't. People, even people who should know better, have perverse attitudes about problems.

      Somebody at the meeting has some concerns about the viability of the plan. Praise him for voicing those concerns so that they can, if necessary, be addressed? Heck no, tell that whiner that there is no place for negativity among team players.

      Nmap crashes the system. Great, we discovered a DOS vulnerability before it could be used against us? Hardly, if that hacker hadn't been hacking none of this trouble would have happened.

      I'm not sure how much of this is just laziness: If the problem doesn't show up on my watch it isn't my problem; and how much is actual magical thinking. A disturbing number of people seem to think that optimism actually makes things work, pessimism actually breaks things, negativity actually makes things work, etc. The Secret [thesecret.tv] is perhaps the purest form of this utter nonsense; but slightly milder variants are all over the place.
    • by digitalhermit (113459) on Monday December 08, 2008 @04:39PM (#26038639) Homepage

      I used to work at a (now defunct) flower company. My office was glass walled, overlooking the entire sales floor. One day I was testing Samba on a small desktop machine. I remember starting up nmbd/smbd. Then moments later, I looked into the sales pit and saw people getting up, the Win95 workstations had begun to bluescreen one by one. I didn't connect the two.

      A half hour later everyone has rebooted. In that time I'd turned off Samba to work on something else. I restart Samba on that little machine (it was called Stargate because it would act as a gateway to some shares on a Sun E6500). The moment I press enter, the machines start bluescreening again. I realized just at that moment what happened and immediately shut it down.

    • by GXTi (635121)
      In fact, a system that is thrashing itself to death (already "crashed") can still be scanned without disturbing its thrashing.
    • The system crashing is not a bug.

      It is a feature.
    • Re: (Score:3, Insightful)

      by dbIII (701233)
      Some HP printers and network to parallel port converters fit squarely into that catagory on all accounts but are still expensive things to fix after a port scan.
  • In college... (Score:3, Informative)

    by Shadow7789 (1000101) on Monday December 08, 2008 @03:14PM (#26037379)
    my school's IT department confused my port scanning with that of a virus and subsequently banned me from the network.
    • Maybe use -sS??
    • Re:In college... (Score:5, Informative)

      by MadMidnightBomber (894759) on Monday December 08, 2008 @04:11PM (#26038273)

      If you are at college, do NOT:

      * 'finger' every possible username programmatically.
      * do a nessus scan on the IT people's servers "just to see"
      * nmap the college's /16
      * attempt an infeasible online crack of an admin's password from a computer you've just logged into. in a lab you swiped your own card to get in.

      All of these actions will get you noticed, but not in a good way.

      love & kisses, your friendly college sysadmin

      • by PitaBred (632671)

        As an addendum, an accidental "Net Send" to a domain rather than your buddy will also get you noticed ;)

        • by Doug Neal (195160)

          As an addendum, an accidental "Net Send" to a domain rather than your buddy will also get you noticed ;)

          Heh, I saw that happen in a call centre once. They were a lot less understanding than a college would have been...

        • by nog_lorp (896553) *

          My college doesn't run Windows tyvm.

        • What the fuck? Tell us what college you went to that A. Uses Windows, B. Allows an unprivileged user the ability to send broadcast messages to the whole domain. When people say epic fail, this is what they're talking about.
      • Re: (Score:3, Interesting)

        by X0563511 (793323)

        Darwin at work. Let them be caught ;)

      • Re: (Score:3, Funny)

        by RockWolf (806901)

        love & kisses, your friendly college sysadmin

        Why didn't I have one of those? I feel so unloved...

      • Re: (Score:1, Funny)

        by Anonymous Coward

        Bah, that's nothing. I was banned from my middle school library for a year for cleaning the rollers on a ball mouse.

      • by Darby (84953)

        love & kisses, your friendly college sysadmin

        Luckily, my college sysadmin is named HappyNoonFlowerHanderOuter, so I'm not worried ;-)

      • by tehcyder (746570)

        All of these actions will get you noticed, but not in a good way.

        Says Mr. MadMidnightBomber...

    • by pgn674 (995941)

      my school's IT department confused my port scanning with that of a virus and subsequently banned me from the network.

      Me too. And this was while I was working in the IT department at said school. The guy over in Networking just laughed and put me back on the network.

      Then later I got booted again because Google Desktop was being a little too friendly on the network. It only happened that once, so I guess Google updated the program soon after.

    • I (a Canadian working for a defunct Cdn software company) was at a US military installation several years ago.

      One of the guys from our dev team wanted to show me some new functionality that had been integrated into one of our tools (NMAP). We thought it best that we scan our own domain rather than one of the military domains... it never occurred to us that that just made the situation worse.

      A US military site scanning a Cdn web site was bad, two Canadian civilians running the scan from a classified US comp


    • eeeeyeah, thats to be expected, as port scanning is a script-kiddies first point of contact to seeing what version/OS the target is using, as well as what apps the target is running, to expose vulnerabilities.

      but, you probably already know this ;)
    • Re: (Score:3, Insightful)

      by magarity (164372)

      my school's IT department confused my port scanning with that of a virus
       
      At a consulting client once I plugged in my usb thumb drive to transfer a document and the corporate scanning software on their computer detected nmap. It was immediately deleted with a pop-up that screamed "hacking tool detected!" On the one hand I was glad I didn't get escorted out (and not paid) but on the other hand it was rude of them to delete it when they could have just disallowed running it.

    • which school was that???

  • by larry bagina (561269) on Monday December 08, 2008 @03:16PM (#26037417) Journal

    I suspect a lot of slashdot readers are too new, have forgotten, or never learned of Fyodor's slashdot "girlfriend". Long story short -- a dude posted on slashdot, claiming to be a girl. Fyodor tried to hook up with "her" and "she" strung him along for awhile. After discovering "she" had dude parts, Fyodor hacked his computer and posted screenshots.

    • by Splab (574204)

      Thanks for elaborating, been around slashdot since 2002, never heard of the guy.

      • by burner (8666)

        Since '98 here -- me either.

        Though I haven't always visited religiously the entire time. (I admit that I may fit into the "have forgotten" category)

    • by russotto (537200)

      Read the story. Totally justified. Trolls should know better than to meddle in the affairs of dragons.

    • That's really one of those one-in-a-million things. Getting trolled like that, Yahoo vuln, open X server on a home *nix box. The stars really aligned.

    • No one really cares, nor did they ask about it.
      So the question is, why do you feel the need to share that bit of irrelevant information?
      Yes, everyone is vulnerable to social engineering.
      Is this the best security tool around, heck yes.

    • No one really cares about this, except you. The question is, why?
      What do you have against Fyodor? Why are you jealous of him?

      The is a book about an powerful security tool, can't ya just focus on that?

    • wow, what a valuable post.

      u must be a reall important person.

  • matrix reloaded (Score:5, Interesting)

    by circletimessquare (444983) <circletimessquare&gmail,com> on Monday December 08, 2008 @03:27PM (#26037593) Homepage Journal

    while mostly being a steaming pile of shit compared to the original, it attempts to redeem itself by accurately using nmap in one scene

    http://www.theregister.co.uk/2003/05/16/matrix_sequel_has_hacker_cred/ [theregister.co.uk]

    That's exactly how the fictional Trinity uses it. In a sequence that flashes on screen for a few scant seconds, the green phosphor text of Trinity's computer clearly shows Nmap being run against the IP address 10.2.2.2, and finding an open port number 22, correctly identified as the SSH service used to log into computers remotely.

    "I was definitely pretty excited when I saw it," says "Fyodor," the 25-year-old author of Nmap. "I think compared to previous movies that had any kind of hacking content, you could generally assume it's going to be some kind of stupid 3D graphics show."
    blockquote>

    • Re: (Score:3, Informative)

      by pak9rabid (1011935)
      Haha, yea. I remember seeing that scene, pausing, rewinding, then going frame-by-frame to verify I saw what I thought I did.
    • Re: Matrix Reloaded (Score:5, Informative)

      by fv (95460) * <fyodor@insecure.org> on Monday December 08, 2008 @04:51PM (#26038793) Homepage
      Yeah, Nmap has actually been in a surprising number of major movies. I created the Nmap in the Movies [nmap.org] page to document them with screen shots. The Matrix Reloaded was the most exciting and really started the trend. I guess the rest of Hollywood just followed along and decided that the command shell was the new way to portray hacking, rather than ridiculous 3D animated eye-candy scenes from the era of Hackers and Swordfish. So we got Nmap in Bourne Ultimatum, Die Hard 4, etc.

      I wanted to include a screen shot of Trinity hacking the Matrix with Nmap for this book, but a then-potential publisher said I needed permission from Time Warner first. It took many unanswered requests, but Time Warner finally replied with basically "hell no, you IP pirate!" Of course they phrased it politely like "we would love to allow that, but our policies prohibit us from granting that permission". Funny, they didn't mind using Nmap in their movie without permission, credit, notification, etc. Then they say I can't even include a screen shot of them using Nmap?

      So I dumped the potential publisher and added the screen shots anyway (page 8) :).

      -Fyodor
      Insecure.Org [insecure.org]

      • by milesw (91604)

        I am a very occasional (though appreciative!) user of Nmap, but after reading this:

        So I dumped the potential publisher and added the screen shots anyway

        I immediately bought a copy via the Amazon link. Fyodor, well done, sir!

    • Re: (Score:1, Redundant)

      by gatekeep (122108)

      Obligatory link to the Movies featuring Nmap page [nmap.org]. Enjoy.

    • by srvivn21 (410280)

      while mostly being a steaming pile of shit compared to the original, it attempts to redeem itself by accurately using nmap in one scene

      http://www.theregister.co.uk/2003/05/16/matrix_sequel_has_hacker_cred/ [theregister.co.uk]

      That's exactly how the fictional Trinity uses it. In a sequence that flashes on screen for a few scant seconds, the green phosphor text of Trinity's computer clearly shows Nmap being run against the IP address 10.2.2.2, and finding an open port number 22, correctly identified as the SSH service used to log into computers remotely.

      "I was definitely pretty excited when I saw it," says "Fyodor," the 25-year-old author of Nmap. "I think compared to previous movies that had any kind of hacking content, you could generally assume it's going to be some kind of stupid 3D graphics show."
      blockquote>

      Trinity didn't use nmap. Seriously, she didn't have the time. The hacking was performed by the original team sent in to do the job. She just executed a simple command on a compromised system.

      Just like a manager, they did all the hard work, she took all the credit.

  • ...to know that I wanted to play drums!
  • NMap is the best there is, period. There's not even specialist scanners that can up it's features, especially since you can set packet flags manually in the more recent versions. It really, really fills it's niche. I use it all the time in my daily life just for benign remote service discovery, and I assume many people do too. I've never had anyone complain about it either.

    • For the kids following along at home, nc (netcat) can be used similarly.

      nc -z 10.2.2.2 22
      Connection to 10.2.2.2 22 port [tcp/ssh] succeeded!

      Port scanning doesn't work as fast, of course, but then, nmap isn't always available.

      • A point is that one of the more useful basic features of NMap, the SYN partial-handshake scan (default when run as root) can't be replicated by nc. It always leaves marks in connect logs. Hping can replicate that feature though: "hping -8 -S known host.com" will SYN scan all ports listed in /etc/services on host.com

  • Network map? (Score:2, Interesting)

    by Anonymous Coward

    Have they included a network mapping function yet? They announced it as a GSoC project last year I think, did they get around to hack some graphical map output?

  • nmap and IPv6 (Score:4, Interesting)

    by swillden (191260) <shawn-ds@willden.org> on Monday December 08, 2008 @07:58PM (#26041381) Homepage Journal

    This is tangentially related, but it sort of fits in with the idea of "cools ways to use nmap" -- or, in this case "things you can't do with nmap".

    While setting up a 6to4 tunnel to give my home LAN IPv6 access (just for fun), I decided to use nmap to scan my home IPv6 network. I've used nmap from time to time to portscan, but mostly I use it as a ping scanner, just to find live hosts, so it seemed like a natural way to find out which hosts had picked up IPv6 addresses.

    I first tried the obvious syntax "nmap -sP <my subnet prefix>::/64", but nmap told me that slashes are not allowed, and that "IPv6 addresses can currently only be specified individually".

    My first reaction was "Well, that's stupid. Why can't nmap handle IPv6 subnets? Idiots". However, a half-second later it occurred to me that I was the idiot: what I thought I wanted nmap to do was to scan 18,446,744,073,709,551,616 addresses. That's obviously impractical. That many requests would saturate a 10 Gbps network for 60,000 years (2^64 128-byte packets).

    So, FYI, if you want to find out what hosts are live on your IPv6 network, the way to do it is to ping the link-local multicast address (fe02::1). Assuming they're not firewalled, all of the hosts will answer. Of course, what you'll get back is their link-local addresses, not their routable addresses. I haven't found a convenient way to get a list of those, other than a little sed script to convert the link-local addresses to their equivalents in the subnet.

    • It really isn't worth a chapter, but funny just the same.

      Not perfect behaviour but is that bit of tresspass really that bad? IMHO it's about thirty notches down the "black hat" scale less nasty than spammers that pretend to send things from your email address. I like it as a nice little anecdote to tell people to have decent firewall rules (and not have unsecured MS Windows machines naked to the net).

    • and your point is what?

  • nmap is way cool, infact so cool I am surprised it is legal, heh ;P Thank you & kudos to you Fyodor for your expertise and generosity, truly brilliant and inspirational stuff.
  • nmap is way cool, infact so cool I am surprised it is legal, heh ;P Thank you & kudos to you Fyodor for your expertise and generosity, truly brilliant and inspirational stuff.

  • How can someone call the reference guide well written, then five sentences later say that the book explains commands not documented elsewhere? Isn't the purpose of the reference guide, manpages, and any other documentation to define _all_ of the commands that are inserted into a program?

    Now, I have to question what _else_ has been put into the program that hasn't been documented. Unfortunately, this lends credibility to Fyodor's detractors, and raises questions for me as to whether nmap belongs on my comp

    • Re: (Score:2, Insightful)

      The source is right there for you to read. Also, he's not the only guy working on the project, lots of other people have reviewed the code. Anything fishy would have been caught a long time ago.

      • Nmap grew in functionality as a direct result of Google's sponsorship of the program in the summer of code. With those programmers, Fyoder could have never done it on his own. He has said as much and knows that.
        All of these criticisms all have their base in people being jealous of Fyodor's success. It is that simple.

    • Re: (Score:2, Informative)

      by karlconnors (1352873)

      As to your comment 'How can someone call the reference guide well written, then five sentences later say that the book explains commands not documented elsewhere', there is a difference
      between 'undocumented' and 'not documented elsewhere'.

      My understanding is undocumented is more of an active attempt to keep under wraps.

      Not documented elsewhere is something that someone never got around to writing about.

      And as to the comment 'this lends credibility to Fyodor's detractors', since when does he have detractors?

  • Who have though this day will come – promoting nmap using the surfaris ;)
    Let me add a minor correction to the description:

    "The 1962 song Wipe Out [youtube.com], with its energetic drum solo started, was the impetus for many people to take up playing the drums. Similarly, Nmap [nmap.org], the legendary network scanner, likely interested many in the art of hacking, and for some, started a career for security professionals and hackers. Nmap and its creator Fyodor [insecure.org] need no introduction to anyone on Slashdot. With that, Nmap Ne

UNIX is many things to many people, but it's never been everything to anybody.

Working...