thewh1teagle / xiaomi-1080-360-motor-control

Provides a way controlling the motor directly.
40 stars 10 forks source link

User/password usage on onvif server #16

Closed guguxfr closed 1 year ago

guguxfr commented 3 years ago

Hi,

I'm using your latest release which works pretty well but I'm trying to add a user / passwd with the options upon startup on the onvif_srvd daemon, and they seem to be ignored. Did you compile with WS security activated or do I have to recompile ?

Thanks ! Bye.

thewh1teagle commented 3 years ago

Hi Currently WS security isn't supported. If you want to use it you will need to recompile onvif_srvd This is the repo i used for that https://github.com/thewh1teagle/onvif_srvd ws security requires libssl, liblz and libcrypt Make sure you compile them staticly, otherwise it will not run I am working on it, and i hope i will add new release that supports it in few days :)

guguxfr commented 3 years ago

Ah that is great news ! Then I'll wait next release, there is no hurry for me.

Thanks for the great work !

thewh1teagle commented 3 years ago

I successfully compiled onvif srvd with ws security. Can you test it? onvif_srvd.zip

guguxfr commented 3 years ago

Le 07/11/2020 20:33, thewh1teagle a écrit :

I successfuly compiled onvif srvd with ws scan. Can you test it? onvif_srvd.zip [1]

-- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [2], or unsubscribe [3].

Hi,

I replaced the old binary with yours :

-rwxrwxrwx 1 root root 5860588 Nov 7 2020 onvif_srvd -rwxrwxrwx 1 root root 3799000 Jul 1 13:43 onvif_srvd.old

An restarted the webcam.

onvid_srvd is started with user and password options :

1466 root ./onvif_srvd --pid_file /var/run/onvif_srvd.pid --model MJSXJ02CM --manufacturer Xiaomi --firmware_ver 3.4.2_0062 --ifs wlan0 --port 5000 --scope onvif://www.onvif.org/Profile/S --name HD --width 1920 --height 1080 --url rtsp://192.168.1.47:8554/mainstream --type H264 --user XXXXX --password YYYYYY --ptz --move_left eval echo pan forward 5

/mnt/sdcard/hacks/motor_control/event --move_right eval echo pan reverse 5 > /mnt/sdcard/hacks/motor_control/event --move_up eval echo tilt forward 5 > /mnt/sdcard/hacks/motor_control/event --move_down eval echo tilt reverse 5 > /mnt/sdcard/hacks/motor_control/event

But still, If I use onvifer on my phone, I did not configure any account and password and I'm still able to access the webcam. Did I miss something ?

Bye.

Links:

[1] https://github.com/thewh1teagle/xiaomi-1080-360-motor-control/files/5505341/onvif_srvd.zip [2] https://github.com/thewh1teagle/xiaomi-1080-360-motor-control/issues/16#issuecomment-723485397 [3] https://github.com/notifications/unsubscribe-auth/AF56NYZILVCFAUBHQQE6CN3SOWOJHANCNFSM4TNAJFRQ

thewh1teagle commented 3 years ago

@guguxfr Looks like you did it correct. I think it's something (bug) in the source code of onvif_srvd.. I am sure i compiled it with ws..

guguxfr commented 3 years ago

Le 07/11/2020 21:03, thewh1teagle a écrit :

@guguxfr [1] Looks like you did it correct. I think it's something (bug) in the source code of onvif_srvd.. I am sure i compiled it with ws..

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or unsubscribe [3].

Ah, that is not good news.

I'll make some tests tomorrow and let you know if I find something interesting.

Links:

[1] https://github.com/guguxfr [2] https://github.com/thewh1teagle/xiaomi-1080-360-motor-control/issues/16#issuecomment-723488491 [3] https://github.com/notifications/unsubscribe-auth/AF56NY4R6VMLXYNFLUTGEITSOWRZRANCNFSM4TNAJFRQ

guguxfr commented 3 years ago

Hi, It seems like activating WS-security framework is not sufficient. The onvif server is missing GetAccessPolicy and SetAccessPolicy functions I think. I do not find them in the code, and here may lots of work involved to add them. What do you think ? Bye.

thewh1teagle commented 3 years ago

Bad news. But, before I'm going to get into the code, I want to ask the man who created this onvif server.

thewh1teagle commented 3 years ago

See https://github.com/KoynovStas/onvif_srvd/issues/28 We need to implement it ourselves. I am not familiar with cpp .. will try

guguxfr commented 3 years ago

Yep, that's what I thought. I'm not a very good developer, but I'll see if I have some spare time to work on it too.

guguxfr commented 3 years ago

Hi, I tried to compile with WS security option, but it needs the arm libs of course (ssl etc ...) Did you cross compile them manually or did you use a toolchain ? Bye.

thewh1teagle commented 3 years ago

@guguxfr I used a toolchain of course. Use the dockerfile there, you have scripts for run it And the docker image will install all you need for that If you have questions tell me