A little further down in the source for the page you will find <script src="/static/js/main.js"></script>, and following that link to http://silkeborgkommune.dk/static/js/main.js you will find the definition of the SetEmailLink function:
function SetEmailLink(id, linkCiphers, textChipers, key) {
var link = "";
var text = "";
for (var i = 0; i < linkCiphers.length; i++) {
var linkChar = linkCiphers[i] - key[i % key.length];
link += String.fromCharCode(linkChar);
}
for (var j = 0; j < textChipers.length; j++) {
var textChar = textChipers[j] - key[j % key.length];
text += String.fromCharCode(textChar);
}
var element = jQuery("#" + id);
if (element.is("a")) {
if (text != "") {
element.html(text);
}
if (link != "") {
element.attr("href", link);
}
}
}
It looks like a pretty straightforward cypher to re-implement in Perl. Figure out what that is doing, and you will be a step closer to automating the deobfuscation of the email address, as well as closer to violating the presumed intent of hiding the email address in cypher form.
Here's the relevant part, rewritten in Perl:
sub SetEmailLink {
my ( undef, $linkCiphers, undef, $key ) = @_;
my $link = q();
for( my $i = 0; $i != @$linkCiphers; ++$i ) {
my $linkChar = $linkCiphers->[$i] - $key->[$i % @$key];
$link .= chr($linkChar);
}
return $link;
};
print SetEmailLink('phmain_1_phrightcontent_0_lnkEmail', [113,104,125,
+164,118,187,87,149,128,146,184,114,53,138,161,112,176,146,143,76,160,
+188,112,114,121,154,113,190,132,80,112,152], [], [4,7,20,56,2,76,29,3
+4,12,45,83])
Note, there's also an illegal character embedded between "146" and ",184" which you will need to deal with. After removing that, here is the (partially obscured) output:
mailto:st###.vind##@silk#####.d#
Which goes to show, attempting to obscure the target of mailto: links is an inferior approach compared to server-side alternatives.
|