<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>WebstersProdigy &#187; nmap</title>
	<atom:link href="http://webstersprodigy.net/tag/nmap/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstersprodigy.net</link>
	<description>Updates every other Friday... usually</description>
	<lastBuildDate>Sat, 26 May 2012 06:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='webstersprodigy.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>WebstersProdigy &#187; nmap</title>
		<link>http://webstersprodigy.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://webstersprodigy.net/osd.xml" title="WebstersProdigy" />
	<atom:link rel='hub' href='http://webstersprodigy.net/?pushpress=hub'/>
		<item>
		<title>nmap script to try and detect login pages</title>
		<link>http://webstersprodigy.net/2010/04/07/nmap-script-to-try-and-detect-login-pages/</link>
		<comments>http://webstersprodigy.net/2010/04/07/nmap-script-to-try-and-detect-login-pages/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 20:18:00 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[nmap]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=660</guid>
		<description><![CDATA[The title sort of explains it.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=660&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The title sort of explains it.</p>
<p><pre class="brush: python;">
description = [[
Attempts to check if a login page exists on the port.
]]

---
-- @output
-- 80/tcp open  http
-- |_ http-login-form: HTTP login detected

-- HTTP authentication information gathering script
-- rev 1.0 (2010-02-06)

author = &quot;Rich Lundeen &lt;mopey@webstersprodigy.net&gt;&quot;

license = &quot;Same as Nmap--See http://nmap.org/book/man-legal.html&quot;

categories = {&quot;ioactive&quot;}

require(&quot;shortport&quot;)
require(&quot;http&quot;)
require(&quot;pcre&quot;)

portrule = shortport.port_or_service({80, 443, 8080}, {&quot;http&quot;,&quot;https&quot;})

parse_url = function(url)
  local re = pcre.new(&quot;^([^:]*):[/]*([^/]*)&quot;, 0, &quot;C&quot;)
  local s, e, t = re:exec(url, 0, 0)
  local proto = string.sub(url, t[1], t[2])
  local host = string.sub(url, t[3], t[4])
  local path = string.sub(url, t[4] + 1)
  local port = string.find(host, &quot;:&quot;)
  if port ~= nil then
    --TODO check bounds, sanity, cast port to an int
    local thost = string.sub(host, 0, port-1)
    port = string.sub(host, port+1)
    host = thost
  else
    if proto == &quot;http&quot; then
      port = 80
    elseif proto == &quot;https&quot; then
      port = 443
    end
  end
  return host, port, path
end

--attempting to be compatible with nessus function in http.inc
--in this case, host is a url - it should use get_http_page
--get_http_page = function(port, host, redirect)
  

--port and url are objects passed to the action function
--redirect an integer to prohibit loops
get_http_page_nmap = function(port, host, redirect, path)
  if path == nil then
    path = &quot;/&quot;
  end
  if redirect == nil then
    redirect = 2
  end
  local answer = http.get(host, port, path)
  if ((answer.header.location ~= nil) and (redirect &gt; 0) and 
      (answer.status &gt;=300) and (answer.status &lt; 400)) then
    nhost, nport, npath = parse_url(answer.header.location)
    if (((nhost ~= host.targetname) and (nhost ~= host.ip) and 
        (nhost ~= host.name)) or nport ~= port.number ) then
      --cannot redirect more, different service
      return answer, path
    else
      return get_http_page_nmap(port, host, redirect-1, npath)
    end
  end
  return answer, path
end

action = function(host, port)
  local result, path = get_http_page_nmap(port, host, 3)
  --seems to be a bug in the matching
  local loginflags = pcre.flags().CASELESS + pcre.flags().MULTILINE
  local loginre = {
     pcre.new(&quot;&lt;script&gt;[^&gt;]*login&quot;    , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;[^&gt;]*login&quot;           , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;script&gt;[^&gt;]*password&quot; , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;script&gt;[^&gt;]*user&quot;     , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;input[^&gt;)]*user&quot;      , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;input[^&gt;)]*pass&quot;      , loginflags, &quot;C&quot;),
     pcre.new(&quot;&lt;input[^&gt;)]*pwd&quot;       , loginflags, &quot;C&quot;) }

  local loginform = false
  for i,v in ipairs(loginre) do
    local ismatch, j = v:match(result.body, 0)
    if ismatch then
      loginform = true
      break
      end
  end
  if loginform then
    return &quot;Login Form Detected at &quot; .. path
  end
end
</pre> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/660/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/660/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/660/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=660&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2010/04/07/nmap-script-to-try-and-detect-login-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>Unintended consequences of half open scans</title>
		<link>http://webstersprodigy.net/2008/02/21/unintended-consequences-of-half-open-scans/</link>
		<comments>http://webstersprodigy.net/2008/02/21/unintended-consequences-of-half-open-scans/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 09:04:44 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[tcp]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=264</guid>
		<description><![CDATA[Short analysis of the nmap half open scans (also called syn scans).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=264&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Short analysis of the nmap half open scans (also called syn scans).</p>
<p>These scans are distinguished from the default operation of full connection scans, which completes the full tcp handshake. i.e.</p>
<blockquote><p>SYN &#8211;&gt;<br />
&lt;&#8212;SYN+ACK<br />
ACK&#8211;&gt;</p></blockquote>
<p>A half open scan just does</p>
<blockquote><p>SYN&#8211;&gt;<br />
&lt;&#8211;SYN+ACK</p></blockquote>
<p>The scanner determines weather the port is up or not based on if the SYN+ACK comes back.  Obviously, the final ack is never sent back.  This can be performed by</p>
<blockquote><p>$ nmap -P0 -sS target</p></blockquote>
<p>This was a popular method due to it being &#8216;stealthy&#8217; though it&#8217;s not so much stealthy anymore and because it&#8217;s fast &#8211; though it doesn&#8217;t seem to be faster than a full connection scan in practice.</p>
<p>Anyways, now to something everyone doesn&#8217;t already know (maybe, at least I didn&#8217;t).</p>
<p>nmap uses raw sockets to craft these packets, which is why syn scans must be run as root.  What&#8217;s interesting is that if the remote host responds with a SYN+ACK &#8211; the local stack receives this packet, which did not come from the local stack (because again, it was crafted with a raw socket by nmap).  As far as the scanning computer knows, the SYN+ACK is not part of a handshake and appears to have come out of nowhere, so the scanner sends a RST back to the target system.  Nuts.</p>
<p>You can stop this by using simple iptables, on INPUT or OUTPUT, by having a default drop policy (only allowing ESTABLISHED,RELATED and known services through is probably a good rule of thumb).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/webstersprodigy.wordpress.com/264/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/webstersprodigy.wordpress.com/264/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=264&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2008/02/21/unintended-consequences-of-half-open-scans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
		<item>
		<title>scanrand</title>
		<link>http://webstersprodigy.net/2007/07/06/scanrand/</link>
		<comments>http://webstersprodigy.net/2007/07/06/scanrand/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 03:34:03 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Security Tools]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[portscan]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=175</guid>
		<description><![CDATA[scanrand is a cool tool for network scanning written by Dan Kaminski.  The big advantage to this tool as a network scanner is that it can scan very large networks very very fast.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=175&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>scanrand is a cool tool for network scanning written by Dan Kaminski.  The big advantage to this tool as a network scanner is that it can scan very large networks very very fast.</p>
<p>It works by splitting into two completely independent processes, one for sending packets and one for receiving them.  The sending process fires off syn packets and doesn&#8217;t try to retain state information.  Also, the receiving process doesn&#8217;t retain state.  It works by using a stateful protocol in a stateless way.</p>
<p>How does this prevent a smart router or something from just sending weird information in response to  a detected scan?</p>
<p>Normally, an ISN of a syn packet is meant to be basically random.  scanrand builds a deterministic iSN by running the source ip source port destination ip and destination port concatinated with a secret key and run through a one way hashing function &#8211; meaning these &#8220;random&#8221; isns can be calculated. this is called an &#8220;inverse syn cookie&#8221;.</p>
<p>Awesome.</p>
<p>Again, to reiterate the advantages:a class C network has been known to be scanned in as little as four seconds with this tool.</p>
<p>Here is how I tried it on my local network:</p>
<blockquote><p>scanrand -d eth1 -b10M 192.168.1.1-254:quick
</p></blockquote>
<p>pretty simple.  the 10M limits the scan to 10 mbps.  One thing with scanrand is you probably ususally want to throttle the traffic -or else your network could easily become overloaded.  the -d eth1 is just specifying my wireless card.  the 192.168.1.1-254:quick is specifying which IPs and ports to scan.  quick is a shortcut meaning ports</p>
<blockquote><p>80,443,445,53,20-23,25,135,139,8080, 110,111,143,1025,5000,465,993,31337, 79,8010,8000,6667,2049,3306</p></blockquote>
<p>the biggest disadvantage might be how noisy it is.  But it&#8217;s not meant to be quiet.</p>
<p>Anyway, this is a pretty innovative &#8220;why didn&#8217;t I think of that&#8221; tools.  Give it a try.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/webstersprodigy.wordpress.com/175/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/webstersprodigy.wordpress.com/175/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webstersprodigy.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webstersprodigy.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webstersprodigy.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webstersprodigy.net&#038;blog=35949064&#038;post=175&#038;subd=webstersprodigy&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2007/07/06/scanrand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/be2c27a28b3788a3b9a7a8fa243d2978?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">webstersprodigy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
