Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Operating Systems > Linux, Unix

Reply
 
LinkBack Thread Tools
Old 10-31-07   #1 (permalink)
Linux Lobbyist
 
endo's Avatar
 
amd nvidia

Join Date: Feb 2007
Location: Omaha, Nebraska
Posts: 2,762

Rep: 158 endo is acknowledged by manyendo is acknowledged by many
Unique Rep: 108
Trader Rating: 10
Default Quickly check for potential root-exploitable programs

Quote:
One potential way for a user to escalate her privileges on a system is to exploit a vulnerability in an SUID or SGID program. SUID and SGID are legitimately used when programs need special permissions above and beyond those that are available to the user who is running them. One such program is passwd. Simultaneously allowing a user to change her password while not allowing any user to modify the system password file means that the passwd program must be run with root privileges. Thus the program has its SUID bit set, which causes it to be executed with the privileges of the program file’s owner. Similarly, when the SGID bit is set, the program is executed with the privileges of the file’s group owner.

Running ls -l on a binary that has its SUID bit set should look like this:

-r-s–x–x 1 root root 16336 Feb 13 2003 /usr/bin/passwd

Notice that instead of an execute bit (x) for the owner bits, it has an s. This signifies an SUID file.

Unfortunately, a poorly written SUID or SGID binary can be used to quickly and easily escalate a user’s privileges. Also, an attacker who has already gained root access may hide SUID binaries throughout your system in order to leave a backdoor for future access. This leads us to the need for scanning systems for SUID and SGID binaries. This is a simple process and can be done with the following command:

# find / \( -perm -4000 -o -perm -2000 \) -type f -exec ls -la {} \;

One important thing to consider is whether an SUID program is in fact a shell script rather than an executable, since it’s trivial for someone to change an otherwise innocuous script into a backdoor. Most operating systems will ignore any SUID or SGID bits on a shell script, but if you want to find all SUID or SGID scripts on a system, change the argument to the -exec option in the last command and add a pipe so that the command reads:

# find / \( -perm -4000 -o -perm -2000 \) \ -type f -exec file {} \; | grep -v ELF

Now every time an SUID or SGID file is encountered, the file command will run and determine what type of file is being examined. If it’s an executable, grep will filter it out; otherwise, it will be printed to the screen with some information about what kind of file it is. Most operating systems use ELF-format executables, but if you’re running an operating system that doesn’t (older versions of Linux used a.out, and AIX uses XCOFF), you’ll need to replace the ELF in the previous grep command with the binary format used by your operating system and architecture. If you’re unsure of what to look for, run the file command on any binary executable, and it will report the string you’re looking for.
source

something you guys might want to know.

System: Black Sunshine :)
CPU
AMD Athlon 64 FX-60 @ 2800MHz
Motherboard
ABIT AT8 32X Socket 939
Memory
Kingston HyperX 2GB (2 x 1GB)
Graphics Card
EVGA 8800 GTS 320MB
Hard Drive
150gb raptor. WD 1 tb black storage, 500gb
Sound Card
onboard
Power Supply
Antec TruePower Quattro 850W
Case
Thermaltake Armor Series black
CPU cooling
BIG TYPHOON CL-P0114 TT
GPU cooling
stock
OS
windows xp
Monitor
samsung SyncMaster 204B
endo is offline   Reply With Quote
Old 11-02-07   #2 (permalink)
Linux Lobbyist
 
endo's Avatar
 
amd nvidia

Join Date: Feb 2007
Location: Omaha, Nebraska
Posts: 2,762

Rep: 158 endo is acknowledged by manyendo is acknowledged by many
Unique Rep: 108
Trader Rating: 10
Default

bump

System: Black Sunshine :)
CPU
AMD Athlon 64 FX-60 @ 2800MHz
Motherboard
ABIT AT8 32X Socket 939
Memory
Kingston HyperX 2GB (2 x 1GB)
Graphics Card
EVGA 8800 GTS 320MB
Hard Drive
150gb raptor. WD 1 tb black storage, 500gb
Sound Card
onboard
Power Supply
Antec TruePower Quattro 850W
Case
Thermaltake Armor Series black
CPU cooling
BIG TYPHOON CL-P0114 TT
GPU cooling
stock
OS
windows xp
Monitor
samsung SyncMaster 204B
endo is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 10:42 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License

Terms of Service / Forum Rules | Privacy Policy | DMCA Info | Advertising | Become an Official Vendor
Copyright © 2009 Shogun Interactive Development. Most rights reserved.
Page generated in 0.09596 seconds with 8 queries