Skip to content

Commit

Permalink
Better hex formatting functions for nbstat
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Jun 14, 2018
1 parent 3248b7f commit 65f51df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/nbstat.nse
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ action = function(host)
end

-- MAC prefixes are matched on the first three bytes, all uppercase
local prefix = string.upper(string.format("%02x%02x%02x", statistics:byte(1), statistics:byte(2), statistics:byte(3)))
mac.address = ("%02x:%02x:%02x:%02x:%02x:%02x"):format( statistics:byte(1), statistics:byte(2), statistics:byte(3), statistics:byte(4), statistics:byte(5), statistics:byte(6) )
local prefix = string.upper(stdnse.tohex(statistics:sub(1,3)))
mac.address = stdnse.format_mac(statistics:sub(1,6))
mac.manuf = mac_prefixes[prefix] or "unknown"

host.registry['nbstat'] = {
Expand Down

0 comments on commit 65f51df

Please sign in to comment.