Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/JettChenT/scan-for-webcams

scan for webcams on the internet
https://github.com/JettChenT/scan-for-webcams

clarifai python scraping security shodan shodan-python webcam webcams

Last synced: about 2 months ago
JSON representation

scan for webcams on the internet

Awesome Lists containing this project

README

        

# scan-for-webcams :camera:

![scan-for-webcamBanner](./.github/scan-for-webcamBanner.png)

![PyPI - License](https://img.shields.io/pypi/l/scan-for-webcams?style=flat-square)
[![Discord server invite](https://discordapp.com/api/guilds/974876463797006356/embed.png)](https://discord.gg/JCepvsHNqW)

[中文文档](/zh/README.md)

## Note
I switched to a new method of [installing](#Installation) this program
for a better developer experience and better modifiability.

As a result, the PYPI package `scan-for-webcams` is not maintained anymore, and
should be considered deprecated.

btw: we have a discord channel ! [join](https://discord.gg/JCepvsHNqW)

## Table of contents

- [Note](#note)
- [Table of contents](#table-of-contents)
- [Usage](#usage)
- [Installation](#installation)
- [Experimental Vision-Language Model Support](#experimental-vision-language-model-support)
- [Places365: On device footage classification](#places365-on-device-footage-classification)
- [Graphical User Interface](#graphical-user-interface)
- [Demo](#demo)

## Usage

* `python sfw search MJPG` : for public [MJPG streamers](https://github.com/jacksonliam/mjpg-streamer)

* `python sfw search webcamXP` : for public [webcamXP streamers](http://www.webcamxp.com/)

* `python sfw search yawCam`: for public [yawCam steamers](https://www.yawcam.com/)

* `python sfw search hipcam`: for public hipcam streamers

* `python sfw search rtsp`: **DANGER** searches for rtsp servers on shodan, and performs enumeration on them to try and find streams

* `python sfw play {url}`: plays the camera stream
* for `rtsp://` streams, sfw will play it in a GUI viewer (see `sfw/rtsp.py`)
* for all other streams, sfw will open it in the default browser.

* `python sfw search ... --gui`: displays the scanned cameras in a grid visually.

* `python sfw search --help`: for more options and help

The program will output a list of links with the format of `ip_address:port`, and descriptions of the image beneath it.

If your terminal supports links, click the link and open it in your browser, otherwise, copy the link and open it in your browser.

## Installation
1. Clone this repository: `git clone https://github.com/JettChenT/scan-for-webcams`

2. install requirements.txt: `pip install -r requirements.txt`

3. set up shodan:
go to [shodan.io](https://shodan.io), register/log in and grab your API key

4. set up clarifai:
go to [clarifai.com](https://clarifai.com), register/log in, create an application and grab your API key.
Alternatively, use the local [places365](#places365-on-device-footage-classification) model.

5. setup geoip:
go to [geo.ipify.org](https://geo.ipify.org), register/log in and grab your API key

6. Add API keys:
1. run `python sfw setup`
2. enter your shodan, clarifai and geoip API keys

And then you can [run](#Usage) the program!

## Experimental Vision Language Model Support
We are working on supporting generating descriptions for footages
via vision language models, which can generate descriptions for images in
natural language, instead of just tags, and can run on-device.
Currently, we support a `llama.cpp` based `llava 7b` model.

To use this, run the following commands:

```shell
pip install -U --no-cache-dir llama-cpp-python@git+https://github.com/damian0815/llama-cpp-python/@4ec35390d72faba70942b9605dfcbde2bda0bdad
pip install huggingface_hub wurlitzer
python sfw search webcamXP --vllm=True --parallel=False # or any other search command with the latter two flags
```

Note: our current VLLM integration is experimental, and may not work as expected.
Parallel mode must be disabled for VLLM as of now.

## Places365: On device footage classification
It is now possible to run [the Places365 model](https://github.com/CSAILVision/places365),
a model fined tuned for real world locations,
to get information about webcam footage.

To use this model, you need to install the following packages:
```bash
pip install -r requirements-places.txt
```

Then, you can run the program with the `--places` flag:
```
python sfw search MJPG --tag=False --places
```

The model will take some time to download, and will be cached for future use.

## Graphical User Interface

To get a display of the live streams of all the scanned webcams, simply append the `--gui` option to your command.

## Demo

[![asciicast](https://asciinema.org/a/494164.svg)](https://asciinema.org/a/494164)