IP camera reconnaissance toolkit: Python core + web backend
Project description
CamSniff - IP Camera Reconnaissance Tool
- Introduction
- Features
- Dependencies
- Installation
- Usage
- Output and Reporting
- Configuration
- Troubleshooting
- Contributing
- Acknowledgments
- License
Release 1.0.4 Highlights
This release focuses on backend modernization and internal consistency:
- Introduced a new FastAPI backend (
camsniff-web) with:/healthreadiness probe/eventsendpoint (JSONL tail with filtering by level/event)- WebSocket streaming (
/ws) for real-time scan events with backlog replay
- Centralized path handling via
python_core/config.py(single source for output/log/database paths; respectsCAMSNIFF_OUTPUT). - Removed duplicate legacy logging functions and tightened JSONL event logging contract.
- Added initial Python tests for configuration and backend endpoints.
- Debian packaging updated (added FastAPI & Uvicorn runtime dependencies).
- Makefile improvements: added
pytest,quicktest,package-check,lint, andformattargets.
Version Note: Earlier references to 2.0.x were provisional; the project is formally continuing at 1.0.4 to keep alignment with Debian packaging history while the new backend stabilizes.
Introduction
CamSniff is a powerful reconnaissance tool for discovering, analyzing and displaying IP cameras and IoT devices.
-
It performs device fingerprinting, service enumeration, endpoint detection, snapshot capture for AI analysis, and vulnerability scanning.
-
The built-in web interface provides real-time visualizations, including camera feeds, network maps, geographic locations, and alerts.
Primarily built for Debian-based Linux distributions, CamSniff auto-installs dependencies on first run with admin privileges.
- It uses local datasets for RTSP paths (
data/rtsp_paths.csv) and CVEs (data/cves) by default, avoiding network downloads. Radio-based features (Wi-Fi, BLE, Zigbee, Z-Wave) may not work on WSL due to hardware limitations.
Disclaimer: This tool is for educational and research purposes only. Use responsibly and with explicit permission. The authors are not liable for any misuse.
Features
- Device Fingerprinting: Supports major brands like Hikvision, D-Link, TP-Link, Samsung, Panasonic, Dahua, Axis, Vivotek, and Foscam.
- Network Scanning: Uses
fping,arp-scan,masscan,nmap, andonesixtyonefor host discovery and port scanning. - Protocol Handling: RTSP, HTTP (MJPEG/HLS), CoAP, RTMP, and MQTT.
- IoT Enumeration: UPnP/SSDP, mDNS, BLE, Zigbee/Z-Wave, Wi-Fi OUI lookup, and network topology mapping.
- Web Interface: Flask-based dashboard for camera feeds, topology diagrams, maps, alerts, live screenshots, and timelines.
- Reporting: Text/JSON summaries, alert logs, and optional Nmap vulnerability scans.
- Credential Brute-Forcing: Hydra and Medusa with custom wordlists; Gobuster for directory brute-forcing.
- AI Analysis: OpenCV for detecting infrared, motion, and brightness in snapshots.
- Multi-View Support: Mosaic layouts with overlays for multiple cameras.
- Automation: Auto/quiet modes, subnet targeting, stealth delays, and plugin extensibility.
Dependencies
CamSniff depends on various open-source tools and libraries, auto-installed on first run with sudo. Review their licenses individually.
Core Utilities ๐
- Bash - Scripting shell
- curl - Data transfer
- jq - JSON processing
- netcat - Network utility
- FFmpeg - Multimedia handling
- FFplay - Media playback
Network Scanning ๐
- fping - ICMP ping
- masscan - Fast port scanner
- Nmap - Network mapping
- Hydra - Brute-force login
- tcpdump - Packet capture
- tshark - Protocol analysis
- arp-scan - ARP scanning
Python Components ๐
- Python 3 - Core language
- venv - Virtual environments
- pip - Package manager
- OpenCV - Computer vision
- Flask - Web framework
Additional Tools ๐งฐ
- Gobuster - Directory enumeration
- Medusa - Brute-force
- onesixtyone - SNMP scanner
- libcoap - CoAP client
- rtmpdump - RTMP streaming
IoT Discovery ๐ก
- Avahi - mDNS/DNS-SD
- BlueZ - Bluetooth/BLE
- NetworkManager - Wi-Fi tools (
iw,nmcli)
Recommended: avahi-utils, bluez, bluez-tools, wireless-tools, iw, network-manager.
Installation
Recommended: DEB Package
Download from releases:
sudo apt install ./camsniff*.deb
Or:
sudo gdebi ./camsniff*.deb
Installs /usr/bin/camsniff and /etc/camsniff/camcfg.json.
From Source
-
Clone:
git clone https://github.com/John0n1/CamSniff.git cd CamSniff
-
Make executable:
chmod +x *.sh
Python-Only (via pip)
For CLI probes and web backend:
pip install camsniff
Provides camsniff-cli and camsniff-web. Does not include full Bash orchestrator or system tools.
Python Extras Quick Reference
| Use Case | Command |
|---|---|
| Core CLI + FastAPI backend | pip install camsniff[web] |
| Add AI / CV / snapshot analysis | pip install camsniff[ai] |
| Developer tooling (lint, tests) | pip install camsniff[dev] |
Multiple groups (example):
pip install 'camsniff[web,ai,dev]'
Usage
Run with sudo for full functionality:
sudo ./camsniff.sh
Or if installed:
sudo camsniff
Options:
-y, --yes: Skip prompts-q, --quiet: Less verbose-a, --auto: Fully automated-t, --target <subnet>: e.g.,192.168.1.0/24-h, --help: Show help
Wireless features require compatible hardware; disable in config if unsupported.
Project Structure
โโโ camsniff.sh # Main entry point script
โโโ core/ # Core functionality scripts
โ โโโ env_setup.sh # Environment configuration
โ โโโ scan_analyze.sh # Scanning and analysis logic
โ โโโ setup.sh # Initial setup functions
โ โโโ cleanup.sh # Cleanup operations
โ โโโ install_deps.sh # Dependency installation
โ โโโ iot_enumerate.sh # IoT device enumeration
โ โโโ webui.sh # Web interface launcher
โ โโโ doctor.sh # System diagnostics
โโโ python_core/ # Python modules and scripts
โ โโโ __init__.py # Package initialization
โ โโโ cli.py # Command-line interface
โ โโโ web_backend.py # FastAPI backend
โ โโโ ai_analyze.py # AI analysis functions
โ โโโ cve_quick_search.py # CVE search functionality
โโโ tests/ # Test suite
โ โโโ test_*.sh # Individual test scripts
โ โโโ ...
โโโ data/ # Data files (RTSP paths, wordlists)
โโโ web/ # Web interface files
โโโ debian/ # Debian packaging files
Output and Reporting
Results saved in output/results_YYYYMMDD_HHMMSS/:
logs/: Scan logsscreenshots/: Annotated snapshotsreports/:summary_YYYYMMDD_HHMMSS.txt/json: Overviewscameras.json: Device details (IPs, protocols, etc.)alerts.log: Eventsanalysis_IP.json: AI results per devicemdns_services.txt,ssdp_devices.txt,ble_scan.txt: IoT datatopology.json: Network maplogs/nmap_vuln_*.txt: Vulnerability scans (if enabled)
Web Interface: Start with ./core/webui.sh or camsniff-web. Access at http://localhost:8088 (configurable via CAMSNIFF_WEB_PORT).
Updated Event Log Schema (JSONL):
{"ts":"2025-01-01T12:00:00.123Z","event_type":"camera_found","level":"info","category":"camera","payload":{"ip":"192.168.1.10","port":554,"protocol":"rtsp","url":"rtsp://..."}}
Command-line emission example:
python -m python_core.logging_utils emit --event-type camera_found \
--category camera \
--payload '{"ip":"192.168.1.10","port":554}'
Listing recent events:
python -m python_core.logging_utils list --limit 5
Tailing (follow mode):
python -m python_core.logging_utils tail --follow
Field Semantics:
- ts: ISO8601 UTC timestamp with millisecond precision.
- event_type: Machine-friendly event key (e.g. camera_found, scan_start, vuln_detected).
- level: info | warn | error | debug (semantic severity, not tied to Python logging module).
- category: Optional coarse grouping (scan, camera, vuln, system, auth, stream).
- message: Optional human-readable summary for quick display.
- payload: Arbitrary structured object; avoid duplicating top-level fields.
Backward Compatibility:
- The backend
/eventsendpoint already reads onlyevent_type; oldereventkeys will not appear unless translated. Shell emission harmonization is in progress (1.0.5 milestone).
Configuration
Edit camcfg.json (defaults: /etc/camsniff/camcfg.json):
{
"sleep_seconds": 45,
"nmap_ports": "1-65535",
"masscan_rate": 20000,
"hydra_rate": 16,
"max_streams": 4,
"cve_github_repo": "",
"cve_cache_dir": "data/cves",
"cve_current_year": "2025",
"dynamic_rtsp_url": "",
"dirb_wordlist": "/usr/share/wordlists/dirb/common.txt",
"password_wordlist": "data/passwords.txt",
"username_wordlist": "data/usernames.txt",
"snmp_communities": ["public", "private", "camera", "admin", "cam", "cisco", "default", "guest", "test"],
"medusa_threads": 8,
"enable_iot_enumeration": true,
"enable_pcap_capture": true,
"enable_wifi_scan": true,
"enable_ble_scan": true,
"enable_zigbee_zwave_scan": true,
"stealth_mode": true,
"enable_nmap_vuln": true
}
stealth_mode: Adds delays for stealth.enable_nmap_vuln: Enables detailed vuln scans (slower).- Offline-first: Uses local files for RTSP/CVEs.
Troubleshooting
- Dependencies: Use
sudofor auto-install. - RTSP Errors: Verify
dynamic_rtsp_urlor use fallback. - Permissions:
sudorequired for scans. - Animations: Set
NO_ANIM=1for non-interactive. - IoT Scans: Disable unsupported features in config.
- Logs: Check
output/*/logs/andalerts.log.
Additional Logging / Diagnostics:
- To set an explicit output root:
export CAMSNIFF_OUTPUT=/tmp/camsniff_run - Confirm backend health:
curl -s http://localhost:8089/health->ok - Quick event sanity check:
python -m python_core.logging_utils emit --event-type test_ping --message "hello" - If systemd unit is used, inspect:
journalctl -u camsniff-web.service -e
Security Hardening Notes:
- The systemd service runs with a dynamic user and a tightened filesystem view.
- Write locations are restricted to the configured output and volatility directories.
Contributing
-
Fork and clone:
git clone https://github.com/your-username/CamSniff.git cd CamSniff
-
Branch:
git checkout -b feature-branch
-
Commit and push:
git commit -m "Description" git push origin feature-branch
-
Open a PR with details.
Try to follow simimar coding patterns.
Acknowledgments
Gratitude to open-source tool developers powering CamSniff.
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file camsniff-1.0.5.tar.gz.
File metadata
- Download URL: camsniff-1.0.5.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a677b394bc55285a9c2767eb6a1d4d5e4e6eb75d8ad3f39e8d3e87551bf86ed
|
|
| MD5 |
aef95d9f525b35c1f1b1de53924b69de
|
|
| BLAKE2b-256 |
d30521b830c6fb53e9c53dc6aedc3550344102995a64601a8d01d15a27c852ea
|
File details
Details for the file camsniff-1.0.5-py3-none-any.whl.
File metadata
- Download URL: camsniff-1.0.5-py3-none-any.whl
- Upload date:
- Size: 21.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9565d39912ccf354aa9bc15710e05d464ecb61b07192e6f126fc34d2028a5922
|
|
| MD5 |
b3bdc2ea4a0a6d26ff29679baf940320
|
|
| BLAKE2b-256 |
b133b44b04d1c19a1c9d133eb36f7bc9315eea6523a203ce9b9c903735231464
|