-1

I'm running on a linux box, a process as a regular user, this is the only way I can start this process. After it starts I can put a break point inside the main function, after it hits the breakpoint I can do what ever I want to the process (I'm root on the system). I'd like to change the process owner from the regular user to root, is it possible?

e271p314
  • 3,841
  • 7
  • 36
  • 61
  • Maybe [this](http://stackoverflow.com/questions/428920/changing-the-owner-of-an-existing-process-in-linux) will help you. – VP. Nov 21 '13 at 10:14
  • Any other suggestions? I'm looking for a way to do it without changing the code. What I want is after the process hits the breakpoint, do some linux magic and turn my process owner to root – e271p314 Nov 21 '13 at 10:21
  • So you just need a linux command to do that? – VP. Nov 21 '13 at 10:35
  • Yes, something like `chown` that can take `pid` as an argument not just a file – e271p314 Nov 21 '13 at 12:41

1 Answers1

1

If you're running gdb as root you should be able to achieve this by running the command:

call setuid(0)

Hope this helps

jcm
  • 2,568
  • 14
  • 18