4

I need people with Macs (running macOS) to help me make sure this Python script I wrote works. I'll upload it to git{hub, lab} and link to it in the comments.

Comments
  • 0
    The script in question:

    https://gitlab.com/RiderExMachina/...

    I need to know if elevations are necessary to remove the files in /Library/$FOLDER, and if so, how to implement it.
  • 0
    Always working:
    DROP * FROM folder
    Just kidding, i have no Mac
  • 0
    I would guess at:
    1. Depends on the individual perms/ownership of the thing you're trying to remove and the directory it lives in.
    2. Either:
    - run it with sudo
    - make the script suid root (probably a bad idea and not sure it would work) (also, you'd need to add the hashbang at the beginning), or
    - (if it was bash, but there may well be an equivalent) put a line at the beginning that checks if the 'whoami' command says 'root' and if not, have the script exec itself with sudo.
  • 0
    @d4ng3r0u5

    I was able to get it to run after writing some exception handling, however, I have to open the terminal and run it as "sudo python script.py; python script.py".

    I might change the non-root stuff to before the root stuff, and then try to do privilege escalation.
Add Comment