Nmap Development mailing list archives

Re: [NSE] Script for HTML generator meta tag


From: Patrick Donnelly <batrick () batbytes com>
Date: Tue, 10 Jan 2012 20:01:05 -0500

On Tue, Jan 10, 2012 at 8:03 AM, Michael Kohl <citizen428 () gmail com> wrote:
Hi,

as an exercise for getting started with NSE, I wrote a little script
to extract the contents of the generator meta tag if there is one:

PORT    STATE SERVICE
21/tcp  open  ftp
22/tcp  open  ssh
25/tcp  open  smtp
80/tcp  open  http
|_generator: TYPO3 4.2 CMS
111/tcp open  rpcbind
199/tcp open  smux
443/tcp open  https
|_generator: TYPO3 4.2 CMS

The script can be found here, maybe it's useful enough for others to
include in the distribution:

https://gist.github.com/903f268b5ebfe932f4dc


   for line in response.body:gmatch("[^\r\n]+") do
      generator = line:match(pattern)
      if generator then
         return generator
      end
  end

can simply be

  return response.body:match(pattern)

Thanks for sharing your script!

-- 
- Patrick Donnelly
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: