Vulnerability Development mailing list archives
Re: 2 dodgy network programs
From: zaf () NRC CO NZ (Nick 'Zaf' Clifford)
Date: Sun, 10 Oct 1999 12:07:56 +1300
Antonomasia wrote:
I was just visiting http://www.echelon.wiretapped.net and downloaded a small file called "tcplog.c" with no author or version stated. It is for logging connections to your box (linux only). There are some minor coding gripes I could make, but line 107 takes a risk with the size of a hostname 98 char *hostlookup(unsigned long int in) 99 { 100 static char blah[1024]; 101 struct in_addr i; 102 struct hostent *he; 103 104 i.s_addr=in; 105 he=gethostbyaddr((char *)&i, sizeof(struct in_addr),AF_INET); 106 if(he == NULL) strcpy(blah, inet_ntoa(i)); 107 else strcpy(blah, he->h_name); 108 return blah; 109 }
<SNIP> The "standard" max length of a hostname is 63 characters. Its used with little or no buffer checking in a *LOT* of code bases, most ircd's assume this is the maximum, with little checking. I don't think you'd be able to convince a nameservice to pass on a > 63 char hostname to a program. Though you might strike luck with /etc/hosts. Nick
Current thread:
- Re: Newbie in Jeopardy, (continued)
- Re: Newbie in Jeopardy Nimrod Vered (Oct 09)
- Re: Guestbook perl script (error fix) Erik Parker (Oct 08)
- SSH and X11 forwarding Rob Quinn (Oct 08)
- fbsd 3.3 ospf_monitor research Brock Tellier (Oct 08)
- Re: fbsd 3.3 ospf_monitor research Jeff Bachtel (Oct 10)
- Re: fbsd 3.3 ospf_monitor research Andrew Reiter (Oct 11)
- restoretextmode problems robert (Oct 11)
- NT SysKey should be breakable Mikael Olsson (Oct 08)
- Re: NT SysKey should be breakable Mikael Olsson (Oct 09)
- 2 dodgy network programs Antonomasia (Oct 09)
- Re: 2 dodgy network programs Nick 'Zaf' Clifford (Oct 09)
- Re: 2 dodgy network programs David R. Conrad (Oct 13)
- Classes? Devin Walters (Oct 16)
- Re: Classes? Blue Boar (Oct 16)
- Re: Classes? Dragos Ruiu (Oct 16)
- Re: Classes? Bacano (Oct 17)
- Re: Classes? Max Vision (Oct 18)
- Re: Classes? David R. Conrad (Oct 17)
- Re: Classes? Crispin Cowan (Oct 18)
- Re: Classes? George Kurtz (Oct 20)
- Re: Classes? Max Vision (Oct 24)