Skip to content

Instantly share code, notes, and snippets.

@kotx
Last active November 21, 2022 23:00
Show Gist options
  • Save kotx/d6900c18cbf64591271c3ecc0f8753c1 to your computer and use it in GitHub Desktop.
Save kotx/d6900c18cbf64591271c3ecc0f8753c1 to your computer and use it in GitHub Desktop.
CyberChef recipe for Cloudflare's "email protection"

CyberChef Link

All this does is extract the string (e.g. 0a676f6d7f6763644a676f6d7f246e6f7c) and XOR's the remainder by the first byte (0a).

[
{ "op": "Comment",
"args": ["This code extracts the hex string, takes the first byte as the XOR key, and XORs it with that key. "] },
{ "op": "CSS selector",
"args": ["a[href^=\"/cdn-cgi\"]", "\\n"] },
{ "op": "Regular expression",
"args": ["User defined", "(?<=/cdn-cgi/l/email-protection#)[a-fA-F0-9]+", true, true, false, false, false, false, "List matches"] },
{ "op": "Register",
"args": ["([a-fA-F0-9]{2})", true, false, false] },
{ "op": "Regular expression",
"args": ["User defined", "(?<=^..)(.*)", true, true, false, false, false, false, "List matches"] },
{ "op": "From Hex",
"args": ["None"] },
{ "op": "XOR",
"args": [{ "option": "Hex", "string": "$R0" }, "Standard", false] }
]
Comment('This code extracts the hex string, takes the first byte as the XOR key, and XORs it with that key. ')
CSS_selector('a[href^="/cdn-cgi"]','\\n')
Regular_expression('User defined','(?<=/cdn-cgi/l/email-protection#)[a-fA-F0-9]+',true,true,false,false,false,false,'List matches')
Register('([a-fA-F0-9]{2})',true,false,false)
Regular_expression('User defined','(?<=^..)(.*)',true,true,false,false,false,false,'List matches')
From_Hex('None')
XOR({'option':'Hex','string':'$R0'},'Standard',false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment