Code Monkey home page Code Monkey logo

node_dvripclient's Introduction

DVRIPClient - Client for various Surveillance cameras and DVR's operating under the DVR-IP protocol, also known as NetSurveillance or Sofia

This is My first project that I've built thats based on ES6 from ground up. I probably did some things wrong-ish. Also my first project where I've used JSDoc extensively, but from what I can tell I've done everything mostly correct.

As it stands, I've implemented only the things that I needed, as well as most easily implementable ones. If you're missing a certain function call feel free to add it in and submit a PR! :D

TODO

  • Generate Wiki using JSDoc comments
  • Add tests

License

MIT

node_dvripclient's People

Contributors

kinsi55 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

node_dvripclient's Issues

getVideoStream File format?

What kind of file format does getVideoStream output? I want to use this lib with react native and stream the video on the screen

Error

When I run file to get the video , this error comes up

Receiving 10 seconds of footage...
/home/user/Desktop/projects/cam/node_dvripclient/lib/dvripclient.js:421
this.setSessionId();
^

TypeError: this.setSessionId is not a function
at Immediate.disconnect (/home/user/Desktop/projects/cam/node_dvripclient/lib/dvripclient.js:421:8)
at Immediate.disconnect [as _onImmediate] (/home/user/Desktop/projects/cam/node_dvripclient/lib/dvripstreamclient.js:41:9)
at runCallback (timers.js:794:20)
at tryOnImmediate (timers.js:752:5)
at processImmediate [as _immediateCallback] (timers.js:729:5)

Also can I redirect video to get live stream

Question about RTSP quality in VLC

When using xmeye app on android or vms app on desktop, the quality is good. However when using a link like this rtsp://192.168.1.142:554/user=admin_password=_channel=1_stream=0.sdp in VLC Media, the quality is much worse and image glitches out/gets stuck. Is there anyway to fix this?

MD5 vs Plaintext passwords

//Absolutely stupid custom password hashing. Special thanks to https://github.com/tothi/pwn-hisilicon-dvr#password-hash-function
//We *could* use it, but then again, there isnt really any protection involved with this...
//An attacker can just as well sniff the hash and use that to authenticate, it'd just be an unnecessary extra dependency (md5).
//By checking out the Github link you should come to the conclusion that any device of this kind should *never* be directly
//exposed to the internet anways.

Yeah, that's pretty much how that is.

Still, hashing it is mildly a little bit better than plaintext.

Overall, I get the sense that a lot of these "security" devices aren't actually focused on providing security.

Instead, they're more like "false feelings of security" devices.

Login success, but error in response to claimVideoStream

Very cool project, man. One of the best I've seen for these devices.

I was able to login but I got an error after login, in response to claimVideoStream:

Failed: { Ret: 103,
  SessionID: '0x00000AAA',
  ErrorMessage: 'Illegal request' }

I'm noticing the packets node_dvripclient generates are slightly different from the ActiveX client.

Namely, I'm seeing that _sessionID is being set like "0x00000AAA" in node_dvripclient and in the packets generated by the ActiveX client it would be something like "0xAAA"

The ActiveX app does it like this:


0000   54 2b 57 14 0e d9 98 ee cb 55 5b 1c 08 00 45 00   T+W......U[...E.
0010   00 fd 20 4b 40 00 80 06 55 61 c0 a8 01 78 c0 a8   .. [email protected]..
0020   01 86 10 da 87 07 16 20 f3 ef 6d 1d 4a ab 50 18   ....... ..m.J.P.
0030   c8 00 6a 91 00 00 ff 00 00 00 4e 02 00 00 00 00   ..j.......N.....
0040   00 00 00 00 85 05 c1 00 00 00 7b 20 22 4e 61 6d   ..........{ "Nam
0050   65 22 20 3a 20 22 4f 50 4d 6f 6e 69 74 6f 72 22   e" : "OPMonitor"
0060   2c 20 22 4f 50 4d 6f 6e 69 74 6f 72 22 20 3a 20   , "OPMonitor" : 
0070   7b 20 22 41 63 74 69 6f 6e 22 20 3a 20 22 43 6c   { "Action" : "Cl
0080   61 69 6d 22 2c 20 22 50 61 72 61 6d 65 74 65 72   aim", "Parameter
0090   22 20 3a 20 7b 20 22 43 68 61 6e 6e 65 6c 22 20   " : { "Channel" 
00a0   3a 20 30 2c 20 22 43 6f 6d 62 69 6e 4d 6f 64 65   : 0, "CombinMode
00b0   22 20 3a 20 22 43 4f 4e 4e 45 43 54 5f 41 4c 4c   " : "CONNECT_ALL
00c0   22 2c 20 22 53 74 72 65 61 6d 54 79 70 65 22 20   ", "StreamType" 
00d0   3a 20 22 4d 61 69 6e 22 2c 20 22 54 72 61 6e 73   : "Main", "Trans
00e0   4d 6f 64 65 22 20 3a 20 22 54 43 50 22 20 7d 20   Mode" : "TCP" } 
00f0   7d 2c 20 22 53 65 73 73 69 6f 6e 49 44 22 20 3a   }, "SessionID" :
0100   20 22 30 78 41 41 41 22 20 7d 0a                   "0xAAA" }.


node_dvripclient does it like this:

0000   54 2b 57 14 0e d9 98 ee cb 55 5b 1c 08 00 45 00   T+W......U[...E.
0010   00 e4 31 78 40 00 80 06 44 4d c0 a8 01 78 c0 a8   [email protected]..
0020   01 86 10 be 87 07 00 3c c0 6e f9 ab a5 10 50 18   .......<.n....P.
0030   08 05 d9 da 00 00 ff 00 00 02 4a 00 00 00 00 00   ..........J.....
0040   00 00 00 00 85 05 a8 00 00 00 7b 22 4e 61 6d 65   ..........{"Name
0050   22 3a 22 4f 50 4d 6f 6e 69 74 6f 72 22 2c 22 4f   ":"OPMonitor","O
0060   50 4d 6f 6e 69 74 6f 72 22 3a 7b 22 41 63 74 69   PMonitor":{"Acti
0070   6f 6e 22 3a 22 43 6c 61 69 6d 22 2c 22 50 61 72   on":"Claim","Par
0080   61 6d 65 74 65 72 22 3a 7b 22 43 68 61 6e 6e 65   ameter":{"Channe
0090   6c 22 3a 30 2c 22 43 6f 6d 62 69 6e 4d 6f 64 65   l":0,"CombinMode
00a0   22 3a 22 43 4f 4e 4e 45 43 54 5f 41 4c 4c 22 2c   ":"CONNECT_ALL",
00b0   22 53 74 72 65 61 6d 54 79 70 65 22 3a 22 4d 61   "StreamType":"Ma
00c0   69 6e 22 2c 22 54 72 61 6e 73 4d 6f 64 65 22 3a   in","TransMode":
00d0   22 54 43 50 22 7d 7d 2c 22 53 65 73 73 69 6f 6e   "TCP"}},"Session
00e0   49 64 22 3a 22 30 78 30 30 30 30 30 41 41 41 22   Id":"0x00000AAA"
00f0   7d 0a                                             }.

I'm wondering if maybe it's the SessionId that the server software wants to be shaped like 0x24A instead of 0x0000024A

Either that or some of those mysterious bytes up there before the JSON.

UPDATE: In the error response from the server, the third digit from the right of the SessionID looks like it was omitted. Still looking like it's something to do with the SessionId.

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.