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 namespace MiniOrange; use Illuminate\Http\Request; use MiniOrange\Classes\A..
Decoded Output download
<?php
namespace MiniOrange;
use Illuminate\Http\Request;
use MiniOrange\Classes\Actions\ProcessResponseAction;
use MiniOrange\Classes\Actions\ProcessUserAction;
use MiniOrange\Classes\Actions\ReadResponseAction;
use MiniOrange\Classes\Actions\TestResultActions;
use MiniOrange\Helper\Constants;
use MiniOrange\Helper\Messages;
use MiniOrange\Helper\Utilities;
use MiniOrange\Helper\PluginSettings;
use MiniOrange\Classes\Actions\AuthFacadeController;
use MiniOrange\Helper\Lib\AESEncryption;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Log;
use App\Events\GetSsoUserAttr;
use MiniOrange\Helper\CustomerDetails as CD;
final class SSO
{
public function __construct()
{
if (mo_saml_is_customer_license_verified()) {
goto N2;
}
Utilities::showErrorMessage("No License is currently active on this domain. Please activate the license and try again.");
goto Ix;
N2:
if (empty(CD::get_option("certificate"))) {
goto JS;
}
$Tq = CD::get_option("mo_saml_customer_token");
$GY = AESEncryption::decrypt_data(CD::get_option("certificate"), $Tq);
if (!(time() > strtotime($GY))) {
goto sN;
}
Utilities::showErrorMessage("Your trial has expired.");
sN:
JS:
Ix:
Log::info("Received IDP Response");
$Y7 = PluginSettings::getPluginSettings();
if (array_key_exists("SAMLResponse", $_REQUEST) && !empty($_REQUEST["SAMLResponse"])) {
goto zz;
}
Utilities::showErrorMessage(Messages::MISSING_SAML_RESPONSE);
goto Q3;
zz:
try {
$r7 = array_key_exists("RelayState", $_REQUEST) ? $_REQUEST["RelayState"] : "/";
Log::info("relayState => " . $r7);
$TH = ReadResponseAction::execute();
$mD = new ProcessResponseAction($TH);
$mD->execute();
$q2 = current(current($TH->getAssertions())->getNameId());
$mp = current($TH->getAssertions())->getAttributes();
$mp["NameID"] = array("0" => $q2);
$PT = current($TH->getAssertions())->getSessionIndex();
$Do = $Y7->getCustomAttributeMapping();
if (strcasecmp($r7, Constants::TEST_RELAYSTATE) == 0) {
goto ru;
}
(new ProcessUserAction($mp, $r7, $PT))->execute();
Log::info("user email => " . $mp[$Y7->getSamlAmEmail()][0]);
Log::info("username => " . $mp[$Y7->getSamlAmUsername()][0]);
if (isset($_SESSION)) {
goto Ly;
}
session_start();
Ly:
$_SESSION["email"] = $mp[$Y7->getSamlAmEmail()];
$_SESSION["username"] = $mp[$Y7->getSamlAmUsername()];
$_SESSION["session_index"] = $PT;
$_SESSION["slo_url"] = $Y7->getSamlLogoutUrl();
if (!(is_array($Do) && !empty($Do))) {
goto UW;
}
foreach ($Do as $Tq => $Qv) {
if (!array_key_exists($Qv, $mp)) {
goto pH;
}
$_SESSION[$Tq] = $mp[$Qv];
pH:
ZP:
}
ii:
UW:
if (!class_exists("App\Events\GetSsoUserAttr")) {
goto LV;
}
$yN = event(new GetSsoUserAttr($mp));
LV:
$ut = urlencode(AESEncryption::encrypt_data($_SESSION["email"][0], "M12K19PV"));
$Ws = urlencode(AESEncryption::encrypt_data($_SESSION["username"][0], "M12K19PV"));
Log::info("redirecting to sign in request");
header("Location: sign?email=" . $ut . "&name=" . $Ws);
exit;
goto vw;
ru:
Log::info("displaying test result window");
(new TestResultActions($mp))->execute();
vw:
} catch (SAMLResponseException $t3) {
if (strcasecmp($r7, Constants::TEST_RELAYSTATE) === 0) {
goto pz;
}
Utilities::showErrorMessage($t3->getMessage());
goto a5;
pz:
(new TestResultActions(array(), $t3))->execute();
a5:
}
Q3:
}
}
new SSO();
?>
Did this file decode correctly?
Original Code
<?php
namespace MiniOrange;
use Illuminate\Http\Request;
use MiniOrange\Classes\Actions\ProcessResponseAction;
use MiniOrange\Classes\Actions\ProcessUserAction;
use MiniOrange\Classes\Actions\ReadResponseAction;
use MiniOrange\Classes\Actions\TestResultActions;
use MiniOrange\Helper\Constants;
use MiniOrange\Helper\Messages;
use MiniOrange\Helper\Utilities;
use MiniOrange\Helper\PluginSettings;
use MiniOrange\Classes\Actions\AuthFacadeController;
use MiniOrange\Helper\Lib\AESEncryption;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Log;
use App\Events\GetSsoUserAttr;
use MiniOrange\Helper\CustomerDetails as CD;
final class SSO
{
public function __construct()
{
if (mo_saml_is_customer_license_verified()) {
goto N2;
}
Utilities::showErrorMessage("\x4e\157\40\x4c\151\143\145\156\x73\145\40\x69\163\x20\143\x75\162\162\x65\x6e\x74\154\x79\40\141\x63\164\x69\x76\145\40\x6f\x6e\40\x74\x68\151\163\x20\x64\157\x6d\x61\x69\156\56\40\120\154\x65\x61\163\145\x20\141\x63\164\x69\166\x61\x74\x65\x20\164\x68\x65\40\x6c\x69\143\x65\x6e\x73\x65\40\141\156\144\40\x74\162\171\x20\x61\147\141\151\156\x2e");
goto Ix;
N2:
if (empty(CD::get_option("\143\145\162\x74\151\146\x69\143\x61\164\145"))) {
goto JS;
}
$Tq = CD::get_option("\x6d\x6f\137\163\141\155\x6c\137\x63\x75\163\164\x6f\155\x65\x72\137\x74\x6f\x6b\x65\x6e");
$GY = AESEncryption::decrypt_data(CD::get_option("\143\x65\162\164\151\146\x69\143\x61\x74\145"), $Tq);
if (!(time() > strtotime($GY))) {
goto sN;
}
Utilities::showErrorMessage("\131\157\165\x72\40\164\x72\151\x61\154\x20\150\x61\163\x20\145\x78\160\x69\162\145\144\x2e");
sN:
JS:
Ix:
Log::info("\122\145\x63\145\x69\x76\145\144\40\111\104\x50\40\122\x65\x73\x70\x6f\x6e\163\x65");
$Y7 = PluginSettings::getPluginSettings();
if (array_key_exists("\x53\x41\115\x4c\122\145\163\160\157\x6e\x73\145", $_REQUEST) && !empty($_REQUEST["\123\x41\115\114\122\x65\163\160\157\x6e\x73\145"])) {
goto zz;
}
Utilities::showErrorMessage(Messages::MISSING_SAML_RESPONSE);
goto Q3;
zz:
try {
$r7 = array_key_exists("\x52\145\x6c\x61\171\x53\164\x61\164\145", $_REQUEST) ? $_REQUEST["\122\x65\x6c\141\171\x53\x74\141\164\x65"] : "\57";
Log::info("\x72\x65\x6c\x61\x79\x53\x74\141\x74\x65\40\x3d\76\40" . $r7);
$TH = ReadResponseAction::execute();
$mD = new ProcessResponseAction($TH);
$mD->execute();
$q2 = current(current($TH->getAssertions())->getNameId());
$mp = current($TH->getAssertions())->getAttributes();
$mp["\116\x61\x6d\x65\111\x44"] = array("\60" => $q2);
$PT = current($TH->getAssertions())->getSessionIndex();
$Do = $Y7->getCustomAttributeMapping();
if (strcasecmp($r7, Constants::TEST_RELAYSTATE) == 0) {
goto ru;
}
(new ProcessUserAction($mp, $r7, $PT))->execute();
Log::info("\x75\163\145\162\x20\145\x6d\141\151\154\40\75\x3e\40" . $mp[$Y7->getSamlAmEmail()][0]);
Log::info("\165\x73\x65\x72\156\141\155\145\40\75\76\40" . $mp[$Y7->getSamlAmUsername()][0]);
if (isset($_SESSION)) {
goto Ly;
}
session_start();
Ly:
$_SESSION["\145\155\x61\x69\154"] = $mp[$Y7->getSamlAmEmail()];
$_SESSION["\x75\163\x65\x72\156\x61\x6d\145"] = $mp[$Y7->getSamlAmUsername()];
$_SESSION["\163\145\x73\x73\x69\157\x6e\x5f\151\x6e\x64\x65\170"] = $PT;
$_SESSION["\x73\154\157\137\x75\x72\154"] = $Y7->getSamlLogoutUrl();
if (!(is_array($Do) && !empty($Do))) {
goto UW;
}
foreach ($Do as $Tq => $Qv) {
if (!array_key_exists($Qv, $mp)) {
goto pH;
}
$_SESSION[$Tq] = $mp[$Qv];
pH:
ZP:
}
ii:
UW:
if (!class_exists("\x41\x70\160\x5c\x45\166\145\156\164\x73\x5c\x47\145\164\x53\163\x6f\125\x73\145\162\101\164\x74\x72")) {
goto LV;
}
$yN = event(new GetSsoUserAttr($mp));
LV:
$ut = urlencode(AESEncryption::encrypt_data($_SESSION["\145\x6d\141\x69\x6c"][0], "\x4d\61\62\113\61\71\x50\126"));
$Ws = urlencode(AESEncryption::encrypt_data($_SESSION["\165\x73\145\162\x6e\x61\155\x65"][0], "\115\x31\62\x4b\x31\x39\120\126"));
Log::info("\x72\x65\x64\x69\x72\x65\143\x74\151\156\147\40\x74\x6f\x20\163\151\x67\156\x20\x69\156\x20\x72\x65\x71\x75\x65\x73\164");
header("\114\x6f\x63\141\x74\151\157\x6e\x3a\40\163\x69\x67\156\x3f\x65\155\141\x69\x6c\75" . $ut . "\46\x6e\x61\x6d\145\x3d" . $Ws);
exit;
goto vw;
ru:
Log::info("\144\151\x73\160\154\x61\171\x69\x6e\x67\x20\x74\x65\x73\x74\40\162\x65\x73\x75\154\x74\40\167\151\156\x64\157\167");
(new TestResultActions($mp))->execute();
vw:
} catch (SAMLResponseException $t3) {
if (strcasecmp($r7, Constants::TEST_RELAYSTATE) === 0) {
goto pz;
}
Utilities::showErrorMessage($t3->getMessage());
goto a5;
pz:
(new TestResultActions(array(), $t3))->execute();
a5:
}
Q3:
}
}
new SSO();
Function Calls
None |
Stats
MD5 | d2263aba2fd264364e719f36ded92e59 |
Eval Count | 0 |
Decode Time | 41 ms |