mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Added EUI-64 detection to 'Parse IPv6 address'
This commit is contained in:
parent
14e9ea699a
commit
b93c183772
1 changed files with 16 additions and 0 deletions
|
@ -209,6 +209,22 @@ var IP = {
|
||||||
output += "\nThis is a reserved multicast address.";
|
output += "\nThis is a reserved multicast address.";
|
||||||
output += "\nMulticast addresses range: ff00::/8";
|
output += "\nMulticast addresses range: ff00::/8";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Detect possible EUI-64 addresses
|
||||||
|
if ((ipv6[5] & 0xff === 0xff) && (ipv6[6] >>> 8 === 0xfe)) {
|
||||||
|
output += "\n\nThis IPv6 address contains a modified EUI-64 address, identified by the presence of FF:FE in the 12th and 13th octets.";
|
||||||
|
|
||||||
|
var intIdent = Utils.hex(ipv6[4] >>> 8) + ":" + Utils.hex(ipv6[4] & 0xff) + ":" +
|
||||||
|
Utils.hex(ipv6[5] >>> 8) + ":" + Utils.hex(ipv6[5] & 0xff) + ":" +
|
||||||
|
Utils.hex(ipv6[6] >>> 8) + ":" + Utils.hex(ipv6[6] & 0xff) + ":" +
|
||||||
|
Utils.hex(ipv6[7] >>> 8) + ":" + Utils.hex(ipv6[7] & 0xff),
|
||||||
|
mac = Utils.hex((ipv6[4] >>> 8) ^ 2) + ":" + Utils.hex(ipv6[4] & 0xff) + ":" +
|
||||||
|
Utils.hex(ipv6[5] >>> 8) + ":" + Utils.hex(ipv6[6] & 0xff) + ":" +
|
||||||
|
Utils.hex(ipv6[7] >>> 8) + ":" + Utils.hex(ipv6[7] & 0xff);
|
||||||
|
output += "\nInterface identifier: " + intIdent +
|
||||||
|
"\nMAC address: " + mac;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "Invalid IPv6 address";
|
return "Invalid IPv6 address";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue