<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>ClearNet Security: Tag nmap</title>
    <link>http://blog.clearnetsec.com/articles/tag/nmap</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Follow-up on using unicornscan for a big scan (400,000+ public IPs)</title>
      <description>&lt;p&gt;I&#8217;m happy to report our growing experience using unicornscan for large discovery sweeps is a positive one.  Our confidence in using this tool has increased and it is now our preferred weapon of choice for scanning large IP swaths.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;To recap:&lt;/b&gt;  We performed a sweep of 400,000+ public IPs across multiple continents by configuring the scans to do a full TCP port scan of each IP, sustained ~55 Mbits/s using between 3 and 5 systems, and completed it in a matter of days.  
&lt;/p&gt;
&lt;p&gt;
This is pretty good considering by sending two SYN probes per port it meant sending ~52.5 billion packets and producing some 3 Terabytes of data. 
&lt;/p&gt;
&lt;p&gt;
Nmap is often our preferred tool, and we used it to spot check our results with unicornscan, but from now on it will come down to the details of the gig to make the choice.
&lt;/p&gt;
&lt;p&gt;
&lt;i&gt;&lt;b&gt;Tech note:&lt;/b&gt;  We avoided problems with table overflows and other like issues by placing the systems directly on the internet and with iptables turned off.&lt;/i&gt;


</description>
      <pubDate>Thu, 27 Dec 2007 12:36:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:bb1d8624-361f-4fca-9777-466bfd9d4124</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2007/12/27/follow-up-on-using-unicornscan-for-a-big-scan-400-000-public-ips</link>
      <category>nmap</category>
      <category>scanning</category>
      <category>security</category>
      <category>port  scanning</category>
      <category>ClearNet</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
      <category>unicornscan</category>
    </item>
    <item>
      <title>Trying out unicornscan</title>
      <description>&lt;p&gt;We&#8217;ve hit a new high.  We&#8217;ve soaked ourselves in a bandwidth bath on behalf of a client whom would like us to discover active services across a range of six public /16 blocks plus some scattered /17s, /24s, etc.  The range is close to a total of 400,000 IPs.  
&lt;/p&gt;
&lt;p&gt;
We started out with five dual Xeon systems running 20 to 40 instances of nmap, each tuned, and each instance targeting 64 IPs.  This client wants the job completed in weeks, so we decided it was a good time to get more experience with unicornscan.
&lt;/p&gt;
&lt;p&gt;
By luck, we tapped into a Danish provider that is allowing us to push 55Mbits/s.  I have no idea how much that amount of bandwidth would normally cost, especially if sustaining it 24x7 for a few weeks, but I&#8217;m guessing it is way over $10,000.  Our client would allow us to go up to 100Mbits/s, alas, our luck doesn&#8217;t go that far.  
&lt;/p&gt;
&lt;p&gt;
Anyway, we now have faster dual-core systems each pushing ~25 Mbits/s via &lt;a href="http://www.unicornscan.org/"&gt;unicornscan&lt;/a&gt; like so:
&lt;/p&gt;
&lt;p&gt;
&lt;blockquote&gt;
sudo nohup /usr/local/bin/unicornscan -mT -p &#8211;r25000 -vv xxx.zz.0.0/16:a -w unicorn.output.for.xxx.zz..0.0.fullTCP &gt; unicorn.output.fullTCP &amp;
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;p&gt;
We have lots of results from nmap; so far unicornscan is matching the nmap results.  Having the ability to specify packets per second with unicornscan is super nice.
&lt;/p&gt;
&lt;p&gt;
We&#8217;ll create a follow up post on how all our scanning worked out on this gig when we&#8217;re finished (sometime in late November).


</description>
      <pubDate>Sun, 14 Oct 2007 22:10:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:41de7625-dc6f-4304-bd0f-07fd9f49eca1</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2007/10/14/trying-out-unicornscan</link>
      <category>nmap</category>
      <category>port  scanning</category>
      <category>ClearNet</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
      <category>unicornscan</category>
    </item>
    <item>
      <title>nmap junkie?  </title>
      <description>&lt;p&gt;We&#8217;re playing w/RoR and building a few web apps.  I wrote a quick and easy one that helps you build a command line for nmap, nothing particularly special.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://nmapTweaker.clearnetsec.com/"&gt;http://nmaptweaker.clearnetsec.com/&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
I did add some extra content:  tuning tips, examples, and a time estimator.  Basically you can use it to build a command line, then copy and paste it to wherever you want to run it.
&lt;/p&gt;
&lt;p&gt;
It does not do syntax checking for nmap options which require input yet (e.g. targets, output file name, etc.), but the app does do some error checking for conflicting options.    
&lt;/p&gt;
&lt;p&gt;
It&#8217;s a little rough, but hey, it &lt;i&gt;might&lt;/i&gt; save you a few minutes of time if you&#8217;re not an nmap option sage.  
&lt;/p&gt;

</description>
      <pubDate>Thu, 23 Nov 2006 23:02:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:27227f77-be7e-4ac3-8b13-5d2069acc935</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2006/11/23/nmap-junkie</link>
      <category>nmap</category>
      <category>port  scanning</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
      <category>ror</category>
    </item>
    <item>
      <title>D&#233;j&#224; vu with big time port scanning</title>
      <description>&lt;p&gt;We have a potential pen. test &amp;nbsp;project coming up with crazy numbers: &amp;nbsp;260,000+ range of publicly addressable IPs (spread  over several non-contiguous blocks).&amp;nbsp; &lt;a href="http://blog.clearnetsec.com/articles/2005/12/27/70-000-worth-of-new-opteron-servers-for-nmap-scanning-and-they-suck"&gt;Our  previous experience&lt;/a&gt; with scanning large blocks aggressively via the internet has  made us, well, super sensitive.&amp;nbsp; It&amp;rsquo;s freakin&amp;rsquo;  hard.&amp;nbsp; &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;260,000 x 65535 TCP ports x 2 (number of port query attempts)  = 34,078,200,000 TCP SYN packets (nmap, default).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That is ~4x larger compared to our last &amp;quot;large&amp;quot; effort  (~70,000 IPs).&lt;/p&gt;
&lt;p&gt;No info yet on the bandwidth available per block, latency  conditions, or other factors, but let&amp;rsquo;s run some numbers to see how this would  work.&lt;/p&gt;
&lt;p&gt;From recall, the Sun v40z&amp;rsquo;s were averaging ~3500pps (packets per  second) outbound per server.&amp;nbsp; I didn&amp;rsquo;t use packets  per second to estimate previous effort, I created a quick excel chart similar to below to get a ballpark number (updated using 260,000 for the total number of IP addresses to scan):&lt;/p&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
  &lt;col width="364" /&gt;
  &lt;col width="136" /&gt;
  &lt;col width="330" /&gt;
  &lt;tr height="17"&gt;
    &lt;td width="364" height="17"&gt;approx.    number of IP addresses to scan&lt;/td&gt;
    &lt;td width="136"&gt;&lt;div align="right"&gt;260,000 &lt;/div&gt;&lt;/td&gt;
    &lt;td width="367"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of TCP    ports to query &lt;em&gt;&lt;strong&gt;per&lt;/strong&gt;&lt;/em&gt; IP address&lt;/td&gt;
    &lt;td&gt; &lt;div align="right"&gt;65,535 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;&lt;div align="right"&gt;total # of    TCP ports to query &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;17,039,100,000 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17" bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;time-out setting per    port query&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;1.25 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt; seconds (allow 1.25 seconds for query response)&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of query attempts per    port&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;2 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;which implies we need    34,078,200,000 SYN requests  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;&lt;div align="right"&gt;total seconds    per port query&lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;2.50 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;seconds&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17" bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of    parallel &lt;em&gt;&lt;strong&gt;port &lt;/strong&gt;&lt;/em&gt;queries&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;2 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;(we set it to 100, but empirical evidence shows this to be ~2)&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;total # of    hours to complete single IP port scan&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;22.76 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;total number of seconds    to perform scan (if sequential)&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;21,298,875,000 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;total number    of hours to perform scan (if sequential)&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;5,916,354 &lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17" bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td bgcolor="#CCCCCC"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of    scans in parallel&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;1,600&lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;(2 servers, each running 8 unique nmap processes with min_hostgroup set to 100) &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of    hours to complete scan&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;3,698&lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of    days to complete scan&lt;/td&gt;
    &lt;td&gt; &lt;div align="right"&gt;&lt;strong&gt;154 &lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;p /&gt;
&lt;p&gt;Now I realize pps is an important factor.&amp;nbsp; Remember these are still pretty fast servers:  quad dual core opterons with 16 GB RAM. Doing a sanity check with our previous results of obtaining ~3500 pps per server goes as follows: &amp;nbsp;&lt;/p&gt;
&lt;table cellspacing="0" cellpadding="0" border="1"&gt;
  &lt;col width="364" /&gt;
  &lt;col width="136" /&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17" width="364"&gt;total #    of SYN requests&lt;/td&gt;
    &lt;td width="136"&gt;&lt;div align="right"&gt;34,078,200,000 &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;average outbound packets per second / per server&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;3500&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;number of dedicated servers&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;2 &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt;total number of seconds to complete scan&lt;/td&gt;
    &lt;td&gt;&lt;table cellspacing="0" cellpadding="0"&gt;
      &lt;tr&gt;
        &lt;td height="17" width="136"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4,868,314.29&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt; number of hours to complete scan&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;
      &lt;table cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
          &lt;td height="17" width="136"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;    1,352.31 &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr height="17"&gt;
    &lt;td height="17"&gt; number of days to complete scan&lt;/td&gt;
    &lt;td&gt;&lt;div align="right"&gt;&lt;strong&gt;56&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;p /&gt;
&lt;p&gt;So the numbers don't match. The first chart says it'll take ~154 days, the second says ~56 days. In the first chart I set &amp;quot;number of scans in parallel&amp;quot; to 1600. I got that by having 8 unique nmap processes each running with min_hostgroup of 100 (800 hosts being scanned simultaneously per server; we have two dedicated scanners, so the total is 1600 hosts). The number that is probably way off is the &amp;quot;number of parallel port queries&amp;quot; in the first chart. Although we had set the value to 100 (meaning scan 100 ports simultaneously on each host) it often seemed like we were only getting 2 or so in parallel (observed from watching tcpdump output). That was probably after running into the memory issues I reported with nmap (which &lt;a href="http://www.securityfocus.com/archive/101/418822/30/0/threaded"&gt;Fyodor subsequently reported to fix&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;I just ran a few quick checks on a Sun Fire x2100 we have (dual core opteron 175 / 4 GB of RAM) using a newer nmap version (4.11). Firing off a bunch of nmap scans on one server with parameters similar to below resulted in a sustained 9000+ pps (~4.5 Mbits/s).  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt; /usr/local/bin/nmap  -vv -sS -P0 -p 1-65535 -n --min_hostgroup 100    --max_rtt_timeout 1250 --min_parallelism 100  &amp;lt;a_/24_block&amp;gt; &lt;/p&gt;
&lt;p&gt;&lt;img src="http://blog.clearnetsec.com/files/2100zIPTraf.JPG" width="554" height="271" /&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I didn't let the test run for very long to see if issues arise like before. If  we could sustain 9000 pps per server and be allowed to push ~9Mbits/s, then the overall time is greatly reduced. It drops to ~22 days. I really doubt we'll be able to or allowed to push 9Mbits/s, but at least we now have ballpark figures to play with. 

&lt;p&gt;Who else has had this kind of crazy port scanning fun?&lt;/p&gt;

&lt;/p&gt;
&lt;p&gt;Related entry: &lt;a href="http://blog.clearnetsec.com/articles/2006/05/03/maximizing-nmap-scans-for-accuracy"&gt;maximizing nmap scans for accuracy&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;

</description>
      <pubDate>Tue, 22 Aug 2006 23:13:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:cb71aba2-3e34-417e-8f9f-0b494fc6b3f4</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2006/08/22/d%C3%A9j%C3%A0-vu-with-big-time-port-scanning</link>
      <category>nmap</category>
      <category>port  scanning</category>
      <category>performance</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
    </item>
    <item>
      <title>maximizing nmap scans for accuracy</title>
      <description>&lt;p&gt;There have been some recent newsgroup postings about consistency problems with nmap results (especially when scanning over the internet).  In my experience, if you want the best chance of obtaining accurate nmap scan results, you need to:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;check the latency to your targets (ping some device on the target net block for awhile, what is the average rtt value?)
    &lt;ul&gt;
      &lt;li&gt;use the average to configure the --max_rtt_timeout nmap option (e.g. if your ping time is 300ms, you obviously want to set this option to more than 300ms to prevent nmap for missing an open port if/when a probe takes longer than 300ms. Maybe set it to 500ms or even higher. Speed suffers, but we're chasing accuracy) &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;if you can, check the available bandwidth limit for you and the target net (e.g. T3:45mbps, T1:1.544mbps, DSL, etc.)
    &lt;ul&gt;
      &lt;li&gt;use this to configure the --min-hostgroup and --max-hostgroup nmap options and the --min-parallelism and --max-parallelism options (i.e. the more bandwidth each side has available, the more hosts and ports you can scan in parallel). This can significantly reduce overall scan time while keeping accuracy as the highest priority. I typically use IPTraf to watch pps (packets per second) to guage my bandwidth usage. If my options are too aggressive (i.e. consuming too much bandwidth), I'll kill the current scan and start over with different tuning values. The objective here is to set --min-hostgroup and min-parallelism to something that both sides can handle without sacrificing accuracy. If bandwidth permits, I like to set min_parallelism to 100 (number of parallel SYN requests or whatever scan type you're doing). I've gone up to 300 for --min-hostgroup (had lots of bandwidth and plenty of server horsepower). You don't want to cause your scan server, the target, or any device the probes traverse to drop packets, so the more information you have about all the components involved the better you'll be able to tune these values. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;if you can, verify there are no 'smart' devices impeding scans (e.g. IPS, rate limiting device, etc.) &lt;/li&gt;
  &lt;li&gt;run multiple nmap scans of the same target, preferably at different times of the day and different days of the week (e.g. nightly backups can saturate certain hosts/links which causes nmap to fail to discover open ports). I like to run multiple services scans (~1600 ports) and do one or two 65k scans depending on circumstances. If time permits, the confidence boost you get knowing you've maximized accuracy by running repeated scans is satisfying. It also shows your assiduity; you can tell your customer you fired off 5 scans at different times to obtain your final list of exposed services. If you missed something after repeated scans (assuming you used safe tuning values), something is likely wrong.&lt;/li&gt;
  &lt;li&gt;set --host_timeout to something you are comfortable with.
    &lt;ul&gt;
      &lt;li&gt;if you determine a scan may take 20 hours to perform a 65k port scan of the target device, then set this option accordingly. Note: you can use 's', 'm', or 'h' to specify seconds, minutes, or hours. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;set --max-scan-delay to something low if nothing is impeding scans
    &lt;ul&gt;
      &lt;li&gt;I typically set this option to 0 because I'm confident in my other tuning values (no delay between probes, just fire them off)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While tuning nmap options can do lots of good things it is still important to verify your scan server can keep up. We've knocked down 8-way Opteron systems w/16GB of RAM, so optimal nmap options may not be realistic for your hardware. &lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;

</description>
      <pubDate>Wed, 03 May 2006 01:05:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:0f284715-f876-43ac-933c-561b64142161</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2006/05/03/maximizing-nmap-scans-for-accuracy</link>
      <category>nmap</category>
      <category>tuning</category>
      <category>performance</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
      <category>accuracy</category>
    </item>
    <item>
      <title>Scan fast and evade triggers</title>
      <description>&lt;p&gt;I've wanted to build this for a long time, alas the pain and  costs of obtaining disparate public IPv4 blocks is high.&amp;nbsp; I want to perform 65k port scans fast,  accurately, and avoid 95% of the IDSes, IPSes, or whatever other &amp;lsquo;smart&amp;rsquo; devices  are in my way.&amp;nbsp; It can be done.&amp;nbsp; &lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Buy or lease some servers&lt;/li&gt;
  &lt;li&gt;Find a few data centers that connect to  different Tier 1 providers&lt;/li&gt;
  &lt;li&gt;Justify and purchase IP blocks from ARIN (or another  regional registry)&lt;/li&gt;
  &lt;li&gt;Setup scan server(s)&lt;/li&gt;
  &lt;li&gt;Setup NAT server(s)&lt;/li&gt;
  &lt;li&gt;Write some code to distribute port scans &lt;/li&gt;
  &lt;li&gt;Feel cool when you can scan like crazy &lt;/li&gt;
  &lt;li&gt;Feel really cool when no &amp;lsquo;smart&amp;rsquo; devices alert,  block, or rate limit you because you haven&amp;rsquo;t triggered any threshold &amp;lsquo;rules&amp;rsquo;&lt;/li&gt;
  &lt;li&gt;Act surprised when the client mentions his team  didn&amp;rsquo;t see or report any anomalous behavior &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a high-level diagram of what I want:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.clearnetsec.com/roller/resources/cns/ScanServer.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Of course, there are some realities which make this hard to  build.&amp;nbsp; Registries prefer to hand out  contiguous net blocks, but it would be far more desirable to have a bunch of smaller  non-contiguous net blocks.&amp;nbsp; Some &amp;lsquo;smart&amp;rsquo;  devices do detect scans based on the source net block, not just via a single  source IP.&amp;nbsp; Bandwidth and latency conditions  are always in play.&amp;nbsp; I still want it.&amp;nbsp; A scan setup like this can increase accuracy,  be fast, is distributed, and raises the difficulty for detection.&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;FYI: Initial costs from ARIN for different net block sizes &lt;/p&gt;
&lt;table cellspacing="0" cellpadding="0"&gt;
  &lt;tr&gt;
    &lt;th&gt;Category&lt;/th&gt;
    &lt;th&gt;Initial Registration Fee (US Dollars)&lt;/th&gt;
    &lt;th&gt;Assignment Size&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;X-small/&lt;br /&gt;
      Micro-allocation &lt;/td&gt;
    &lt;td align="right"&gt;$1,250&lt;/td&gt;
    &lt;td align="right"&gt;/24 - &amp;lt; /20&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Small&lt;/td&gt;
    &lt;td align="right"&gt;$2,250&lt;/td&gt;
    &lt;td align="right"&gt;/20 - /19&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Medium&lt;/td&gt;
    &lt;td align="right"&gt;$4,500&lt;/td&gt;
    &lt;td align="right"&gt;&amp;gt; /19 - /16&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;Large&lt;/td&gt;
    &lt;td align="right"&gt;$9,000&lt;/td&gt;
    &lt;td align="right"&gt;&amp;gt; /16 - /14&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;X-large&lt;/td&gt;
    &lt;td align="right"&gt;$18,000&lt;/td&gt;
    &lt;td align="right"&gt;&amp;gt; /14&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&lt;/p&gt;

</description>
      <pubDate>Tue, 14 Mar 2006 03:48:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:bff733f4-e884-4002-b473-ec3e8f6c0bcb</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2006/03/14/scan-fast-and-evade-triggers</link>
      <category>nmap</category>
      <category>scanning</category>
      <category>port  scanning</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
      <category>ids</category>
      <category>ips</category>
      <category>circumvent</category>
    </item>
    <item>
      <title>Quick list of cool new things in Nmap 4.00</title>
      <description>&lt;p&gt;I'm catching up on the new features in &lt;a href="http://www.insecure.org/nmap/download.html"&gt;Nmap 4.00&lt;/a&gt; from this &lt;a href="http://www.securityfocus.com/columnists/384"&gt;Security Focus interview with Fyodor&lt;/a&gt;.  Some good things to remember:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;press &lt;em&gt;[enter]&lt;/em&gt; anytime to get an estimate of when nmap will finish&lt;/li&gt;
  &lt;li&gt;press 'v' anytime to enable verbose mode / press 'V' anytime to disable verbose mode&lt;/li&gt;
  &lt;li&gt;there are now 3,153 signatures to detect an application or service (and possibly version) of a listening port&lt;/li&gt;
  &lt;li&gt;there is a new &lt;em&gt;--version-intensity &lt;/em&gt;option which specifies how hard nmap will interrogate a listening port&lt;img src="http://www.clearnetsec.com/roller/resources/cns/Insecurelogo-eye-90x168.gif" alt="nmap" align="right" /&gt;&lt;/li&gt;
  &lt;li&gt;new &lt;em&gt;--badsum&lt;/em&gt; option which tells nmap to use invalid TCP or UDP checksums (can give you more information about a FW/IPS)
    &lt;ul&gt;
      &lt;li&gt;Here is the &lt;a href="http://www.phrack.org/show.php?p=60&amp;amp;a=12"&gt;link to Phrack #60&lt;/a&gt; which gives the why and how of this new feature (written by &lt;a href="http://www.antifork.org/"&gt;Ed3f&lt;/a&gt;) &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;much faster (although this depends on things like bandwidth, latency, and which command line options you specified) &lt;/li&gt;
  &lt;li&gt;better OS detection (uses more tests to gain accuracy) &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a &lt;a href="http://www.insecure.org/nmap/data/nmap.usage.txt"&gt;link to the official quick list of options for Nmap 4.00&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;

</description>
      <pubDate>Fri, 03 Feb 2006 11:57:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:6e3d6965-3fed-4790-b364-9e7f60ab748b</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2006/02/03/quick-list-of-cool-new-things-in-nmap-4-00</link>
      <category>nmap</category>
    </item>
    <item>
      <title>$70,000 worth of new opteron servers for nmap scanning and  they suck?</title>
      <description>&lt;p&gt;&lt;img src="http://www.clearnetsec.com/roller/resources/cns/img_3.jpg" width="199" height="157" align="right" /&gt;&lt;/p&gt;
&lt;p&gt;We recently performed a relatively large TCP port scan for a  client; a full 65k SYN scan of ~70,000 IP addresses.&amp;nbsp; &lt;a href="http://www.insecure.org/nmap/index.html"&gt;Nmap&lt;/a&gt; is a great port scanner  and was our first choice.&amp;nbsp; We had two new  and beautiful &lt;a href="http://www.sun.com/servers/entry/v40z/specs.jsp"&gt;Sun  quad v40z dual core opteron servers&lt;/a&gt; (16GB of RAM each) dedicated to the  task.&amp;nbsp; We were under a restrictive change  control window and time was the limiting factor.&amp;nbsp; We broke the scans down like this:&lt;/p&gt;
&lt;ul type="disc"&gt;
  &lt;li&gt;Executed       8 unique nmap instances on each system (one for each &amp;lsquo;virtual&amp;rsquo; processor)&lt;/li&gt;
  &lt;li&gt;Divided       the scans on /24 blocks (the optimal breakdown would&amp;rsquo;ve been on a 100       boundary, but we ran with this)&lt;/li&gt;
  &lt;li&gt;Set       min_hostgroup to 100 (minimum number of devices to scan in parallel)&lt;/li&gt;
  &lt;li&gt;Set       min_parallelism to 100 (minimum number or ports to scan in parallel)&lt;/li&gt;
  &lt;li&gt;Set       max_rtt_timeout to 1250 (wait a maximum of 1.25 seconds to receive a reply       from a port query)&lt;/li&gt;
  &lt;li&gt;Other       command line options used (-vv: verbose, -sS: SYN Scan, -P0: no ICMP, -p:       port range)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All together, a single nmap statement looked like the  following: &lt;br /&gt;
  &lt;span class="style9"&gt;		/usr/local/bin/nmap  -vv -sS -P0 -p 1-65535 -n --min_hostgroup 100
  --max_rtt_timeout 1250 --min_parallelism 100  &amp;lt;a_/24_block&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;We paid close attention to the number of outbound pps  (packets per second) using &lt;a href="http://iptraf.seul.org/"&gt;iptraf&lt;/a&gt; for a  couple reasons:&amp;nbsp; To watch our bandwidth  utilizations to avoid ISP overage charges and to gain a rough baseline so we  could detect a problem.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.clearnetsec.com/roller/resources/cns/iptraf-dstat1.gif" width="561" height="352" /&gt;&lt;/p&gt;
&lt;p&gt;If I remember right, the outbound pps initially was between  2k and 4k per server.&amp;nbsp; Things were  rocking and it looked like we would sail through the port scans.&amp;nbsp; Alas, when doing a quick check after ~30  hours of scanning, we noticed the pps had slowed to ~550 per server.&amp;nbsp; We deduced nmap had some memory management  issues when used the way we crafted.&amp;nbsp;  Each nmap instance was consuming ~1.2GBytes of RAM, appeared to be  increasing, and the CPU idle time for all processors was a continuous 0.&amp;nbsp; This caught us off guard somewhat because we  had successfully performed an nmap TCP services scan (~1668 ports) of the  70,000 IP addresses in less than 40 hours.&amp;nbsp;  This was all on &lt;a href="http://www.novell.com/products/linuxenterpriseserver/"&gt;SuSE Linux  Enterprise Server 9&lt;/a&gt; (x86_64) with nmap version 3.93.&amp;nbsp; We knew now this was not going to be  easy.&amp;nbsp; The number of SYN requests to do  this is big, roughly:&amp;nbsp; 65,535 hosts x  65535 ports x 2 (number of port query attempts) = 8,589,672,450 outbound SYN  packets.&amp;nbsp; If we could sustain ~3,500  outbound pps on each server, then we could finish in approximately 15 days  (within the change control window).&amp;nbsp; At  1,100 total pps, it is ~90 days, ouch!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In the mix of this engagement, there was a timely posting on  the network security &lt;a href="http://www.securityfocus.com/archive/101"&gt;pen-test  newsgroup&lt;/a&gt; asking about scanning a large network with nmap in which &lt;a href="http://www.securityfocus.com/archive/101/416490"&gt;I posted a reply&lt;/a&gt;.&amp;nbsp; I subsequently received a &lt;a href="http://www.securityfocus.com/archive/101/418822/30/0/threaded"&gt;response from  Fyodor&lt;/a&gt; (the author of nmap) which not only confirmed our experiences but  also contained a link to an updated version to better enable nmap to handle this scenario (thanks Fyodor!!).&amp;nbsp; I  haven&amp;rsquo;t had a chance to use this updated version yet, but I&amp;rsquo;m excited to check  it out.&amp;nbsp; Also I am going to explore some  home grown scanners we used while building a vulnerability scan engine and play  around with the &lt;a href="http://www.doxpara.com/read.php/docs/scanrand_logs.html"&gt;scanrand&lt;/a&gt; and &lt;a href="http://www.unicornscan.org/"&gt;unicorn&lt;/a&gt; scanners.&amp;nbsp; This ended up being a great experience and a  wake-up call to verify the tools we depend on work at the scale we need before  accepting the next job. &lt;/p&gt;


</description>
      <pubDate>Tue, 27 Dec 2005 22:51:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:d76207a6-d266-444a-a2e4-f9ccf516233c</guid>
      <author>tate@ClearNetSec.com (Tate Hansen)</author>
      <link>http://blog.clearnetsec.com/articles/2005/12/27/70-000-worth-of-new-opteron-servers-for-nmap-scanning-and-they-suck</link>
      <category>nmap</category>
      <category>v40z</category>
      <category>port</category>
      <category>scanning</category>
      <category>tuning</category>
      <category>ClearNet Security</category>
      <category>Tate Hansen</category>
    </item>
  </channel>
</rss>
