- A simple tool to enhance USB drive security.
The USB Port Manager is a Python application designed to control and monitor USB ports on your computer. Whether you want to enable or disable USB ports, track user activity, or enhance security, this tool provides a simple interface to manage USB connectivity.
-
USB Port Control:
- Enable or disable USB ports to prevent unauthorized data transfers or device connections.
- Enhance security by restricting access to USB devices.
-
User Activity Logging:
- Keep track of USB port usage by logging user actions (enable/disable) and timestamps.
- Maintain an audit trail for accountability and troubleshooting.
-
Two-Factor Authentication (2FA):
- Implement an additional layer of security using time-based one-time passwords (TOTPs).
- Protect sensitive operations with a secure Base32 secret.
-
Login/Sign Up:
- Users can create an account or log in with existing credentials.
- Passwords are securely hashed and stored in the database.
-
Main Application Window:
- Users can enable or disable USB ports with a single click.
- The activity log displays recent actions and timestamps.
-
Two-Factor Authentication:
- Users receive a one-time password (OTP) via email or phone.
- OTPs are generated using a Base32 secret and verified during critical operations.
- Python:
- Ensure you have Python installed on your system. If not, download and install it from the official Python website.
- Clone this Repository:
- Clone this repository to your local machine.
git clone https://github.com/Shubham24S/USB-Physical-Security.git
-
Install Dependencies:
- Install Python and required dependencies (e.g.,
pip install bcrypt pyotp).
- Install Python and required dependencies (e.g.,
-
How to Run the USB Port Manager Application:
- Follow the steps below to set up and run the application.
-
Generate a Base32 Secret:
- Open a terminal or command prompt.
- Navigate to the directory containing
generate_secret.py. - Run the script:
python generate_secret.py. - Copy the generated Base32 secret (e.g.,
JBSWY3DPEHPK3PXP).
-
Update
main.pywith the Base32 Secret:- Open
main.pyin a text editor. - Locate the
two_factor_authfunction (around line 210). - Replace
'your_base32_secret'with the copied secret. - Save the file.
- Open
-
Create an
.envFile:- Create a file named
.envin the same directory asmain.py. - Add your email and password to the
.envfile:EMAIL=example@gmail.com EMAIL_PASSWORD=mypassword123
- Create a file named
-
Run the Application:
- Open a terminal or command prompt.
- Navigate to the directory containing
main.py. - Run the script:
python main.py. - The application window will appear, allowing you to manage USB ports.
- The application will prompt you to log in or sign up.
- If you encounter any issues, ensure that your environment variables (email and password) are correctly set in the
.envfile.
- Fork this repository.
- Create a new branch:
git checkout -b feature-name. - Make your changes and commit:
git commit -m "Add feature". - Push to your fork:
git push origin feature-name. - Create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.