mirror of
https://github.com/nmap/nmap.git
synced 2026-10-21 03:11:48 +00:00
Patch to hddtemp-info by Toni Ruotto that keeps reading past the first
byte if there's a delay and supports different separator characters.
This commit is contained in:
parent
77c5cd9d9a
commit
1046dcab57
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue