How It Works (High-level)
On startup, the script reads system details (username, hostname, IP, current time).
It checks Firebase Realtime Database to see if this device is registered — if not, it registers itself with initial data.
Every 10 seconds, it queries Firebase for two flags: alert and screenshot.
If alert is set, it sends a Telegram message with login/system info, then resets the flag.
If screenshot is set, it captures the screen, sends the image to Telegram, then resets the flag.
This process repeats indefinitely, allowing remote monitoring and commands through Firebase and Telegram.
DixitGuard
DixitGuard is a remote monitoring script project that allows you to monitor login alerts and take screenshots on a Linux machine. It integrates with Firebase Realtime Database and Telegram Bot API to send alerts and screenshots remotely.
Features
- Sends login alerts with user, date, hostname, and IP address.
- Stores login info on Firebase Realtime Database.
- Takes screenshots remotely based on Firebase flags.
- Sends screenshots to Telegram.
- Periodically checks Firebase for commands.
Setup Instructions
Prerequisites
- Linux machine with
bash
-
curl
installed -
import
tool from ImageMagick installed (sudo apt install imagemagick
) - Firebase Realtime Database setup with rules allowing your bot to read/write
- Telegram bot token and chat ID
Firebase Setup
- Create a Firebase project at https://console.firebase.google.com/
- Create a Realtime Database
- Set database rules to allow read/write for your bot (for testing only; secure it for production)
- Note the database URL (ends with
.firebaseio.com
or similar)
Telegram Setup
- Create a bot via BotFather on Telegram
- Get your Bot Token
- Find your chat ID by messaging your bot and using tools like userinfobot 4.Full Codes (https://github.com/dixitcoder/DixitGuard/tree/main)
Configure Script
Edit the script to set these variables:
bash
BOT_TOKEN="your_telegram_bot_token_here"
CHAT_ID="your_chat_id_here"
DB_URL="your_firebase_database_url_here"
Running the Script
Make the script executable:
chmod +x DixitGuard.sh
Run it in background or screen:
./DixitGuard.sh &
How It Works
On startup, it registers the host in Firebase if not already present.
Every 10 seconds, it checks Firebase flags for:
alert: sends a login alert to Telegram and resets the flag.
screenshot: takes a screenshot, sends it to Telegram, and resets the flag.
Security Notice
This script is intended for educational and authorized monitoring only. Unauthorized access or surveillance is illegal and unethical.
License
MIT License
> Project Overview
DixitGuard is a Linux shell script project designed for remote monitoring and alerting using Firebase Realtime Database and Telegram Bot API.
It helps you remotely track Linux device usage by:
Sending login alerts with system info (user, hostname, IP address, login time) to a Telegram chat.
Taking screenshots on demand and sending them to Telegram.
Polling Firebase Realtime Database to listen for remote commands (alerts or screenshot requests).
Automatically initializing its Firebase entry on first run to store device info and state.
Top comments (0)