Solved

cURL always return "401 Unauthorized"

Posted on 2008-06-24
2
1,484 Views
Last Modified: 2010-04-21
Hi,

I'm trying to automatically download log files from our video conference servers. When I try this with a browser is works (authentication -> save file as).

Now I want to use the cURL command in a script to get the files but it wont work. Here the command I use:

curl --anyauth --insecure --proxy-user 'xxx:yyy' --proxy-ntlm --proxy 'http://x.x.x.x:8080/' --connect-timeout '10' --user 'authname:authpw' --output 'output.txt' https://x.x.x.x/localcdr.csv

The result in the output.txt file = 401 Unauthorized - User authentication is required.

Now the tricky part: 1 of the 7 servers is returning the file with the above command, the other 6 wont :(
With a browser => they work.

Who can help me or has some tips?

Thanks in advance
Filips
0
Comment
Question by:Filips
2 Comments
 
LVL 4

Accepted Solution

by:
snrudda earned 250 total points
ID: 21854998
May find a way out of this fuzz by using sniffer like Wireshark (http://www.wireshark.org/) to see what's the difference between 1 and 6 servers.

I'd rather said servers check some secondary attributes like User-agent or Cookies, you may never guess that without sniffer :)
0
 
LVL 6

Author Closing Comment

by:Filips
ID: 31470103
This was a good hint. I didn't do a sniff but checked the headers with another tool. Result: our network guys made an error in the authentication module.

Thanks snrudda
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now