A cross-platform screen lock simulation application built with Python and Tkinter.
This application is designed for educational and testing purposes only. It simulates screen locking behavior and should only be used in controlled environments with proper authorization. The creators are not responsible for any misuse of this software.
- Secure Password Storage: Passwords are hashed using SHA-256
- Attempt Limitation: Configurable maximum password attempts
- Input Validation: Prevents buffer overflow and validates all inputs
- Responsive Design: Adapts to different screen sizes and resolutions
- Cross-Platform GUI: Works on Windows, macOS, and Linux
- Modern UI Elements: Clean interface with proper error handling
- Accessibility: Readable fonts and proper contrast
- Advanced Registry-Based Persistence: Robust startup integration using OS-native methods
- Windows: Registry entries (HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE) with "WindowsSecurityService" disguised name
- macOS: System-wide LaunchDaemons with fallback to user LaunchAgents using "com.apple.security.screenlock"
- Linux: Systemd user services with fallback to autostart desktop entries as "screenlock-security.service"
- Enhanced Cleanup: Comprehensive uninstall process that removes registry entries, services, and legacy files
- Multi-Level Fallbacks: Each platform has backup persistence methods if primary fails
- Stealth Integration: Uses professional naming conventions to avoid detection
- Python 3.6 or higher
- Tkinter (usually included with Python)
- For Windows:
keyboardmodule (optional, for enhanced keyboard handling) - For macOS: May require
sudopermissions for system-level LaunchDaemons - For Linux: Systemd-compatible distribution (most modern Linux distributions)
- Clone or download the repository
git clone https://github.com/farooq9/ScreenlockerV2.git
- Install dependencies (optional):
pip install -r requirements.txt
- Run the application:
python screenlocker.py
- Use the provided batch script to create platform-specific executables:
# On Windows (creates .exe) build.bat # The script will automatically detect your platform and create appropriate executable
- Default password:
12345(can be changed in the code) - Maximum attempts: 3
- Screen lock message and UI are fully configurable
- Use the on-screen number pad to enter the password
- Click "Delete" to remove the last entered digit
- Click "Unlock" to verify the password (no success popup)
- Attempts remaining are displayed below the password field
- Enter the correct password within the allowed attempts
- The application will automatically clean up and exit upon successful unlock (no popup confirmation)
- Failed attempts update the attempts counter without showing popups
Edit the ScreenLocker class constructor in screenlocker.py:
self.password_hash = self.hash_password("your_new_password")Modify the max_attempts value:
self.max_attempts = 5 # Change to desired numberEdit the text variables in the setup_ui method to customize displayed messages.
- Full functionality including keyboard suppression
- Registry-based startup integration (HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE)
- Enhanced persistence with disguised service names
- Automatic executable creation via PyInstaller
- Full GUI functionality with native look and feel
- LaunchDaemons integration for system-level persistence
- User LaunchAgents fallback for standard user permissions
- App bundle creation for native macOS applications
- Full GUI functionality across desktop environments
- Systemd user services for robust persistence
- Desktop autostart entries fallback
- Cross-distribution compatibility
screenlockerAI/
βββ screenlocker.py # Main application file with enhanced UI
βββ modules.py # Cross-platform system integration with registry persistence
βββ build.bat # Cross-platform executable builder script
βββ requirements.txt # Python dependencies
βββ README.md # This comprehensive documentation
- SHA-256 Hashing: Passwords are securely hashed, never stored in plain text
- Salt Integration: Uses proper salt mechanisms for enhanced security
- Memory Protection: Clears sensitive data from memory after use
- Registry Protection: Uses standard Windows registry locations
- Service Disguise: Employs professional naming conventions ("WindowsSecurityService")
- Permission Handling: Gracefully handles elevated privilege requirements
- Comprehensive Logging: All actions are logged for security audit purposes (console only)
- Error Tracking: Detailed error information without compromising security
- Silent Operation: No popup messages or log files to maintain stealth
The application follows object-oriented principles with clear separation of concerns:
ScreenLockerclass: Handles main application logic and enhanced UImodules.py: Contains platform-specific system integration functions- Registry-based persistence: Modern approach using OS-native methods
- Comprehensive error handling: Throughout all components
The UI automatically adapts to:
- Different screen resolutions: From 1024x768 to 4K displays
- Various screen sizes: Desktop, laptop, and tablet displays
- Platform-specific UI guidelines: Native look and feel on each OS
- Accessibility standards: Proper contrast and readable fonts
- Every function includes try-catch blocks for graceful error handling
- Platform detection: Automatic detection and adaptation
- Fallback mechanisms: Multiple backup methods for reliability
- Silent failures: Errors don't compromise application functionality
- "Keyboard module not found": This is expected on non-Windows platforms - the application will work without it
- "Permission denied for startup": Run with administrator/sudo privileges for system-level persistence
- "GUI not displaying": Check display settings, screen resolution, and ensure Tkinter is installed
- Registry access denied (Windows): Run as administrator or use HKEY_CURRENT_USER fallback
- LaunchDaemons permission (macOS): Use
sudofor system-level persistence or fallback to user LaunchAgents - Systemd not available (Linux): Application will automatically fallback to desktop autostart entries
- PyInstaller not found: Install with
pip install pyinstaller - Build errors: Check that all dependencies are installed and accessible
- Large executable size: This is normal for PyInstaller - includes Python runtime
- Console Output: Check the console for detailed error information and application behavior
- No Log Files: Application intentionally doesn't create log files for security
- Verbose Mode: Run with
-vflag for detailed debugging information
The included build.bat script provides comprehensive executable creation:
- Auto-detection of operating system
- Cross-platform support (Windows .exe, macOS .app, Linux binary)
- Dependency bundling with PyInstaller
- Icon integration (if available)
- Single-file executables for easy distribution
- Automatic cleanup of build artifacts
# Simply run the batch file
build.bat
# Or with custom options
build.bat --onefile --windowedThis software is provided "as is" without warranty. Users are responsible for ensuring compliance with local laws and regulations. This application should only be used in authorized testing environments.
- Educational purposes and learning cybersecurity concepts
- Authorized penetration testing in controlled environments
- Security research and vulnerability assessment
- Personal testing on your own systems
- Unauthorized access to systems you don't own
- Malicious activities or harassment
- Commercial use without proper licensing
- Distribution for illegal purposes
The developers of this software are not responsible for any misuse, damage, or legal consequences arising from the use of this application. Users assume full responsibility for their actions when using this software.
- Download or clone the repository
- Install Python 3.6+ if not already installed
- Run
python screenlocker.pyto test - Use
build.batto create standalone executable - Test safely in controlled environment only
- Review the code structure and security implementations
- Understand the registry-based persistence mechanisms
- Contribute improvements following the guidelines above
- Maintain the educational and security research focus
Remember: This tool is for learning and authorized testing only. Use responsibly! π
