<?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 port</title>
    <link>http://blog.clearnetsec.com/articles/tag/port</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <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>
