initial commit
This commit is contained in:
32
CTF/Decryptify1.2/php/invite_code.php
Normal file
32
CTF/Decryptify1.2/php/invite_code.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
function calculate_constant_value($email, $seed_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$constant_value = dechex($seed_value) - ($email_length + $email_hex);
|
||||
return $constant_value;
|
||||
}
|
||||
|
||||
function calculate_seed_value($email, $constant_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$seed_value = hexdec($email_length + $constant_value + $email_hex);
|
||||
return $seed_value;
|
||||
}
|
||||
|
||||
$email1 = "alpha@fake.thm";
|
||||
$email2 = "hello@fake.thm";
|
||||
$seed_array = [1324931, 428529271, 719176282, 933931643, 1493184672, 1723879575, 2232092689];
|
||||
|
||||
foreach($seed_array as $seed) {
|
||||
|
||||
$constant_value = calculate_constant_value($email1, $seed);
|
||||
|
||||
$seed_value = calculate_seed_value($email2, $constant_value);
|
||||
mt_srand($seed_value);
|
||||
$random = mt_rand();
|
||||
$invite_code = base64_encode($random);
|
||||
|
||||
echo "The invite code for " . $constant_value . " is: " . $invite_code . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
32
CTF/Decryptify1.2/php/invite_code1.php
Normal file
32
CTF/Decryptify1.2/php/invite_code1.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
function calculate_constant_value($email, $seed_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$constant_value = dechex($seed_value) - ($email_length + $email_hex);
|
||||
return $constant_value;
|
||||
}
|
||||
|
||||
function calculate_seed_value($email, $constant_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$seed_value = hexdec($email_length + $constant_value + $email_hex);
|
||||
return $seed_value;
|
||||
}
|
||||
|
||||
$email1 = "alpha@fake.thm";
|
||||
$email2 = "admin@fake.thm";
|
||||
$seed_array = [1324931, 428529271, 719176282, 933931643, 1493184672, 1723879575, 2232092689];
|
||||
|
||||
foreach($seed_array as $seed) {
|
||||
|
||||
$constant_value = calculate_constant_value($email1, $seed);
|
||||
|
||||
$seed_value = calculate_seed_value($email2, $constant_value);
|
||||
mt_srand($seed_value);
|
||||
$random = mt_rand();
|
||||
$invite_code = base64_encode($random);
|
||||
|
||||
echo "The invite code for " . $constant_value . " is: " . $invite_code . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
11
CTF/Decryptify1.2/php/test1.php
Normal file
11
CTF/Decryptify1.2/php/test1.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
$email = "alpha@fake.thm";
|
||||
$seed_value = 1324931;
|
||||
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$sum_value = dechex($seed_value);
|
||||
|
||||
$constant_value = $sum_value - ($email_length + $email_hex);
|
||||
echo "The constant value is: " . $constant_value;
|
||||
?>
|
||||
18
CTF/Decryptify1.2/php/test2.php
Normal file
18
CTF/Decryptify1.2/php/test2.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
function calculate_seed_value($email, $constant_value) {
|
||||
$email_length = strlen($email);
|
||||
$email_hex = hexdec(substr($email, 0, 8));
|
||||
$seed_value = hexdec($email_length + $constant_value + $email_hex);
|
||||
|
||||
return $seed_value;
|
||||
}
|
||||
|
||||
$email = "hello@fake.thm";
|
||||
$constant_value = 99999;
|
||||
|
||||
$seed_value = calculate_seed_value($email, $constant_value);
|
||||
mt_srand($seed_value);
|
||||
$random = mt_rand();
|
||||
$invite_code = base64_encode($random);
|
||||
echo "The invite code for " . $email . " is: " . $invite_code;
|
||||
?>
|
||||
Reference in New Issue
Block a user