• Samsy@lemmy.ml
    link
    fedilink
    arrow-up
    33
    arrow-down
    1
    ·
    22 days ago

    But rm -fr / * seems not to work for removing the French language pack. Can someone confirm if it works with sudo?

    • plateee@piefed.social
      link
      fedilink
      English
      arrow-up
      15
      ·
      22 days ago

      Ah, I see your problem, you need to add --no-preserve-root.

      See the French are super into wine - and grape vines are notoriously hard to get rid of, so if you want to really get rid of the French language pack, you need to rip that grapevine out by the root (e.g. don’t preserve the root). Otherwise, the French language pack will just grow back harder and Frenchier than before.

      Sacrebleu!

  • SilentObserver@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    21 days ago

    Don’t need sudo if you’re always root.

    Now excuse me. I need to call the bank and find out why my checking account is suddenly $0.

    • shane@feddit.nl
      link
      fedilink
      arrow-up
      3
      ·
      21 days ago

      And yet half the time when I’m root I preface with sudo. I can’t stop myself!

  • luciferofastora@feddit.org
    link
    fedilink
    arrow-up
    15
    ·
    22 days ago

    I once did a HackTheBox where the privilege escalation weakness was a cronjob running a script. I’m not sure if I correctly remember all the details, but I think it read some parameters from a file and fed them to some other script. Since it had something to do with the webserver the user was administrating, they needed write access to the file, granted via ACL. That took me a while to spot, actually. Not sure why, but ACL is a constant blind spot for me. As for passing the parameters, you can just append the contents of the file to the command and pipe it to bash.

    I don’t recall what the normal script did, but it needed writing permissions for something. The proper way to do this would be ACL, but I guess I’m not the only one with a blind spot. The easy way to ensure the script can do whatever it needs to is to sudo the whole thing.

    So what do you do if you have a script running every ten minutes, reading the first line of a file you can edit, then executing it with superuser privileges?

    Whatever the fuck you want.

        • rem26_art@fedia.io
          link
          fedilink
          arrow-up
          4
          ·
          22 days ago

          sudo -i starts a login shell as the specified user. Login shell means it’ll read that user’s bashrc/zshrc/whatever other login files and apply those. If no user is specified, then it’ll login as root, so you get a root shell

          • B-TR3E@feddit.org
            link
            fedilink
            arrow-up
            2
            arrow-down
            4
            ·
            22 days ago

            OMG. There’s literally more ignorance and bullshit than words in that sentence. It is so wrong that not even the opposite is true. I hope that was sarcasm - in which case I draw my hat because it would be a true peace of art.
            Before voting me down, be sure to

            man environ
            
            • and be sure you’ve understood at least what the environment variables do. If that is too hard for you, at least find out what the difference between a binary and a UID might be.
            • B-TR3E@feddit.org
              link
              fedilink
              arrow-up
              2
              ·
              22 days ago

              No arguments, just downvotes… I almost suspect some participants do not even understand what might be wrong with “you are sudo”? I also bet you don’t have the right idea what the difference between effective UIDs might be depending if you’re using “su”, “su -i” , "su - " sudo or “sudo su”. The differences are not exactly subtile and I dare to say admins on unixoids who don’t know them are basically talking heads without an idea what they’re actually talking about.

  • AA5B@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    21 days ago

    Look at OP, claiming to have that mythical girlfriend who will make a sandwich without escalating privileges