This project demonstrates how a Python script can:
- Access the system webcam using OpenCV
- Capture images at defined intervals
- Send captured images over a network socket
- Run silently in the background using
.pyw - Automatically delete temporary files after sending
The purpose is to help students understand how certain malware techniques may operate, so they can better defend against such threats.
- Python 3
- OpenCV (cv2)
- Socket Programming
- OS Module
- Time Module
- The script initializes the system camera.
- Captures a single frame.
- Saves it temporarily as
capture.jpg. - Sends the file to a configured server IP and port.
- Deletes the local file.
- Waits for the defined interval.
- Repeats the process.
This demonstrates how data exfiltration techniques may function in real-world attack scenarios.
Inside the script you can configure:
KALI_IP→ Listening server IPPORT→ Listening port numberINTERVAL_SECONDS→ Time between capturesALSO_SAVE_ON_WINDOWS→ Local debugging option
✔ Use Virtual Machines
✔ Use isolated lab networks
✔ Use only your own authorized systems
✔ Inform anyone involved in testing
❌ Never deploy on real user systems
❌ Never use without permission
To prevent unauthorized webcam access:
- Review app permissions regularly
- Use antivirus / endpoint protection
- Enable firewall monitoring
- Keep OS and software updated
- Disable unused webcams
- Physically cover webcam when not in use
This project helps learners understand:
- Webcam API handling in Python
- Background execution techniques
- Network file transmission basics
- Importance of cybersecurity defenses
The author does not promote misuse of this project. Any illegal activity performed using similar techniques is solely the responsibility of the user.
Hasnain Dark Net
Cybersecurity Research & Awareness
