<?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/"
	>

<channel>
	<title>webstersprodigy.net &#187; nmap</title>
	<atom:link href="http://webstersprodigy.net/tag/nmap/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstersprodigy.net</link>
	<description>Me trying to learn how to use a computer</description>
	<lastBuildDate>Sat, 04 Feb 2012 01:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>nmap script to try and detect login pages</title>
		<link>http://webstersprodigy.net/2010/04/nmap-script-to-try-and-detect-login-pages/</link>
		<comments>http://webstersprodigy.net/2010/04/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.]]></description>
			<content:encoded><![CDATA[<p>The title sort of explains it.</p>
<pre class="brush: python; title: ; notranslate">
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>
]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2010/04/nmap-script-to-try-and-detect-login-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>bash script for nmap list scan</title>
		<link>http://webstersprodigy.net/2009/10/bash-script-for-nmap-list-scan/</link>
		<comments>http://webstersprodigy.net/2009/10/bash-script-for-nmap-list-scan/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 05:24:33 +0000</pubDate>
		<dc:creator>webstersprodigy</dc:creator>
				<category><![CDATA[GrayHat]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[nmap]]></category>

		<guid isPermaLink="false">http://webstersprodigy.net/?p=624</guid>
		<description><![CDATA[This is a stupid script to scan a class b network. I only wanted a detailed scan of hosts that exist (which I generated with a ping scan). I also wanted this information separated by file.]]></description>
			<content:encoded><![CDATA[<p>This is a stupid script to scan a class b network. I only wanted a detailed scan of hosts that exist (which I generated with a ping scan). I also wanted this information separated by file.</p>
<p>So this takes every class C within the class B and checks to see if there are any IPs in it. If there are, it nmaps the ones that exist and writes them to their own file.</p>
<p>Also, the IP range is 10.1, so change as needed.</p>
<pre class="brush: bash; title: ; notranslate">

#!/bin/bash
for i in {1..254}; do
  cat iplist_sorted.txt |grep &quot;10[.]1[.]$i&quot; &gt; /dev/null
  #if there are hosts on this class C
  if [ $? -eq 0 ]; then
    echo &quot;nmaping $i&quot;
    cat iplist_sorted.txt |grep &quot;10[.]1[.]$i[.]&quot; &gt; ./ip_tmplist_$i
    #of course, specific scans will vary
    nmap -iL ./ip_tmplist_$i -sS -T4 -n -A -v --top-ports 2000 -oN ./nmap_10.1.$i.Xscan max-rtt-timeout 200
    rm ./ip_tmplist_$i
  fi
done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webstersprodigy.net/2009/10/bash-script-for-nmap-list-scan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

