Comments on: Moodle Administrators – Execute Shell Commands directly from the Moodle interface https://lmsdaily.com/moodle-administrators-execute-shell-commands-directly-from-the-moodle-interface/ Moodle News, Edtech News, LMS News & Teacher Tips for Modern Teacher Tue, 18 Jun 2024 07:15:59 +0000 hourly 1 https://wordpress.org/?v=6.5.5 By: Jaswinder Singh https://lmsdaily.com/moodle-administrators-execute-shell-commands-directly-from-the-moodle-interface/#comment-856 Tue, 18 Jun 2024 07:15:59 +0000 https://lmsdaily.com/?p=11046#comment-856 In reply to MK.

Thanks a lot for your detailed analysis and my apologies for not highlighting the security risks. My point of review is just to help new administrators learn about tools, plugins which can help them without doing actual code review. From an institution point of view, all plugins shall go through a thorough testing and compatibility verification before they can be used in production environments.

]]>
By: MK https://lmsdaily.com/moodle-administrators-execute-shell-commands-directly-from-the-moodle-interface/#comment-846 Thu, 13 Jun 2024 17:43:55 +0000 https://lmsdaily.com/?p=11046#comment-846 I would be very cautious about running the Webshell plugin on any Moodle installation, especially a production one. The plugin is only 2 weeks old (as of June 13th) – the codebase is not mature.

The claim that the Webshell plugin “mitigates security risks associated with SSH” is a bold one. All that is required to access this plugin is an admin password. A properly configured SSH server that makes use of private/public keypairs (and optionally restricts commands) is far more secure than this approach – and its security has been reviewed by many more sets of eyes than this plugin has been.

Also worrisome is the author’s comment on lines 240-243 of the classes/executor.php file:

* Try to run the user code.
*
* This function should NEVER be called by other plugins since we do NOT check capabilities here again

In other words: the function that runs the user’s shell command does not do any checks to see whether the user is actually allowed to do so, and so the author is relying on other plugin authors to not use & abuse their code. It would be very easy to build a malicious plugin that exploits this function.

If you need shell access to a production Moodle server, learn how to configure SSH correctly (no passwords, public/private key authentication only, and consider making use of SSH’s restricted commands feature). Also consider running it on a different port than the default (port 22). Security-wise, you’ll be better off.

]]>