Bugtraq mailing list archives
Possible fixed identd
From: prj () NLS NET (Phillip R. Jaenke)
Date: Wed, 13 Aug 1997 21:05:51 -0400
Moving right along, ahead of schedule..
Submitted for your approval and testing, a slightly modified identd.
Please note, this is UNTESTED as of 09:13 EDT, Wednesday, August 13th.
I'm currently swamped, but will be attempting to run a few tests today.
Compiles cleanly on Linux.
[root@maezw /root]# gcc -Wall -O3 -m486 identd.c -o identd
[root@maezw /root]#
Any contributions, ideas, suggestions, please email me privately. If
you have an OS that it does NOT compile on, and you create a fix or
patch, please share with the entire list. Thanks, and enjoy! :)
--------8<---cut here--->8---------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/time.h>
#include <ctype.h>
#include <string.h>
int writeranduser(void)
{
int r;
char username[12];
srandom(getpid());
memset(username, 0, 12);
r = random() % 26;
r = r + 'a';
memset(username, r, 11);
if(write(1, username, strlen(username)) < strlen(username))
exit(0);
return 1;
}
int main(int argc, char **argv)
{
char genrandomuser = 1;
char *portpair = NULL;
fd_set rset;
struct timeval tv;
int i;
if(argc > 1) genrandomuser = 0;
portpair = malloc(1024);
if(!portpair)
exit(0);
memset(portpair, 0, 1024);
tv.tv_sec = 180;
tv.tv_usec = 0;
FD_ZERO(&rset);
FD_SET(0, &rset);
i = select(1, &rset, NULL, NULL, &tv);
if(i < 1)
exit(0);
if(read(0, portpair, 512) < 1)
exit(0);
while(*portpair)
{
if(isdigit(*portpair))
if(write(1, portpair, 1) < 0)
exit(0);
else;
else if(*portpair == ',')
if(write(1, portpair, 1) < 0)
exit(0);
else;
portpair++;
}
if(write(1, " : USERID : UNIX : ", 19) < 19)
exit(0);
if(!genrandomuser)
if(write(1, argv[1], strlen(argv[1])) < strlen(argv[1]))
exit(0);
else;
else
writeranduser();
if(write(1, "\r\n", 2) < 2)
exit(0);
return 1;
}
-Phillip R. Jaenke (InterNIC Handle: PRJ5) [prj () NLS NET]
UNIX Systems Administration, Management, and Technical Support,
NetLink Services, Inc. (216/468.5100 - sales () nls net - www.nls.net)
"People disagree with me. I just ignore them." -- Linus Torvalds
-RC5- Team Nightmare (ARRRRRRRRGH!! We lost our webserver. AGAIN!)
"RC5 - DES Was Too Easy!" -- [i386] @ IRC
Current thread:
- Re: CPSR #8: identd Denial of Service, (continued)
- Re: CPSR #8: identd Denial of Service Curt Sampson (Aug 04)
- INND causes cancer in laboratory rats (fwd) Dan Fleisher (Aug 01)
- Re: INND causes cancer in laboratory rats (fwd) thoth () PURPLEFROG COM (Aug 01)
- Bugs in Debian Linux's ircd package Matt (Aug 01)
- SSH LocalForward Kristof Van Damme (Aug 02)
- Security hole in rusers client David Holland (Aug 02)
- SSH LocalForward Nicolas Dubee (Aug 02)
- Re: your mail Erik Troan (Aug 10)
- Sun Security Bulletin #00149 Aleph One (Aug 13)
- Sun Security Bulletin #00150 Aleph One (Aug 13)
- Possible fixed identd Phillip R. Jaenke (Aug 13)
- CERT Advisory CA-97.22 - BIND - the Berkeley Internet Name Daemon Aleph One (Aug 14)
- Vulnerability in 4.4BSD rfork() implementation Thomas H. Ptacek (Aug 02)
- Linux clone() looks safe (Re: Vulnerability in 4.4BSD rfork() Jeff Epler (Aug 02)
- Re: Linux clone() looks safe (Re: Vulnerability in 4.4BSD rfork() Marc Slemko (Aug 03)
- Re: sendmail -C: Known? Patches? (AIX 4.1.5) Gene Spafford (Aug 09)
- Re: sendmail -C: Known? Patches? (AIX 4.1.5) Troy Bollinger (Aug 10)
