How to switch from ordinary users to root users in the program? (Mac OS X)

xiaoxiao2021-03-06  43

#include

INT main (void) {int Ret; Ret = setuid (0); // Make the program to run Printf ("Ret% D / N", RET); system ("/ bin / bash");} and it is Before you get the root privilege, you can make the following modifications! ! ! ! !

# cc ac # chmod 04777 a.out // Set the UID bit for s # chown root: root a.out // Make the file owner to root, under Mac, SYSTEM, the group is Wheel # su - guest $ a. Outret 1 #

转载请注明原文地址:https://www.9cbs.com/read-53849.html

New Post(0)