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

Signing you up...

Thank you for signing up!

PHP Decode

"\$c\x6f\x63\x6b =\x20'riz\x65\x5f'\x2e\x72andom()\x2e'.t\x73\x27;\nfi\x6ce\x5fp\x75t_c\..

Decoded Output download

<?    "\$cock = 'rize_'.random().'.ts';
file_put_contents(\$cock, \"import { encrypt, CardData, CardTypes } from 'cs2-encryption';

(async () => {
  try {
    const context = '\$tokenbaby';

    const data: CardData = {
      number: '\$cc',
      expirationMonth: '\$mm',
      expirationYear: '\$yyyy',    
      type: CardTypes.Visa,
    };

    const encrypted = await encrypt(data, context);
    console.log(encrypted);
  } catch (error) {
    console.error('Error:', error);
  }
})();\");
 \$encrypted = trim(shell_exec("ts-node \$cock\"));
 \$kid = base64_decode(explode("." ,\$encrypted)[0]);
 \$keyId = json_decode(\$kid)->kid;
unlink(\$cock);




\$url = 'https://flex.cybersource.com/flex/v2/tokens';
\$ch = curl_init();
curl_setopt(\$ch, CURLOPT_URL, \$url);
curl_setopt(\$ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt(\$ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt(\$ch, CURLOPT_HTTPHEADER, [
  'Accept: */*',
  'Content-Type: application/jwt; charset=UTF-8',
  'Origin: https://flex.cybersource.com',
  'Referer: https://flex.cybersource.com/cybersource/assets/microform/0.11.6/iframe.html?keyId='.\$keyId,
  'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
]);
curl_setopt(\$ch, CURLOPT_POSTFIELDS, \$encrypted);
curl_setopt(\$ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt(\$ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt(\$ch, CURLOPT_SSL_VERIFYPEER, 0);
\$rizecutie = curl_exec(\$ch);
   \$rizecutie . PHP_EOL;
curl_close(\$ch);
"; ?>

Did this file decode correctly?

Original Code

  "\$c\x6f\x63\x6b =\x20'riz\x65\x5f'\x2e\x72andom()\x2e'.t\x73\x27;\nfi\x6ce\x5fp\x75t_c\x6fnt\x65\x6ets(\$c\x6fck, \"\x69\x6d\x70o\x72\x74\x20{\x20\x65n\x63r\x79pt, \x43\x61\x72d\x44\x61ta,\x20Ca\x72dT\x79p\x65s } \x66\x72o\x6d\x20'c\x73\x32-e\x6ec\x72\x79p\x74i\x6f\x6e';\n\n(a\x73yn\x63\x20() => {\n\x20\x20\x74\x72y {\n\x20\x20\x20 \x63\x6f\x6e\x73\x74\x20\x63o\x6e\x74\x65xt\x20= \x27\$\x74o\x6ben\x62\x61by';\n\n\x20   c\x6fn\x73\x74 dat\x61:\x20\x43ar\x64Da\x74\x61 \x3d {\n\x20 \x20\x20\x20 num\x62e\x72:\x20\x27\$\x63\x63',\n \x20  \x20 e\x78\x70\x69r\x61\x74\x69o\x6e\x4d\x6fnth: '\$\x6dm',\n\x20  \x20  \x65xpiratio\x6e\x59ea\x72:\x20\x27\$y\x79\x79\x79', \x20\x20\x20\n   \x20\x20 t\x79p\x65: \x43a\x72\x64\x54y\x70\x65\x73\x2e\x56i\x73\x61,\n\x20\x20 \x20};\n\n\x20\x20  const enc\x72\x79\x70t\x65\x64\x20= \x61\x77\x61\x69\x74\x20\x65nc\x72y\x70t(d\x61t\x61,\x20\x63ont\x65\x78t);\n \x20  co\x6es\x6fle.\x6co\x67(\x65ncry\x70te\x64);\n\x20\x20}\x20\x63\x61tch\x20(e\x72r\x6fr)\x20{\n\x20 \x20\x20\x63onsole.er\x72\x6fr('\x45r\x72\x6f\x72:', er\x72or)\x3b\n\x20 }\n})()\x3b\")\x3b\n \$encryp\x74\x65\x64\x20\x3d \x74ri\x6d(\x73hell\x5f\x65x\x65\x63(\x22ts-\x6eod\x65 \$\x63\x6fc\x6b\"));\n \$\x6b\x69\x64\x20= b\x61s\x65\x364\x5f\x64e\x63\x6f\x64\x65(\x65\x78plod\x65(\x22.\x22 ,\$en\x63rypted)[\x30]);\n\x20\$\x6beyId \x3d\x20\x6a\x73on\x5fd\x65code(\$k\x69\x64)->\x6bi\x64\x3b\nunl\x69\x6ek(\$\x63\x6fck)\x3b\n\n\n\n\n\$url\x20=\x20'https://f\x6ce\x78.c\x79\x62\x65\x72s\x6f\x75\x72c\x65.co\x6d/\x66lex/\x76\x32/\x74\x6f\x6ben\x73\x27\x3b\n\$ch\x20=\x20cur\x6c_i\x6e\x69t()\x3b\ncu\x72\x6c\x5fs\x65\x74opt(\$ch, CURLOPT_\x55\x52L, \$ur\x6c)\x3b\n\x63\x75\x72l\x5f\x73\x65t\x6f\x70\x74(\$\x63h, \x43\x55R\x4c\x4f\x50\x54\x5fC\x55ST\x4fM\x52E\x51\x55\x45\x53\x54, 'POS\x54')\x3b\n\x63u\x72l_\x73\x65t\x6fpt(\$ch,\x20\x43U\x52\x4cOPT\x5fR\x45T\x55R\x4eT\x52\x41N\x53\x46ER,\x20\x31);\nc\x75\x72\x6c\x5fs\x65topt(\$\x63h,\x20C\x55RLO\x50T\x5fHTT\x50\x48\x45\x41\x44ER, [\n \x20'Ac\x63\x65p\x74: */*',\n \x20'C\x6f\x6e\x74e\x6e\x74-\x54y\x70\x65: ap\x70l\x69\x63\x61\x74\x69\x6fn/\x6a\x77t;\x20c\x68a\x72\x73\x65t=\x55TF-\x38\x27,\n \x20'O\x72\x69\x67\x69\x6e: \x68\x74tp\x73://\x66le\x78\x2e\x63yb\x65\x72so\x75\x72\x63e\x2ecom',\n\x20 \x27Re\x66\x65r\x65\x72: \x68\x74t\x70\x73://\x66lex\x2ecyb\x65rsou\x72\x63\x65.\x63\x6fm/\x63y\x62\x65r\x73o\x75rc\x65/\x61s\x73\x65\x74s/\x6d\x69\x63\x72\x6ffo\x72m/0\x2e11.\x36/\x69\x66\x72a\x6d\x65\x2e\x68t\x6d\x6c?key\x49d\x3d\x27\x2e\$\x6b\x65\x79I\x64,\n  \x27\x55\x73e\x72-\x41gent: \x4d\x6fz\x69l\x6c\x61/\x35\x2e0\x20(Win\x64\x6f\x77\x73 NT\x2010\x2e\x30; W\x69\x6e\x364;\x20\x786\x34) A\x70\x70\x6c\x65\x57ebKit/\x35\x337.3\x36 (KH\x54M\x4c,\x20\x6ci\x6b\x65 \x47\x65\x63ko) \x43\x68\x72\x6f\x6de/1\x314\x2e\x30\x2e0\x2e\x30 Sa\x66ari/\x3537.\x33\x36\x27,\n]);\n\x63u\x72l_s\x65t\x6fp\x74(\$\x63\x68, CU\x52\x4cO\x50\x54\x5fPO\x53TFIELD\x53, \$en\x63\x72yp\x74ed)\x3b\ncu\x72\x6c\x5f\x73et\x6fpt(\$\x63\x68, C\x55\x52LO\x50\x54_F\x4fL\x4cO\x57\x4cO\x43AT\x49O\x4e,\x20\x31);\ncur\x6c\x5fs\x65t\x6f\x70t(\$\x63\x68, \x43U\x52LOP\x54\x5fS\x53\x4c\x5fVE\x52\x49F\x59H\x4f\x53\x54,\x200);\n\x63url_\x73e\x74o\x70\x74(\$\x63\x68, CU\x52L\x4f\x50T\x5f\x53\x53L_V\x45R\x49FYP\x45\x45R,\x20\x30)\x3b\n\$ri\x7a\x65c\x75\x74ie \x3d\x20\x63\x75\x72l\x5fexe\x63(\$c\x68);\n\x20\x20\x20\$ri\x7a\x65\x63u\x74\x69\x65\x20.\x20P\x48P\x5fE\x4f\x4c\x3b\nc\x75rl_cl\x6f\x73e(\$\x63h)\x3b\n";

Function Calls

None

Variables

None

Stats

MD5 3e9dfcefd54018727f25160f3fd71c05
Eval Count 0
Decode Time 58 ms