Created
November 19, 2020 15:22
-
-
Save ericek111/75187f89df1813b8ba6f310d4ce3316d to your computer and use it in GitHub Desktop.
CloudFlare e-mail obfuscator cracker in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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