Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digest authentication no longer works #247

Closed
vincyrei opened this issue Nov 26, 2019 · 20 comments · Fixed by #252
Closed

Digest authentication no longer works #247

vincyrei opened this issue Nov 26, 2019 · 20 comments · Fixed by #252
Assignees
Labels

Comments

@vincyrei
Copy link

vincyrei commented Nov 26, 2019

Context

Both binary and docker releases

Any commit since digest authentication was added

Environment

Any OS

Issue

Making any requests with digest authentication causes the following issue:

*   Trying 127.0.0.1:8554...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8554 (#0)
* Server auth using Digest with user 'ubnt'
> DESCRIBE rtsp://ubnt:administrator@127.0.0.1:8554/live.sdp RTSP/1.0
CSeq: 1
Accept: application/sdp

< RTSP/1.0 401 Unauthorized
< CSeq: 1
< WWW-Authenticate: Digest realm="GStreamer RTSP Server", nonce="3034e78651e4e61e"
< Server: GStreamer RTSP server
< Date: Sun, 12 Jan 2020 09:36:53 GMT
<
* Connection #0 to host 127.0.0.1 left intact
* Issue another request to this URL: 'rtsp://ubnt:administrator@127.0.0.1:8554/live.sdp'
* Protocol "rtsp" not supported or disabled in libcurl
* Closing connection -1

* Protocol "rtsp" not supported or disabled in libcurl

While when using basic authentication or no authentication, streams are accessed without any issue, and this log never appears.

@Ullaakut

This comment has been minimized.

@Ullaakut Ullaakut self-assigned this Nov 27, 2019
@Ullaakut Ullaakut added the bug label Nov 27, 2019
@Ullaakut

This comment has been minimized.

@Ullaakut

This comment has been minimized.

@Ullaakut Ullaakut changed the title problem with digest authentication Support other authentication type Nov 30, 2019
@vincyrei

This comment has been minimized.

@vincyrei
Copy link
Author

vincyrei commented Dec 4, 2019

The problem remains only on digest authentication. also with the test on your RTSPAllTheThings tool.

@Ullaakut

This comment has been minimized.

@Ullaakut Ullaakut changed the title Support other authentication type Digest authentication no longer works Jan 12, 2020
@Ullaakut
Copy link
Owner

Since this issue is the most detailed out of the 3 describing the same issue, I'll keep this one and close the other ones as duplicates.

Currently the status on this issue is that I've spent a great deal of time trying to understand what's going on, and I'm completely dumbfounded. It turns out that even reverting to the original commit where digest auth was added, and where in the PR there were reproducible examples to verify that it worked, running the exact same commands no longer works on any of my machines.

I suspected a bug introduced in a recent version of curl, but that doesn't seem to be the case.

Modifying the code in any way in Cameradar didn't seem to solve this issue at all either. I guess I'll need to seek help from someone with more experience with curl, or to switch to another method for making RTSP requests altogether.

@Ullaakut
Copy link
Owner

So after some investigation and a bounty on stackoverflow, it seems like it's a curl issue: curl/curl#4750

A solution could be to download a specific curl version when building the binary in docker, but this means that building the binary manually (go build) will also require a specific curl version.

I'll write some fixes and documentation this weekend, and I'll try to help on fixing the issue in curl.

@Ullaakut
Copy link
Owner

I confirm that using an older curl version fixes the issue:

Screenshot 2020-01-17 at 8 55 19 AM

@vincyrei
Copy link
Author

Perfect, thank you very much. I await your instructions. I can't wait to get the most out of your tool. Thanks again.

@Ullaakut
Copy link
Owner

Hi @vincyrei ! It should be fixed on master now, I'll push the fixed docker image to the repository now :)

You can run docker pull ullaakut/cameradar:latest in a few minutes and it should be working fine! Sorry about the time it took me to debug this issue 😅

@Ullaakut
Copy link
Owner

It's pushed on DockerHub under the tags latest, v4, v4.1 and v4.1.1, so feel free to docker pull one of those and try again :)

Also, if you prefer to use the binary version, just make sure that your version of the libcurl package is <7.66.0!

Let me know if it works for you, and thanks for your patience 🙏

@vincyrei
Copy link
Author

Now it works great. In my case with a HIKVISION DS-2CD2345FWD-I camera I had to modify the parameters --attack-interval duration to avoid a problem like this: Perform failed for "rtsp: // admin: 4321@192.168.10.64: ​​554 /" ( auth 3): curl: Failure when receiving data from the peer.
Maybe it can be useful for other discussions. Thanks again I will let you know after other tests.

@Ullaakut
Copy link
Owner

@vincyrei Ah glad to hear that. It's interesting that you got this error and that the interval solved it. Is the camera you're accessing on the same network as the attacking host? Are you sure the network is reliable?

@vincyrei
Copy link
Author

The host is on the same network. the network is reliable. I think it's a matter of speed of requests. probably due to a method of protection. it doesn't happen with other cameras. maybe a new hikvision firmware

@Ullaakut
Copy link
Owner

Ah, very interesting :) I'll try to get my hands on one of those to see if I can do smth about it :p

@jeretc
Copy link

jeretc commented Feb 13, 2020

i get something like this :

Perform failed: curl: Unsupported protocol

@Ullaakut
Copy link
Owner

@jeretc Which version of Cameradar are you using? This issue has been fixed in the latest version.

@jepunband
Copy link

It's pushed on DockerHub under the tags latest, v4, v4.1 and v4.1.1, so feel free to docker pull one of those and try again :)

Also, if you prefer to use the binary version, just make sure that your version of the libcurl package is <7.66.0!

Let me know if it works for you, and thanks for your patience 🙏

hi, do you have some information on how to install older libcurl. i installed cameradar using go. i have the same issue.

@Ullaakut
Copy link
Owner

Hi @jepunband

You can find download links to all curl versions at https://curl.se/download.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants