Program to control remote computer by email.
Program to control remote computer by email, in which:
- The user (client) sends an email (containing requests to be made by the server) to the server's email (server).
- The server reads the incoming email, performs the tasks the client sends and sends the results back to the client by replying to the client's email.
Check out the demo video to see the application in action.
Login page User have 2 choice to using the program:- Without google account, in this option, user can use program in anonymous mode (In this feature, the user has to send and view the response manually, the program only helps the user to write valid commands to the server)
- Within google account, in this option, user must provide read and send email permission (In this feature, the program will help you to send and view reply email)
- See the content of the reply mail
- See the details of the attached file
- Download the attached file to the
- Download folder
- Framework: Flask
- Backend: Python
- Frontend: HTML, CSS, JavaScript, Bootstrap 5
Client application: A web GUI app to control remote computer, in which:
- Login with google account.
- Send email to server.
- Get and show reply email from server.
- View detail and download attached files.
Server application:
- Key logger: Get keystrokes from keyboard.
- Shutdown/logout:
- Shutdown computer.
- Logout computer.
- MAC address: Get computer's MAC address.
- Save screenshot.
- Capture webcam image.
- Directory tree:
- List all files in a directory.
- Copy files to client computer.
- Copy files to server computer.
- Delete files.
- App process:
- List processes.
- List applications.
- Kill processes.
- Start applications.
- Registry:
- Get registry value.
- Set registry value.
- Create registry key.
- Delete registry key.
-
Python
>= 3.10.7
-
Enable IMAP in your server email, see Turn POP & IMAP on or off for users
-
Client environment variables:
-
Environment: add file
.env
in/Client
,.env
config:SECRET_KEY
: a key used by Flask to encrypt and sign session data.PORT
: specify which port the Flask application should listen on.SERVER_EMAIL_ADDRESS
: the email address of the server, which is received email from clientSERVER_EMAIL_PASSWORD
: the password of the server's email
Example:
# .env SECRET_KEY = "RemoteControlByEmail-HCMUS" PORT = 3000 SERVER_EMAIL_ADDRESS = "[email protected]" SERVER_EMAIL_PASSWORD = "server_password"
Note: If you want to use this example environment, you need to rename it to .env.
-
Credentials: get Gmail API credentials file by Gmail API instruction then add file
credentials.json
in/Client
Example:
// credentials.json { "installed": { "client_id": "client_id.apps.googleusercontent.com", "project_id": "gmail-remote-control", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_secret": "client_secret", "redirect_uris": ["http://localhost"] } }
Note: If you want to use this example environment, you need to rename it to credentials.json.
-
Note: The
credentials.json
file is only used for the first time the user logs in, after that the program will automatically generate atoken.json
file to store the user's credentials.
Clone the project:
git clone https://github.com/HCMUS-Project/Gmail-Remote-Control.git
Go to the project directory:
cd Gmail-Remote-Control
Install dependencies:
pip install -r requirements.txt
Start the server:
python Server/server.py
The server will run on port 5656 and with host 0.0.0.0
Start the client:
python Client/client
The client will run on PORT which define in .env
file and with host:
- Running on http://127.0.0.1:[PORT]
- 19127392 - To Gia Hao
- 19127525 - Nguyen Thanh Quan
- 19127625 - Lam Chi Van
Python 3.11 Document
Flask document
Youtube - MacOS big sur theme
Gmail API Document
PIL Documentation
Pynput Documentation
Psutil Documentation