mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Fix bitcoin-info displaying incorrect last block; add user agent output
This commit is contained in:
@@ -299,12 +299,14 @@ Response = {
|
|||||||
|
|
||||||
-- Parses the raw data and builds the Version instance
|
-- Parses the raw data and builds the Version instance
|
||||||
parse = function(self)
|
parse = function(self)
|
||||||
local ra, sa, cmd, nodeid
|
local ra, sa, cmd, nodeid, pos
|
||||||
|
|
||||||
-- After 2012-02-20, version messages contain checksums
|
-- After 2012-02-20, version messages contain checksums
|
||||||
self.magic, cmd, self.len, self.checksum, self.ver_raw, self.service,
|
self.magic, cmd, self.len, self.checksum, self.ver_raw, self.service,
|
||||||
self.timestamp, ra, sa, nodeid,
|
self.timestamp, ra, sa, nodeid,
|
||||||
self.subver, self.lastblock = string.unpack("<I4 c12 I4 I4 I4 I8 I8 c26 c26 c8 B I4", self.data)
|
pos = string.unpack("<I4 c12 I4 I4 I4 I8 I8 c26 c26 c8", self.data)
|
||||||
|
pos, self.user_agent = Util.decodeVarString(self.data, pos)
|
||||||
|
self.lastblock, pos = string.unpack("<I4", self.data, pos)
|
||||||
self.nodeid = stdnse.tohex(nodeid)
|
self.nodeid = stdnse.tohex(nodeid)
|
||||||
self.cmd = string.unpack("z", cmd)
|
self.cmd = string.unpack("z", cmd)
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ action = function(host, port)
|
|||||||
result["Version"] = ver.ver
|
result["Version"] = ver.ver
|
||||||
result["Node Id"] = ver.nodeid
|
result["Node Id"] = ver.nodeid
|
||||||
result["Lastblock"] = ver.lastblock
|
result["Lastblock"] = ver.lastblock
|
||||||
|
if ver.user_agent ~= "" then
|
||||||
|
result["User Agent"] = ver.user_agent
|
||||||
|
end
|
||||||
|
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user