1
0
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:
david
2013-06-18 03:44:32 +00:00
parent 1614b7f594
commit af5f103b5f

View File

@@ -39,25 +39,44 @@ categories = {"discovery", "safe"}
local enc_methods = {
["des"] = 0x80010001,
["3des"] = 0x80010005,
["aes/128"]= { 0x80010007, 0x800E0080 },
["aes/192"]= { 0x80010007, 0x800E00C0 },
["aes/256"]= { 0x80010007, 0x800E0100 }
["aes/128"] = { 0x80010007, 0x800E0080 },
["aes/192"] = { 0x80010007, 0x800E00C0 },
["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 = { ["768"] = 0x80040001, ["1024"] = 0x80040002, ["1536"]= 0x80040005}
local exchange_mode = { ["Main"] = 0x02, ["Aggressive"]= 0x04}
local protocol_ids = { ["tcp"] = "06", ["udp"]= "11"}
local group_desc = {
["768"] = 0x80040001,
["1024"] = 0x80040002,
["1536"] = 0x80040005,
}
local exchange_mode = {
["Main"] = 0x02,
["Aggressive"] = 0x04,
}
local protocol_ids = {
["tcp"] = "06",
["udp"] = "11",
}
-- Response packet types
local response_exchange_type = {
["02"] = "Main",
["04"] = "Aggressive",
["05"] = "Informational"
["05"] = "Informational",
}
-- Payload names
@@ -69,7 +88,7 @@ local payloads = {
["05"] = "ID",
["08"] = "Hash",
["0A"] = "Nonce",
["0D"] = "VID"
["0D"] = "VID",
}
@@ -125,7 +144,6 @@ end
--
local function convert_to_hex(id)
local hex_str = ""
for c in string.gmatch(id, ".") do
hex_str = hex_str .. string.format("%X", c:byte())
end
@@ -217,7 +235,6 @@ local function lookup(vendor_ids)
-- Only store the first match
if info.vendor == nil then
-- the fingerprint contains information about the VID
info.vendor = row
@@ -379,7 +396,6 @@ local function generate_aggressive(port, protocol, id, diffie)
key_length = 128
end
return bin.pack(">SHHSSHSHCHHH",
-- Key Exchange
0x0a00 , -- Next payload (Nonce)
@@ -439,7 +455,7 @@ local function generate_transform(auth, encryption, hash, group, number, total)
0x0000 , -- spacers ?
enc , -- Encryption algorithm
hash_algo[hash] , -- Hash algorithm
authentication[auth], -- Authentication method
authentication[auth] , -- Authentication method
group_desc[group] -- Group Description
)
@@ -508,7 +524,7 @@ function request(port, proto, mode, transforms, diffie, id)
l , -- packet length
--# Security Association
-- Security Association
payload_after_sa , -- Next payload (Key exchange, if aggressive mode)
l_sa , -- Length
0x00000001 , -- IPSEC