Questions tagged [suid]
78 questions
2
votes
1 answer
root command from a 'set-user root' program
I wish to start a root command from a 'set-user root' program,
so I wrote the following C sample program:
#include
#include
#include
#include
void main(int argc, char *argv[])
{
if(argc > 2) {
…

Antonio Rizzo
- 748
- 1
- 8
- 17
2
votes
1 answer
Different SUID on different classes
Assuming that I have got completely different classes with different class names. Should I use different serialVersionUID in the classes?
If so, why is it necessary?
How does the JRE the deserialization exactly?

Tom Maier
- 293
- 3
- 12
2
votes
1 answer
Running python with different permissions
I'm trying to run a python script as other user (not root) which is also a system user with no shell. I understand that I can't set suid flag directly on the script so I wrote a C++ wrapper.
wrapper.cpp
#include
#include…

Sergej Andrejev
- 9,091
- 11
- 71
- 108
1
vote
1 answer
How do permissions propagate in Mac OS X?
So if I make a program suid root on my mac, and that program runs exec on /bin/sh, the shell is not root whereas if I do the same thing on Linux, the shell is root. Does Mac not propagate permissions the same way Linux does? Or is there just…

Jays
- 145
- 3
- 8
1
vote
1 answer
[Linux Difference between SUID and cap_setuid of binary]
"I dont understand difference between SUID of binary and cap_setuid in linux.Then, difference between SUID and setuid"

kaiharvez
- 11
- 1
1
vote
1 answer
Run program as root using SUID
Don't tell me this is a duplicate because I have already read questions like how to execute a command as root but I just can't make it work for me.
This is my C program whoami.c:
#include
#include
int main() {
…

Tommimon
- 131
- 1
- 12
1
vote
1 answer
osquery suid_bin usage to list all system suid bit set
I have to list all suid set on my server with osquery, I assume that suid_bin should give me all suid set, but it seems that it misses some of them.
I'm using it like this:
Select * from suid_bin
But if I do a manual check on /usr for example I…

Eiga
- 11
- 4
1
vote
2 answers
A same suid + system program, different outputs on different systems
I write a simple program named suid.c:
int main(int argc, char* argv[]) {
system(argv[1]);
}
Compile it with gcc then set suid permission (root user now):
# gcc suid.c -o suid
# chmod +s suid
I tried to run ./suid id with the www-data user…

OOq
- 59
- 6
1
vote
1 answer
Run "systemctl restart ___" from setuid root program without asking for root password?
I am developing for a network appliance that runs Linux (CentOS 8), and for some really basic config at the VGA console, we've set up a locked-down user account. We've provided a couple of suid root programs that do things like set up the IP address…

Timothy Miller
- 1,527
- 4
- 28
- 48
1
vote
2 answers
Can't drop privileges with suid binary?
I was wondering if there is a way to drop privileges using a suid binary (using Ubuntu 18.04). Look:
# cp /bin/bash .
# chown www-data bash
# chmod 4700 bash
# ls -lh
-rws------ 1 www-data root 1,1M abr 4 2018 bash
# ./bash
# id
uid=0(root)…

Diego M. Vadell
- 13
- 1
- 4
1
vote
1 answer
linux suid program not preserve the euid after execv
Here is my c code snippet from test.c.
printf("ruid:%d, euid:%d\n",getuid(),geteuid());
char *args[] = {"/bin/bash","-c","exec id",0};
execv("/bin/bash",args);
I compile the code with sudo gcc test.c -o test; sudo chmod +s ./test, so program test…

dcnh35
- 354
- 2
- 13
1
vote
1 answer
Setting SUID flag on a file?
I have a python file that I would like to set the SUID flag on. So that if any normal user executes it it executes as root. I know it's a security issue but I still need to set the SUID flag.

AustinM
- 773
- 6
- 18
- 27
1
vote
0 answers
How can I invoke SIGALARM when running the following code?
How can I use the set-guid bit vulnerability to execute a file /bin/grade which is owned by root using the following 3 vulnerable programs? I am not root nor part of the bsp* groups so my access to the programs is limited to read & execute only. For…

J123
- 11
- 1
- 3
1
vote
2 answers
Setting SUID/SGID permissions to an executable
I want to show, with a concrete example, how powerful is the exploitation of a buffer overflow.
To achive this goal i prepared this simple C program, called "bo":
#include
#include
void function(char* input) {
char…

ilmarchese
- 11
- 8
1
vote
2 answers
List of valid suid/sgid executables on Linux?
Can anyone tell me where to find a list of valid suid/guid programs on Linux, ideally Ubuntu?
Note I can use find to get a list of suid/sgid programs on my machine, but I want to know if they are real valid programs; is there a list I can compare…

markjames
- 23
- 6