MAJOR=4 MINOR=49 DEVNAME=tty49 6 ˆl–äY>””¾R( ÅÕÀ½q§”Å£�þBgÝlMJônIüÿË ƒh¹ÊÉÈ 2 $ˆÅÄÊ 535Âa–äY>””¾R( ÅÕÆZ¸ ©‹FÿÉ‹½•]oÚ0†ïû+<_ì>ÒikOAD3mÓ´ '6ÄšG¶)e¿~†„–N°‰q•çµÏû¼‰�ðE<é'_¦ô>¹¡éÇw£aáÀ§^ NâúA@Ú€Á#œ;W]¬V+²êm�Ì w… À:#3G¸ã˜^„›1z�Â\0î¯(tÒ)A‡%HÏ襳’ ¿rµL•ÌvÀuaÁŠ’Ï¥„‹B“Ü’LëÊ7â:³-kÕNÀÒ�e¦–~ji+:µZ 'B¨[zиSÍ×s�óñý¶°tëgSºÝ3%e„�®0 e±@Öd™éÒBªXù�,ä#¦\„¿û“o^.ß̦!C¹ó¿íGãëIc:f…ïÇkn½æÓ³šË¹ü¨ø®ßÉÇŒkM,lfdå¤.Ÿ¤à÷Q3­lÅ<ë¥'È;ª–ð?¥Á²gaLofƒqgu$|³Ä“»ÿ÷Z1�2#J‡biDæ´Y7еƒ—ej«ëÝ-j�Œ\äS„Zè òrpâÁíç�|N&P¦˜)HŽéc¹ïôkÝv·Ûj¿iuº¨Ó» Ú¾"¯?œ�Áo"¿‡jˆ]} ŠKÒ;'…[WÂ6M} Š€g¤°¢ùš¶Å)üwIû7þÿòô€æ\ a{¼‡Pÿ{~9:ïÞ6ˆl–Ðz¾” ŠeJeAà™¸ËêbÑ¿�þDÔr,Ü¢qÖã#Åx€þÍ ƒ} 7Ì¿Ê$½local coap = require "coap" local shortport = require "shortport" local stdnse = require "stdnse" local stringaux = require "stringaux" local table = require "table" description = [[ Dumps list of available resources from CoAP endpoints. This script establishes a connection to a CoAP endpoint and performs a GET request on a resource. The default resource for our request is /.well-known/core, which should contain a list of resources provided by the endpoint. For additional information: * https://en.wikipedia.org/wiki/Constrained_Application_Protocol * https://tools.ietf.org/html/rfc7252 * https://tools.ietf.org/html/rfc6690 ]] --- -- @usage nmap -p U:5683 -sU --script coap-resources -- -- @output -- PORT STATE SERVICE REASON -- 5683/udp open coap udp-response ttl 36 -- | coap-resources: -- | /large: -- | rt: block -- | sz: 1280 -- | title: Large resource -- | /large-update: -- | ct: 0 -- | rt: block -- | sz: 55 -- | title: Large resource that can be updated using PUT method -- | /link1: -- | if: If1 -- | rt: Type1 Type2 -- |_ title: Link test resource -- -- @args coap-resources.uri URI to request via the GET method, -- /.well-known/core by default. -- -- @xmloutput -- -- 0 -- General Info --
-- -- 0 -- Faults Reporting --
-- -- 0 -- Monitor Reporting --
-- -- 0 -- Status Reporting --
-- -- 0 -- Devices Block -- Internal Clock --
-- -- 0 -- Warnings Reporting --
author = "Mak Kolybabi " license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"safe", "discovery"} -- TODO: Add 5684 "coaps" if DTLS support is added portrule = shortport.port_or_service(5683, "coap", "udp") format_payload = function(payload) -- Leave strings alone. if type(payload) == "string" then return payload end local tbl = stdnse.output_table() -- We want to go through all of the links in alphabetical order. table.sort(payload, function(a,b) return a.name < b.name end) for _, link in ipairs(payload) do -- We want to go through all of the parameters in alphabetical -- order. table.sort(link.parameters, function(a,b) return a.name < b.name end) local row = stdnse.output_table() for _, param in ipairs(link.parameters) do row[param.name] = param.value end tbl[link.name] = row end return tbl end get_blocks = function(helper, options, b2opt, payload, max_reqs) -- Initialize the block table to store all of our received blocks. local blocks = {} blocks[b2opt.number] = payload -- If we don't know the number of the last block, we'll need to use -- the largest number we've seen as the maxumum. local max = b2opt.number -- If the first block we received happens to be the last one, eithe