diff --git a/CHANGELOG b/CHANGELOG index 666c005cc..74a264976 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [NSE] Added the hddtemp-info script from Toni Ruotto, which gets + hard drive temperatures from the hddtemp service. + o [NSE] There is now a limit of 1,000 concurrent running scripts, instituted to keep memory under control when there are many open ports. Nathan reported 3 GB of memory use (with an out-of-memory NSE diff --git a/scripts/hddtemp-info.nse b/scripts/hddtemp-info.nse new file mode 100644 index 000000000..78f9e9040 --- /dev/null +++ b/scripts/hddtemp-info.nse @@ -0,0 +1,37 @@ +description = [[ +Reads hard disk information from hddtemp service. +]] + +--- +-- @output +-- 7634/tcp open hddtemp +-- |_hddtemp-info: /dev/sda: WDC WD2500JS-60MHB1: 38 C + +author = "Toni Ruottu" +license = "Same as Nmap--See http://nmap.org/book/man-legal.html" +categories = {"default", "discovery", "safe"} + +require("comm") +require("shortport") + +portrule = shortport.port_or_service (7634, "hddtemp", {"tcp"}) + +action = function( host, port ) + local status, data = comm.get_banner(host, port) + if not status then + return + end + local fields = stdnse.strsplit("|", data) + local info = {} + local disks = math.floor((# fields) / 5) + for i = 0, (disks - 1) do + local start = i * 5 + local device = fields[start + 2] + local label = fields[start + 3] + local temperature = fields[start + 4] + local unit = fields[start + 5] + local formatted = string.format("%s: %s: %s %s", device, label, temperature, unit) + table.insert(info, formatted) + end + return stdnse.format_output(true, info) +end diff --git a/scripts/script.db b/scripts/script.db index 4d783b734..37286ad83 100644 --- a/scripts/script.db +++ b/scripts/script.db @@ -41,6 +41,7 @@ Entry { filename = "ftp-bounce.nse", categories = { "default", "intrusive", } } Entry { filename = "ftp-brute.nse", categories = { "auth", "intrusive", } } Entry { filename = "ftp-libopie.nse", categories = { "intrusive", "vuln", } } Entry { filename = "giop-info.nse", categories = { "discovery", "safe", } } +Entry { filename = "hddtemp-info.nse", categories = { "default", "discovery", "safe", } } Entry { filename = "hostmap.nse", categories = { "discovery", "external", "intrusive", } } Entry { filename = "http-auth.nse", categories = { "auth", "default", "intrusive", } } Entry { filename = "http-brute.nse", categories = { "auth", "intrusive", } }