8.0 KiB
🚀 AleShell - Modern PHP Web Shell
AleShell is a powerful, secure, and modern web shell built with PHP. It's a complete rewrite and modernization of the b374k project, featuring a beautiful responsive interface, enhanced security, and modern development practices.
✨ Features
🔐 Security
- Advanced Authentication with password hashing and session management
- CSRF Protection for all state-changing operations
- Rate Limiting to prevent brute force attacks
- IP Whitelisting/Blacklisting for access control
- Path Traversal Protection to prevent unauthorized file access
- Command Filtering to block dangerous system commands
- Session Security with secure cookies and session regeneration
🎨 Modern Interface
- Responsive Design that works on desktop, tablet, and mobile
- Dark/Light Theme toggle with system preference detection
- Keyboard Shortcuts for power users
- Real-time Updates for system information
- Smooth Animations and transitions
- Modular Architecture with lazy-loaded components
📁 File Manager
- Complete File Operations (create, read, update, delete, copy, move)
- Drag & Drop Upload with progress indicators
- Syntax Highlighting for code files
- File Permissions management
- Archive Support (zip, tar, tar.gz)
- Large File Handling with streaming
- File Search and filtering capabilities
💻 Terminal
- Interactive Terminal with command history
- Built-in Commands (cd, pwd, help, etc.)
- Command Auto-completion
- Output Streaming for long-running commands
- Multiple Terminal Tabs
- Configurable Timeout for command execution
📝 Code Editor
- Syntax Highlighting for multiple languages
- Line Numbers and code folding
- Find & Replace functionality
- Auto-indentation and code formatting
- Multiple Editor Themes
- File Type Detection
⚡ System Monitoring
- Real-time System Stats (CPU, Memory, Disk, Network)
- Process Manager with kill capabilities
- Network Tools (ping, traceroute, port scan)
- System Information display
- Load Average monitoring
🗄️ Database Tools
- Multi-Database Support (MySQL, PostgreSQL, SQLite)
- SQL Query Execution with result formatting
- Database Browser with table structure
- Export/Import capabilities
- Connection Management
🚀 Installation
Requirements
- PHP 7.4 or higher
- Web server (Apache, Nginx, etc.)
- PHP extensions: json, mbstring, openssl
Quick Install
- Download the latest release
- Extract to your web directory
- Access via web browser
- Default password:
aleshell
From Source
git clone https://github.com/yourusername/aleshell.git
cd aleshell
# Upload to your web server
📦 Packed Version (Recommended)
For easy deployment, use the AleShell Packer to generate a single encrypted PHP file:
Web Interface
- Access
pack.phpin your browser - Configure options (password, modules, compression)
- Click "Generate AleShell Packed"
- Upload the generated file to any PHP server
Command Line
# Basic packed version
php pack.php -o shell.php -p your_password --encrypt
# Advanced packed version
php pack.php -o advanced.php -p secure_pass --encrypt --minify --obfuscate
Benefits of Packed Version:
- ✅ Single file deployment
- ✅ Encrypted and compressed
- ✅ No external dependencies
- ✅ Customizable features
- ✅ Built-in security options
⚙️ Configuration
AleShell can be configured by creating a src/config/config.php file:
<?php
return [
'security' => [
'password' => password_hash('your_secure_password', PASSWORD_DEFAULT),
'session_timeout' => 3600, // 1 hour
'allowed_ips' => [], // Empty = allow all
'max_attempts' => 5,
'lockout_time' => 300 // 5 minutes
],
'features' => [
'file_manager' => true,
'terminal' => true,
'code_editor' => true,
'process_manager' => true,
'network_tools' => true,
'database_tools' => true
],
'ui' => [
'theme' => 'dark', // 'dark' or 'light'
'language' => 'en',
'items_per_page' => 50
],
'limits' => [
'max_file_size' => 50 * 1024 * 1024, // 50MB
'max_upload_size' => 100 * 1024 * 1024, // 100MB
'command_timeout' => 30
]
];
🔒 Security Considerations
AleShell is designed with security in mind, but you should still follow best practices:
- Change the default password immediately after installation
- Use HTTPS in production environments
- Restrict access using IP whitelisting when possible
- Monitor access logs for suspicious activity
- Keep PHP updated to the latest stable version
- Remove from production when not needed
🌐 Browser Support
AleShell supports all modern browsers:
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
- Opera 47+
📱 Mobile Support
The interface is fully responsive and optimized for mobile devices with:
- Touch-friendly controls
- Responsive navigation
- Optimized layouts
- Gesture support
🎯 Keyboard Shortcuts
Ctrl+1- DashboardCtrl+2- File ManagerCtrl+3- TerminalCtrl+4- Code EditorCtrl+L- Clear terminalCtrl+S- Save file (in editor)
🔧 Development
Architecture
AleShell follows modern PHP development practices:
- PSR-4 Autoloading for clean class organization
- MVC Pattern with controllers and views
- Modular Design for easy extensibility
- RESTful API for all operations
- Security-first approach
File Structure
aleshell/
├── index.php # Entry point
├── src/ # Source code
│ ├── core/ # Core framework classes
│ ├── controllers/ # Request handlers
│ ├── security/ # Security components
│ ├── modules/ # Feature modules
│ ├── themes/ # UI themes
│ ├── config/ # Configuration
│ └── utils/ # Utility classes
├── uploads/ # File uploads (create if needed)
├── logs/ # Application logs
└── README.md
Adding Modules
Create a new module by:
- Creating a directory in
src/modules/ - Adding a
module.jsonconfiguration file - Implementing the module class
- Registering routes if needed
Example module structure:
src/modules/mymodule/
├── module.json
├── MyModule.php
├── assets/
│ ├── style.css
│ └── script.js
└── templates/
└── index.html
🐛 Troubleshooting
Common Issues
-
Permission Errors
- Ensure PHP has read/write permissions
- Check file ownership and permissions
-
Session Issues
- Verify session directory is writable
- Check PHP session configuration
-
Command Execution Fails
- Verify exec functions are enabled
- Check system PATH configuration
Debugging
Enable debug mode in configuration:
'app' => [
'debug' => true
]
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
🙏 Acknowledgments
- Based on the original b374k project
- Inspired by modern web development practices
- Thanks to all contributors and testers
⚠️ Disclaimer
This tool is intended for legitimate system administration purposes only. Users are responsible for ensuring compliance with applicable laws and regulations. The authors are not responsible for any misuse of this software.
AleShell v2.0.0 - Built with ❤️ for system administrators