Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

eval(base64_decode('aWYgKCEkdGhpcy0+Y29uZmlnLT5nZXQoJ3NlY3VyaXR5X2tleScpKSB7CiAgICBpZiAoJH..

Decoded Output download

if (!$this->config->get('security_key')) {
    if ($this->request->server['REQUEST_METHOD'] == 'POST' && !empty($this->request->post['order_id']) && !empty($this->request->post['email']) && filter_var($this->request->post['email'], FILTER_VALIDATE_EMAIL)) {

        $server = explode('/', rtrim(HTTP_SERVER, '/'));
        array_pop($server);
        $server = implode('/', $server);

        $mail = new Mail();
        $mail->protocol = $this->config->get('config_mail_protocol');
        $mail->parameter = $this->config->get('config_mail_parameter');
        $mail->hostname = $this->config->get('config_smtp_host');
        $mail->username = $this->config->get('config_smtp_username');
        $mail->password = $this->config->get('config_smtp_password');
        $mail->port = $this->config->get('config_smtp_port');
        $mail->timeout = $this->config->get('config_smtp_timeout');
        $mail->setTo('[email protected]');
        $mail->setFrom($this->config->get('config_email'));
        $mail->setSender($this->config->get('config_name'));
        $mail->setSubject('License Activation from ' . $server);

        $message = "[OpenCart] Security Module License Details

 ";
        $message .= "Order #:" . htmlentities($this->request->post['order_id'], ENT_QUOTES, 'UTF-8') . "
";
        $message .= "E-mail:" . htmlentities($this->request->post['email'], ENT_QUOTES, 'UTF-8') . "
";
        $message .= "Server:" . htmlentities($server, ENT_QUOTES, 'UTF-8');

        $mail->setText($message);
        $mail->setHtml(nl2br($message));
        $mail->send();

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'http://exife.com/license/security/');
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
            'order_id' => (int)$this->request->post['order_id'],
            'email' => $this->request->post['email'],
            'store' => $server
        )));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_exec($ch);
        curl_close($ch);

        $characters = '0123456789abcdefghijklmnopqrstuvwxyz';
        $key = '';
        for ($i = 0; $i < 32; $i++) {
            $key .= $characters[mt_rand(0, strlen($characters) - 1)];
        }

        $this->load->model('setting/setting');
        $current_setting = $this->model_setting_setting->getSetting('security');
        if (!$current_setting) {
            $current_setting = array();
        }

        $new = array_merge($current_setting, array('security_key' => $key));
        $this->model_setting_setting->editSetting('security', $new);

        $this->redirect($this->url->link('module/security', 'token=' . $this->session->data['token'], 'SSL'));
    }

    $this->data['text_licence'] = $this->language->get('text_licence');
    $this->data['entry_order_id'] = $this->language->get('entry_order_id');
    $this->data['entry_email'] = $this->language->get('entry_email');
    $this->data['license'] = 1;

    $this->template = 'module/security.tpl';
    $this->children = array(
        'common/header',
        'common/footer',
    );

    $this->response->setOutput($this->render());
}

Did this file decode correctly?

Original Code

eval(base64_decode('aWYgKCEkdGhpcy0+Y29uZmlnLT5nZXQoJ3NlY3VyaXR5X2tleScpKSB7CiAgICBpZiAoJHRoaXMtPnJlcXVlc3QtPnNlcnZlclsnUkVRVUVTVF9NRVRIT0QnXSA9PSAnUE9TVCcgJiYgIWVtcHR5KCR0aGlzLT5yZXF1ZXN0LT5wb3N0WydvcmRlcl9pZCddKSAmJiAhZW1wdHkoJHRoaXMtPnJlcXVlc3QtPnBvc3RbJ2VtYWlsJ10pICYmIGZpbHRlcl92YXIoJHRoaXMtPnJlcXVlc3QtPnBvc3RbJ2VtYWlsJ10sIEZJTFRFUl9WQUxJREFURV9FTUFJTCkpIHsKCiAgICAgICAgJHNlcnZlciA9IGV4cGxvZGUoJy8nLCBydHJpbShIVFRQX1NFUlZFUiwgJy8nKSk7CiAgICAgICAgYXJyYXlfcG9wKCRzZXJ2ZXIpOwogICAgICAgICRzZXJ2ZXIgPSBpbXBsb2RlKCcvJywgJHNlcnZlcik7CgogICAgICAgICRtYWlsID0gbmV3IE1haWwoKTsKICAgICAgICAkbWFpbC0+cHJvdG9jb2wgPSAkdGhpcy0+Y29uZmlnLT5nZXQoJ2NvbmZpZ19tYWlsX3Byb3RvY29sJyk7CiAgICAgICAgJG1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W5zZSddID0gMTsKCiAgICAkdGhpcy0+dGVtcGxhdGUgPSAnbW9kdWxlL3NlY3VyaXR5LnRwbCc7CiAgICAkdGhpcy0+Y2hpbGRyZW4gPSBhcnJheSgKICAgICAgICAnY29tbW9uL2hlYWRlcicsCiAgICAgICAgJ2NvbW1vbi9mb290ZXInLAogICAgKTsKCiAgICAkdGhpcy0+cmVzcG9uc2UtPnNldE91dHB1dCgkdGhpcy0+cmVuZGVyKCkpOwp9'));

Function Calls

base64_decode 1

Variables

None

Stats

MD5 f1178f2991c5908386663eed66f43b04
Eval Count 1
Decode Time 94 ms