Logo van Privilege Escalation

Privilege Escalation

Organisatie
omagents
privilege-escalation

Voer opdrachten uit waarvoor rootrechten nodig zijn vanuit niet-interactieve agent-shells. Activeer deze skill wanneer sudo mislukt, blijft hangen, een time-out geeft, wordt geweigerd of meldt dat er geen TTY of askpass beschikbaar is, en voor taken met verhoogde rechten, zoals systeempakketten installeren, bestanden in /etc of /usr aanpassen, systeemservices beheren, mounten en kernelmodules gebruiken. Biedt een keten die eerst controleert via sudo -n, pkexec, run0 en doas.

Overzicht

Uitgeveromagents
Repositoryomagents
Skillnaamprivilege-escalation
Sterren
361
Forks
2
Meegeleverde bestanden
1
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 1

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door omagents op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Privilege Escalation in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/omagents/omagents.git /tmp/omagents
mkdir -p .claude/skills
cp -r /tmp/omagents/packages/core/skills/privilege-escalation .claude/skills/privilege-escalation
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Privilege Escalation in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Privilege Escalation automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Privilege Escalation niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Privilege Escalation for Agent Shells

Agent shells have no TTY. A bare sudo command blocks on a password prompt that no one can type; it stalls until the tool timeout, and on OpenCode 2.3.1+ the timed-out command moves to the background instead of being killed, leaving the blocked process lingering there — and some hosts deny sudo patterns outright before the command even runs. When a command needs root, pick an escalation tool that works without a terminal instead of dying on bare sudo.

When to Use

  • The command needs root: system package installs, writes to /etc or /usr, system systemctl units, mounts, user/group management, privileged journalctl reads.
  • sudo already failed with "a terminal is required", "no askpass program", or "sudo: a password is required", or the command timed out.
  • The host's permission rules denied the sudo pattern.

Probe First, Then Escalate

Work down this chain in order:

Does the command elevate itself (sudo, pkexec, run0, doas, su, mount, …)?
  → Run it as-is. Never wrap a self-elevating command.
Else does `sudo -n true` succeed (passwordless, cached, or askpass configured)?
  → Run `sudo -n <command>`.
Else does `command -v pkexec` find pkexec?
  → Run `pkexec --disable-internal-agent <absolute-path> <args…>`.
Else does `command -v run0` find run0 (systemd 256+)?
  → Run `run0 <command>`.
Else does `command -v doas` find doas?
  → Run `doas -n <command>`.
Else
  → Print the exact command for the user to run manually. Stop.

sudo -n fails fast instead of hanging: it never prompts, so it is a safe probe even when passwordless sudo is not configured. Check which tools exist with command -v pkexec; command -v run0; command -v doas before committing to one.

pkexec Rules

pkexec escalates through Polkit, which shows a GUI password dialog the human at the machine can approve — no terminal required. To use it correctly:

  • Pin the exact executable with an absolute path. pkexec resets the child to a minimal safe environment whose PATH differs from yours, and the Polkit approval dialog shows the fully resolved program — so make the target unambiguous: resolve it first with command -v pacman, then run pkexec /usr/bin/pacman -Syu.

  • Pipes and redirections run as the calling user, not root. pkexec echo 'value' > /etc/example.conf fails or writes a user-owned file. Write root files with tee:

    bash
    printf '%s\n' 'net.ipv4.ip_forward = 1' | pkexec tee /etc/sysctl.d/99-forward.conf
  • Compound commands (pipes, redirections, &&) run as one root shell:

    bash
    pkexec sh -c 'cp /etc/hosts /etc/hosts.bak && printf "%s\n" "10.0.0.5 host" >> /etc/hosts'
  • Always pass --disable-internal-agent. Without a polkit agent, pkexec registers its own textual agent that prompts on the controlling TTY — so in a shell that happens to inherit a TTY, plain pkexec … can block on a password prompt, the exact hang this skill exists to avoid. With the flag, pkexec either prompts through the desktop's GUI polkit agent or fails immediately. If a pkexec invocation ever visibly waits for input, abandon it rather than letting it stall until the timeout — newer OpenCode hosts keep timed-out commands running in the background.

  • A polkit authentication agent must be running for the GUI prompt to appear, which is typical on desktop sessions. Headless servers and plain SSH sessions usually have none — pkexec fails there; fall through to run0, doas, or the manual step.

  • GUI applications are not launchable under pkexec (DISPLAY and XAUTHORITY are dropped); it is for commands, not desktop apps.

run0 and doas

  • run0 is systemd's replacement for sudo (systemd 256+). It authenticates through the same Polkit machinery as pkexec but keeps a saner environment and resolves the command by name, so no absolute-path pinning is needed. Use it when sudo -n fails but a polkit agent exists.
  • doas is the OpenBSD-style alternative, configured in /etc/doas.conf. doas -n is its non-interactive form.

Never

  • Never bare interactive sudo in an agent shell — it blocks on a prompt until the tool timeout and then lingers as a background task on newer OpenCode hosts instead of dying. If sudo -n fails, move down the chain.
  • Never pipe or embed a password: echo '<password>' | sudo -S … leaks the secret into logs and history. If the user offers a password, refuse it and use a tool with a proper prompt instead.
  • Never edit sudoers or add NOPASSWD policy just to unblock an agent — a permanent security weakening is not a fix for a convenience problem.
  • Never double-wrap: sudo pkexec …, pkexec sudo …, or run0 doas … stack prompts and fail.
  • Never run destructive root commands (rm -rf-class) without quoting the exact command to the user first and getting confirmation.

Platform Notes

  • macOS: only sudo exists. If sudo -n fails, hand the command to the user.
  • Windows: no pkexec, run0, or doas. Privileged commands need an elevated shell the agent cannot open — always hand the command to the user.
  • Linux without a desktop session: pkexec and run0 usually cannot prompt. Fall through to the manual step rather than looping.

When Every Tool Fails

Print the exact command — absolute path, full arguments — for the user to run in their own terminal, then stop. Do not retry escalation attempts in a loop: each one either fails immediately (already probed) or hangs (already the failure mode this skill avoids).

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Privilege Escalation?

Voer opdrachten uit waarvoor rootrechten nodig zijn vanuit niet-interactieve agent-shells. Activeer deze skill wanneer sudo mislukt, blijft hangen, een time-out geeft, wordt geweigerd of meldt dat er geen TTY of askpass beschikbaar is, en voor taken met verhoogde rechten, zoals systeempakketten installeren, bestanden in /etc of /usr aanpassen, systeemservices beheren, mounten en kernelmodules gebruiken. Biedt een keten die eerst controleert via sudo -n, pkexec, run0 en doas.

Waarom Privilege Escalation gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Privilege Escalation bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Privilege Escalation in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Privilege Escalation gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Privilege Escalation gebruiken?

Zoveel als je wilt. Je kunt Privilege Escalation gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Privilege Escalation gratis?

Ja. Deze skill is door omagents op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇