Article View: news.software.nntp
Article #55762Re: Best way to determine if login is required?
From: Frank Durda IV
Date: Fri, 28 Dec 2001 00:25
Date: Fri, 28 Dec 2001 00:25
185 lines
9933 bytes
9933 bytes
Bill Kearney <wkearney99@hotmail.com> wrote:
: Hi all,
:
: What's considered the 'best practice' for determining if a client needs to
: log into a server?
Here are the steps I live by on my servers:
(1) If a newsreader wants to authenticate, it SHOULD send AUTHINFO commands
immediately after connecting. (Our server can grant users additional
services and speed, but they have to identify themselves first, otherwise
they may get the stock package if connecting from a trusted netblock;
otherwise, they get no access at all.)
(2) If the newsreader doesn't authenticate right away, it can try to do stuff
until confronted with a 480 response (which may come from any command
other than HELP, QUIT and AUTHINFO). At that point, the newsreader MUST
choose:
(3) send the AUTHINFO commands now and on success*, repeat the blocked
command, and then proceed normally.
OR
(4) don't go that direction any more since the unknown client (as the
server knows you right now) clearly isn't allowed to do whatever
the command was that returned 480.
Using the above formula, we have had absolutely no problems in dealing with
Microsoft, Netscape, Agent and numerous other newsreaders. All seem to cope
reasonably well, with one obscure exception, mentioned below.
* Based on our discussions with Forte in the early days of authinfo and how
they wanted the server to behave, our servers close a connection with a
502 error immediately (after a sleep(n)) if an "authinfo pass" fails to
match the expected login/password entry in the access file. The sleep is
there to discourage password cracking attempts, greatly reducing the number
of tries that can be attempted per hour. All good and bad authinfo
attempts are logged.
As demonstrated in recent days, Typhoon servers apparently let you remain
connected, despite giving a bad login/password. This is a nasty security
problem because no legit newsreader will try alternate login/passwords if
the first one fails, so this behavior of the server only benefits the
hacker, who can sit there for hours, brute force cracking passwords,
possibly with little or no logging of what is going on. Not nice.
In the one case where the above flow didn't work, we have had an instance of
a customer ordering one of the higher-level packages, and for these you
always have to authenticate so the server can adjust accordingly. We ran
into a version of trn that if it didn't run into a 480 error, it would never
authenticate, and there was no way to force it to authenticate without it
first encountering a 480 error.
Finally, we set up a special port that always acts like you are unknown and
required everybody to authenticate. Of course, about the time we got the
alternate port working, the customer upgraded to a newer version of trn
which had a way to force authentication, and the issue went away.
The moral for anyone writing a newsreader: be sure that there is a way
to force authentication to occur on each connect rather than trying to always
make the determination automatically and then running into a situation like
the one described.
FYI, As a troubleshooting trick, Airnews alters the greeting banner and HELP
command display for each connection so you can see what privs/speeds
you have based on what we know about you right now, like this:
200 library1.airnews.net AIRNEWS Server is ready. 6(108) [Who_are_you] (posting ok)
help
100 Legal commands
authinfo user Name|pass Password
article [MessageID|Number]
...
xpath MessageID
Your Service level is Not yet logged-in
(At this point, about all you can do is authinfo, quit and help. Other
commands either fail with 480 or return "playing-dumb" answers.)
authinfo user amsomebody@connecting.from.somewhere.net
381 PASS required
authinfo pass apassword
281 Ok - Classic 150Kbit/sec, 2 connects allowed
help
100 Legal commands
authinfo user Name|pass Password
article [MessageID|Number]
...
xpath MessageID
Your Service level is Classic 150Kbit/sec, 2 connects allowed
or coming from a known netblock that has a different service package:
200 library1.airnews.net AIRNEWS Server is ready. 6(108) [foobarnet] (posting ok)
help
100 Legal commands
authinfo user Name|pass Password
article [MessageID|Number]
...
xpath MessageID
Your Service level is Foobarnet News Access 768Kbit/sec, 4 connects allowed
- - - - - - - - -
When it gets down to it, the entire authentication thing is really pasted-on.
The original code at Airnews was crafted to exactly match what Agent was
emitting, because the stock INN tree didn't have any code to handle
AUTHINFO back then (the 1.4 and 1.5 era). Today, we now have a system that
directs a given login to a configuration file that describes all the settings
for that class of user, keeping the access files small but allowing a lot
of customization.
We also fought the problem of the standard greeting response code, 200/201.**
We found that Agent and other newsreaders that were confronted with a 201
on initial connect would never allow posting, (wouldn't even issue a post
command), even if they authenticated (via authinfo) and would be allowed to
post once authenticated. This was kind of dumb anyway, because the server
99% of the time wouldn't know if the customer was going to be allowed to post
at the time the greeting banner is displayed anyway.
So, to this day we have to lie and greet everybody with 200 regardless of
whether posting is allowed or not. The client finds out when they run into
a 480 or some other restricting response.
** It's actually worse than that. Seems some versions of Agent weren't
using the response code numbers, and were actually looking for the string
"posting ok".
We even changed the "help" output at one point to only show the commands
that were available prior to authenticating, and doing this broke the
Agent newsreaders. Seems some Agent versions issued a "help" command
immediately after connecting and prior to authenticating, then analyzed
the "help" output to figure out what commands were available on the
server and would use or not use the available commands accordingly.
This is so non-RFC-ish, something you think Microsoft might come up
with! :-(
So a tip: don't output a shorter list of help commands prior to
authenticating, or change their order or spacing in the help display from
what appears in stock INN, or else some Agent newsreaders will think
that they have no or few commands to work with. (No, dropping "post"
from the help list didn't change that other irritating behavior, but
thanks for asking.) I hope modern Agent versions don't do this anymore.
: I'm assuming the server is going to be supporting the
: AUTHINFO commands. How should one 'feel out' the server to see if it wants
: authentication? I'm trying to write a client that will handle both
: authenticated and anonymous access. But if the user 'improperly' inserts a
: username/password pair I'm considering whether the client should ignore
: those values and proceed anonymously. That is, anonymously in the context
: of not performing the authinfo command.
If you are being anonymous, don't issue the authinfo commands, unless by
chance the server has actually created an entry in the access file for
"anonymous" with an empty password, like FTP servers do. I've never seen
that done on a NNTP server, and it seems pointless if you can simply accept
post/article commands without requiring an authinfo command in the first
place.
Of course, there is a difference between the news server knowing who the
clients are and requiring authinfo, and disclosing that knowledge in any
posts that are generated or in any logs that are kept. Quite a few servers
go out of their way to not add anything to posts that would identify the
poster to an individual, but if the guy with the court order shows up, most
server operators want to be able to go back and identify the poster rather
than lose their equipment to an electronic dissecting lab. More and more
court orders sound like the highwayman Dennis Moore: "The Rogues Identity,
or Your Server". Or was that Lophines? :-(
Frank Durda IV - only this address works:|"Like the HitchHikers Guide to the
<uhclem.jan02%nemesis.lonestar.org> | Galaxy, when the Internet is
| inaccurate, at least it can be said
This Anti-spam address expires Jan. 31st | to be definitively inaccurate."
Copr. 2001, ask before reprinting.
Technical Details
Message-ID:
<5B1BB2EE7B245B3C.BB02DD5EEF21BD78.75A5618A870ED179@lp.airnews.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!news-west.rr.com!news.airnews.net!cabal10.airnews.net!cabal1.airnews.net!news-f.iadfw.net!not-for-mailReferences:
<WbIW7.880$5c4.125016@newsread1.prod.itd.earthlink.net>Show Full Headers
Complete Article Headers
Message-ID: <5B1BB2EE7B245B3C.BB02DD5EEF21BD78.75A5618A870ED179@lp.airnews.net> Subject: Re: Best way to determine if login is required? Date: Fri, 28 Dec 2001 00:25:06 +0000 From: Frank Durda IV <uhclem.jan02@nemesis.lonestar.org> References: <WbIW7.880$5c4.125016@newsread1.prod.itd.earthlink.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!news-west.rr.com!news.airnews.net!cabal10.airnews.net!cabal1.airnews.net!news-f.iadfw.net!not-for-mail Newsgroups: news.software.nntp Organization: The Big Blue Box Lines: 184 X-Orig-Message-ID: <a0ge52$rbk@library1.airnews.net> Abuse-Reports-To: abuse at airmail.net to report improper postings NNTP-Proxy-Relay: library1-aux.airnews.net NNTP-Posting-Time: Thu Dec 27 18:25:06 2001 NNTP-Posting-Host: !c<$00d-1[G3i-- (Encoded at Airnews!)