Extension:GoToShell

The GoToShell extension implements a special page that takes the user to shell and back. This extension is free software than can be modified and distributed under the terms of the GPL and/or the DWTSYWWI (Do Whatever The Shell You Want With It) license. By default, shell is reserved for bureaucrat>Special:MyLanguage/Manual:Bureaucrat|bureaucrats only, but you can change $wgGroupPermissions so that other deserving users can go to shell too.

$wgGoToShellCommand
Set this to whatever you want it to do; e.g. "ls -l", "update-php>Special:MyLanguage/update.php|./maintenance/php update.php --quick", "rm -rf /incriminating_data", etc.