Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- description = [[
- Shows the index of the default page of a web server.
- ]]
- ---
- --@output
- -- Interesting ports on scanme.nmap.org (64.13.134.52):
- -- PORT STATE SERVICE
- -- 80/tcp open http
- author = "A. Ramos"
- license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
- categories = {"default", "discovery", "safe"}
- local url = require 'url'
- local dns = require 'dns'
- local http = require 'http'
- local ipOps = require 'ipOps'
- local stdnse = require 'stdnse'
- portrule = function(host, port)
- local svc = { std = { ["http"] = 1, ["http-alt"] = 1 },
- ssl = { ["https"] = 1, ["https-alt"] = 1 } }
- if port.protocol ~= 'tcp'
- or not ( svc.std[port.service] or svc.ssl[port.service] ) then
- return false
- end
- -- Don't bother running on SSL ports if we don't have SSL.
- if (svc.ssl[port.service] or port.version.service_tunnel == 'ssl')
- and not nmap.have_ssl() then
- return false
- end
- return true
- end
- action = function(host, port)
- local data, result, output
- local MAX_SIZE = 5000
- result = http.get( host, port, '/DVR.cfg', {bypass_cache = true, no_cache = true, no_cache_body = true, max_content_length = MAX_SIZE
- } )
- output = result.rawheader
- table.insert(output, result.body)
- return stdnse.format_output(true, output)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement