DEV Community

Mahmudur Rahman
Mahmudur 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

A utility designed to discreetly capture an intruder's photo using the webcam and then shut down the Windows PC immediately.

SilentCamTrap

SilentCamTrap is a personal security utility designed to discreetly capture an intruder's photo using the webcam and then shut down the Windows PC immediately. It is disguised as a harmless game executable (PlayGame.exe) to trick anyone who tries to open your computer without permission.


How It Works

  1. The user double-clicks the PlayGame.exe file, which looks like a normal game.
  2. This executable is a small C program that silently launches a Python script in the background.
  3. The Python script accesses the webcam, captures a photo without opening any preview window, and saves it to a predefined folder.
  4. Immediately after capturing the image, the script shuts down the computer (shutdown /s /t 0).
  5. The captured photo is saved with a timestamp in a folder (default is intruder_logs, but this can be customized).

Why Use C and Python Together?

  • C is used to create a lightweight, native…






📬 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)