Hi Christophe,
many thanks for the bug report. The exploit will not work with the
current ntop CVS:
deri@jabber 204> ./ntop -i "%p %p %p %p %p" -P . -t 5
24/Oct/2000:08:34:55 [main.c:360] SSL is present but https is disabled:
use -W <https port> for enabling it
24/Oct/2000:08:34:55 [http.c:362] Unable to create file
/usr/local/var/ntop/ntop.access.log. Access log is disabled.
24/Oct/2000:08:34:55 [main.c:372] ntop v.1.3.2 MT (SSL)
[i386-pc-solaris2.8] (10/18/00 03:06:10 PM build)
24/Oct/2000:08:34:55 [main.c:390] Listening on [%p %p %p %p %p]
24/Oct/2000:08:34:55 [main.c:391] Copyright 1998-2000 by Luca Deri
<[EMAIL PROTECTED]>
24/Oct/2000:08:34:55 [main.c:392] Get the freshest ntop from
http://www.ntop.org/
24/Oct/2000:08:34:55 [main.c:393] Initialising...
24/Oct/2000:08:34:55 [initialize.c:736] 1 810c7dc 8047143 240 8064c69
missing unit number
deri@jabber 205>
Nevertheless I feel I have to catch the error when I parse the
parameters.
Somehow I still have to realise why Ksecurity plays with old ntop
versions. They alerted the ntop community a couple of months ago about a
vulnerability on a very old ntop (1.2a9) version. Now they did it again.
Cheers, Luca
BAILLEUX Christophe wrote:
>
> Ksecurity Advisory
> (Korea security group)
>
> Subject: ntop format string vulnerability
> Release Date: 10/17/2000
> Author: AirPlane ([EMAIL PROTECTED])
> Platforms: *nix
> test version: ntop 1.1.pre3 , ntop 1.2.a10
>
> I.Background
> ntop is a popular utility for monitoring and
> summarizing network usage for unix systems.
>
> II.Summary
> ntop 1.1.pre3 and 1.2.a10 are vulnerabled to format
> string attack in there -i option.
>
> OpenBSD,FreeBSD,NetBSD include ntop 1.1.pre3 in
> there port packages but they aren't default install.
>
> In FreeBSD case, By default the ntop port is installed
> setuid root and only executable by root and members
> of the 'wheel' group.
>
> III.Detailed Description
>
> ntop.c/ntop 1.1.pre3
> 395: printf(ebuf);
> 429: printf(ebuf);
> 434: printf(ebuf);
>
> ntop.c/ntop 1.2.a10
> 633: printf(ebuf);
> 705: printf(ebuf);
> 712: printf(ebuf);
> 725: printf(ebuf);
>
> There are standard format string bug,
> ebuf variable used device error message.
>
> khs% uname -a
> FreeBSD khs.AirPlane 4.0-RELEASE FreeBSD 4.0-
> RELEASE
>
> khs% ls -al /usr/local/sbin/ntop
> -r-sr-s--- 1 root wheel 171978 Jul 25
> 03:45 /usr/local/sbin/ntop
>
> khs% id
> uid=1002(user) gid=1002(user) groups=1002(user), 0
> (wheel)
>
> khs% /usr/local/sbin/ntop -i "%p %p %p %p %p"
> ntop v.1.1 MT [i386-unknown-freebsd4.0]
> listening on 0x80516ad 0x0 0xbf bff888 0x807d480
> Host Act -Rcvd- Sent TCP UDP ICMP 0xbfbff970
> 0xbfbff834
> 0x804a23d 0x3: Device not configured
>
> khs% /usr/local/sbin/ntop -i "%s %s %s %s"
> ntop v.1.1 MT [i386-unknown-freebsd4.0] listening on
> 5T^h|^h{^hx
> Segmentation fault(core dumped)
>
> IV.Solution
> 1. chmod u-s path/to/ntop
> 2. FreeBSD users read FreeBSD-SA-00:36(ntop -w
> buffer overflow).
> 3. maybe ntop 1.3.2(snapshot) version doesn't format
> string bugs.
--
Luca Deri Finsiel S.p.A.
Via Matteucci 34/B 56124 Pisa, Italy.
Ph. +39/050/968.639 Fax. +39/050/968.626
Email: [EMAIL PROTECTED] WWW: http://www.tlcpi.finsiel.it/~deri/
ICQ: 68183632
Software is about stuff, about getting hands dirty - Jim Coplien