DEV Community

Mahmud Rahman
Mahmud Rahman

Posted on

SilentCamTrap – Catch Intruders with One Click (Then Auto-Shutdown Your PC)

SilentCamTrap is a personal security utility I built for one reason: to silently snap a photo of anyone who tries to snoop on my PC — and immediately shut the system down before they can do more damage.

Disguised as a harmless-looking executable game (PlayGame.exe), this tool uses a combination of C and Python to capture a webcam photo without any visible interface, store it with a timestamp, and then shut the system down — all in seconds.

Releases: https://github.com/mahmud-r-farhan/SilentCamTrap/releases


🔍 How It Works

  1. The user (you) runs PlayGame.exe — looks like an innocent game.
  2. Under the hood, this executable silently runs a Python script.
  3. The Python script:
  • Activates the webcam.
  • Takes a picture without showing any preview.
  • Saves the image in a predefined folder (intruder_logs).
  • Shuts down the Windows machine instantly.

⚙️ Tech Stack & Reasoning

  • C: Used to create a lightweight, stealthy Windows-native executable (PlayGame.exe). It launches silently and looks legit — no console, no trace.
  • Python: Handles the actual job of webcam capture and triggering the system shutdown via:

    • OpenCV for image capture
    • os.system("shutdown /s /t 0") for shutdown

🔁 Why both?
Python = fast development & rich libraries.
C = system-level disguise & native performance.


🛠️ Setup & Usage

Prerequisites

  • Windows PC
  • Python 3.x installed (for testing/dev)
  • GCC (MinGW) for C compilation
  • Python packages: opencv-python, pyinstaller

Steps

  1. Clone or download the project.
  2. Install dependencies:
   pip install opencv-python pyinstaller
Enter fullscreen mode Exit fullscreen mode
  1. Compile the Python script:
   pyinstaller --noconsole --onefile capture_shutdown.py
Enter fullscreen mode Exit fullscreen mode
  1. Move the resulting capture_shutdown.exe to the main folder.
  2. Compile the C launcher:
   gcc trap.c -o PlayGame.exe
Enter fullscreen mode Exit fullscreen mode
  1. Double-click PlayGame.exe to test.

🔧 Customization

  • Photo Save Location: Edit the folder variable in capture_shutdown.py.
  • Make it Sneaky:

    • Rename PlayGame.exe to something that fits your use case.
    • Add a fake game icon using a .ico file and resource editing tools.
    • Store logs on an external drive, hidden folder, or encrypted volume.

🛡️ Security & Privacy Notes

  • Data Privacy: No data is sent externally. All photos are saved locally.
  • Ethical Use Only: This is designed for personal device security. Please ensure you're not violating any privacy laws or ethical boundaries.
  • Transparency: Inform any shared users if this is active. (E.g., roommates, family)

📁 GitHub Repo:

GitHub logo mahmud-r-farhan / SilentCamTrap

Intruder Detection and Data Collection System

🔒 SilentCamTrap

Version License Node Python CI

Intruder Detection & Capture Review System

Capture an event, collect the surrounding context, review it in a dashboard

Features • Quick Start • Configuration • Documentation • API Reference


⚖️ Read this first

SilentCamTrap can capture webcam images and read local system data, so it touches privacy law in almost every jurisdiction. Use it only on machines you own or are explicitly authorised to monitor, and where the people involved have notice and consent.

  • enable_shutdown and enable_self_delete ship disabled by default and are intended for controlled lab demos, not production endpoints.
  • Do not deploy the client on third-party or managed devices without written authorisation.
  • Unauthorised access to a computer, or intercepting data from a network or communications service, is illegal in many countries (for example the US CFAA, the UK Computer Misuse Act the EU GDPR for personal data handling).

The repository author is not responsible for misuse…


📬 Contact: dev@devplus.fun

Download:

For PlayGame.exe(C) require the capture_shutdown.exe(Python)
example:

Desktop
├── dist
│   └── capture_shutdown.exe
└── PlayGame.exe
Enter fullscreen mode Exit fullscreen mode

Follow for more @mahmud-r-farhan

Top comments (0)