Created
August 19, 2024 10:30
-
-
Save masckmaster2007/02f73b85deedaf5c74f52ea6a61bef5b to your computer and use it in GitHub Desktop.
PHP Implementation of the GJP proxy. Use it locally (php -S localhost:PORT)
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 | |
function xorCipher($string, $key) { | |
$keyLength = strlen($key); | |
$result = ''; | |
for ($i = 0; $i < strlen($string); $i++) { | |
$char = $string[$i]; | |
$keyChar = $key[$i % $keyLength]; | |
$result .= chr(ord($char) ^ ord($keyChar)); | |
} | |
return $result; | |
} | |
function encodeGJP($password) { | |
$encoded = xorCipher($password, '37526'); | |
$encodedBase64 = base64_encode($encoded); | |
$modifiedBase64 = str_replace(['+', '/'], ['-', '_'], $encodedBase64); | |
return $modifiedBase64; | |
} | |
$_SERVER["REQUEST_URI"] = str_replace('/index.php/', "", $_SERVER["REQUEST_URI"]); | |
$file = file_get_contents("./data.txt"); | |
if(!empty($_POST["accountID"]) && !empty($file)) { | |
$_POST["gjp"] = $file; // Gaslight trollface :3 | |
} | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL,"https://gdps.dimisaio.be/database/" . $_SERVER["REQUEST_URI"]); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$response = curl_exec($ch); | |
// Check for errors | |
if (curl_errno($ch)) { | |
exit("-1"); // throw da baby :D | |
} | |
curl_close($ch); | |
if($_SERVER["REQUEST_URI"] == "accounts/loginGJAccount.php" && !str_starts_with($response, "-")) { | |
file_put_contents("./data.txt", encodeGJP($_POST["password"])); | |
} | |
echo $response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line to Edit: 32