mirror of
https://github.com/nmap/nmap.git
synced 2026-01-02 12:59:02 +00:00
Modified code used to create the PPPoE host unique tag [Patrik]
This commit is contained in:
@@ -434,19 +434,16 @@ PPPoE = {
|
||||
-- @param value string/number containing the tag value
|
||||
-- @return o instance of ConfigNak
|
||||
new = function(self, tags)
|
||||
local c = tostring(coroutine.running())
|
||||
c = c:match("^thread: 0x(.*)"):sub(1, 8)
|
||||
|
||||
math.randomseed(os.time())
|
||||
while ( #c < 8 ) do
|
||||
c = c .. stdnse.tohex(math.random(255))
|
||||
local c = ""
|
||||
for i=1, 4 do
|
||||
c = c .. math.random(255)
|
||||
end
|
||||
|
||||
local o = {
|
||||
header = PPPoE.Header:new(PPPoE.Code.PADI),
|
||||
tags = tags or {
|
||||
PPPoE.Tag:new(PPPoE.TagType.SERVICE_NAME),
|
||||
PPPoE.Tag:new(PPPoE.TagType.HOST_UNIQUE, bin.pack("H", c))
|
||||
PPPoE.Tag:new(PPPoE.TagType.HOST_UNIQUE, bin.pack("A", c))
|
||||
}
|
||||
}
|
||||
setmetatable(o, self)
|
||||
|
||||
Reference in New Issue
Block a user