| [reply] |
As of early 2004, Microsoft is removing support for this in Internet Explorer. Here are the details. This is their better fix to the bug that prompted them to tell people to type in URLs.
For those who don't know, they have two reasons for doing this. The first is that users were getting mislead by URLs which used the name:password@ trick to make it look like they were going to a different site than they were really going to. The second is that if a URL includes %01 or %00 in it, then IE truncates the display of the URL there. So there is no way to see the real URL from within IE.
I have not heard of any plans on their part to fix the second bug. Their solution to the first problem personally inconveniences me, but I can understand their justification.
For anyone who used the advice above, please note that it will continue to work in all third-party browsers, ftp clients, software libraries like LWP, etc. But you can't rely on it in Internet Explorer going forward. | [reply] |
An addendum that I needed to look up. What do you do if the name or password contains special characters? Well the answer after reading RFC 1738 is that you just URI encode them. (Duh, I should have guessed.) You can do that with the URI::Escape module. Be warned, the default character set it escapes does not include @. Therefore you will want to use something like this:
use URI::Escape qw(uri_escape);
# Takes a list of strings, returns them escaped for use in URLs. In s
+calar
# context will only escape the first.
sub safe_uri_escape {
wantarray
? map {uri_escape($_, "\\W")} @_
: uri_escape(shift, "\\W");
}
| [reply] [d/l] |
I realize this thread is over two years old, but it caught my attention because I have been looking into deobfuscation of evil URLs, and I believe this is not a good idea, particularly in a HTTP URL.
This field (called "userinfo") is defined in the general URI format in RFC 2396, but it is not used in the HTTP URL fomat described in RFC 2616. Nonetheless, most browsers will transmit this field unchanged, and most web servers will ignore it, but supply it to a CGI program as part of the "environment" data. Its chief application is intentionally obscuring the identity of the URL. It is used mainly by fraudsters and spammers for that purpose.
In addition, here is a quote from RFC 2396:
"It is clearly unwise to use a URL that contains a password which is intended to be secret. In particular, the use of a password within the 'userinfo' component of a URL is strongly disrecommended except in those rare cases where the 'password' parameter is intended to be public."
| [reply] |
| [reply] |
tilly,
Thanks! You just saved me hours and hours of tedious work. | [reply] |