All Projects β†’ barneygale β†’ Elevate

barneygale / Elevate

Licence: other
Python library for requesting root privileges

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Elevate

wsudo
Proof of concept sudo for Windows
Stars: ✭ 71 (-4.05%)
Mutual labels:  sudo
Impost3r
πŸ‘»Impost3r -- A linux password thief
Stars: ✭ 355 (+379.73%)
Mutual labels:  sudo
Gsudo
A Sudo for Windows - run elevated without spawning a new Console Host Window
Stars: ✭ 1,016 (+1272.97%)
Mutual labels:  sudo
sudohulk
try privilege escalation changing sudo command
Stars: ✭ 114 (+54.05%)
Mutual labels:  sudo
Pam reattach
Reattach to the user's GUI session on macOS during authentication (for Touch ID support in tmux)
Stars: ✭ 262 (+254.05%)
Mutual labels:  sudo
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (+517.57%)
Mutual labels:  sudo
rubysu
Give Ruby objects superuser privileges
Stars: ✭ 15 (-79.73%)
Mutual labels:  sudo
Sudo rails
πŸ”’ Sudo mode for your Rails controllers
Stars: ✭ 66 (-10.81%)
Mutual labels:  sudo
Electron Sudo
Electron subprocesses with administrative privileges, prompting the user with an OS dialog if necessary.
Stars: ✭ 336 (+354.05%)
Mutual labels:  sudo
Delayed Admin
A self-control tool for system administrators.
Stars: ✭ 36 (-51.35%)
Mutual labels:  sudo
Qubes-scripts
Scripts that help with administration and usage of Qubes OS
Stars: ✭ 33 (-55.41%)
Mutual labels:  sudo
sudo
Development repository for sudo cookbook
Stars: ✭ 119 (+60.81%)
Mutual labels:  sudo
Freeipa
Mirror of FreeIPA, an integrated security information management solution
Stars: ✭ 520 (+602.7%)
Mutual labels:  sudo
createprocess-windows
A complete, robust command-line utility to construct highly customized calls to the CreateProcess() Windows API. Released under a MIT or LGPL license.
Stars: ✭ 74 (+0%)
Mutual labels:  sudo
Sudo killer
A tool to identify and exploit sudo rules' misconfigurations and vulnerabilities within sudo for linux privilege escalation.
Stars: ✭ 1,073 (+1350%)
Mutual labels:  sudo
kakoune-sudo-write
Write to files using 'sudo'
Stars: ✭ 24 (-67.57%)
Mutual labels:  sudo
Ansible Role Security
Ansible Role - Security
Stars: ✭ 398 (+437.84%)
Mutual labels:  sudo
Gtfonow
Automatic privilege escalation for misconfigured capabilities, sudo and suid binaries
Stars: ✭ 68 (-8.11%)
Mutual labels:  sudo
Sudo pair
Plugin for sudo that requires another human to approve and monitor privileged sudo sessions
Stars: ✭ 1,077 (+1355.41%)
Mutual labels:  sudo
Sudo
sudo for windows
Stars: ✭ 648 (+775.68%)
Mutual labels:  sudo

Elevate: Request root privileges

Elevate is a small Python library that re-launches the current process with root/admin privileges using one of the following mechanisms:

  • UAC (Windows)
  • AppleScript (macOS)
  • pkexec, gksudo or kdesudo (Linux)
  • sudo (Linux, macOS)

Usage

To use, call elevate.elevate() early in your script. When run as root this function does nothing. When not run as root, this function replaces the current process (Linux, macOS) or creates a new process, waits, and exits (Windows). Consider the following example:

.. code-block:: python

import os
from elevate import elevate

def is_root():
    return os.getuid() == 0

print("before ", is_root())
elevate()
print("after ", is_root())

This prints::

before False
before True
after True

On Windows, the new process's standard streams are not attached to the parent, which is an inherent limitation of UAC. By default the new process runs in a new console window. To suppress this window, use elevate(show_console=False).

On Linux and macOS, graphical prompts are tried before sudo by default. To prevent graphical prompts, use elevate(graphical=False).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].