tanbhirhossain/laravel-live-terminal
exec())./terminal) and a config file (config/terminal.php). Minimal dependency on core Laravel systems (no database, queue, or event bus changes).allowed_commands in config.can:admin or role-based gates).exec(), which may require disable_functions adjustments in php.ini (common in shared hosting).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Shell Injection | Critical | Strict whitelisting + input sanitization. |
| Authentication Bypass | High | Enforce multi-factor auth (MFA) for terminal access. |
| Performance Overhead | Medium | Limit concurrent sessions; avoid long-running commands. |
| Hosting Compatibility | Medium | Test exec() restrictions in target environment. |
| Command Output Size | Low | Implement pagination or streaming for large outputs. |
artisan cache:clear)?Admin) or external systems (e.g., LDAP)?migrate) to avoid timeouts?exec() behavior.exec(), shell_exec(), or passthru() enabled (commonly disabled in shared hosting).allow_url_fopen if commands fetch remote resources.exec() is enabled (php -i | grep disable_functions).artisan queue:work --once).composer require tanbhirhossain/laravel-live-terminal
php artisan vendor:publish --provider="Tanbhir\LiveTerminal\LiveTerminalServiceProvider"
allowed_commands in config/terminal.php (start with a minimal set, e.g., cache:clear, migrate).'allowed_commands' => [
'cache:clear',
'migrate --force',
'queue:work --once --sleep=3 --tries=1',
],
TerminalMiddleware):
Route::middleware(['auth', 'can:access-terminal'])->get('/terminal', [TerminalController::class, 'index']);
throttle:60,1).storage:link) may time out or crash the browser. Consider streaming via ob_flush().chmod -R 755 storage/bootstrap/cache).route:list).cache:clear).exec() failures.terminal_commands table).allowed_commands must be version-controlled and reviewed during deployments.exec() behavior).allowed_commands syntax (e.g., migrate vs. migrate:status).www-data).exec() restrictions in php.ini.storage/logs/laravel.log for exec() errors.storage:link may block the web process.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Whitelist Misconfiguration | Unauthorized command execution | Automated CI checks for allowed_commands. |
| DDoS on Terminal Route | Server overload | Cloudflare WAF + rate-limiting. |
| Command Output Bomb | Browser crash/memory leak | Stream output with ob_flush(). |
PHP exec() Disabled |
Package fails silently | Feature flag for fallback to SSH. |
| Session Hijacking | Unauthorized access | Enforce short-lived tokens + MFA. |
How can I help you explore Laravel packages today?