Giter Club home page Giter Club logo

scan-for-webcams's Introduction

scan-for-webcams πŸ“·

scan-for-webcamBanner

PyPI - License Discord server invite

δΈ­ζ–‡ζ–‡ζ‘£

Note

I switched to a new method of installing 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

Table of contents

Usage

  • python sfw search MJPG : for public MJPG streamers

  • python sfw search webcamXP : for public webcamXP streamers

  • python sfw search yawCam: for public yawCam steamers

  • 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, register/log in and grab your API key

  4. set up clarifai: go to clarifai.com, register/log in, create an application and grab your API key. Alternatively, use the local places365 model.

  5. setup geoip: go to 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 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:

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, 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:

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

scan-for-webcams's People

Contributors

dependabot[bot] avatar jettchent avatar lgtm-migrator avatar woehrer12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scan-for-webcams's Issues

Clarifai API key error

Hi. After add envs and start main.py have this error, cant do with that anything. Is this my fault ?
have file CLARIFAI_API_KEY.env with export "CLARIFAI_API_KEY"="<AP_ KEY_HERE>"
Thank you.

clarifai.errors.ApiError: b'GET https://api.clarifai.com/v2/models FAILED(1605376096.0716262). status_code: 401, reason: Unauthorized, error_code: 11008, error_description: Invalid API key or Invalid API key/application pair, error_details: Invalid format of key.\n >> Python client 2.6.2 with Python 3.9.0 on win32\n >> GET https://api.clarifai.com/v2/models\n >> REQUEST(1605376096.0716262) {\n "page": 1,\n "per_page": 20\n}\n >> RESPONSE(1605376096.0716262) {\n "status": {\n "code": 11008,\n "description": "Invalid API key or Invalid API key/application pair",\n "details": "Invalid format of key.",\n "req_id": "49d1691503f941b8ade82f5863d56387"\n },\n "models": []\n}'

Invalid Syntax Error

I get an invalid syntax error. Please see details below.

Can anyone advise why this is? I followed all directions, including the install of the Shodan and Clarifai API keys.

Thank you.

I am getting an error during the requirements command, that I have placed below

root@kali:~/scan-for-webcams# python MJPG.py
Traceback (most recent call last):
  File "MJPG.py", line 1, in 
    from search import Scanner
  File "/root/scan-for-webcams/search.py", line 7
    from rich import print
                         ^
SyntaxError: invalid syntax
root@kali:~/scan-for-webcams# python webcamXP.py
Traceback (most recent call last):
  File "webcamXP.py", line 1, in 
    from search import Scanner
  File "/root/scan-for-webcams/search.py", line 7
    from rich import print
                         ^
SyntaxError: invalid syntax
root@kali:~/scan-for-webcams# 

This may help: I get the following when I am running the requirements command:

root@kali:~/scan-for-webcams# pip install -r requirements.txt
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. 
More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support                                                                                                            
Requirement already satisfied: shodan==1.23.0 in /usr/local/lib/python2.7/dist-packages/shodan-1.23.0-py2.7.egg (from -r requirements.txt (line 1)) (1.23.0)
Collecting requests==2.24.0
  Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
ERROR: Could not find a version that satisfies the requirement rich==6.0.0 (from -r requirements.txt (line 3)) (from versions: none)
ERROR: No matching distribution found for rich==6.0.0 (from -r requirements.txt (line 3))

webcamxp not working

sfw search webcamXP
Γ— Get data from API failed

sfw search webcamXP --debug=True
Γ— Get data from API failed
ERROR:
<class 'shodan.exception.APIError'>

KeyError: 'type'

sfw search webcamXP --debug=True
loc:True, check_empty:True, tag:True
β ™ Looking for possible servers...Traceback (most recent call last):
File "/home/bachym/.local/bin/sfw", line 8, in
sys.exit(Main())
File "/home/bachym/.local/lib/python3.8/site-packages/scanforwebcams/universal.py", line 6, in Main
fire.Fire(CLI)
File "/home/bachym/.local/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/bachym/.local/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/bachym/.local/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/bachym/.local/lib/python3.8/site-packages/scanforwebcams/cli.py", line 38, in search
self.scanner.scan_preset(preset, check, tag, loc, debug=debug)
File "/home/bachym/.local/lib/python3.8/site-packages/scanforwebcams/search.py", line 166, in scan_preset
self.scan(**config)
File "/home/bachym/.local/lib/python3.8/site-packages/scanforwebcams/search.py", line 90, in scan
self.init_clarifai()
File "/home/bachym/.local/lib/python3.8/site-packages/scanforwebcams/search.py", line 43, in init_clarifai
self.clarifai_app = ClarifaiApp(api_key=self.CLARIFAI_API_KEY)
File "/home/bachym/.local/lib/python3.8/site-packages/clarifai/rest/client.py", line 124, in init
self.models = Models(self.api, self.solutions) # type: Models
File "/home/bachym/.local/lib/python3.8/site-packages/clarifai/rest/client.py", line 1068, in init
self.model_id_cache = self.init_model_cache()
File "/home/bachym/.local/lib/python3.8/site-packages/clarifai/rest/client.py", line 1088, in init_model_cache
model_type = m.output_info['type']
KeyError: 'type'

Clarifai

File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/clarifai/rest/client.py", line 1088, in init_model_cache
model_type = m.output_info['type']
KeyError: 'type'

You are using the deprecated Python REST package. Please replace your code with the new & updated Python gRPC client: https://github.com/Clarifai/clarifai-python-grpc

API keys storage

Up until now, scan-for-webcams has been using environs to store API keys, while recently I've found an alternative here, where users write their api keys into the .env file, so that they don't have to set the environ everytime they run the app.

Which one should we use?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.