mirror of
https://github.com/nmap/nmap.git
synced 2025-12-08 21:51:28 +00:00
o [NSE] Added the script broadcast-tellstick-discover, which discovers Telldus
Technologies TellStickNet devices on the LAN. [Patrik Karlsson]
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o [NSE] Added the script broadcast-tellstick-discover, which discovers Telldus
|
||||
Technologies TellStickNet devices on the LAN. [Patrik Karlsson]
|
||||
|
||||
o [NSE] Added the Apache JServer Protocol (AJP) library and the scripts
|
||||
ajp-methods, ajp-headers and ajp-auth. [Patrik Karlsson]
|
||||
|
||||
|
||||
51
scripts/broadcast-tellstick-discover.nse
Normal file
51
scripts/broadcast-tellstick-discover.nse
Normal file
@@ -0,0 +1,51 @@
|
||||
description=[[
|
||||
Discovers Telldus Technologies TellStickNet devices on the LAN.
|
||||
]]
|
||||
|
||||
---
|
||||
-- @usage
|
||||
-- nmap --script broadcast-tellstick-discover
|
||||
--
|
||||
-- @output
|
||||
-- | broadcast-tellstick-discover:
|
||||
-- | Product: TellStickNet
|
||||
-- | MAC: ACCA12345678
|
||||
-- | Activation code: 8QABCDEFGH
|
||||
-- |_ Version: 3
|
||||
--
|
||||
|
||||
author = "Patrik Karlsson"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"broadcast", "safe"}
|
||||
|
||||
prerule = function() return ( nmap.address_family() == 'inet' ) end
|
||||
|
||||
local function fail(err) return ("\n ERROR: %s"):format(err or "") end
|
||||
|
||||
action = function()
|
||||
local socket = nmap.new_socket("udp")
|
||||
local host, port = { ip = "255.255.255.255" }, { number = 30303, protocol = "udp" }
|
||||
|
||||
socket:set_timeout(5000)
|
||||
if ( not(socket:sendto(host, port, "D")) ) then
|
||||
return fail("Failed to send discovery request to server")
|
||||
end
|
||||
|
||||
local status, response = socket:receive()
|
||||
if ( not(status) ) then
|
||||
return fail("Failed to receive response from server")
|
||||
end
|
||||
|
||||
local prod, mac, activation, version = response:match("^([^:]*):([^:]*):([^:]*):([^:]*)$")
|
||||
if ( not(prod) or not(mac) or not(activation) or not(version) ) then
|
||||
return
|
||||
end
|
||||
|
||||
local output = {
|
||||
("Product: %s"):format(prod),
|
||||
("MAC: %s"):format(mac),
|
||||
("Activation code: %s"):format(activation),
|
||||
("Version: %s"):format(version)
|
||||
}
|
||||
return stdnse.format_output(true, output)
|
||||
end
|
||||
@@ -38,6 +38,7 @@ Entry { filename = "broadcast-pppoe-discover.nse", categories = { "broadcast", "
|
||||
Entry { filename = "broadcast-rip-discover.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-ripng-discover.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-sybase-asa-discover.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-tellstick-discover.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-upnp-info.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-versant-locate.nse", categories = { "broadcast", "safe", } }
|
||||
Entry { filename = "broadcast-wake-on-lan.nse", categories = { "broadcast", "safe", } }
|
||||
|
||||
Reference in New Issue
Block a user