Skip to content

Instantly share code, notes, and snippets.

@ericek111
Created November 19, 2020 15:22
Show Gist options
  • Save ericek111/75187f89df1813b8ba6f310d4ce3316d to your computer and use it in GitHub Desktop.
Save ericek111/75187f89df1813b8ba6f310d4ce3316d to your computer and use it in GitHub Desktop.
CloudFlare e-mail obfuscator cracker in PHP
<?php
$doc = new \DOMDocument();
@$doc->loadHTMLFile($argv[1] ?? "https://baraja.cz/zivotopis");
$xpath = new \DOMXPath($doc);
function r($e, $t) {
return hexdec(substr($e, $t, 2));
}
function n($n, $c) {
$o = "";
for ($a = r($n, $c), $i = $c + 2; $i < strlen($n); $i += 2) {
$l = r($n, $i) ^ $a;
$o .= chr($l);
}
return $o;
}
$els = $xpath->query("//*[@data-cfemail]");
foreach ($els as $el) {
$attr = $el->parentNode->getAttribute("href");
$attr = parse_url($attr, PHP_URL_FRAGMENT);
echo n($attr, 0) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment