Article View: news.software.nntp
Article #50858hacking inn with kerberos hooks
From: Russell Virgilio
Date: Mon, 26 Feb 2001 22:08
Date: Mon, 26 Feb 2001 22:08
82 lines
4310 bytes
4310 bytes
I need to add some kerberos hooks to inn 2.3.1 I have inserted them
into ckpasswd.c, and am using a return value of 0 for success, and
anything else for failure. I know my kerberos api is working, but I
want to be sure there is nothing else I am missing in INN's process to
validate user/pass. When innd calls ckpasswd does it pass in the
user/pass? I am using the existing ckpasswd routines to parse
user/pass, is this safe? Does Innd base it's authentication on the
return value of ckpasswd? I can not seem to find the answers to these
questions in the source code for INN. Here is my ckpasswd.c file,
which I can compile with no errors. I will attach some sample news.err
messages as well. Thanks for any help.
/* $Id: ckpasswd.c,v 1.6.2.2 2000/09/20 10:47:22 kondou Exp $
**
** The default username/password authenticator.
*/
#include "config.h"
#include "clibrary.h"
#include "prism_auth.h"
#include <pwd.h>
int main(int argc, char *argv[])
{
extern int optind;
extern char *optarg;
int opt;
int retval;
char uname[SMBUF], pass[SMBUF];
char buff[SMBUF];
uname[0] = '\0';
pass[0] = '\0';
/* make sure that strlen(buff) is always less than sizeof(buff) */
buff[sizeof(buff)-1] = '\0';
/* get the username and password from stdin */
while (fgets(buff, sizeof(buff)-1, stdin) != (char*) 0) {
/* strip '\r\n' */
buff[strlen(buff)-1] = '\0';
if (strlen(buff) && (buff[strlen(buff)-1] == '\r'))
buff[strlen(buff)-1] = '\0';
#define NAMESTR "ClientAuthname: "
#define PASSSTR "ClientPassword: "
if (!strncmp(buff, NAMESTR, strlen(NAMESTR)))
strcpy(uname, buff+sizeof(NAMESTR)-1);
if (!strncmp(buff, PASSSTR, strlen(PASSSTR)))
strcpy(pass, buff+sizeof(PASSSTR)-1);
}
if (!uname[0] || !pass[0])
exit(3);
/* got username and password, check if they're valid */
retval=prism_auth(PA_SYSLOG | PA_DEBUG | PA_TGT, uname, pass,
"/services/server/news/.pgp/keytab", NULL, NULL, NULL);
exit(retval);
}
here is my news.err file
Feb 26 17:01:21 overkill nnrpd[5055]: [ID 516902 news.warning] SERVER
perl filtering enabled
Feb 26 17:01:21 overkill nnrpd[5055]: [ID 781445 news.warning] starttls:
TLSv1 with cipher RC4-MD5 (128/128 bits) no authentication
Feb 26 17:01:21 overkill nnrpd[5055]: [ID 998472 news.warning]
batman.ns.gatech.edu connect
Feb 26 17:01:21 overkill nnrpd[5055]: [ID 561221 news.warning]
batman.ns.gatech.edu bad_auth
Feb 26 17:01:21 overkill nnrpd[5055]: [ID 452021 news.warning]
batman.ns.gatech.edu times user 0.260 system 0.010 elapsed 0.252
Feb 26 17:01:31 overkill nnrpd[5056]: [ID 516902 news.warning] SERVER
perl filtering enabled
Feb 26 17:01:31 overkill nnrpd[5056]: [ID 781445 news.warning] starttls:
TLSv1 with cipher RC4-MD5 (128/128 bits) no authentication
Feb 26 17:01:31 overkill nnrpd[5056]: [ID 998472 news.warning]
batman.ns.gatech.edu connect
Feb 26 17:01:31 overkill nnrpd[5056]: [ID 561221 news.warning]
batman.ns.gatech.edu bad_auth
Feb 26 17:01:31 overkill nnrpd[5056]: [ID 452021 news.warning]
batman.ns.gatech.edu times user 0.240 system 0.030 elapsed 0.247
Technical Details
Message-ID:
<3A9AD3EC.BF47214F@gatech.edu>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!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!howland.erols.net!feed2.news.rcn.net!rcn!news.mindspring.net!cc.gatech.edu!GT-News!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <3A9AD3EC.BF47214F@gatech.edu> Subject: hacking inn with kerberos hooks Date: Mon, 26 Feb 2001 17:08:44 -0500 From: Russell Virgilio <russ@gatech.edu> 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!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!howland.erols.net!feed2.news.rcn.net!rcn!news.mindspring.net!cc.gatech.edu!GT-News!not-for-mail Newsgroups: news.software.nntp Organization: Georgia Institute of Technology, Atlanta GA, USA Lines: 81 NNTP-Posting-Host: unknown@dedalus.ns.gatech.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news-int.gatech.edu 983225334 14839 128.61.2.38 (26 Feb 2001 22:08:54 GMT) X-Complaints-To: usenet@news.gatech.edu NNTP-Posting-Date: 26 Feb 2001 22:08:54 GMT X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.17-21mdksecure i686) X-Accept-Language: en