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 /** * STRESS WEB * @author S.T.R.E.S.S. * @copyright 2022 - 2023 STRESS WEB 1..

Decoded Output download

<?php 
/** 
 * STRESS WEB 
 * @author S.T.R.E.S.S. 
 * @copyright 2022 - 2023 STRESS WEB 14 
 * @version 13 
 * @web https://t.me/localhost_3001 
 */ 
if ( !defined("STRESSWEB") ) 
    die( "Access denied..." ); 
if ( $controller->isLogged() ) { 
 
    $_do = ( isset($_REQUEST["do"]) and $_REQUEST["do"] == "set" ) ? "set":"old"; 
 
    if ( $_do == 'set' and $l2cfg["chmail_activate"] ) { 
        $hash = ( isset($_REQUEST["hash"]) ) ? urldecode( $_REQUEST["hash"] ):""; 
        if ( empty($hash) ) { 
            $_do = 'old'; 
        } else { 
            $hash = explode( '|', base64_decode($hash) ); 
            if ( count($hash) != 5 or md5($hash[0].$hash[1].$hash[2].$hash[3].$l2cfg['salt']) != $hash[4] ) { 
                $profile = "<div class='error'>incorrect hash</div>"; 
            } elseif ( time() > $hash[3] + 259200 ) { 
                $profile = "<div class='error'> </div>"; 
            } elseif ( $hash[0] != $controller->GetName() ) { 
                $profile = "<div class='error'> </div>"; 
            } else { 
                $db->ldb( $_lid ); 
 
                $ldb[$_lid]->query( "UPDATE `accounts` SET `l2email`='".$ldb[$_lid]->safe($hash[1])."' WHERE `login`='".$ldb[$_lid]->safe($hash[0])."' AND `l2email`='".$ldb[$_lid]->safe($hash[2])."'" ); 
                if ( $ldb[$_lid]->affected() > 0 ) { 
                    $tpl->ShowError( $lang["error"], 
                    '<div class="alert alert-success alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                    <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_2"].'</p>',false); 
                } else { 
                    $tpl->ShowError( $lang["error"], 
                    '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                    <p class="p-0 m-0 w-100 text-center">'.$lang["err_db"].'</p>',false); 
                } 
            } 
        } 
    } 
 
    if ( $_do == 'old' ) { 
        $profile = <<< HTML 
<div id='chaccmail'> 
<form name="chmail" class="w-50" action="" method="post"> 
<h4>{$lang["chmail_0"]}</h4> 
<div class="form-group"> 
  <label for="dbcollate">{$lang["chmail_3"]}</label> 
  <input type="text" class="form-control" name="mailnew" maxlength="50" id="dbcollate" placeholder=" "> 
</div> 
<input type="submit" name="submit" value="{$lang["send"]}" class="chbutton btn btn-primary"> 
</form> 
</div> 
HTML; 
 
        if ( isset($_POST["submit"]) ) { 
            $mailnew = $db->safe( $_POST["mailnew"] ); 
            if ( empty($mailnew) ) { 
                $tpl->ShowError( $lang["error"], 
                '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_1"].'</p>'); 
 
            } elseif ( !filter_var($mailnew, FILTER_VALIDATE_EMAIL) ) { 
                $tpl->ShowError( $lang["error"], 
                '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                <p class="p-0 m-0 w-100 text-center">'.$lang["err_mail"].'</p>'); 
            } else { 
                $db->ldb( $_lid ); 
 
                if ( $l2cfg['chmail_activate'] ) { 
                    $email = $ldb[$_lid]->result( $ldb[$_lid]->query("SELECT l2email FROM accounts WHERE login='{$controller->GetName()}'"), 0 ); 
                    $time = time(); 
                    $hash = urlencode( base64_encode($controller->GetName().'|'.$mailnew.'|'.$email.'|'.$time.'|'.md5($controller->GetName().$mailnew.$email.$time.$l2cfg['salt'])) ); 
                    $host = HTTP_HOME_URL; 
                    $activation_url = HTTP_HOME_URL."/index.php?f=cp&opt=chmail&do=set&hash={$hash}"; 
                    $mail_message = <<< HTML 
                     {$controller->GetName()}, 
                       ' e-mail'    .  ,    e-mail   : 
                    {$activation_url}  
 
                    ------------------------------------------------ 
                        e-mail: 
                    ------------------------------------------------ 
                    : {$controller->GetName()}  
                    E-mail: {$mailnew}  
 
                     , 
                      {$host} 
                    HTML; 
                    $mail = new Email( $l2cfg ); 
                    $mail->send( $email, ' e-mail', $mail_message ); 
                    if ( $mail->send_error ) { 
                        $tpl->ShowError( $lang["error"], $mail->smtp_msg ); 
                    } else { 
                        $tpl->ShowError( $lang["error"], 
                        '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                        <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_4"].'</p>',false); 
                    } 
 
                } else { 
                    $ldb[$_lid]->query( "UPDATE `accounts` SET `l2email`='{$mailnew}' WHERE `login`='{$controller->GetName()}'" ); 
                    if ( $ldb[$_lid]->affected() > 0 ) { 
                        $tpl->ShowError( $lang["error"], 
                        '<div class="alert alert-success alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                        <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_2"].'</p>',false); 
                    } else { 
                        $tpl->ShowError( $lang["error"], 
                        '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)"> 
                        <p class="p-0 m-0 w-100 text-center">'.$lang["err_db"].'</p>',false); 
                    } 
                } 
            } 
        } 
    } 
} else 
    exit; 
?>

Did this file decode correctly?

Original Code

<?php
/**
 * STRESS WEB
 * @author S.T.R.E.S.S.
 * @copyright 2022 - 2023 STRESS WEB 14
 * @version 13
 * @web https://t.me/localhost_3001
 */
if ( !defined("STRESSWEB") )
    die( "Access denied..." );
if ( $controller->isLogged() ) {

    $_do = ( isset($_REQUEST["do"]) and $_REQUEST["do"] == "set" ) ? "set":"old";

    if ( $_do == 'set' and $l2cfg["chmail_activate"] ) {
        $hash = ( isset($_REQUEST["hash"]) ) ? urldecode( $_REQUEST["hash"] ):"";
        if ( empty($hash) ) {
            $_do = 'old';
        } else {
            $hash = explode( '|', base64_decode($hash) );
            if ( count($hash) != 5 or md5($hash[0].$hash[1].$hash[2].$hash[3].$l2cfg['salt']) != $hash[4] ) {
                $profile = "<div class='error'>incorrect hash</div>";
            } elseif ( time() > $hash[3] + 259200 ) {
                $profile = "<div class='error'> </div>";
            } elseif ( $hash[0] != $controller->GetName() ) {
                $profile = "<div class='error'> </div>";
            } else {
                $db->ldb( $_lid );

                $ldb[$_lid]->query( "UPDATE `accounts` SET `l2email`='".$ldb[$_lid]->safe($hash[1])."' WHERE `login`='".$ldb[$_lid]->safe($hash[0])."' AND `l2email`='".$ldb[$_lid]->safe($hash[2])."'" );
                if ( $ldb[$_lid]->affected() > 0 ) {
                    $tpl->ShowError( $lang["error"],
                    '<div class="alert alert-success alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                    <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_2"].'</p>',false);
                } else {
                    $tpl->ShowError( $lang["error"],
                    '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                    <p class="p-0 m-0 w-100 text-center">'.$lang["err_db"].'</p>',false);
                }
            }
        }
    }

    if ( $_do == 'old' ) {
        $profile = <<< HTML
<div id='chaccmail'>
<form name="chmail" class="w-50" action="" method="post">
<h4>{$lang["chmail_0"]}</h4>
<div class="form-group">
  <label for="dbcollate">{$lang["chmail_3"]}</label>
  <input type="text" class="form-control" name="mailnew" maxlength="50" id="dbcollate" placeholder=" ">
</div>
<input type="submit" name="submit" value="{$lang["send"]}" class="chbutton btn btn-primary">
</form>
</div>
HTML;

        if ( isset($_POST["submit"]) ) {
            $mailnew = $db->safe( $_POST["mailnew"] );
            if ( empty($mailnew) ) {
                $tpl->ShowError( $lang["error"],
                '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_1"].'</p>');

            } elseif ( !filter_var($mailnew, FILTER_VALIDATE_EMAIL) ) {
                $tpl->ShowError( $lang["error"],
                '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                <p class="p-0 m-0 w-100 text-center">'.$lang["err_mail"].'</p>');
            } else {
                $db->ldb( $_lid );

                if ( $l2cfg['chmail_activate'] ) {
                    $email = $ldb[$_lid]->result( $ldb[$_lid]->query("SELECT l2email FROM accounts WHERE login='{$controller->GetName()}'"), 0 );
                    $time = time();
                    $hash = urlencode( base64_encode($controller->GetName().'|'.$mailnew.'|'.$email.'|'.$time.'|'.md5($controller->GetName().$mailnew.$email.$time.$l2cfg['salt'])) );
                    $host = HTTP_HOME_URL;
                    $activation_url = HTTP_HOME_URL."/index.php?f=cp&opt=chmail&do=set&hash={$hash}";
                    $mail_message = <<< HTML
                     {$controller->GetName()},
                       ' e-mail'    .  ,    e-mail   :
                    {$activation_url} 

                    ------------------------------------------------
                        e-mail:
                    ------------------------------------------------
                    : {$controller->GetName()} 
                    E-mail: {$mailnew} 

                     ,
                      {$host}
                    HTML;
                    $mail = new Email( $l2cfg );
                    $mail->send( $email, ' e-mail', $mail_message );
                    if ( $mail->send_error ) {
                        $tpl->ShowError( $lang["error"], $mail->smtp_msg );
                    } else {
                        $tpl->ShowError( $lang["error"],
                        '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                        <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_4"].'</p>',false);
                    }

                } else {
                    $ldb[$_lid]->query( "UPDATE `accounts` SET `l2email`='{$mailnew}' WHERE `login`='{$controller->GetName()}'" );
                    if ( $ldb[$_lid]->affected() > 0 ) {
                        $tpl->ShowError( $lang["error"],
                        '<div class="alert alert-success alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                        <p class="p-0 m-0 w-100 text-center">'.$lang["chmail_2"].'</p>',false);
                    } else {
                        $tpl->ShowError( $lang["error"],
                        '<div class="alert alert-danger alert-dismissible fade show position-absolute" role="alert" style="padding:10px 0px;width:400px;top:100px;left:50%;transform:translateX(-50%)">
                        <p class="p-0 m-0 w-100 text-center">'.$lang["err_db"].'</p>',false);
                    }
                }
            }
        }
    }
} else
    exit;
?>

Function Calls

None

Variables

None

Stats

MD5 1446cb52a55fbaf0cc271e0187a1c15c
Eval Count 0
Decode Time 47 ms