From 624ff8bc1b99c00bd411d194b15711c5d1e430ad Mon Sep 17 00:00:00 2001 From: Brendan LE GLAUNEC Date: Mon, 18 Sep 2017 22:43:30 +0200 Subject: [PATCH] Fixes in readme and contributing.md (#77) --- CONTRIBUTING.md | 22 +++++----------------- README.md | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1361156..8cdac78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,20 +2,18 @@ This file will give you guidelines on how to contribute if you want to, and will list known contributors to this repo. -If you're not into software development or not into C++, you can still help. Updating the dictionaries for example, would be a really cool contribution! Just make sure the ids and routes you add are **default constructor credentials** and not custom credentials. +If you're not into software development or not into Golang, you can still help. Updating the dictionaries for example, would be a really cool contribution! Just make sure the credentials and routes you add are **default constructor credentials** and not custom credentials. If you have other cool ideas, feel free to share them with me at [brendan.leglaunec@etixgroup.com](mailto:brendan.leglaunec@etixgroup.com) ! ## Version 2.0.0 -- *Cameradar* will become the name of the library. -- *Cameraccess* will be the name of the binary that uses Cameradar to _hack_ the cameras. +- *Cameradar* is the name of the Golang library. +- *Cameraccess* is the name of the binary that uses Cameradar to discover and access the cameras. This quite big refactoring comes from the fact that most users who want to access cameras either want to launch it with the basic cache manager, mostly using the docker image already provided in this repository, or will not use it because it does not integrate into their software solution without sharing their database with Cameradar, which would cause issues with database migrations for example. -Transforming it into a library will allow developers to use it directly in their own code exactly as they want, allowing for a greater flexibility. The Cameraccess binary will then provide a simple use example as well as maintaining the current simple way of using Cameradar for non-developers. - -This is quite a huge task compared to the tiny changes I usually do on Cameradar, so it might take a long time. +Transforming it into a library allows developers to use it directly in their own code exactly as they want, allowing for a greater flexibility. The Cameraccess binary also provides a simple use example as well as maintains the old simple way of using Cameradar for non-developers. ## Workflow @@ -52,16 +50,6 @@ If Travis CI reports errors, you should be able to view the logs [by clicking he This part will tell you about what are the general coding guidelines I want to keep on this project. -#### C++ - -+ All C++ code has to be formatted using `clang-format` -+ The namespaces should be respected and new files should implement the same namespace structure as the other files -+ Forward declarations should be used as much as possible -+ Use smart pointers instead of raw pointers as much as possible -+ Each constructor with only one parameter which is not a copy or a move constructor must be marked explicit -+ Use C++11 specifiers as much as possible *(override, noexcept)* -+ Variable and function names must always be in *snake_case*. - #### Golang + All Golang code has to be formated using `gofmt` @@ -69,7 +57,7 @@ This part will tell you about what are the general coding guidelines I want to k #### Shell scripting -+ Just make sure Codacy does not trigger warnings on your code. I probably suck more than you in shell anyway, who would I be to give you guidelines on it? ++ Just make sure Codacy does not trigger warnings on your code. ## Contributors diff --git a/README.md b/README.md index 7f08311..877391b 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,6 @@ e.g.: `docker run ullaakut/cameradar -t 192.168.100.0/24 -l` will scan the ports * If you want to get the precise results of the nmap scan in the form of an XML file, you can add `-v /your/path:/tmp/cameradar_scan.xml` to the docker run command, before `ullaakut/cameradar`. * If you use the `-r` and `-c` options to specify your -Check [Cameradar's readme on the Docker Hub](https://hub.docker.com/r/ullaakut/cameradar/) for more information and more command-line options. - -For more complex use of the Docker image, see the `Environment variables` part of [Cameradar's readme on the Docker Hub](https://hub.docker.com/r/ullaakut/cameradar/). - ### Library ### Dependencies of the library @@ -62,9 +58,7 @@ For more complex use of the Docker image, see the `Environment variables` part o #### Installing the library -```bash - go get github.com/EtixLabs/cameradar -``` +`go get github.com/EtixLabs/cameradar` After this command, the *cameradar* library is ready to use. Its source will be in: @@ -82,13 +76,13 @@ You can use the cameradar library for simple discovery purposes if you don't nee The Discover function calls the RunNmap function as well as the ParseNmapResults function and returns the discovered streams without attempting any attack. It will use default values for its calls to RunNmap: -

+

This describes the nmap time presets. You can pass a value between 1 and 5 as described in this table, to the RunNmap function.

The RunNmap function will execute nmap and generate an XML file containing the results of the scan. -

+

The ParseNmapResult function will open the specified XML file and return all open RTSP streams found within it. #### Attack @@ -119,6 +113,12 @@ LoadCredentials takes a JSON file that has the same format as [this one](diction LoadRoutes takes a file that has the same format as [this one](dictionary/routes). Warning: This file is not JSON. +#### Miscellaneous + +

+ +RTSPURL allows you to generate the full URL of a stream. + ### Configuration The **RTSP port used for most cameras is 554**, so you should probably specify 554 as one of the ports you scan. Not specifying any ports to the cameraccess application will scan the 554 and 8554 ports. @@ -127,7 +127,9 @@ e.g.: `docker run ullaakut/cameradar -p "18554,19000-19010" -t localhost` will s You **can use your own files for the ids and routes dictionaries** used to attack the cameras, but the Cameradar repository already gives you a good base that works with most cameras, in the `/dictionaries` folder. -e.g.: ```bash +e.g.: + +```bash docker run -v /my/folder/with/dictionaries:/tmp/dictionaries \ ullaakut/cameradar \ -r "/tmp/dictionaries/my_routes" \ @@ -164,7 +166,7 @@ With the above result, the RTSP URL would be `rtsp://admin:12345@173.16.100.45:5 ## Environment variables -TODO +Not yet implemented. ## Contribution