Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/totekuh/rtsp-crawler-engine

A platform to target exposed RTSP streams
https://github.com/totekuh/rtsp-crawler-engine

Last synced: 1 day ago
JSON representation

A platform to target exposed RTSP streams

Awesome Lists containing this project

README

        

# rtsp-crawler-engine


The project contains two modules:

1. rtsp crawlers with an ability to probe and stream located RTSP (Real Time Streming Protocol), such as CCTV and so on. The crawlers have been written in python3.7 and they have been integrated with the masscan https://github.com/robertdavidgraham/masscan which is making possible for them to scan and probe a wide range of internet addresses by running a single command.



2. a backend API to store and categorize probed streams. The API has been written in Java 1.8 / Spring framework. The crawlers could communicate automatically with a backend server while they are doing a long-ride probing.



For more information, please use a --help argument on a crawler script. For the backend API endpoints, please refer to the end of this document.

# There are different ways to obtain the cameras:
# 1. blindly scan the internet and locate open streams:

REMEMBER! If you use masscan to locate the streams, please note that masscan uses it's own TCP/IP stack, so it will simply ignore your proxy and leak your source IP address.

./masscan_to_rtsp.py --masscan 10.0.0.0/8 --output masscan_results.txt
# 1.1 do an aggressive scan:
./masscan_to_rtsp.py --masscan 10.0.0.0/8 --aggressive --output masscan_results.txt

2. IF YOU ARE A SHODAN MEMBER: Get the cameras from the Shodan API and feed them into the crawler. You must be a member of Shodan to export their results.

1.2 consume the shodan JSON export to extract and probe cameras:


torify ./rtsp_probe.py --batch-json shodan-export.json --output probe_result.json

# 2 probe the results
torify ./rtsp_probe.py --batch-list masscan_results.txt --output probe_result.json

Use a tor proxy to keep yourself anonymous during the rtsp probing.

# 3 import retrieved cameras to the backend API:
torify ./rtsp_probe.py --batch-list masscan_results.txt --output probe_result.json --import http://localhost/cameras/import

where http://localhost/cameras/import is the URL to your backend API

# You can use rtsp_probe.py to continuously stream a single camera:
torify ./rtsp_probe.py --url rtsp://10.10.10.10:554 --stream

#Backend API:
Use this URL with a rtsp prober to store the results
POST /cameras/import
{
"status": "UNCONNECTED";
"url": "rtsp://10.10.10.10:554";
}

GET /cameras/?id=1
{
"cameraId": 1,
"rtspUrl": "rtsp://82.209.221.80:554",
"creationTimestamp": "2019-00-03 12:00:00",
"lastUpdateTimestamp": "2019-03-14 07:03:02",
"status": "OPEN",
"countryName": null,
"city": null
}

GET /cameras/?rtspUrl="rtsp://82.209.221.80:554"
{
"cameraId": 1,
"rtspUrl": "rtsp://82.209.221.80:554",
"creationTimestamp": "2019-00-03 12:00:00",
"lastUpdateTimestamp": "2019-03-14 07:03:02",
"status": "OPEN",
"countryName": null,
"city": null
}