Questions tagged [privilege-elevation]

48 questions
12
votes
1 answer

Why do I need setuid(0) within a setuid-root C program that calls an administrative program with system()?

I had to do a dirty Linux hack for somebody so they could start a printer with the cupsenable printername shell command while being a non-root user. I didn't want them to be able to use the entirety of the cupsenable syntax as root, so I just wrote…
JCCyC
  • 16,140
  • 11
  • 48
  • 75
8
votes
2 answers

UAC and elevation prompt pattern

I've read several questions regarding UAC and privilege elevation but I've not found a satisfactory/comprehensive answer. I have this scenario: on Windows 6 or above, when the user opens a configuration window I have to show the shield…
lornova
  • 6,667
  • 9
  • 47
  • 74
7
votes
1 answer

Escalate Privilege at Runtime (Windows API C/C++)

My application does not always require "admin" privileges and most of the time would run as the current user. Is there any way, I can escalate privs by throwing up a UAC at runtime after my program is already running? This will only happen as and…
MathOldTimer
  • 1,311
  • 3
  • 13
  • 22
7
votes
1 answer

Removing Administrator Privilages from Process

With the help of this great MSDN article, my first idea was to simply check if the process is using an elevated Administrator group, and using AdjustTokenGroups() I would set the Administrator group to SE_GROUP_USE_FOR_DENY_ONLY. Unfortunately…
3
votes
1 answer

How to have a non-root parent process spawn a root child process under MacOS/X?

I've got a regular old MacOS/X GUI process, launched by the user double-clicking an icon, and is therefore running with that user's privileges. What I'd like to do is have this GUI process spawn a child process and communicate with the child process…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
3
votes
0 answers

How to launch an elevated process in a logon user session from a local service?

I need to launch an elevated process in an interactive logon user session from my local service. For that I use the code very similar to this one. But I'm not sure how to specify elevation in the user token returned by WTSQueryUserToken API, and to…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
3
votes
1 answer

CreateProecssAsUser elevated privilege?

I'm getting an error with my CreateProcessAsUser function. It says "The requested operation requires elevation. " I thought i had given it the highest privilege i could. Anyone help? thanks My code is as follows: activeSessionId =…
user966890
  • 205
  • 1
  • 7
  • 15
3
votes
1 answer

Django user entitlements on creation / privilege escalation

I got the following issue: If I give a user staff-status and allow him to create users but not to create new groups and assign entitlements, he is still able to assign another user the 'admin'-entitlements - so he can easily add a user who has more…
2
votes
1 answer

Programmatically triggering the privileges dialog under a Lazarus application on Ubuntu

I want to ease my father's task of installing some software that I'm developing for him. For this I'm using Lazarus and I would like to know if there is and API to raize the privilege escalation dialog. It seams to be hard to pin-point a single…
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
2
votes
1 answer

Executing the tasks with sudo privileges in ansible playbook

I have simple ansible playbook - hosts: all remote_user: myusername become: yes become_user: myusername become_method: sudo tasks: - name: Install tmux apt: name=tmux state=present I get the below error while running the…
Swarup Donepudi
  • 984
  • 1
  • 11
  • 23
2
votes
0 answers

x86_64 kernel - segments - privilege level

I can understand the theory behind the different privilege levels x86_64 arch has. Read a lot about them in the intel/amd dev guides. But what I cannot afford to understand is when (practical use cases) do we need different privilege level. Why do…
Jdarc
  • 55
  • 6
1
vote
2 answers

How to elevate to SYSTEM - needed to execute RunAsUser module

I need to execute a PS which creates registry entries for the current user and right after restarts a service (admin rights needed). I found a module called RunAsUser that seems to do this very…
YaKs
  • 143
  • 12
1
vote
0 answers

Run electron app using admin privilege (sudo yarn start)

I'm trying to run my electron app using sudo privilege, but i keep getting this error. sudo yarn start => [22144:0610/115332.565394:FATAL:electron_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. Here is my script: …
Amir Zare
  • 41
  • 5
1
vote
1 answer

Run a subshell as root

Consider you have a Linux/UNIX machine with Bash. You have a file secret.txt that only root can read. You want to use a command that takes a string as an argument, say, sample-command Log in as a root user and run the command using the…
Culip
  • 559
  • 8
  • 24
1
vote
0 answers

How to fix the access denied errormessage after successfully elevating with powershell

I've written a small powershell script which removes some entries from the hosts file if they exists. As it is right now, it does what it should and removes the entry if it exists. I added some thinks to make sure, the script is run with…
1
2 3 4