Advertisement
Guest User

getdvr.cfg nmap

a guest
Jan 25th, 2013
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. description = [[
  2. Shows the index of the default page of a web server.
  3. ]]
  4.  
  5. ---
  6. --@output
  7. -- Interesting ports on scanme.nmap.org (64.13.134.52):
  8. -- PORT   STATE SERVICE
  9. -- 80/tcp open  http
  10.  
  11. author = "A. Ramos"
  12.  
  13. license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
  14.  
  15. categories = {"default", "discovery", "safe"}
  16.  
  17.  
  18. local url    = require 'url'
  19. local dns    = require 'dns'
  20. local http   = require 'http'
  21. local ipOps  = require 'ipOps'
  22. local stdnse = require 'stdnse'
  23.  
  24. portrule = function(host, port)
  25.         local svc = { std = { ["http"] = 1, ["http-alt"] = 1 },
  26.                                 ssl = { ["https"] = 1, ["https-alt"] = 1 } }
  27.         if port.protocol ~= 'tcp'
  28.         or not ( svc.std[port.service] or svc.ssl[port.service] ) then
  29.                 return false
  30.         end
  31.         -- Don't bother running on SSL ports if we don't have SSL.
  32.         if (svc.ssl[port.service] or port.version.service_tunnel == 'ssl')
  33.         and not nmap.have_ssl() then
  34.                 return false
  35.         end
  36.         return true
  37. end
  38.  
  39.  
  40. action = function(host, port)
  41.  
  42.   local data, result, output
  43.   local MAX_SIZE = 5000
  44.  
  45.   result = http.get( host, port, '/DVR.cfg', {bypass_cache = true, no_cache = true, no_cache_body = true, max_content_length = MAX_SIZE
  46. } )
  47.  
  48.   output = result.rawheader
  49.  
  50.         table.insert(output, result.body)
  51.   return stdnse.format_output(true, output)
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement