شعار Privilege Escalation

Privilege Escalation

مؤسسة
omagents
privilege-escalation

شغّل الأوامر التي تتطلب صلاحيات root من جلسات الوكلاء غير التفاعلية. شغّل هذه المهارة عندما يفشل sudo أو يتوقف عن الاستجابة أو تنتهي مهلته أو يُرفض، أو عند ظهور رسالة تفيد بعدم توفر TTY أو askpass، وكذلك عند تنفيذ مهام بصلاحيات مرتفعة مثل تثبيت حزم النظام أو تعديل /etc أو /usr أو خدمات النظام أو نقاط التحميل أو وحدات النواة. توفّر سلسلة تبدأ بالتحقق عبر sudo -n ثم pkexec وrun0 وdoas.

نظرة عامة

الناشرomagents
المستودعomagents
اسم المهارةprivilege-escalation
النجوم
361
التفريعات
2
الملفات المرفقة
1
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 1

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها omagents على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Privilege Escalation في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

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
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Privilege Escalation في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Privilege Escalation تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Privilege Escalation بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

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

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Privilege Escalation؟

شغّل الأوامر التي تتطلب صلاحيات root من جلسات الوكلاء غير التفاعلية. شغّل هذه المهارة عندما يفشل sudo أو يتوقف عن الاستجابة أو تنتهي مهلته أو يُرفض، أو عند ظهور رسالة تفيد بعدم توفر TTY أو askpass، وكذلك عند تنفيذ مهام بصلاحيات مرتفعة مثل تثبيت حزم النظام أو تعديل /etc أو /usr أو خدمات النظام أو نقاط التحميل أو وحدات النواة. توفّر سلسلة تبدأ بالتحقق عبر sudo -n ثم pkexec وrun0 وdoas.

لماذا تستخدم Privilege Escalation على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Privilege Escalation عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Privilege Escalation في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/omagents/omagents/tree/main/packages/core/skills/privilege-escalation. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Privilege Escalation؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Privilege Escalation؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Privilege Escalation معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Privilege Escalation مجانية؟

نعم. نشرها omagents على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇