mirror of
https://github.com/nmap/nmap.git
synced 2025-12-29 10:59:02 +00:00
o [NSE] Added the scripts rtsp-url-brute, rtsp-methods and the supporting rtsp
library. The scripts check the supported RTSP methods and attempt to brute force valid RTSP urls. [Patrik]
This commit is contained in:
47
scripts/rtsp-methods.nse
Normal file
47
scripts/rtsp-methods.nse
Normal file
@@ -0,0 +1,47 @@
|
||||
description = [[
|
||||
Finds out what methods are supported by the RTSP 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 <patrik@cqure.net>"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"default", "safe"}
|
||||
|
||||
require 'rtsp'
|
||||
require 'shortport'
|
||||
|
||||
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.print_debug(2, "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
|
||||
Reference in New Issue
Block a user