Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
function saml_logout() { global $base_url; if (setrawcookie("\x..
Decoded Output download
<? function saml_logout()
{
global $base_url;
if (setrawcookie("miniOrange2faInvokedSuccessfully", FALSE, \Drupal::time()->getRequestTime() - 7200, "/")) {
goto t6;
}
\Drupal::logger("miniorange_saml_idp")->error(t("Something went wrong while unsetting the cookie %cookie_name.", array("%cookie_name" => "miniOrange2faInvokedSuccessfully")));
goto vv;
t6:
\Drupal::logger("miniorange_saml_idp")->info(t("Unset the cookie %cookie_name successfully.", array("%cookie_name" => "miniOrange2faInvokedSuccessfully")));
vv:
$user = \Drupal::currentUser();
if (!empty($_REQUEST["SAMLRequest"])) {
goto Ob;
}
if (isset($_COOKIE["slo_initiator"])) {
goto dn;
}
$q9 = isset($_COOKIE["response_params"]) ? JSON::decode($_COOKIE["response_params"]) : array();
foreach ($q9 as $eo => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($eo, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
if (!($F0 == '')) {
goto LO;
}
Utilities::moIDPSetCookie("response_params", Json::encode($q9), time() - 7200);
\Drupal::moduleHandler()->invokeAll("user_logout", [$user]);
session_destroy();
$W9 = new RedirectResponse($base_url);
$W9->send();
return new Response();
LO:
unset($q9[$eo]);
Utilities::moIDPSetCookie("response_params", Json::encode($q9), time() + 7200);
$VE = $base_url . "/?q=admin/config/people/miniorange_saml_idp/";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
FI:
}
Hx:
if (!isset($_COOKIE["response_params"])) {
goto In;
}
unset($_COOKIE["response_params"]);
Utilities::moIDPSetCookie("response_params", '', time() - 3600);
In:
$F3 = $base_url;
\Drupal::moduleHandler()->invokeAll("user_logout", [$user]);
session_destroy();
$W9 = new RedirectResponse($F3);
$W9->send();
return new Response();
goto in;
dn:
$gY = JSON::decode($_COOKIE["slo_initiator"]);
$gY = Utilities::moIDPSanitizeParameters($gY);
$q9 = isset($_COOKIE["response_params"]) ? JSON::decode($_COOKIE["response_params"]) : array();
if (sizeof($q9) > 0) {
goto Rk;
}
unset($_COOKIE["response_params"]);
Utilities::moIDPSetCookie("response_params", '', time() - 3600);
unset($_COOKIE["slo_initiator"]);
Utilities::moIDPSetCookie("slo_initiator", '', time() - 3600);
$n5 = $_SESSION["base64EncodedXML"];
\Drupal::moduleHandler()->invokeAll("user_logout", [$user]);
session_destroy();
if (!str_contains($gY["destination"], "learnworlds.com")) {
goto Hd;
}
$W9 = new RedirectResponse($gY["destination"]);
$W9->send();
return new Response();
Hd:
$this->_send_logout_response($n5, $gY["relayState"], $gY["destination"]);
goto ra;
Rk:
foreach ($q9 as $FL => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($FL, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
if (!($F0 == '')) {
goto tM;
}
\Drupal::moduleHandler()->invokeAll("user_logout", [$user]);
session_destroy();
$W9 = new RedirectResponse($base_url);
$W9->send();
return new Response();
tM:
unset($q9[$FL]);
Utilities::moIDPSetCookie("response_params", Json::encode($q9), time() + 7200);
$VE = $base_url . "/?q=admin/config/people/miniorange_saml_idp/";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
iX:
}
ef:
ra:
in:
Ob:
if (array_key_exists("SAMLRequest", $_REQUEST) && !empty($_REQUEST["SAMLRequest"])) {
goto ff;
}
if (array_key_exists("SAMLResponse", $_REQUEST) && !empty($_REQUEST["SAMLResponse"])) {
goto Rf;
}
goto pK;
ff:
$TD = gzinflate(base64_decode($_REQUEST["SAMLRequest"]));
if ($TD !== FALSE) {
goto l7;
}
$M2 = base64_decode($_REQUEST["SAMLRequest"]);
goto NX;
l7:
$M2 = $TD;
NX:
$P0 = new DOMDocument();
if (!(\PHP_VERSION_ID < 80000)) {
goto V9;
}
libxml_disable_entity_loader(true);
V9:
$P0->loadXML($M2);
$eQ = $P0->firstChild;
$Ta = "/";
if (!array_key_exists("RelayState", $_REQUEST)) {
goto XN;
}
$NR = $_REQUEST["RelayState"];
$NR = str_replace(""", """, $NR);
XN:
if (!($eQ->localName == "LogoutRequest")) {
goto dB;
}
$a8 = new LogoutRequest($eQ);
$F6 = $a8->getId();
$Cx = $a8->getIssuer();
$XS = new MiniorangeSAMLSP();
$mI = $XS->sqlQueryWithWhereClause("*", "mo_idp_sp_issuer", $Cx);
$La = $mI[0]->mo_idp_slo_url;
$mA = $mI[0]->mo_idp_logout_binding_type;
$kP = $mI[0]->mo_idp_response_signed;
if ($mA == 1) {
goto rG;
}
$mA = "HTTP-Redirect";
goto iO;
rG:
$mA = "HTTP-POST";
iO:
$VE = $base_url . "/?q=admin/config/people/miniorange_saml_idp/";
$QF = Utilities::createLogoutResponse($F6, $VE, $La, $mA);
$ET = \Drupal::config("miniorange_saml_idp.settings")->get("miniorange_saml_private_certificate");
$tC = \Drupal::config("miniorange_saml_idp.settings")->get("miniorange_saml_publ_certificate");
if (!empty($ET) && !empty($tC)) {
goto ko;
}
$w4 = MiniorangeSAMLIdpConstants::Miniorange_saml_idp_key;
$SR = MiniorangeSAMLIdpConstants::Miniorange_saml_idp_certificate;
goto WN;
ko:
$w4 = $ET;
$SR = $tC;
WN:
$n5 = Utilities::signXML($mA, $QF, $SR, $w4, $kP);
dB:
$a8 = new LogoutRequest($eQ);
$Cx = $a8->getIssuer();
$XS = new MiniorangeSAMLSP();
$mI = $XS->sqlQueryWithWhereClause("*", "mo_idp_sp_issuer", $Cx);
$eo = $mI[0]->id;
$q9 = isset($_COOKIE["response_params"]) ? JSON::decode($_COOKIE["response_params"]) : array();
$gY = Utilities::moIDPSanitizeParameters($q9[$eo]);
$gY["id"] = $eo;
$_SESSION["base64EncodedXML"] = $n5;
$gY["destination"] = $La;
Utilities::moIDPSetCookie("slo_initiator", Json::encode($gY), time() + 7200);
unset($q9[$eo]);
Utilities::moIDPSetCookie("response_params", Json::encode($q9), time() + 7200);
foreach ($q9 as $eo => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($eo, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
unset($q9[$eo]);
Utilities::moIDPSetCookie("response_params", Json::encode($q9), time() + 7200);
$VE = $base_url . "/?q=admin/config/people/miniorange_saml_idp/";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
mY:
}
je:
$F3 = $base_url . "/user/logout/";
$W9 = new RedirectResponse($F3);
$W9->send();
return new Response();
goto pK;
Rf:
$this->_read_saml_response($_REQUEST, \Drupal::request()->query->getIterator()->getArrayCopy());
pK:
return new Response();
} ?>
Did this file decode correctly?
Original Code
function saml_logout()
{
global $base_url;
if (setrawcookie("\x6d\x69\x6e\151\117\162\141\156\x67\x65\x32\146\x61\x49\x6e\166\157\x6b\145\x64\123\165\143\x63\x65\163\x73\146\x75\x6c\154\171", FALSE, \Drupal::time()->getRequestTime() - 7200, "\x2f")) {
goto t6;
}
\Drupal::logger("\155\151\x6e\x69\x6f\x72\141\156\x67\145\137\x73\141\x6d\154\x5f\x69\x64\160")->error(t("\123\x6f\x6d\x65\164\150\x69\x6e\147\x20\167\x65\156\x74\40\167\x72\x6f\156\147\x20\x77\150\151\x6c\x65\x20\x75\156\x73\145\164\x74\151\156\x67\40\164\x68\x65\x20\143\157\157\153\x69\x65\x20\45\143\x6f\x6f\x6b\x69\x65\137\x6e\x61\155\x65\56", array("\45\143\x6f\x6f\x6b\151\x65\137\x6e\x61\x6d\145" => "\155\x69\x6e\x69\117\162\141\x6e\x67\x65\62\x66\141\x49\156\x76\x6f\153\x65\x64\x53\165\143\x63\x65\163\x73\x66\x75\x6c\x6c\x79")));
goto vv;
t6:
\Drupal::logger("\155\151\x6e\151\157\x72\x61\156\147\x65\x5f\x73\x61\x6d\x6c\137\151\x64\160")->info(t("\x55\x6e\163\145\x74\x20\x74\x68\x65\40\143\x6f\x6f\x6b\x69\145\x20\45\x63\x6f\x6f\x6b\x69\145\x5f\156\x61\155\x65\40\x73\165\143\143\x65\x73\x73\x66\165\x6c\x6c\171\56", array("\x25\x63\x6f\157\153\x69\x65\137\x6e\x61\155\x65" => "\155\x69\156\x69\117\x72\141\156\147\145\x32\146\x61\111\156\x76\157\153\x65\x64\123\165\143\143\x65\163\x73\x66\x75\154\154\x79")));
vv:
$user = \Drupal::currentUser();
if (!empty($_REQUEST["\x53\x41\x4d\114\x52\x65\161\165\145\163\x74"])) {
goto Ob;
}
if (isset($_COOKIE["\163\154\x6f\137\x69\156\x69\164\x69\141\x74\157\162"])) {
goto dn;
}
$q9 = isset($_COOKIE["\162\x65\163\x70\x6f\x6e\x73\x65\x5f\160\x61\x72\x61\x6d\163"]) ? JSON::decode($_COOKIE["\162\145\163\x70\x6f\156\x73\x65\x5f\x70\141\x72\141\x6d\163"]) : array();
foreach ($q9 as $eo => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($eo, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
if (!($F0 == '')) {
goto LO;
}
Utilities::moIDPSetCookie("\162\x65\163\160\157\156\163\145\137\160\x61\x72\141\155\163", Json::encode($q9), time() - 7200);
\Drupal::moduleHandler()->invokeAll("\x75\163\145\x72\137\x6c\157\x67\157\165\164", [$user]);
session_destroy();
$W9 = new RedirectResponse($base_url);
$W9->send();
return new Response();
LO:
unset($q9[$eo]);
Utilities::moIDPSetCookie("\x72\x65\x73\x70\x6f\156\163\x65\137\160\141\x72\141\x6d\x73", Json::encode($q9), time() + 7200);
$VE = $base_url . "\x2f\x3f\161\x3d\x61\x64\x6d\x69\x6e\57\143\157\156\146\x69\147\57\160\145\157\x70\x6c\145\x2f\x6d\151\156\151\x6f\x72\x61\156\x67\x65\137\x73\x61\155\x6c\137\151\x64\160\57";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
FI:
}
Hx:
if (!isset($_COOKIE["\162\x65\x73\x70\157\156\x73\145\137\x70\x61\x72\x61\x6d\x73"])) {
goto In;
}
unset($_COOKIE["\x72\145\x73\x70\157\x6e\163\x65\x5f\160\141\162\141\x6d\x73"]);
Utilities::moIDPSetCookie("\x72\x65\163\x70\157\156\x73\145\137\160\x61\x72\141\155\163", '', time() - 3600);
In:
$F3 = $base_url;
\Drupal::moduleHandler()->invokeAll("\165\x73\x65\162\x5f\154\157\147\157\x75\164", [$user]);
session_destroy();
$W9 = new RedirectResponse($F3);
$W9->send();
return new Response();
goto in;
dn:
$gY = JSON::decode($_COOKIE["\x73\154\157\x5f\151\x6e\x69\x74\x69\141\164\157\x72"]);
$gY = Utilities::moIDPSanitizeParameters($gY);
$q9 = isset($_COOKIE["\162\x65\x73\x70\x6f\156\x73\145\137\160\141\162\x61\x6d\163"]) ? JSON::decode($_COOKIE["\162\145\163\160\157\x6e\x73\145\x5f\x70\x61\162\141\155\163"]) : array();
if (sizeof($q9) > 0) {
goto Rk;
}
unset($_COOKIE["\x72\x65\163\160\x6f\156\163\145\x5f\x70\x61\x72\141\x6d\x73"]);
Utilities::moIDPSetCookie("\x72\145\x73\x70\x6f\156\163\x65\137\x70\141\162\x61\x6d\163", '', time() - 3600);
unset($_COOKIE["\x73\x6c\x6f\137\151\156\151\164\x69\x61\x74\157\162"]);
Utilities::moIDPSetCookie("\x73\154\x6f\137\x69\x6e\x69\x74\151\141\164\157\x72", '', time() - 3600);
$n5 = $_SESSION["\142\141\163\145\x36\x34\x45\156\143\157\x64\145\144\x58\115\114"];
\Drupal::moduleHandler()->invokeAll("\165\x73\145\x72\137\x6c\x6f\147\157\165\x74", [$user]);
session_destroy();
if (!str_contains($gY["\144\145\163\x74\151\156\x61\164\151\157\156"], "\x6c\x65\141\x72\x6e\167\157\162\x6c\x64\x73\56\143\157\155")) {
goto Hd;
}
$W9 = new RedirectResponse($gY["\144\x65\x73\164\x69\x6e\141\164\x69\x6f\156"]);
$W9->send();
return new Response();
Hd:
$this->_send_logout_response($n5, $gY["\162\x65\x6c\141\171\x53\164\x61\x74\145"], $gY["\144\145\x73\x74\x69\156\x61\164\151\157\x6e"]);
goto ra;
Rk:
foreach ($q9 as $FL => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($FL, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
if (!($F0 == '')) {
goto tM;
}
\Drupal::moduleHandler()->invokeAll("\x75\163\x65\162\137\x6c\x6f\x67\x6f\x75\x74", [$user]);
session_destroy();
$W9 = new RedirectResponse($base_url);
$W9->send();
return new Response();
tM:
unset($q9[$FL]);
Utilities::moIDPSetCookie("\x72\x65\x73\160\157\x6e\x73\x65\137\x70\141\x72\x61\x6d\x73", Json::encode($q9), time() + 7200);
$VE = $base_url . "\57\x3f\x71\75\141\144\x6d\151\x6e\x2f\x63\157\x6e\x66\x69\147\57\160\x65\157\x70\154\x65\x2f\x6d\151\x6e\151\x6f\162\141\156\x67\145\x5f\x73\x61\155\x6c\137\151\144\x70\x2f";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
iX:
}
ef:
ra:
in:
Ob:
if (array_key_exists("\x53\101\115\x4c\122\x65\x71\165\x65\163\164", $_REQUEST) && !empty($_REQUEST["\x53\x41\115\114\122\145\161\165\145\163\164"])) {
goto ff;
}
if (array_key_exists("\123\101\x4d\114\122\x65\163\160\x6f\156\163\x65", $_REQUEST) && !empty($_REQUEST["\123\x41\x4d\x4c\122\145\x73\x70\x6f\156\x73\145"])) {
goto Rf;
}
goto pK;
ff:
$TD = gzinflate(base64_decode($_REQUEST["\123\101\x4d\114\x52\145\161\165\145\x73\164"]));
if ($TD !== FALSE) {
goto l7;
}
$M2 = base64_decode($_REQUEST["\x53\101\115\x4c\122\x65\161\x75\145\163\164"]);
goto NX;
l7:
$M2 = $TD;
NX:
$P0 = new DOMDocument();
if (!(\PHP_VERSION_ID < 80000)) {
goto V9;
}
libxml_disable_entity_loader(true);
V9:
$P0->loadXML($M2);
$eQ = $P0->firstChild;
$Ta = "\57";
if (!array_key_exists("\x52\145\x6c\141\x79\123\x74\141\164\145", $_REQUEST)) {
goto XN;
}
$NR = $_REQUEST["\122\x65\x6c\141\x79\x53\164\x61\x74\145"];
$NR = str_replace("\42", "\46\161\x75\x6f\164\x3b", $NR);
XN:
if (!($eQ->localName == "\x4c\157\x67\157\165\164\x52\145\x71\165\145\163\164")) {
goto dB;
}
$a8 = new LogoutRequest($eQ);
$F6 = $a8->getId();
$Cx = $a8->getIssuer();
$XS = new MiniorangeSAMLSP();
$mI = $XS->sqlQueryWithWhereClause("\x2a", "\155\x6f\x5f\151\x64\x70\137\163\160\137\x69\163\163\165\145\162", $Cx);
$La = $mI[0]->mo_idp_slo_url;
$mA = $mI[0]->mo_idp_logout_binding_type;
$kP = $mI[0]->mo_idp_response_signed;
if ($mA == 1) {
goto rG;
}
$mA = "\x48\124\124\120\55\x52\145\144\x69\162\x65\143\164";
goto iO;
rG:
$mA = "\x48\124\x54\x50\55\120\x4f\x53\124";
iO:
$VE = $base_url . "\x2f\x3f\161\75\x61\144\155\151\x6e\x2f\143\157\x6e\146\x69\x67\57\160\145\x6f\x70\154\145\57\155\x69\x6e\151\157\x72\141\x6e\x67\145\137\x73\x61\x6d\154\137\x69\x64\160\57";
$QF = Utilities::createLogoutResponse($F6, $VE, $La, $mA);
$ET = \Drupal::config("\155\x69\x6e\151\x6f\162\141\x6e\x67\x65\137\163\141\x6d\x6c\137\151\x64\160\x2e\x73\x65\x74\164\x69\156\147\x73")->get("\155\x69\156\151\157\162\x61\x6e\x67\x65\x5f\163\141\x6d\154\137\160\x72\x69\166\141\x74\x65\x5f\x63\145\x72\x74\x69\146\x69\143\141\164\x65");
$tC = \Drupal::config("\x6d\x69\156\151\157\162\141\156\147\x65\137\163\141\x6d\x6c\137\151\144\160\56\x73\145\x74\x74\151\x6e\x67\x73")->get("\155\151\156\x69\157\162\141\156\147\x65\137\163\141\x6d\154\x5f\160\165\x62\x6c\137\143\145\x72\164\151\146\151\x63\141\164\145");
if (!empty($ET) && !empty($tC)) {
goto ko;
}
$w4 = MiniorangeSAMLIdpConstants::Miniorange_saml_idp_key;
$SR = MiniorangeSAMLIdpConstants::Miniorange_saml_idp_certificate;
goto WN;
ko:
$w4 = $ET;
$SR = $tC;
WN:
$n5 = Utilities::signXML($mA, $QF, $SR, $w4, $kP);
dB:
$a8 = new LogoutRequest($eQ);
$Cx = $a8->getIssuer();
$XS = new MiniorangeSAMLSP();
$mI = $XS->sqlQueryWithWhereClause("\x2a", "\155\x6f\x5f\151\144\x70\x5f\x73\160\x5f\x69\163\x73\165\x65\x72", $Cx);
$eo = $mI[0]->id;
$q9 = isset($_COOKIE["\x72\x65\x73\160\x6f\x6e\163\145\137\160\141\162\x61\x6d\x73"]) ? JSON::decode($_COOKIE["\x72\x65\x73\160\157\x6e\163\x65\137\x70\141\162\141\155\x73"]) : array();
$gY = Utilities::moIDPSanitizeParameters($q9[$eo]);
$gY["\x69\x64"] = $eo;
$_SESSION["\142\x61\x73\145\x36\64\105\x6e\143\x6f\x64\x65\x64\x58\115\x4c"] = $n5;
$gY["\x64\145\163\x74\151\x6e\x61\164\151\157\x6e"] = $La;
Utilities::moIDPSetCookie("\x73\x6c\157\137\151\x6e\151\x74\151\x61\164\157\x72", Json::encode($gY), time() + 7200);
unset($q9[$eo]);
Utilities::moIDPSetCookie("\162\145\163\160\x6f\x6e\163\145\x5f\x70\141\x72\x61\155\163", Json::encode($q9), time() + 7200);
foreach ($q9 as $eo => $wp) {
$wp = Utilities::moIDPSanitizeParameters($wp);
$eo = filter_var($eo, FILTER_VALIDATE_INT);
$XS = new MiniorangeSAMLSP($eo);
$Pt = $XS->getMoIdpNameidFormat();
$Cx = $XS->getMoIdpSpIssuer();
$F0 = $XS->getMoIdpSloUrl();
unset($q9[$eo]);
Utilities::moIDPSetCookie("\162\145\163\160\x6f\156\x73\145\137\160\x61\162\x61\x6d\x73", Json::encode($q9), time() + 7200);
$VE = $base_url . "\x2f\x3f\x71\75\141\x64\x6d\x69\x6e\57\143\157\x6e\x66\x69\147\x2f\x70\145\157\x70\x6c\x65\x2f\155\151\156\151\157\x72\x61\x6e\147\145\137\x73\141\x6d\x6c\x5f\x69\x64\x70\57";
$this->mo_idp_send_logout_request($eo, $Pt, $VE, $F0);
mY:
}
je:
$F3 = $base_url . "\57\x75\163\x65\x72\57\x6c\157\147\x6f\165\x74\x2f";
$W9 = new RedirectResponse($F3);
$W9->send();
return new Response();
goto pK;
Rf:
$this->_read_saml_response($_REQUEST, \Drupal::request()->query->getIterator()->getArrayCopy());
pK:
return new Response();
}
Function Calls
None |
Stats
MD5 | 165cecb3a88a5c3b2e95a45b7032885f |
Eval Count | 0 |
Decode Time | 80 ms |