How can I re-enable the setuid or setgid bits ???


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How can I re-enable the setuid or setgid bits ???
# 1  
Old 04-03-2012
How can I re-enable the setuid or setgid bits ???

While I was looking for tips for hardening the security of my MAC OSX I found the following posting:

"<How to disable Setuid and Setgid Binaries >
Setuid programs run with the privileges of the file's owner
(which is often root), no matter which user executes them.
Bugs in these programs can allow privilege escalation attacks.
To find setuid and setgid programs, use the commands:
find / -perm -04000 -ls
find / -perm -02000 -ls

The following files should have their setuid or setgid bits
disabled (using chmod ug-s programname) unless
required for the purpose listed in the second column. The
programs can always have their setuid or setgid bits re-enabled
if necessary for the purpose shown..."

Therefore I disabled the setuid and/or setgid bits of the programs (many) with the command:

chmod ug-s programname.

AND NOW HOW CAN I RE-ENABLE THEM??? :-((
Thank you and greetings

Vera
# 2  
Old 04-03-2012
You followed extremely bad advice -- so poor that I suspect it may have been a malicious joke. At best, whoever gave it was ignorant of how system things like mountpoint managers and login systems need setuid to function.

More importantly -- do you still know which files you did chmod on?

If you don't know, you may need to reinstall, since finding a comprehensive list will be difficult.

To put it back for setuid-root programs: chmod u+s filename
To put it back for setgid programs: chmod g+s filename
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 04-03-2012
Thank you very very much!
It was nor a joke, I read it on the site of the
NSA (National Security Agency). They give a list of the programs to disable and describe what to do... tips to protect MAC OSX, but I suppose they thought that if somebody does what they say, he or she must have a certain knowledge... I don't have it jet, I am still a dummy Smilie

Thank you so much for your help you saved my day :-)

Vera
# 4  
Old 04-03-2012
The point is that programs which don't need setuid shouldn't have it -- that would be very dangerous. But there are those things which do. Smilie mount for instance needs setuid in a lot of systems. This is okay because it implements its own security.

If someone set cp setuid just to make things more convenient for themselves, that on the other hand would be a nightmare.

You'll have to consider them individually.
# 5  
Old 04-03-2012
Through the command: chmod ug-s programname it is told to 'treat' the following programs MacOS/ARDAgent afpLoad PrinterSharingTool Locum aehelper csregprinter dumpemacs vpnd lppasswd rcp rlogin rsh sadc pppd scselect Disable Setuid and Setgid Binaries Setuid programs run with the privileges of the file's owner (which is often root), no matter which user executes them. Bugs in these programs can allow privilege escalation attacks. To find setuid and setgid programs, use the commands: find / -perm -04000 -ls find / -perm -02000 -ls The following files should have their setuid or setgid bits disabled (using chmod ug-s programname) unless required for the purpose listed in the second column. The programs can always have their setuid or setgid bits re-enabled if necessary for the purpose shown. )

---------- Post updated at 09:29 PM ---------- Previous update was at 09:23 PM ----------

nsa.gov/ia/mitigation_guidance/security_configuration_guides/operating_systems.shtml

---------- Post updated at 09:39 PM ---------- Previous update was at 09:29 PM ----------

I know nothing but I want to learn everything. The first thing should be to ensure security to the computer. Do u think this is the right way? (I mean disabled setuid or setgid bits) I know that my questions might seem very stupid but I am a total beginner, I didn't feel too much ashamed to write only because this is the section for dummies :-)
# 6  
Old 04-03-2012
I repeat: Blindly disabling all setuid programs is silly. You are guaranteed to break important things that way.

I repeat: If you don't know if/why they need setuid, research them individually.

The link you gave even lists programs which you can disable setuid bits for on many versions of OSX -- and the consequences of doing so. Even those were set setuid for a reason, after all...
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 04-04-2012
Thank you

Thank you, I have understood and I will not disable them anymore. They are back...
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

What keeps me from abusing setuid(0) and programs with setuid bit set?

Just learning about the privilege escalation method provided by setuid. Correct me if I am wrong but what it does is change the uid of the current process to whatever uid I set. Right ? So what stops me from writing my own C program and calling setuid(0) within it and gaining root privileges ? ... (2 Replies)
Discussion started by: sreyan32
2 Replies

2. Shell Programming and Scripting

Setuid and setgid and similar settings

so im writing a script for a android system. these types of systems are not the typical unix systems. what i need to do is basic. i have a script which I put in a directory and then zipped up the directory in a zip file. that way, when the script is unzipped, the person unzipping will see... (1 Reply)
Discussion started by: SkySmart
1 Replies

3. Solaris

Special File Permissions Setgid and setuid ..HELP

I have a user AAA who's who is part of a group call clserv and techsupp, His userfiles have the following permissions:- drwxrwx--- 16 AAA clserv 1858 Aug 22 12:48 UserFiles he has a link in his UserFiles/ lrwxrwxrwx 1 root root 36 Mar 9 2013 TECHSUPP_GLOBAL... (5 Replies)
Discussion started by: kilobyter
5 Replies

4. What is on Your Mind?

Place Bits & Win Bits!!! - 17th Annual Satellite Awards

Ten movies have been nominated as best motion picture by the International Press Academy, presentation of the 2012 Satellite Awards will be held on 16th December at Los Angeles, CA. Place your bits here on one of the below nominated movie of your choice:- Argo ... (0 Replies)
Discussion started by: Yoda
0 Replies

5. Solaris

about setuid setgid permissions

hi.. why we go for setuid, setgid permissions? as a system admin ,when we use this ,except default solaris setuid,setgid files and dirs.. hopes that anyone can help me regarding this.. (1 Reply)
Discussion started by: saravananpalani
1 Replies

6. Shell Programming and Scripting

Searching for SETUID and SETGID using PERL file find with lstat

About System and Perl: Sun Solaris 5.9 sparc, Perl 5.6.1 I've decided to use the perl file::find module to look for all the SETUID and SETGID files on my unix boxes. I wrote something like this: (I've shorted it a little to make it simple) #!/opt/perl/bin/perl use File::Find; find... (1 Reply)
Discussion started by: x96riley3
1 Replies

7. Programming

setgid

I have a setuid to root program that has now to be changed to setuid to oracle depending on who is running it. Oracle has only two groups, dba (primary) and osgrp1 (secondary). But running 'id' if oracle shows all the secondary groups belonging to root, and only dba or osgrp1 as the primary group... (2 Replies)
Discussion started by: blowtorch
2 Replies

8. UNIX for Dummies Questions & Answers

Using setuid and setgid

Hi, I have been looking at setuid and setgid. I understand that setuid determines who owns the file and setgid determines which group of people can access the file... yeah?! But i need to know how to actually use setuid and setgid. I'm guessing chmod will feature somewhere.. Any help... (1 Reply)
Discussion started by: crispy
1 Replies

9. UNIX for Dummies Questions & Answers

Changing 24 bits to 8 bits display

Hello all, I was wondering if anyone can tell me how to change 24 bits depth display to 8 bits depth display for Sun Ultra1, running Solaris 8? THANKS in advance. I think that the command is ffbconfig, but it has nothing about depth. (4 Replies)
Discussion started by: larry
4 Replies
Login or Register to Ask a Question