This exploit module leverages an improper input validation vulnerability in MyBB prior to `1.8.30` to execute arbitrary code in the context of the user running the application. MyBB Admin Control setting page calls PHP `eval` function with an unsanitized user input. The exploit adds a new setting, injecting the payload in the vulnerable field, and triggers its execution with a second request. Finally, it takes care of cleaning up and removes the setting. Note that authentication is required for this exploit to work and the account must have rights to add or update settings (typically, myBB administrator role).
Linux,PHP,Unix,Windows
php, cmd, x86, x64
To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':
msf > use exploit/multi/http/mybb_rce_cve_2022_24734
msf exploit(mybb_rce_cve_2022_24734) > show targets
...targets...
msf exploit(mybb_rce_cve_2022_24734) > set TARGET < target-id >
msf exploit(mybb_rce_cve_2022_24734) > show options
...show and set options...
msf exploit(mybb_rce_cve_2022_24734) > exploit
Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.
– Jim O’Gorman | President, Offensive Security