From 1046dcab5728820692b31024e6ec1a7b6ffd1364 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 29 Dec 2010 22:37:20 +0000 Subject: [PATCH] Patch to hddtemp-info by Toni Ruotto that keeps reading past the first byte if there's a delay and supports different separator characters. --- scripts/hddtemp-info.nse | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/hddtemp-info.nse b/scripts/hddtemp-info.nse index 1f63d7686..4a861c83d 100644 --- a/scripts/hddtemp-info.nse +++ b/scripts/hddtemp-info.nse @@ -17,11 +17,13 @@ require("shortport") portrule = shortport.port_or_service (7634, "hddtemp", {"tcp"}) action = function( host, port ) - local status, data = comm.get_banner(host, port) + -- 5000B should be enough for 100 disks + local status, data = comm.get_banner(host, port, {bytes=5000}) if not status then return end - local fields = stdnse.strsplit("|", data) + local separator = string.sub(data, 1, 1) + local fields = stdnse.strsplit(separator, data) local info = {} local disks = math.floor((# fields) / 5) for i = 0, (disks - 1) do