Logo: Privilege Escalation

Privilege Escalation

Organisatioun
omagents
privilege-escalation

Féiert an net-interaktive KI-Agent-Shellen Befehler aus, déi Root-Rechter erfuerderen. Dëse Skill gëtt ausgeléist, wann sudo net funktionéiert, hänke bleift, en Timeout kritt, refuséiert gëtt oder mellt, datt keen TTY oder askpass disponibel ass. En ass och fir Aufgaben mat erhéichte Rechter geduecht, wéi Systempaketer installéieren, Ännerungen un /etc oder /usr, Systemdéngschter, Mounts a Kernelmoduler. Bitt eng Ofwierkette, déi mat enger Kontroll ufänkt a sudo -n, pkexec, run0 an doas benotzt.

Iwwersiicht

Editeuromagents
Repositoryomagents
Skill-Nummprivilege-escalation
Stären
361
Forks
2
Matgeliwwert Dateien
1
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    omagents huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Privilege Escalation an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-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 nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Privilege Escalation an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Privilege Escalation automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Privilege Escalation net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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).

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Privilege Escalation?

Féiert an net-interaktive KI-Agent-Shellen Befehler aus, déi Root-Rechter erfuerderen. Dëse Skill gëtt ausgeléist, wann sudo net funktionéiert, hänke bleift, en Timeout kritt, refuséiert gëtt oder mellt, datt keen TTY oder askpass disponibel ass. En ass och fir Aufgaben mat erhéichte Rechter geduecht, wéi Systempaketer installéieren, Ännerungen un /etc oder /usr, Systemdéngschter, Mounts a Kernelmoduler. Bitt eng Ofwierkette, déi mat enger Kontroll ufänkt a sudo -n, pkexec, run0 an doas benotzt.

Firwat Privilege Escalation op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Privilege Escalation besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Privilege Escalation an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Privilege Escalation benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Privilege Escalation benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Privilege Escalation domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Privilege Escalation gratis?

Jo. omagents huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇