mirror of
https://github.com/nmap/nmap.git
synced 2025-12-20 22:49:01 +00:00
Whitespace in ike.lua.
This commit is contained in:
@@ -41,23 +41,42 @@ local enc_methods = {
|
|||||||
["3des"] = 0x80010005,
|
["3des"] = 0x80010005,
|
||||||
["aes/128"] = { 0x80010007, 0x800E0080 },
|
["aes/128"] = { 0x80010007, 0x800E0080 },
|
||||||
["aes/192"] = { 0x80010007, 0x800E00C0 },
|
["aes/192"] = { 0x80010007, 0x800E00C0 },
|
||||||
["aes/256"]= { 0x80010007, 0x800E0100 }
|
["aes/256"] = { 0x80010007, 0x800E0100 },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local authentication= {
|
||||||
|
["psk"] = 0x80030001,
|
||||||
|
["rsa"] = 0x80030003,
|
||||||
|
["Hybrid"] = 0x8003FADD,
|
||||||
|
["XAUTH"] = 0x8003FDE9,
|
||||||
|
}
|
||||||
|
|
||||||
local authentication= { ["psk"] = 0x80030001, ["rsa"] = 0x80030003, ["Hybrid"] = 0x8003FADD, ["XAUTH"] = 0x8003FDE9}
|
local hash_algo = {
|
||||||
|
["md5"] = 0x80020001,
|
||||||
|
["sha1"] = 0x80020002,
|
||||||
|
}
|
||||||
|
|
||||||
local hash_algo = { ["md5"] = 0x80020001, ["sha1"] = 0x80020002}
|
local group_desc = {
|
||||||
local group_desc = { ["768"] = 0x80040001, ["1024"] = 0x80040002, ["1536"]= 0x80040005}
|
["768"] = 0x80040001,
|
||||||
local exchange_mode = { ["Main"] = 0x02, ["Aggressive"]= 0x04}
|
["1024"] = 0x80040002,
|
||||||
local protocol_ids = { ["tcp"] = "06", ["udp"]= "11"}
|
["1536"] = 0x80040005,
|
||||||
|
}
|
||||||
|
|
||||||
|
local exchange_mode = {
|
||||||
|
["Main"] = 0x02,
|
||||||
|
["Aggressive"] = 0x04,
|
||||||
|
}
|
||||||
|
|
||||||
|
local protocol_ids = {
|
||||||
|
["tcp"] = "06",
|
||||||
|
["udp"] = "11",
|
||||||
|
}
|
||||||
|
|
||||||
-- Response packet types
|
-- Response packet types
|
||||||
local response_exchange_type = {
|
local response_exchange_type = {
|
||||||
["02"] = "Main",
|
["02"] = "Main",
|
||||||
["04"] = "Aggressive",
|
["04"] = "Aggressive",
|
||||||
["05"] = "Informational"
|
["05"] = "Informational",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Payload names
|
-- Payload names
|
||||||
@@ -69,7 +88,7 @@ local payloads = {
|
|||||||
["05"] = "ID",
|
["05"] = "ID",
|
||||||
["08"] = "Hash",
|
["08"] = "Hash",
|
||||||
["0A"] = "Nonce",
|
["0A"] = "Nonce",
|
||||||
["0D"] = "VID"
|
["0D"] = "VID",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -125,7 +144,6 @@ end
|
|||||||
--
|
--
|
||||||
local function convert_to_hex(id)
|
local function convert_to_hex(id)
|
||||||
local hex_str = ""
|
local hex_str = ""
|
||||||
|
|
||||||
for c in string.gmatch(id, ".") do
|
for c in string.gmatch(id, ".") do
|
||||||
hex_str = hex_str .. string.format("%X", c:byte())
|
hex_str = hex_str .. string.format("%X", c:byte())
|
||||||
end
|
end
|
||||||
@@ -217,7 +235,6 @@ local function lookup(vendor_ids)
|
|||||||
|
|
||||||
-- Only store the first match
|
-- Only store the first match
|
||||||
if info.vendor == nil then
|
if info.vendor == nil then
|
||||||
|
|
||||||
-- the fingerprint contains information about the VID
|
-- the fingerprint contains information about the VID
|
||||||
info.vendor = row
|
info.vendor = row
|
||||||
|
|
||||||
@@ -379,7 +396,6 @@ local function generate_aggressive(port, protocol, id, diffie)
|
|||||||
key_length = 128
|
key_length = 128
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return bin.pack(">SHHSSHSHCHHH",
|
return bin.pack(">SHHSSHSHCHHH",
|
||||||
-- Key Exchange
|
-- Key Exchange
|
||||||
0x0a00 , -- Next payload (Nonce)
|
0x0a00 , -- Next payload (Nonce)
|
||||||
@@ -508,7 +524,7 @@ function request(port, proto, mode, transforms, diffie, id)
|
|||||||
l , -- packet length
|
l , -- packet length
|
||||||
|
|
||||||
|
|
||||||
--# Security Association
|
-- Security Association
|
||||||
payload_after_sa , -- Next payload (Key exchange, if aggressive mode)
|
payload_after_sa , -- Next payload (Key exchange, if aggressive mode)
|
||||||
l_sa , -- Length
|
l_sa , -- Length
|
||||||
0x00000001 , -- IPSEC
|
0x00000001 , -- IPSEC
|
||||||
|
|||||||
Reference in New Issue
Block a user