Online PHP and Javascript Decoder decode hidden script to uncover its real functionality


Show other level


 goto saYbp; n25ZV: if (isset($_GET["\165\163\145\162\x49\144"], $_GET["\156\145\167\x47\162\x6f\x75\x70"])) { $servername = "\154\157\143\x61\x6c\150\x6f\x73\164"; $username = "\x72\157\157\164"; $password = ''; $dbname = "\155\63\x6c\155\143\157\x6d\160\141\x6e\171\x78\166\162\160"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { $data["\x73\x75\143\x63\145\x73\163"] = false; $data["\x6d\145\x73\163\x61\147\x65"] = "\103\x6f\156\x6e\x65\143\x74\x69\x6f\x6e\40\146\x61\x69\154\145\x64\72\x20" . $conn->connect_error; http_response_code(500); echo json_encode($data); die; } $userId = intval($_GET["\165\x73\145\162\x49\x64"]); $newGroup = $_GET["\156\145\167\107\x72\157\x75\x70"]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "\x68\x74\x74\x70\72\x2f\57\x6c\x6f\x63\141\154\x68\x6f\x73\x74\x3a\x33\65\60\x30\57\x72\145\x71\165\145\163\x74\57\x61\x64\x64\147\x72\157\165\x70"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("\151\x64" => $userId, "\x67\x72\157\x75\x70" => $newGroup))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if (curl_errno($ch)) { $data["\x73\165\x63\x63\x65\x73\x73"] = false; $data["\x6d\x65\x73\x73\141\x67\x65"] = "\143\125\x52\x4c\40\x65\x72\162\x6f\162\x3a\x20" . curl_error($ch); http_response_code(500); curl_close($ch); echo json_encode($data); die; } curl_close($ch); $check_and_remove_sql = "\x55\120\104\x41\124\105\x20\166\162\160\x5f\x75\x73\145\x72\137\x64\141\x74\x61\x20\xa\x20\x20\40\40\x20\40\x20\40\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\x20\40\40\x20\40\x20\x20\40\123\105\124\x20\144\x76\141\154\x75\145\40\x3d\x20\x4a\x53\117\x4e\x5f\x52\105\115\117\x56\105\50\x64\x76\x61\154\165\x65\54\x20\47\44\56\147\162\157\x75\160\x73\56\x22\330\271\xd8\247\xd8\xb7\331\x84\x22\x27\x29\x20\xa\40\40\40\40\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\40\x20\40\x20\x57\110\105\122\105\40\x75\163\145\162\137\151\x64\x20\75\40\77\40\x41\116\x44\40\x4a\123\x4f\116\137\103\x4f\x4e\124\101\x49\x4e\x53\x5f\x50\x41\124\x48\50\144\166\141\x6c\165\145\x2c\x20\x27\157\x6e\x65\x27\54\40\47\44\x2e\147\162\x6f\165\x70\163\56\x22\330\xb9\xd8\xa7\xd8\267\xd9\204\42\x27\x29"; $check_and_remove_stmt = $conn->prepare($check_and_remove_sql); $check_and_remove_stmt->bind_param("\x69", $userId); $check_and_remove_stmt->execute(); if ($check_and_remove_stmt->affected_rows >= 0) { $add_sql = "\x55\x50\104\x41\x54\105\x20\x76\162\160\x5f\x75\x73\145\x72\x5f\x64\x61\x74\x61\x20\x53\105\124\x20\144\166\x61\154\x75\145\x20\75\40\112\123\x4f\x4e\137\123\105\124\x28\144\x76\x61\x6c\165\145\x2c\x20\x43\117\116\103\101\x54\50\47\44\x2e\147\x72\x6f\165\160\163\x2e\x27\x2c\x20\77\x29\54\40\164\162\x75\x65\51\x20\x57\110\x45\122\105\40\x75\x73\x65\x72\x5f\151\x64\40\x3d\40\x3f"; $add_stmt = $conn->prepare($add_sql); $add_stmt->bind_param("\x73\x69", $newGroup, $userId); $add_stmt->execute(); if ($add_stmt->affected_rows > 0) { logAction($conn, $userId, $newGroup, "\x61\x64\144\40\147\162\x6f\165\x70"); $data["\x73\165\143\143\x65\163\x73"] = true; $data["\x6d\x65\x73\163\141\147\x65"] = "\x47\162\x6f\x75\160\x20\47{$newGroup}\x27\x20\x61\144\144\145\x64\40\x73\165\x63\143\x65\x73\163\146\x75\154\154\x79\x20\x66\x6f\162\40\165\x73\x65\x72\40\111\104\72\x20{$userId}\x20\141\156\x64\x20\141\x63\x74\151\x6f\156\x20\x6c\x6f\147\147\x65\x64\x20\163\x75\143\143\x65\x73\x73\x66\165\154\x6c\171"; echo json_encode($data); } else { $data["\163\165\x63\x63\x65\x73\x73"] = false; $data["\x6d\145\x73\163\141\x67\x65"] = "\x46\x61\151\154\x65\144\x20\x74\x6f\x20\x61\x64\144\40\x67\x72\x6f\x75\x70\40\x27{$newGroup}\x27\40\146\157\162\40\x75\x73\145\162\40\111\104\x3a\x20{$userId}"; http_response_code(500); echo json_encode($data); } $add_stmt->close(); } else { $data["\x73\165\143\x63\x65\163\163"] = false; $data["\x6d\145\163\x73\141\147\x65"] = "\x46\x61\151\154\145\144\40\164\x6f\x20\162\145\155\157\166\x65\40\145\x78\151\x73\x74\151\156\147\x20\147\x72\x6f\x75\160\40\x27\330\xb9\330\247\330\xb7\331\x84\x27\x20\157\162\40\151\164\40\144\x6f\145\163\156\x27\164\x20\x65\x78\151\x73\164\40\x66\x6f\162\40\165\x73\x65\162\x20\111\104\x3a\40{$userId}"; http_response_code(500); echo json_encode($data); } $check_and_remove_stmt->close(); $conn->close(); } else { $data["\163\165\x63\143\145\x73\163"] = false; $data["\155\x65\x73\163\x61\x67\145"] = "\x4d\151\x73\x73\151\x6e\x67\40\162\145\x71\165\151\162\x65\x64\x20\160\141\x72\141\155\x65\164\x65\x72\x73\40\50\165\163\145\x72\111\x64\x20\141\x6e\x64\57\x6f\x72\40\x6e\145\x77\x47\162\x6f\x75\x70\x29"; http_response_code(400); echo json_encode($data); } goto C5C8u; Sia0F: ini_set("\x64\x69\x73\160\154\141\171\137\x65\162\x72\x6f\x72\163", 1); goto IIT67; IIT67: header("\103\x6f\x6e\x74\x65\156\x74\x2d\124\x79\160\x65\72\x20\x61\x70\x70\154\x69\143\x61\x74\151\x6f\156\57\x6a\163\157\x6e"); goto n25ZV; C5C8u: function logAction($conn, $userId, $newGroup, $action) { if (session_status() === PHP_SESSION_NONE) { session_start(); } $loggedInUsername = $_SESSION["\x75\x73\x65\x72\x6e\x61\x6d\x65"] ?? "\x64\151\163\143\157\162\144\40\142\157\164"; $admin_ip = $_SERVER["\122\105\x4d\x4f\x54\x45\137\101\x44\104\x52"]; $created_at = date("\131\55\x6d\x2d\x64\x20\110\x3a\x69\72\163"); $sql = "\x49\x4e\123\x45\122\x54\40\x49\x4e\124\x4f\x20\x6c\157\147\x73\40\x28\165\163\145\162\x6e\x61\155\x65\x2c\x20\141\143\x74\x69\x6f\156\x5f\165\163\x65\x72\137\151\144\x2c\40\147\x72\157\165\x70\137\x6e\141\x6d\145\x2c\x20\141\143\x74\x69\157\x6e\54\40\141\x64\155\151\156\137\151\x70\54\40\x63\162\145\x61\164\x65\x64\x5f\x61\164\51\x20\126\x41\x4c\x55\x45\123\40\50\77\x2c\x20\77\x2c\40\77\x2c\40\x3f\x2c\40\77\x2c\40\77\51"; $stmt = $conn->prepare($sql); $stmt->bind_param("\163\151\x73\163\x73\x73", $loggedInUsername, $userId, $newGroup, $action, $admin_ip, $created_at); $stmt->execute(); $stmt->close(); } goto m5AuM; saYbp: error_reporting(E_ALL); goto Sia0F; m5AuM: 


 goto saYbp; n25ZV: if (isset($_GET["userId"], $_GET["newGroup"])) { $servername = "localhost"; $username = "root"; $password = ''; $dbname = "m3lmcompanyxvrp"; $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { $data["success"] = false; $data["message"] = "Connection failed: " . $conn->connect_error; http_response_code(500); echo json_encode($data); die; } $userId = intval($_GET["userId"]); $newGroup = $_GET["newGroup"]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://localhost:35/request/addgroup"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("id" => $userId, "group" => $newGroup))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if (curl_errno($ch)) { $data["success"] = false; $data["message"] = "cURL error: " . curl_error($ch); http_response_code(500); curl_close($ch); echo json_encode($data); die; } curl_close($ch); $check_and_remove_sql = "UPDATE vrp_user_data \xa                             SET dvalue = JSON_REMOVE(dvalue, '$.groups."عاطل"') \xa                             WHERE user_id = ? AND JSON_CONTAINS_PATH(dvalue, 'one', '$.groups."عاطل"')"; $check_and_remove_stmt = $conn->prepare($check_and_remove_sql); $check_and_remove_stmt->bind_param("i", $userId); $check_and_remove_stmt->execute(); if ($check_and_remove_stmt->affected_rows >= 0) { $add_sql = "UPDATE vrp_user_data SET dvalue = JSON_SET(dvalue, CONCAT('$.groups.', ?), true) WHERE user_id = ?"; $add_stmt = $conn->prepare($add_sql); $add_stmt->bind_param("si", $newGroup, $userId); $add_stmt->execute(); if ($add_stmt->affected_rows > 0) { logAction($conn, $userId, $newGroup, "add group"); $data["success"] = true; $data["message"] = "Group '{$newGroup}' added successfully for user ID: {$userId} and action logged successfully"; echo json_encode($data); } else { $data["success"] = false; $data["message"] = "Failed to add group '{$newGroup}' for user ID: {$userId}"; http_response_code(500); echo json_encode($data); } $add_stmt->close(); } else { $data["success"] = false; $data["message"] = "Failed to remove existing group 'عاطل' or it doesn't exist for user ID: {$userId}"; http_response_code(500); echo json_encode($data); } $check_and_remove_stmt->close(); $conn->close(); } else { $data["success"] = false; $data["message"] = "Missing required parameters (userId and/or newGroup)"; http_response_code(400); echo json_encode($data); } goto C5C8u; Sia0F: ini_set("display_errors", 1); goto IIT67; IIT67: header("Content-Type: application/json"); goto n25ZV; C5C8u: function logAction($conn, $userId, $newGroup, $action) { if (session_status() === PHP_SESSION_NONE) { session_start(); } $loggedInUsername = $_SESSION["username"] ?? "discord bot"; $admin_ip = $_SERVER["REMOTE_ADDR"]; $created_at = date("Y-m-d H:i:s"); $sql = "INSERT INTO logs (username, action_user_id, group_name, action, admin_ip, created_at) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("sissss", $loggedInUsername, $userId, $newGroup, $action, $admin_ip, $created_at); $stmt->execute(); $stmt->close(); } goto m5AuM; saYbp: error_reporting(E_ALL); goto Sia0F; m5AuM: 


 goto saYbp; n25ZV: if (isset($_GET["userId"], $_GET["newGroup"])) {   $password = '';  $conn = new mysqli("localhost", "root", $password, "m3lmcompanyxvrp"); if ($conn->connect_error) { $data["success"] = false; $data["message"] = "Connection failed: " . $conn->connect_error; http_response_code(500); echo json_encode($data); die; } $userId = intval($_GET["userId"]); $newGroup = $_GET["newGroup"]; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://localhost:35/request/addgroup"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array("id" => $userId, "group" => $newGroup))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); if (curl_errno($ch)) { $data["success"] = false; $data["message"] = "cURL error: " . curl_error($ch); http_response_code(500); curl_close($ch); echo json_encode($data); die; } curl_close($ch); $check_and_remove_sql = "UPDATE vrp_user_data \xa                             SET dvalue = JSON_REMOVE(dvalue, '$.groups."عاطل"') \xa                             WHERE user_id = ? AND JSON_CONTAINS_PATH(dvalue, 'one', '$.groups."عاطل"')"; $check_and_remove_stmt = $conn->prepare($check_and_remove_sql); $check_and_remove_stmt->bind_param("i", $userId); $check_and_remove_stmt->execute(); if ($check_and_remove_stmt->affected_rows >= 0) { $add_sql = "UPDATE vrp_user_data SET dvalue = JSON_SET(dvalue, CONCAT('$.groups.', ?), true) WHERE user_id = ?"; $add_stmt = $conn->prepare($add_sql); $add_stmt->bind_param("si", $newGroup, $userId); $add_stmt->execute(); if ($add_stmt->affected_rows > 0) { logAction($conn, $userId, $newGroup, "add group"); $data["success"] = true; $data["message"] = "Group '{$newGroup}' added successfully for user ID: {$userId} and action logged successfully"; echo json_encode($data); } else { $data["success"] = false; $data["message"] = "Failed to add group '{$newGroup}' for user ID: {$userId}"; http_response_code(500); echo json_encode($data); } $add_stmt->close(); } else { $data["success"] = false; $data["message"] = "Failed to remove existing group 'عاطل' or it doesn't exist for user ID: {$userId}"; http_response_code(500); echo json_encode($data); } $check_and_remove_stmt->close(); $conn->close(); } else { $data["success"] = false; $data["message"] = "Missing required parameters (userId and/or newGroup)"; http_response_code(400); echo json_encode($data); } goto C5C8u; Sia0F: ini_set("display_errors", 1); goto IIT67; IIT67: header("Content-Type: application/json"); goto n25ZV; C5C8u: function logAction($conn, $userId, $newGroup, $action) { if (session_status() === PHP_SESSION_NONE) { session_start(); } $loggedInUsername = $_SESSION["username"] ?? "discord bot"; $admin_ip = $_SERVER["REMOTE_ADDR"]; $created_at = date("Y-m-d H:i:s"); $sql = "INSERT INTO logs (username, action_user_id, group_name, action, admin_ip, created_at) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("sissss", $loggedInUsername, $userId, $newGroup, $action, $admin_ip, $created_at); $stmt->execute(); $stmt->close(); } goto m5AuM; saYbp: error_reporting(E_ALL); goto Sia0F; m5AuM: 



© 2023 Quttera Ltd. All rights reserved.