-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloudflare-man-in-the-middle-mitigation.js
More file actions
99 lines (95 loc) · 2.06 KB
/
cloudflare-man-in-the-middle-mitigation.js
File metadata and controls
99 lines (95 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// From https://usamaejaz.com/cloudflare-email-decoding/
function cfDecodeEmail(encodedString) {
var email = '',
r = parseInt(encodedString.substr(0, 2), 16),
n,
i;
for (n = 2; encodedString.length - n; n += 2) {
i = parseInt(encodedString.substr(n, 2), 16) ^ r;
email += String.fromCharCode(i);
}
return email;
}
console.log(cfDecodeEmail('543931142127353935313e352e7a373b39'));
/////
!(function () {
'use strict';
function e(e) {
try {
if ('undefined' == typeof console) return;
'error' in console ? console.error(e) : console.log(e);
} catch (e) {}
}
function t(e) {
return (
(d.innerHTML = '<a href="' + e.replace(/"/g, '"') + '"></a>'),
d.childNodes[0].getAttribute('href') || ''
);
}
function r(e, t) {
var r = e.substr(t, 2);
return parseInt(r, 16);
}
function n(n, c) {
for (var o = '', a = r(n, c), i = c + 2; i < n.length; i += 2) {
var l = r(n, i) ^ a;
o += String.fromCharCode(l);
}
try {
o = decodeURIComponent(escape(o));
} catch (u) {
e(u);
}
return t(o);
}
function c(t) {
for (var r = t.querySelectorAll('a'), c = 0; c < r.length; c++)
try {
var o = r[c],
a = o.href.indexOf(l);
a > -1 && (o.href = 'mailto:' + n(o.href, a + l.length));
} catch (i) {
e(i);
}
}
function o(t) {
for (var r = t.querySelectorAll(u), c = 0; c < r.length; c++)
try {
var o = r[c],
a = o.parentNode,
i = o.getAttribute(f);
if (i) {
var l = n(i, 0),
d = document.createTextNode(l);
a.replaceChild(d, o);
}
} catch (h) {
e(h);
}
}
function a(t) {
for (var r = t.querySelectorAll('template'), n = 0; n < r.length; n++)
try {
i(r[n].content);
} catch (c) {
e(c);
}
}
function i(t) {
try {
c(t), o(t), a(t);
} catch (r) {
e(r);
}
}
var l = '/cdn-cgi/l/email-protection#',
u = '.__cf_email__',
f = 'data-cfemail',
d = document.createElement('div');
i(document),
(function () {
var e =
document.currentScript || document.scripts[document.scripts.length - 1];
e.parentNode.removeChild(e);
})();
})();