1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

o [NSE] Added the hddtemp-info script from Toni Ruotto, which gets

hard drive temperatures from the hddtemp service.
This commit is contained in:
david
2010-11-29 19:00:11 +00:00
parent a92eacec1d
commit f8b17ae441
3 changed files with 41 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
# Nmap Changelog ($Id$); -*-text-*- # 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, o [NSE] There is now a limit of 1,000 concurrent running scripts,
instituted to keep memory under control when there are many open 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 ports. Nathan reported 3 GB of memory use (with an out-of-memory NSE

37
scripts/hddtemp-info.nse Normal file
View File

@@ -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

View File

@@ -41,6 +41,7 @@ Entry { filename = "ftp-bounce.nse", categories = { "default", "intrusive", } }
Entry { filename = "ftp-brute.nse", categories = { "auth", "intrusive", } } Entry { filename = "ftp-brute.nse", categories = { "auth", "intrusive", } }
Entry { filename = "ftp-libopie.nse", categories = { "intrusive", "vuln", } } Entry { filename = "ftp-libopie.nse", categories = { "intrusive", "vuln", } }
Entry { filename = "giop-info.nse", categories = { "discovery", "safe", } } 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 = "hostmap.nse", categories = { "discovery", "external", "intrusive", } }
Entry { filename = "http-auth.nse", categories = { "auth", "default", "intrusive", } } Entry { filename = "http-auth.nse", categories = { "auth", "default", "intrusive", } }
Entry { filename = "http-brute.nse", categories = { "auth", "intrusive", } } Entry { filename = "http-brute.nse", categories = { "auth", "intrusive", } }