diff --git a/CHANGELOG b/CHANGELOG index 575d228e2..4f59e6f15 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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] diff --git a/scripts/broadcast-tellstick-discover.nse b/scripts/broadcast-tellstick-discover.nse new file mode 100644 index 000000000..46ae55f28 --- /dev/null +++ b/scripts/broadcast-tellstick-discover.nse @@ -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 \ No newline at end of file diff --git a/scripts/script.db b/scripts/script.db index bdd9859de..d2350da85 100644 --- a/scripts/script.db +++ b/scripts/script.db @@ -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", } }