Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 2009 14:27:46 +0200
From:      Ruben de Groot <mail25@bzerk.org>
To:        Freminlins <freminlins@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>, utisoft@gmail.com
Subject:   Re: Non-root user and accept() or listen()
Message-ID:  <20090915122746.GA27732@ei.bzerk.org>
In-Reply-To: <eeef1a4c0909150339h78ae9b68j5c80a5e62ae55764@mail.gmail.com>
References:  <eeef1a4c0909140947s5f10b4cdidbd7b41a5539186c@mail.gmail.com> <b79ecaef0909141044l63ec4e76xdebba5f06e645b8e@mail.gmail.com> <eeef1a4c0909150339h78ae9b68j5c80a5e62ae55764@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 15, 2009 at 11:39:05AM +0100, Freminlins typed:
> 2009/9/14 Chris Rees <utisoft@googlemail.com>
> 
> >
> > Isn't this a bit drastic? Listening sockets are opened by very many
> > types of processes, as well as remembering that sendmail, BIND, and
> > others don't actually run as root... I suppose it'd be possible, but
> >  would it actually be useful?
> >
> 
> Sure, those open listening sockets. But those are things I want to listen.
> 
> Now suppose a user account was hacked, and "Bob" sets up a web server
> listening on some random port above 1024. If "Bob" couldn't use listen() he
> wouldn't be able to do that.

Haven't tried it, but you can probably set net.inet.ip.portrange.reservedhigh
to 65535. That way only root can bind(2) to any port.

Ruben




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090915122746.GA27732>