Re: Effective, Real and Group id switching for daemons

From: lists@notatla.demon.co.uk
Date: 01/25/03

  • Next message: Ben Pfaff: "Re: Standards for developing secure software"
    To: jhanna@cproject.com, secprog@securityfocus.com
    Date: Sat, 25 Jan 2003 12:16:06 +0000 (GMT)
    From: lists@notatla.demon.co.uk
    

    From: "John Hanna" <jhanna@cproject.com>

    > One of the important features is to be able to run as non-root after we
    > start listening on port 25.

    I can think of 2 other options:
        use a high port as non-root with port-forwarding to get SMTP traffic
        bind as non-root to port 25 (simple in open-source *nix)

    > First is it important to switch the real uid as well? It might be nice to
    > ... but not real-uid I suppose the clever hacker would switch the

    Exactly - you need to do that.

    > Secondly do I need to give the option to switch effective and real group id
    > as well? I suppose root group might be able to do something a hacker
    > shouldn't, even after they've lost root euid, right?

    A few moments with "man perlvar" should lead you to something like this
    which you can test by running it as root.

    #!/usr/bin/perl -w

    system("id");
    $)="500 500"; # set group IDs, appears twice to call setgroups()
    $(=500;
    system("id");
    $>=500; # set user IDs
    $<=500;
    system("id");



    Relevant Pages

    • Re: switching bsdlabels label
      ... reason someone labelled root as 'd' and home as 'a'. ... bsdlabel -n da0s1> savedabel.txt ... partitions or if it is just that the partitions are mounted backwards ... You could switch it around using bsdlabel, but I don't think the risk would be worth the negligible gain. ...
      (freebsd-questions)
    • Re: switching bsdlabels label
      ... reason someone labelled root as 'd' and home as 'a'. ... bsdlabel -n da0s1> savedabel.txt ... partitions or if it is just that the partitions are mounted backwards ... You could switch it around using bsdlabel, but I don't think the risk would be worth the negligible gain. ...
      (freebsd-stable)
    • Re: Question for Spanning tree experts
      ... I'm trying to understand the importance of "root switch". ... > be working and I'm stumped why we didn't see any network slowness. ... > good way to learn more about spanning tree. ...
      (comp.dcom.sys.cisco)
    • Re: The newgrp command
      ... Well, Ben you are right, root can switch to any group without having to give ... case an ordinary user is not a member of a particular group and she/he tries ... to use the newgrp command to switch to that group with correct password, ...
      (Fedora)
    • Re: Spanning Tree root switch
      ... > tree and root switches. ... I very much doubt that you need a "a "high end" switch as ... Imagine a squirrel on branch A of a fir tree wants to get ... two core switches say with Gigabit between them, ...
      (comp.dcom.sys.cisco)