exploit the possibilities
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:

July 2024

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