1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00
Files
nmap/scripts/rtsp-methods.nse
batrick 810f7d4803 more stdnse.print_debug -> stdnse.debug
This is a catchall pattern with a few exclusions.

$ sed -i 's/stdnse.print_debug( *\([0-9]*\) *, *\(.*\))/stdnse.debug\1(\2)/' *.nse
$ sed -i 's/stdnse.print_debug(\(.*\))/stdnse.debug1(\1)/' *.nse

Excluded:
$ svn revert db2-das-info.nse
$ svn revert flume-master-info.nse
$ svn revert http-headers.nse
$ svn revert http-methods.nse
$ svn revert http-unsafe-output-escaping.nse
$ svn revert http-userdir-enum.nse
$ svn revert http-vuln-cve2011-3192.nse
$ svn revert http-vuln-wnr1000-creds.nse
$ svn revert http-wordpress-plugins.nse
$ svn revert telnet-brute.nse
2014-08-02 02:46:16 +00:00

50 lines
1.2 KiB
Lua

local rtsp = require "rtsp"
local shortport = require "shortport"
local stdnse = require "stdnse"
description = [[
Determines which methods are supported by the RTSP (real time streaming protocol) server.
]]
---
-- @usage
-- nmap -p 554 --script rtsp-methods <ip>
--
-- @output
-- PORT STATE SERVICE
-- 554/tcp open rtsp
-- | rtsp-methods:
-- |_ DESCRIBE, SETUP, PLAY, TEARDOWN, OPTIONS
--
-- @args rtsp-methods.path the path to query, defaults to "*" which queries
-- the server itself, rather than a specific url.
--
--
-- Version 0.1
-- Created 23/10/2011 - v0.1 - created by Patrik Karlsson <patrik@cqure.net>
--
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default", "safe"}
portrule = shortport.port_or_service(554, "rtsp", "tcp", "open")
action = function(host, port)
local path = stdnse.get_script_args('rtsp-methods.path') or '*'
local helper = rtsp.Helper:new(host, port)
local status = helper:connect()
if ( not(status) ) then
stdnse.debug2("ERROR: Failed to connect to RTSP server")
return
end
local response
status, response = helper:options(path)
helper:close()
if ( status ) then
return stdnse.format_output(true, response.headers['Public'])
end
end