Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php // Check if the request method is GET if ($_SERVER['REQUEST_METHOD'] === 'GET') { ..
Decoded Output download
<?php
// Check if the request method is GET
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// Get the 'PH' parameter from the GET request
$p = isset($_GET['PH']) ? $_GET['PH'] : '';
// Login URL
$login_url = 'https://app.mynagad.com:20002/api/login';
// Data to send in the login POST request
$login_data = json_encode([
"aspId" => "100012345612345",
"mpaId" => "17030200074330620770600034613200",
"password" => "2D4DB7F758EA1C1284A168338E803D0A2A0B2D2A224F79A0052917558618A8D7",
"username" => "01792364616"
]);
// Set the headers for the login POST request
$login_headers = [
'X-KM-UserId: 46154981',
'X-KM-User-MpaId: 16993568931635047188718337601686',
'X-KM-User-AspId: 100012345612345',
'X-KM-User-Agent: ANDROID/1150',
'X-KM-Accept-language: bn',
'X-KM-AppCode: 01',
'Content-Type: application/json',
'Host: app.mynagad.com:20002',
'Connection: Keep-Alive',
'Accept-Encoding: gzip',
'User-Agent: okhttp/3.14.9'
];
// Initialize cURL session for login
$login_ch = curl_init($login_url);
// Set cURL options for login
curl_setopt_array($login_ch, [
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $login_data,
CURLOPT_HTTPHEADER => $login_headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
]);
// Execute cURL session for login
$login_response = curl_exec($login_ch);
// Close cURL session for login
curl_close($login_ch);
// Split the login response into headers and body
list($login_responseHeaders, $login_responseBody) = explode("
", $login_response, 2);
// Initialize a variable to store the X-KM-AUTH-TOKEN value
$authToken = null;
// Split the login response headers into an array
$login_responseHeadersArray = explode("
", $login_responseHeaders);
// Loop through the login response headers to find the X-KM-AUTH-TOKEN header
foreach ($login_responseHeadersArray as $header) {
if (strpos($header, 'X-KM-AUTH-TOKEN:') !== false) {
// Extract the value of the X-KM-AUTH-TOKEN header
$authToken = trim(str_replace('X-KM-AUTH-TOKEN:', '', $header));
break;
}
}
// Check if the X-KM-AUTH-TOKEN was found
if ($authToken !== null) {
// Now, you can proceed with the KYC request
// URL to send the POST request for KYC
$kyc_url = 'https://app.mynagad.com:20002/api/external/kyc/customer-data-for-resubmit';
// Data to send in the KYC POST request
$kyc_data = json_encode(["otp" => null, "phoneNumber" => $p]);
// Set the headers for the KYC POST request
$kyc_headers = [
"X-KM-UserId: 46154981",
"X-KM-User-MpaId: 17030200074330620770600034613200",
"X-KM-User-AspId: 100012345612345",
"X-KM-User-Agent: ANDROID/1150",
"X-KM-Accept-language: bn",
"X-KM-AUTH-TOKEN: " . $authToken,
"X-KM-AppCode: 01",
"Content-Type: application/json; charset=UTF-8",
"Content-Length: " . strlen($kyc_data),
"Host: app.mynagad.com:20002",
"Connection: Keep-Alive",
"Accept-Encoding: gzip",
"User-Agent: okhttp/3.14.9"
];
// Initialize cURL session for KYC
$kyc_ch = curl_init($kyc_url);
// Set cURL options for KYC
curl_setopt_array($kyc_ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $kyc_data,
CURLOPT_HTTPHEADER => $kyc_headers,
]);
// Execute cURL session for KYC
$kyc_response = curl_exec($kyc_ch);
// Handle the KYC response as needed
// $kyc_response contains the response from the KYC request
// Close cURL session for KYC
curl_close($kyc_ch);
// Output the KYC respons
// echo json_decode($kyc_response, JSON_PRETTY_PRINT);
echo $kyc_response;
}
}
?>
Did this file decode correctly?
Original Code
<?php
// Check if the request method is GET
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// Get the 'PH' parameter from the GET request
$p = isset($_GET['PH']) ? $_GET['PH'] : '';
// Login URL
$login_url = 'https://app.mynagad.com:20002/api/login';
// Data to send in the login POST request
$login_data = json_encode([
"aspId" => "100012345612345",
"mpaId" => "17030200074330620770600034613200",
"password" => "2D4DB7F758EA1C1284A168338E803D0A2A0B2D2A224F79A0052917558618A8D7",
"username" => "01792364616"
]);
// Set the headers for the login POST request
$login_headers = [
'X-KM-UserId: 46154981',
'X-KM-User-MpaId: 16993568931635047188718337601686',
'X-KM-User-AspId: 100012345612345',
'X-KM-User-Agent: ANDROID/1150',
'X-KM-Accept-language: bn',
'X-KM-AppCode: 01',
'Content-Type: application/json',
'Host: app.mynagad.com:20002',
'Connection: Keep-Alive',
'Accept-Encoding: gzip',
'User-Agent: okhttp/3.14.9'
];
// Initialize cURL session for login
$login_ch = curl_init($login_url);
// Set cURL options for login
curl_setopt_array($login_ch, [
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $login_data,
CURLOPT_HTTPHEADER => $login_headers,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => true,
]);
// Execute cURL session for login
$login_response = curl_exec($login_ch);
// Close cURL session for login
curl_close($login_ch);
// Split the login response into headers and body
list($login_responseHeaders, $login_responseBody) = explode("\r\n\r\n", $login_response, 2);
// Initialize a variable to store the X-KM-AUTH-TOKEN value
$authToken = null;
// Split the login response headers into an array
$login_responseHeadersArray = explode("\n", $login_responseHeaders);
// Loop through the login response headers to find the X-KM-AUTH-TOKEN header
foreach ($login_responseHeadersArray as $header) {
if (strpos($header, 'X-KM-AUTH-TOKEN:') !== false) {
// Extract the value of the X-KM-AUTH-TOKEN header
$authToken = trim(str_replace('X-KM-AUTH-TOKEN:', '', $header));
break;
}
}
// Check if the X-KM-AUTH-TOKEN was found
if ($authToken !== null) {
// Now, you can proceed with the KYC request
// URL to send the POST request for KYC
$kyc_url = 'https://app.mynagad.com:20002/api/external/kyc/customer-data-for-resubmit';
// Data to send in the KYC POST request
$kyc_data = json_encode(["otp" => null, "phoneNumber" => $p]);
// Set the headers for the KYC POST request
$kyc_headers = [
"X-KM-UserId: 46154981",
"X-KM-User-MpaId: 17030200074330620770600034613200",
"X-KM-User-AspId: 100012345612345",
"X-KM-User-Agent: ANDROID/1150",
"X-KM-Accept-language: bn",
"X-KM-AUTH-TOKEN: " . $authToken,
"X-KM-AppCode: 01",
"Content-Type: application/json; charset=UTF-8",
"Content-Length: " . strlen($kyc_data),
"Host: app.mynagad.com:20002",
"Connection: Keep-Alive",
"Accept-Encoding: gzip",
"User-Agent: okhttp/3.14.9"
];
// Initialize cURL session for KYC
$kyc_ch = curl_init($kyc_url);
// Set cURL options for KYC
curl_setopt_array($kyc_ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $kyc_data,
CURLOPT_HTTPHEADER => $kyc_headers,
]);
// Execute cURL session for KYC
$kyc_response = curl_exec($kyc_ch);
// Handle the KYC response as needed
// $kyc_response contains the response from the KYC request
// Close cURL session for KYC
curl_close($kyc_ch);
// Output the KYC respons
// echo json_decode($kyc_response, JSON_PRETTY_PRINT);
echo $kyc_response;
}
}
?>
Function Calls
None |
Stats
MD5 | a7d6f127eff8030687c95e550fa52f11 |
Eval Count | 0 |
Decode Time | 75 ms |