Questions tagged [setuid]

`setuid` is a file permission flag under Unix-like systems that will run an executable with the file owner's permissions rather than the invoking user's. On some systems (FreeBSD), it further works identically to the related `setgid` flag on directories, causing new files to inherit the directory's permissions rather than the current user's.

254 questions
0
votes
1 answer

Need help improving a small C program

I wanted to launch a bash script (read: bash not sh script) as a root not as the user calling it, however bash ignore setuid on scripts, so I chose to write a very small script that takes a script/arguments and call it with setuid set. This worked…
kalbasit
  • 766
  • 8
  • 17
0
votes
1 answer

How to set a specific setuid in a shellcode

I'm using the following assembly code found here to setuid(0) and get a shell during a buffer overflow xor rdi,rdi mov al,0x69 syscall xor rdx,rdx movabs rbx,0x68732f6e69622fff shr rbx,0x8 push rbx mov rdi,rsp xor rax,rax push …
l1ge
  • 21
  • 3
0
votes
0 answers

Passing value to modified syscall function gets changed

I am trying to pass uid_t value as a parameter to modified syscall function (set_uid) and when I pass 30 from caller function, the value gets changed to random number such as 2154135383. This is modified setuid() asmlinkage int new_setuid(uid_t…
ctsmicha
  • 1
  • 1
0
votes
1 answer

Running jailkit from non-root process

I have a webserver which will frequently spawn a latex interpreter (written in python). This interpreter lives inside a chroot jail made using jailkit so it has to be started as root. I don't want the server to run as root and I can't setuid the…
0
votes
1 answer

How to make nscd generate core dump files?

nscd service crashed without a core dump file. ulimit -c is unlimited. Someone says that that's because nscd use "setuid" when the "server-user" is set in /etc/nscd.conf. Then I added a "#" to delete it at the beginning of the "server-user" line in…
june an
  • 73
  • 6
0
votes
0 answers

setuid must be string getting error when trying to deploy my node js app to google cloud platform

I m getting this error when I try to deploy it to google cloud platform. I m using Redis NODEjs Error msg: Unhandled rejection StatusCodeError: 401 - "{\"error\":\"Something strange occurred. Please contact the app…
0
votes
1 answer

setuid on svn update wrapper not working?

I have an svn repository which belongs to user 'foo' and is accessed through Apache, and I'm trying to run svn update from the post-commit hook, on a directory which is also owned by foo. I created a C wrapper owned by foo and setted the suid bit,…
Ivan
  • 1
0
votes
0 answers

setuid bit on shared object

I know that to have a .so loaded, the e'x'ecute bit must be set. However, I wonder what is the effect of +s (setuid) bit on the .so ? If the main program is not "setuid" set, but the .so it loads is setuid, does it change the uid ? I found not but…
0
votes
1 answer

composer gives false warning when run as a non-root user with setuid bit set

I configured my php executable i.e /usr/local/bin/php with a setuid for user deploy. So that if any user calls that php binary it should be executed as deploy only. As you can see below php binary is chowned by a non-root user deploy. But when I…
SkyRar
  • 1,107
  • 1
  • 20
  • 37
0
votes
0 answers

run setuid as www-data in python

I have a python script running as www-data but I would like it to have separate r/w/e permissions to the rest of the scripts. So I created a user to use however can't get the script to run as that user (it's a cgi script and I want all but this one…
0
votes
1 answer

Questions about setuid

I have a problem with running the following C program: #include void main() { if (access("/root/main.c",R_OK)==0) { printf("/root/main.c can be read\n"); } else { printf("can't be read\n"); …
lwp007
  • 25
  • 5
0
votes
0 answers

setuid(###) followed by getuid() fails in C program with permissions bit set

I'm trying something very simple with setuid followed by getuid in a C program that is not working unless the user is the owner of the c program. I am setting the permissions bit using chmod 7777 in addition to thesetuid. Here is the C…
daveg
  • 1,051
  • 11
  • 24
0
votes
0 answers

setuid not working, linux rhel6, simple example

This is a repost after being referred to "Calling a script from a setuid root C program - script does not run as root" for a solution My problem is different in that I do not want to run the C program (and c-shell script called inside) as root. …
daveg
  • 1,051
  • 11
  • 24
0
votes
1 answer

Trying to understand buffer-overflow and setuid. I don't get privileges

I am trying to understand about buffer overflow and setuid. I use this source : #include #include #include int main(void){ char prog[]="/bin/ls -hal"; char in[8]={0}; printf("Name of a dir to list : "); …
user6125411
0
votes
1 answer

setuid has same effect as sudo?

does setting uid has the same effect that sudo has? What happens if setuid'ed executable open whoami with popen? Do I get 'root'?
manatails008
  • 229
  • 4
  • 8