mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-26 17:56:15 -04:00
Merge 68f69d690f
into 7c8be12d52
This commit is contained in:
commit
0c2f0acfe7
6 changed files with 186 additions and 7 deletions
|
@ -249,7 +249,7 @@ module.exports = {
|
|||
testOpHtml(browser, "Parse colour code", "#000", ".colorpicker-preview", "rgb(0, 0, 0)");
|
||||
testOpHtml(browser, "Parse DateTime", "01/12/2000 13:00:00", "", /Date: Friday 1st December 2000/);
|
||||
// testOp(browser, "Parse IP range", "test input", "test_output");
|
||||
testOpHtml(browser, "Parse IPv4 header", "45 c0 00 c4 02 89 00 00 ff 11 1e 8c c0 a8 0c 01 c0 a8 0c 02", "tr:last-child td:last-child", "192.168.12.2");
|
||||
testOpHtml(browser, "Parse IPv4 header", "45 c0 00 c4 02 89 00 00 ff 11 1e 8c c0 a8 0c 01 c0 a8 0c 02", "tr:nth-last-child(2) td:last-child", "192.168.12.2");
|
||||
// testOp(browser, "Parse IPv6 address", "test input", "test_output");
|
||||
// testOp(browser, "Parse ObjectID timestamp", "test input", "test_output");
|
||||
// testOp(browser, "Parse QR Code", "test input", "test_output");
|
||||
|
|
|
@ -115,6 +115,7 @@ import "./tests/NetBIOS.mjs";
|
|||
import "./tests/NormaliseUnicode.mjs";
|
||||
import "./tests/NTLM.mjs";
|
||||
import "./tests/OTP.mjs";
|
||||
import "./tests/ParseEthernetFrame.mjs";
|
||||
import "./tests/ParseIPRange.mjs";
|
||||
import "./tests/ParseObjectIDTimestamp.mjs";
|
||||
import "./tests/ParseQRCode.mjs";
|
||||
|
|
45
tests/operations/tests/ParseEthernetFrame.mjs
Normal file
45
tests/operations/tests/ParseEthernetFrame.mjs
Normal file
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Parse Ethernet frame tests.
|
||||
*
|
||||
* @author tedk [tedk@ted.do]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import TestRegister from "../../lib/TestRegister.mjs";
|
||||
|
||||
TestRegister.addTests([
|
||||
{
|
||||
name: "Parse plain Ethernet frame",
|
||||
input: "000000000000ffffffffffff08004500",
|
||||
expectedOutput: "Source MAC: ff:ff:ff:ff:ff:ff\nDestination MAC: 00:00:00:00:00:00\nData:\n45 00",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse Ethernet frame",
|
||||
"args": ["Hex", "Text output"]
|
||||
}
|
||||
]
|
||||
},
|
||||
// Example PCAP data from: https://packetlife.net/captures/protocol/vlan/
|
||||
{
|
||||
name: "Parse Ethernet frame with one VLAN tag (802.1q)",
|
||||
input: "01000ccdcdd00013c3dfae188100a0760165aaaa",
|
||||
expectedOutput: "Source MAC: 00:13:c3:df:ae:18\nDestination MAC: 01:00:0c:cd:cd:d0\nVLAN: 117\nData:\naa aa",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse Ethernet frame",
|
||||
"args": ["Hex", "Text output"]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Parse Ethernet frame with two VLAN tags (802.1ad)",
|
||||
input: "0019aa7de688002155c8f13c810000d18100001408004500",
|
||||
expectedOutput: "Source MAC: 00:21:55:c8:f1:3c\nDestination MAC: 00:19:aa:7d:e6:88\nVLAN: 16, 128\nData:\n45 00",
|
||||
recipeConfig: [
|
||||
{
|
||||
"op": "Parse Ethernet frame",
|
||||
"args": ["Hex", "Text output"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue